2019-06-01 08:08:55 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2008-05-31 13:43:41 +00: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 08:21:36 +00:00
|
|
|
#include <linux/workqueue.h>
|
2016-06-14 07:36:17 +00:00
|
|
|
#include <dt-bindings/leds/leds-pca9532.h>
|
2008-05-31 13:43:41 +00:00
|
|
|
|
|
|
|
enum pca9532_state {
|
|
|
|
PCA9532_OFF = 0x0,
|
|
|
|
PCA9532_ON = 0x1,
|
|
|
|
PCA9532_PWM0 = 0x2,
|
2017-04-13 07:51:38 +00:00
|
|
|
PCA9532_PWM1 = 0x3,
|
|
|
|
PCA9532_KEEP = 0xff,
|
2008-05-31 13:43:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct pca9532_led {
|
|
|
|
u8 id;
|
|
|
|
struct i2c_client *client;
|
2016-06-14 07:36:17 +00:00
|
|
|
const char *name;
|
|
|
|
const char *default_trigger;
|
2008-05-31 13:43:41 +00:00
|
|
|
struct led_classdev ldev;
|
2009-11-28 11:55:51 +00:00
|
|
|
struct work_struct work;
|
2016-06-14 07:36:17 +00:00
|
|
|
u32 type;
|
2008-05-31 13:43:41 +00:00
|
|
|
enum pca9532_state state;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct pca9532_platform_data {
|
|
|
|
struct pca9532_led leds[16];
|
|
|
|
u8 pwm[2];
|
|
|
|
u8 psc[2];
|
2011-05-25 00:13:23 +00:00
|
|
|
int gpio_base;
|
2008-05-31 13:43:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __LINUX_PCA9532_H */
|