#include <linux/bitops.h>
#include <linux/ctype.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/gpio/driver.h>
#include <linux/i2c.h>
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/property.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <dt-bindings/leds/leds-pca955x.h>
#define PCA955X_LS_LED_ON …
#define PCA955X_LS_LED_OFF …
#define PCA955X_LS_BLINK0 …
#define PCA955X_LS_BLINK1 …
#define PCA955X_GPIO_INPUT …
#define PCA955X_GPIO_HIGH …
#define PCA955X_GPIO_LOW …
enum pca955x_type { … };
struct pca955x_chipdef { … };
static const struct pca955x_chipdef pca955x_chipdefs[] = …;
struct pca955x { … };
struct pca955x_led { … };
struct pca955x_platform_data { … };
static inline int pca95xx_num_input_regs(int bits)
{ … }
static inline u8 pca955x_ledsel(u8 oldval, int led_num, int state)
{ … }
static int pca955x_write_psc(struct i2c_client *client, int n, u8 val)
{ … }
static int pca955x_write_pwm(struct i2c_client *client, int n, u8 val)
{ … }
static int pca955x_write_ls(struct i2c_client *client, int n, u8 val)
{ … }
static int pca955x_read_ls(struct i2c_client *client, int n, u8 *val)
{ … }
static int pca955x_read_pwm(struct i2c_client *client, int n, u8 *val)
{ … }
static enum led_brightness pca955x_led_get(struct led_classdev *led_cdev)
{ … }
static int pca955x_led_set(struct led_classdev *led_cdev,
enum led_brightness value)
{ … }
#ifdef CONFIG_LEDS_PCA955X_GPIO
static int pca955x_read_input(struct i2c_client *client, int n, u8 *val)
{ … }
static int pca955x_gpio_request_pin(struct gpio_chip *gc, unsigned int offset)
{ … }
static void pca955x_gpio_free_pin(struct gpio_chip *gc, unsigned int offset)
{ … }
static int pca955x_set_value(struct gpio_chip *gc, unsigned int offset,
int val)
{ … }
static void pca955x_gpio_set_value(struct gpio_chip *gc, unsigned int offset,
int val)
{ … }
static int pca955x_gpio_get_value(struct gpio_chip *gc, unsigned int offset)
{ … }
static int pca955x_gpio_direction_input(struct gpio_chip *gc,
unsigned int offset)
{ … }
static int pca955x_gpio_direction_output(struct gpio_chip *gc,
unsigned int offset, int val)
{ … }
#endif
static struct pca955x_platform_data *
pca955x_get_pdata(struct i2c_client *client, const struct pca955x_chipdef *chip)
{ … }
static int pca955x_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id pca955x_id[] = …;
MODULE_DEVICE_TABLE(i2c, pca955x_id);
static const struct of_device_id of_pca955x_match[] = …;
MODULE_DEVICE_TABLE(of, of_pca955x_match);
static struct i2c_driver pca955x_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;