blob: 202e290faea877effcc153f0a8bc21e35f2cb697 [file] [log] [blame]
Milo(Woogyom) Kimc93d08f2013-02-05 18:01:23 +09001/*
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) Kimc93d08f2013-02-05 18:01:23 +090023struct lp55xx_led_config {
24 const char *name;
25 u8 chan_nr;
26 u8 led_current; /* mA x10, 0 if led is not connected */
27 u8 max_current;
28};
29
30struct lp55xx_predef_pattern {
Kim, Miloff45262a2013-02-18 21:10:14 -080031 const u8 *r;
32 const u8 *g;
33 const u8 *b;
Milo(Woogyom) Kimc93d08f2013-02-05 18:01:23 +090034 u8 size_r;
35 u8 size_g;
36 u8 size_b;
37};
38
39/*
40 * struct lp55xx_platform_data
41 * @led_config : Configurable led class device
42 * @num_channels : Number of LED channels
43 * @label : Used for naming LEDs
44 * @clock_mode : Input clock mode. LP55XX_CLOCK_AUTO or _INT or _EXT
45 * @setup_resources : Platform specific function before enabling the chip
46 * @release_resources : Platform specific function after disabling the chip
47 * @enable : EN pin control by platform side
48 * @patterns : Predefined pattern data for RGB channels
49 * @num_patterns : Number of patterns
50 * @update_config : Value of CONFIG register
51 */
52struct lp55xx_platform_data {
53
54 /* LED channel configuration */
55 struct lp55xx_led_config *led_config;
56 u8 num_channels;
57 const char *label;
58
59 /* Clock configuration */
60 u8 clock_mode;
61
62 /* Platform specific functions */
63 int (*setup_resources)(void);
64 void (*release_resources)(void);
65 void (*enable)(bool state);
66
67 /* Predefined pattern data */
68 struct lp55xx_predef_pattern *patterns;
69 unsigned int num_patterns;
Milo(Woogyom) Kimc93d08f2013-02-05 18:01:23 +090070};
71
72#endif /* _LEDS_LP55XX_H */