Milo(Woogyom) Kim | c93d08f | 2013-02-05 18:01:23 +0900 | [diff] [blame] | 1 | /* |
| 2 | * LP55XX Platform Data Header |
| 3 | * |
| 4 | * Copyright (C) 2012 Texas Instruments |
| 5 | * |
| 6 | * Author: Milo(Woogyom) Kim <milo.kim@ti.com> |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public License |
| 10 | * version 2 as published by the Free Software Foundation. |
| 11 | * |
| 12 | * Derived from leds-lp5521.h, leds-lp5523.h |
| 13 | */ |
| 14 | |
| 15 | #ifndef _LEDS_LP55XX_H |
| 16 | #define _LEDS_LP55XX_H |
| 17 | |
| 18 | /* Clock configuration */ |
| 19 | #define LP55XX_CLOCK_AUTO 0 |
| 20 | #define LP55XX_CLOCK_INT 1 |
| 21 | #define LP55XX_CLOCK_EXT 2 |
| 22 | |
Milo(Woogyom) Kim | c93d08f | 2013-02-05 18:01:23 +0900 | [diff] [blame] | 23 | struct lp55xx_led_config { |
| 24 | const char *name; |
Linus Walleij | f65f0a1 | 2013-09-15 03:50:17 -0700 | [diff] [blame] | 25 | const char *default_trigger; |
Milo(Woogyom) Kim | c93d08f | 2013-02-05 18:01:23 +0900 | [diff] [blame] | 26 | u8 chan_nr; |
| 27 | u8 led_current; /* mA x10, 0 if led is not connected */ |
| 28 | u8 max_current; |
| 29 | }; |
| 30 | |
| 31 | struct lp55xx_predef_pattern { |
Kim, Milo | ff45262a | 2013-02-18 21:10:14 -0800 | [diff] [blame] | 32 | const u8 *r; |
| 33 | const u8 *g; |
| 34 | const u8 *b; |
Milo(Woogyom) Kim | c93d08f | 2013-02-05 18:01:23 +0900 | [diff] [blame] | 35 | u8 size_r; |
| 36 | u8 size_g; |
| 37 | u8 size_b; |
| 38 | }; |
| 39 | |
Kim, Milo | 33b3a56 | 2013-07-09 02:11:37 -0700 | [diff] [blame] | 40 | enum lp8501_pwr_sel { |
| 41 | LP8501_ALL_VDD, /* D1~9 are connected to VDD */ |
| 42 | LP8501_6VDD_3VOUT, /* D1~6 with VDD, D7~9 with VOUT */ |
| 43 | LP8501_3VDD_6VOUT, /* D1~6 with VOUT, D7~9 with VDD */ |
| 44 | LP8501_ALL_VOUT, /* D1~9 are connected to VOUT */ |
| 45 | }; |
| 46 | |
Milo(Woogyom) Kim | c93d08f | 2013-02-05 18:01:23 +0900 | [diff] [blame] | 47 | /* |
| 48 | * struct lp55xx_platform_data |
| 49 | * @led_config : Configurable led class device |
| 50 | * @num_channels : Number of LED channels |
| 51 | * @label : Used for naming LEDs |
| 52 | * @clock_mode : Input clock mode. LP55XX_CLOCK_AUTO or _INT or _EXT |
| 53 | * @setup_resources : Platform specific function before enabling the chip |
| 54 | * @release_resources : Platform specific function after disabling the chip |
| 55 | * @enable : EN pin control by platform side |
| 56 | * @patterns : Predefined pattern data for RGB channels |
| 57 | * @num_patterns : Number of patterns |
| 58 | * @update_config : Value of CONFIG register |
| 59 | */ |
| 60 | struct lp55xx_platform_data { |
| 61 | |
| 62 | /* LED channel configuration */ |
| 63 | struct lp55xx_led_config *led_config; |
| 64 | u8 num_channels; |
| 65 | const char *label; |
| 66 | |
| 67 | /* Clock configuration */ |
| 68 | u8 clock_mode; |
| 69 | |
Sebastian Reichel | 30dae2f | 2013-10-22 11:02:56 -0700 | [diff] [blame] | 70 | /* optional enable GPIO */ |
| 71 | int enable_gpio; |
Milo(Woogyom) Kim | c93d08f | 2013-02-05 18:01:23 +0900 | [diff] [blame] | 72 | |
| 73 | /* Predefined pattern data */ |
| 74 | struct lp55xx_predef_pattern *patterns; |
| 75 | unsigned int num_patterns; |
Kim, Milo | 33b3a56 | 2013-07-09 02:11:37 -0700 | [diff] [blame] | 76 | |
| 77 | /* LP8501 specific */ |
| 78 | enum lp8501_pwr_sel pwr_sel; |
Milo(Woogyom) Kim | c93d08f | 2013-02-05 18:01:23 +0900 | [diff] [blame] | 79 | }; |
| 80 | |
| 81 | #endif /* _LEDS_LP55XX_H */ |