summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authora0414807local2014-07-27 19:54:13 -0500
committera0414807local2014-07-27 19:54:13 -0500
commit4b2e72df149891c70ae951a9244925eaf4fa15bf (patch)
tree4f867e08986bf790b0b8a2d1bd35f278b53671e8 /include
parente303dc0e6d863297bb98ffecc74c107f45e29ff5 (diff)
downloadkernel-4b2e72df149891c70ae951a9244925eaf4fa15bf.tar.gz
kernel-4b2e72df149891c70ae951a9244925eaf4fa15bf.tar.xz
kernel-4b2e72df149891c70ae951a9244925eaf4fa15bf.zip
Add LM3644 new Flash drivers v4l2&LED subsystem
Signed-off-by: a0414807local <a0414807local@uva0414807>
Diffstat (limited to 'include')
-rw-r--r--include/linux/platform_data/leds-lm3644.h17
-rw-r--r--include/media/lm3644.h86
2 files changed, 103 insertions, 0 deletions
diff --git a/include/linux/platform_data/leds-lm3644.h b/include/linux/platform_data/leds-lm3644.h
new file mode 100644
index 0000000..d9063bf
--- /dev/null
+++ b/include/linux/platform_data/leds-lm3644.h
@@ -0,0 +1,17 @@
1/*
2 * Simple driver for Texas Instruments LM3644 LED Flash driver chip
3 * Copyright (C) 2014 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 */
10
11#ifndef __LM3644_H
12#define __LM3644_H
13
14#define LM3644_NAME "leds-lm3644"
15#define LM3644_ADDR 0x63
16
17#endif /* __LM3644_H */
diff --git a/include/media/lm3644.h b/include/media/lm3644.h
new file mode 100644
index 0000000..f105b74
--- /dev/null
+++ b/include/media/lm3644.h
@@ -0,0 +1,86 @@
1/*
2 * include/media/lm3644.h
3 *
4 * Copyright (C) 2014 Texas Instruments
5 *
6 * Contact: Daniel Jeong <gshark.jeong@gmail.com>
7 * Ldd-Mlp <ldd-mlp@list.ti.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 */
18
19#ifndef __LM3644_H__
20#define __LM3644_H__
21
22#include <media/v4l2-subdev.h>
23
24#define LM3644_NAME "lm3644"
25#define LM3644_I2C_ADDR (0x63)
26
27/* FLASH Brightness
28 * min 11310uA, step 11720uA, max 1500000uA
29 */
30#define LM3644_FLASH_BRT_MIN 11310
31#define LM3644_FLASH_BRT_STEP 11720
32#define LM3644_FLASH_BRT_MAX 1500000
33#define LM3644_FLASH_BRT_uA_TO_REG(a) \
34 ((a) < LM3644_FLASH_BRT_MIN ? 0 : \
35 (((a) - LM3644_FLASH_BRT_MIN) / LM3644_FLASH_BRT_STEP))
36
37/* TORCH BRT
38 * min 1060uA, step 1460uA, max 187000uA
39 */
40#define LM3644_TORCH_BRT_MIN 1060
41#define LM3644_TORCH_BRT_STEP 1460
42#define LM3644_TORCH_BRT_MAX 187000
43#define LM3644_TORCH_BRT_uA_TO_REG(a) \
44 ((a) < LM3644_TORCH_BRT_MIN ? 0 : \
45 (((a) - LM3644_TORCH_BRT_MIN) / LM3644_TORCH_BRT_STEP))
46
47/* FLASH TIMEOUT DURATION
48 * min 10ms, max 400ms
49 * step 10ms in range from 10ms to 100ms
50 * setp 50ms in range from 100ms to 400ms
51 */
52#define LM3644_FLASH_TOUT_MIN 10
53#define LM3644_FLASH_TOUT_LOW_STEP 10
54#define LM3644_FLASH_TOUT_LOW_MAX 100
55#define LM3644_FLASH_TOUT_HIGH_STEP 50
56#define LM3644_FLASH_TOUT_MAX 400
57#define LM3644_FLASH_TOUT_ms_TO_REG(a) \
58 ((a) < LM3644_FLASH_TOUT_MIN ? 0 : \
59 ((a) <= LM3644_FLASH_TOUT_LOW_MAX ? \
60 (((a) - LM3644_FLASH_TOUT_MIN) / LM3644_FLASH_TOUT_LOW_STEP) : \
61 ((((a) - LM3644_FLASH_TOUT_LOW_MAX) / LM3644_FLASH_TOUT_HIGH_STEP) \
62 +((LM3644_FLASH_TOUT_LOW_MAX - LM3644_FLASH_TOUT_MIN) \
63 / LM3644_FLASH_TOUT_LOW_STEP))))
64
65enum lm3644_led_id {
66 LM3644_LED0 = 0,
67 LM3644_LED1,
68 LM3644_LED_MAX
69};
70
71/*
72 * struct lm3644_platform_data
73 * @led0_enable : led0 enable
74 * @led1_enable : led1 enable
75 * @flash1_override : led1 flash current override
76 * @torch1_override : led1 torch current override
77 */
78struct lm3644_platform_data {
79
80 u8 led0_enable;
81 u8 led1_enable;
82 u8 flash1_override;
83 u8 torch1_override;
84};
85
86#endif /* __LM3644_H__ */