Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved. |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #ifndef __LEDS_PM8XXX_H__ |
| 14 | #define __LEDS_PM8XXX_H__ |
| 15 | |
Jay Chokshi | 8994e39 | 2011-09-14 18:20:39 -0700 | [diff] [blame^] | 16 | #include <linux/kernel.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 17 | |
| 18 | #define PM8XXX_LEDS_DEV_NAME "pm8xxx-led" |
| 19 | |
| 20 | /** |
| 21 | * enum pm8xxx_leds - PMIC8XXX supported led ids |
| 22 | * @PM8XXX_ID_LED_KB_LIGHT - keyboard backlight led |
| 23 | * @PM8XXX_ID_LED_0 - First low current led |
| 24 | * @PM8XXX_ID_LED_1 - Second low current led |
| 25 | * @PM8XXX_ID_LED_2 - Third low current led |
| 26 | * @PM8XXX_ID_FLASH_LED_0 - First flash led |
| 27 | * @PM8XXX_ID_FLASH_LED_0 - Second flash led |
| 28 | */ |
| 29 | enum pm8xxx_leds { |
| 30 | PM8XXX_ID_LED_KB_LIGHT = 1, |
| 31 | PM8XXX_ID_LED_0, |
| 32 | PM8XXX_ID_LED_1, |
| 33 | PM8XXX_ID_LED_2, |
| 34 | PM8XXX_ID_FLASH_LED_0, |
| 35 | PM8XXX_ID_FLASH_LED_1, |
| 36 | }; |
| 37 | |
Jay Chokshi | 12e49bf | 2011-07-22 16:24:39 -0700 | [diff] [blame] | 38 | /** |
| 39 | * pm8xxx_led_modes - Operating modes of LEDs |
| 40 | */ |
| 41 | enum pm8xxx_led_modes { |
| 42 | PM8XXX_LED_MODE_MANUAL, |
| 43 | PM8XXX_LED_MODE_PWM1, |
| 44 | PM8XXX_LED_MODE_PWM2, |
| 45 | PM8XXX_LED_MODE_PWM3, |
| 46 | PM8XXX_LED_MODE_DTEST1, |
| 47 | PM8XXX_LED_MODE_DTEST2, |
| 48 | PM8XXX_LED_MODE_DTEST3, |
| 49 | PM8XXX_LED_MODE_DTEST4 |
| 50 | }; |
| 51 | |
Jay Chokshi | 8994e39 | 2011-09-14 18:20:39 -0700 | [diff] [blame^] | 52 | /** |
| 53 | * pm8xxx_led_config - led configuration parameters |
| 54 | * id - LED id |
| 55 | * mode - LED mode |
| 56 | * max_current - maximum current that LED can sustain |
| 57 | */ |
| 58 | struct pm8xxx_led_config { |
| 59 | u8 id; |
| 60 | u8 mode; |
| 61 | u16 max_current; |
| 62 | }; |
| 63 | |
| 64 | /** |
| 65 | * pm8xxx_led_platform_data - platform data for LED |
| 66 | * led_core - array of LEDs. Each datum in array contains |
| 67 | * core data for the LED |
| 68 | * configs - array of platform configuration parameters |
| 69 | * for each LED. It maps one-to-one with |
| 70 | * array of LEDs |
| 71 | * num_configs - count of members of configs array |
| 72 | */ |
| 73 | struct pm8xxx_led_platform_data { |
| 74 | struct led_platform_data *led_core; |
| 75 | struct pm8xxx_led_config *configs; |
| 76 | u32 num_configs; |
| 77 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 78 | #endif /* __LEDS_PM8XXX_H__ */ |