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