2019-06-01 16:08:55 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2008-05-31 21:43:41 +08:00
|
|
|
/*
|
|
|
|
* pca9532.h - platform data structure for pca9532 led controller
|
|
|
|
*
|
|
|
|
* Copyright (C) 2008 Riku Voipio <riku.voipio@movial.fi>
|
|
|
|
*
|
|
|
|
* Datasheet: http://www.nxp.com/acrobat/datasheets/PCA9532_3.pdf
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LINUX_PCA9532_H
|
|
|
|
#define __LINUX_PCA9532_H
|
|
|
|
|
|
|
|
#include <linux/leds.h>
|
2008-12-03 16:21:36 +08:00
|
|
|
#include <linux/workqueue.h>
|
2016-06-14 15:36:17 +08:00
|
|
|
#include <dt-bindings/leds/leds-pca9532.h>
|
2008-05-31 21:43:41 +08:00
|
|
|
|
|
|
|
enum pca9532_state {
|
|
|
|
PCA9532_OFF = 0x0,
|
|
|
|
PCA9532_ON = 0x1,
|
|
|
|
PCA9532_PWM0 = 0x2,
|
2017-04-13 15:51:38 +08:00
|
|
|
PCA9532_PWM1 = 0x3,
|
|
|
|
PCA9532_KEEP = 0xff,
|
2008-05-31 21:43:41 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct pca9532_led {
|
|
|
|
u8 id;
|
|
|
|
struct i2c_client *client;
|
2016-06-14 15:36:17 +08:00
|
|
|
const char *name;
|
|
|
|
const char *default_trigger;
|
2008-05-31 21:43:41 +08:00
|
|
|
struct led_classdev ldev;
|
2009-11-28 19:55:51 +08:00
|
|
|
struct work_struct work;
|
2016-06-14 15:36:17 +08:00
|
|
|
u32 type;
|
2008-05-31 21:43:41 +08:00
|
|
|
enum pca9532_state state;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct pca9532_platform_data {
|
|
|
|
struct pca9532_led leds[16];
|
|
|
|
u8 pwm[2];
|
|
|
|
u8 psc[2];
|
2011-05-25 08:13:23 +08:00
|
|
|
int gpio_base;
|
2008-05-31 21:43:41 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __LINUX_PCA9532_H */
|