#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/usb.h>
#include <linux/workqueue.h>
#include <media/v4l2-device.h>
#include <media/drv-intf/tea575x.h>
#if defined(CONFIG_LEDS_CLASS) || \
(defined(CONFIG_LEDS_CLASS_MODULE) && defined(CONFIG_RADIO_SHARK_MODULE))
#define SHARK_USE_LEDS …
#endif
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
#define SHARK_IN_EP …
#define SHARK_OUT_EP …
#define TEA575X_BIT_MONO …
#define TEA575X_BIT_BAND_MASK …
#define TEA575X_BIT_BAND_FM …
#define TB_LEN …
#define DRV_NAME …
#define v4l2_dev_to_shark(d) …
enum { … };
struct shark_device { … };
static atomic_t shark_instance = …;
static void shark_write_val(struct snd_tea575x *tea, u32 val)
{ … }
static u32 shark_read_val(struct snd_tea575x *tea)
{ … }
static const struct snd_tea575x_ops shark_tea_ops = …;
#ifdef SHARK_USE_LEDS
static void shark_led_work(struct work_struct *work)
{ … }
static void shark_led_set_blue(struct led_classdev *led_cdev,
enum led_brightness value)
{ … }
static void shark_led_set_blue_pulse(struct led_classdev *led_cdev,
enum led_brightness value)
{ … }
static void shark_led_set_red(struct led_classdev *led_cdev,
enum led_brightness value)
{ … }
static const struct led_classdev shark_led_templates[NO_LEDS] = …;
static int shark_register_leds(struct shark_device *shark, struct device *dev)
{ … }
static void shark_unregister_leds(struct shark_device *shark)
{ … }
static inline void shark_resume_leds(struct shark_device *shark)
{ … }
#else
static int shark_register_leds(struct shark_device *shark, struct device *dev)
{
v4l2_warn(&shark->v4l2_dev,
"CONFIG_LEDS_CLASS not enabled, LED support disabled\n");
return 0;
}
static inline void shark_unregister_leds(struct shark_device *shark) { }
static inline void shark_resume_leds(struct shark_device *shark) { }
#endif
static void usb_shark_disconnect(struct usb_interface *intf)
{ … }
static void usb_shark_release(struct v4l2_device *v4l2_dev)
{ … }
static int usb_shark_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{ … }
#ifdef CONFIG_PM
static int usb_shark_suspend(struct usb_interface *intf, pm_message_t message)
{ … }
static int usb_shark_resume(struct usb_interface *intf)
{ … }
#endif
static const struct usb_device_id usb_shark_device_table[] = …;
MODULE_DEVICE_TABLE(usb, usb_shark_device_table);
static struct usb_driver usb_shark_driver = …;
module_usb_driver(…) …;