#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/leds.h>
#include <linux/input.h>
#include <linux/mutex.h>
#include <linux/workqueue.h>
#include <linux/leds-pca9532.h>
#include <linux/gpio/driver.h>
#include <linux/of.h>
#define PCA9532_REG_INPUT(i) …
#define PCA9532_REG_OFFSET(m) …
#define PCA9532_REG_PSC(m, i) …
#define PCA9532_REG_PWM(m, i) …
#define LED_REG(m, led) …
#define LED_NUM(led) …
#define LED_SHIFT(led) …
#define LED_MASK(led) …
#define PCA9532_PWM_PERIOD_DIV …
#define PCA9532_PWM_DUTY_DIV …
#define ldev_to_led(c) …
struct pca9532_chip_info { … };
struct pca9532_data { … };
static int pca9532_probe(struct i2c_client *client);
static void pca9532_remove(struct i2c_client *client);
enum { … };
static const struct i2c_device_id pca9532_id[] = …;
MODULE_DEVICE_TABLE(i2c, pca9532_id);
static const struct pca9532_chip_info pca9532_chip_info_tbl[] = …;
#ifdef CONFIG_OF
static const struct of_device_id of_pca9532_leds_match[] = …;
MODULE_DEVICE_TABLE(of, of_pca9532_leds_match);
#endif
static struct i2c_driver pca9532_driver = …;
static int pca9532_calcpwm(struct i2c_client *client, int pwm, int blink,
enum led_brightness value)
{ … }
static int pca9532_setpwm(struct i2c_client *client, int pwm)
{ … }
static void pca9532_setled(struct pca9532_led *led)
{ … }
static int pca9532_set_brightness(struct led_classdev *led_cdev,
enum led_brightness value)
{ … }
static int pca9532_update_hw_blink(struct pca9532_led *led,
unsigned long delay_on, unsigned long delay_off)
{ … }
static int pca9532_set_blink(struct led_classdev *led_cdev,
unsigned long *delay_on, unsigned long *delay_off)
{ … }
static int pca9532_event(struct input_dev *dev, unsigned int type,
unsigned int code, int value)
{ … }
static void pca9532_input_work(struct work_struct *work)
{ … }
static enum pca9532_state pca9532_getled(struct pca9532_led *led)
{ … }
#ifdef CONFIG_LEDS_PCA9532_GPIO
static int pca9532_gpio_request_pin(struct gpio_chip *gc, unsigned offset)
{ … }
static void pca9532_gpio_set_value(struct gpio_chip *gc, unsigned offset, int val)
{ … }
static int pca9532_gpio_get_value(struct gpio_chip *gc, unsigned offset)
{ … }
static int pca9532_gpio_direction_input(struct gpio_chip *gc, unsigned offset)
{ … }
static int pca9532_gpio_direction_output(struct gpio_chip *gc, unsigned offset, int val)
{ … }
#endif
static void pca9532_destroy_devices(struct pca9532_data *data, int n_devs)
{ … }
static int pca9532_configure(struct i2c_client *client,
struct pca9532_data *data, struct pca9532_platform_data *pdata)
{ … }
static struct pca9532_platform_data *
pca9532_of_populate_pdata(struct device *dev, struct device_node *np)
{ … }
static int pca9532_probe(struct i2c_client *client)
{ … }
static void pca9532_remove(struct i2c_client *client)
{ … }
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;