Riku Voipio | e14fa82 | 2008-05-31 14:43:41 +0100 | [diff] [blame] | 1 | /* |
| 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 Voipio | 934cd3f | 2008-12-03 08:21:36 +0000 | [diff] [blame] | 18 | #include <linux/workqueue.h> |
Phil Reid | fa4191a | 2016-06-14 15:36:17 +0800 | [diff] [blame] | 19 | #include <dt-bindings/leds/leds-pca9532.h> |
Riku Voipio | e14fa82 | 2008-05-31 14:43:41 +0100 | [diff] [blame] | 20 | |
| 21 | enum pca9532_state { |
| 22 | PCA9532_OFF = 0x0, |
| 23 | PCA9532_ON = 0x1, |
| 24 | PCA9532_PWM0 = 0x2, |
| 25 | PCA9532_PWM1 = 0x3 |
| 26 | }; |
| 27 | |
Riku Voipio | e14fa82 | 2008-05-31 14:43:41 +0100 | [diff] [blame] | 28 | struct pca9532_led { |
| 29 | u8 id; |
| 30 | struct i2c_client *client; |
Phil Reid | fa4191a | 2016-06-14 15:36:17 +0800 | [diff] [blame] | 31 | const char *name; |
| 32 | const char *default_trigger; |
Riku Voipio | e14fa82 | 2008-05-31 14:43:41 +0100 | [diff] [blame] | 33 | struct led_classdev ldev; |
Antonio Ospite | 9695fff | 2009-11-28 12:55:51 +0100 | [diff] [blame] | 34 | struct work_struct work; |
Phil Reid | fa4191a | 2016-06-14 15:36:17 +0800 | [diff] [blame] | 35 | u32 type; |
Riku Voipio | e14fa82 | 2008-05-31 14:43:41 +0100 | [diff] [blame] | 36 | enum pca9532_state state; |
| 37 | }; |
| 38 | |
| 39 | struct pca9532_platform_data { |
| 40 | struct pca9532_led leds[16]; |
| 41 | u8 pwm[2]; |
| 42 | u8 psc[2]; |
Joachim Eastwood | 3c1ab50 | 2011-05-24 17:13:23 -0700 | [diff] [blame] | 43 | int gpio_base; |
Riku Voipio | e14fa82 | 2008-05-31 14:43:41 +0100 | [diff] [blame] | 44 | }; |
| 45 | |
| 46 | #endif /* __LINUX_PCA9532_H */ |
| 47 | |