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