mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 02:39:48 +00:00
![Phil Reid](/assets/img/avatar_default.png)
This patch adds basic device tree support for the pca9532 LEDs. Signed-off-by: Phil Reid <preid@electromag.com.au> Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
47 lines
1,009 B
C
47 lines
1,009 B
C
/*
|
|
* pca9532.h - platform data structure for pca9532 led controller
|
|
*
|
|
* Copyright (C) 2008 Riku Voipio <riku.voipio@movial.fi>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; version 2 of the License.
|
|
*
|
|
* Datasheet: http://www.nxp.com/acrobat/datasheets/PCA9532_3.pdf
|
|
*
|
|
*/
|
|
|
|
#ifndef __LINUX_PCA9532_H
|
|
#define __LINUX_PCA9532_H
|
|
|
|
#include <linux/leds.h>
|
|
#include <linux/workqueue.h>
|
|
#include <dt-bindings/leds/leds-pca9532.h>
|
|
|
|
enum pca9532_state {
|
|
PCA9532_OFF = 0x0,
|
|
PCA9532_ON = 0x1,
|
|
PCA9532_PWM0 = 0x2,
|
|
PCA9532_PWM1 = 0x3
|
|
};
|
|
|
|
struct pca9532_led {
|
|
u8 id;
|
|
struct i2c_client *client;
|
|
const char *name;
|
|
const char *default_trigger;
|
|
struct led_classdev ldev;
|
|
struct work_struct work;
|
|
u32 type;
|
|
enum pca9532_state state;
|
|
};
|
|
|
|
struct pca9532_platform_data {
|
|
struct pca9532_led leds[16];
|
|
u8 pwm[2];
|
|
u8 psc[2];
|
|
int gpio_base;
|
|
};
|
|
|
|
#endif /* __LINUX_PCA9532_H */
|
|
|