1 /*
2 * Simple driver for Texas Instruments LM3642 LED Flash driver chip
3 * Copyright (C) 2013 Texas Instruments
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 */
11 #ifndef __LINUX_LM3646_H
12 #define __LINUX_LM3646_H
14 #define LM3646_NAME "leds-lm3646"
15 #define LM3646_ADDR 0x63
17 enum lm3646_tx_pin {
18 LM3646_TX_PIN_DISABLED = 0,
19 LM3646_TX_PIN_ENABLED = 0x08,
20 };
22 enum lm3646_torch_pin {
23 LM3646_TORCH_PIN_DISABLED = 0,
24 LM3646_TORCH_PIN_ENABLED = 0x80,
25 };
27 enum lm3646_strobe_pin {
28 LM3646_STROBE_PIN_DISABLED = 0,
29 LM3646_STROBE_PIN_ENABLED = 0x80,
30 };
32 /* struct lm3646 platform data
33 * @flash_imax 0x0 = 93.4 mA
34 * 0x1 = 187.1 mA
35 * .....
36 * 0xF = 1500 mA
37 * @torch_imax 0x0 = 23.1 mA
38 * 0x1 = 46.5 mA
39 * .....
40 * 0x7 = 187.1 mA
41 * @led1_flash_imax 0x00 = 0 mA(disabled), led2=flash_imax
42 * 0x01 = 23.1 mA, led2=flash_imax-23.1mA
43 * .....
44 * 0x7F = 1.5A, led2=disabled
45 * @led1_torch_imax 0x00 = 0 mA(disabled), led2=torch_imax
46 * 0x01 = 2.6 mA, led2=torch_imax-2.6mA
47 * .....
48 * 0x7F = 187.1 mA, led2=disabled
49 * @tx_pin Enable tx pin and tx current reduction function
50 * @torch_pin : torch pin enable
51 * @strobe_pin : strobe pin enable
52 */
53 struct lm3646_platform_data {
55 u8 flash_imax;
56 u8 torch_imax;
57 u8 led1_flash_imax;
58 u8 led1_torch_imax;
60 enum lm3646_tx_pin tx_pin;
61 enum lm3646_torch_pin torch_pin;
62 enum lm3646_strobe_pin strobe_pin;
63 };
65 #endif /* __LINUX_LM3646_H */