blob: b8d6fffed4d801c938e69bf7aa99fe3ad98085cb [file] [log] [blame]
Riku Voipioe14fa822008-05-31 14:43:41 +01001/*
2 * pca9532.h - platform data structure for pca9532 led controller
3 *
4 * Copyright (C) 2008 Riku Voipio <riku.voipio@movial.fi>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * Datasheet: http://www.nxp.com/acrobat/datasheets/PCA9532_3.pdf
11 *
12 */
13
14#ifndef __LINUX_PCA9532_H
15#define __LINUX_PCA9532_H
16
17#include <linux/leds.h>
Riku Voipio934cd3f2008-12-03 08:21:36 +000018#include <linux/workqueue.h>
Riku Voipioe14fa822008-05-31 14:43:41 +010019
20enum pca9532_state {
21 PCA9532_OFF = 0x0,
22 PCA9532_ON = 0x1,
23 PCA9532_PWM0 = 0x2,
24 PCA9532_PWM1 = 0x3
25};
26
27enum pca9532_type { PCA9532_TYPE_NONE, PCA9532_TYPE_LED,
Joachim Eastwood3c1ab502011-05-24 17:13:23 -070028 PCA9532_TYPE_N2100_BEEP, PCA9532_TYPE_GPIO };
Riku Voipioe14fa822008-05-31 14:43:41 +010029
30struct pca9532_led {
31 u8 id;
32 struct i2c_client *client;
33 char *name;
34 struct led_classdev ldev;
Antonio Ospite9695fff2009-11-28 12:55:51 +010035 struct work_struct work;
Riku Voipioe14fa822008-05-31 14:43:41 +010036 enum pca9532_type type;
37 enum pca9532_state state;
38};
39
40struct pca9532_platform_data {
41 struct pca9532_led leds[16];
42 u8 pwm[2];
43 u8 psc[2];
Joachim Eastwood3c1ab502011-05-24 17:13:23 -070044 int gpio_base;
Riku Voipioe14fa822008-05-31 14:43:41 +010045};
46
47#endif /* __LINUX_PCA9532_H */
48