1
2
3
4
5
6
7
8
9
10
11 #ifndef __LM3646_H__
12 #define __LM3646_H__
13
14 #include <media/v4l2-subdev.h>
15
16 #define LM3646_NAME "lm3646"
17 #define LM3646_I2C_ADDR_REV1 (0x67)
18 #define LM3646_I2C_ADDR_REV0 (0x63)
19
20
21
22
23 #define LM3646_TOTAL_FLASH_BRT_MIN 93350
24 #define LM3646_TOTAL_FLASH_BRT_STEP 93750
25 #define LM3646_TOTAL_FLASH_BRT_MAX 1499600
26 #define LM3646_TOTAL_FLASH_BRT_uA_TO_REG(a) \
27 ((a) < LM3646_TOTAL_FLASH_BRT_MIN ? 0 : \
28 ((((a) - LM3646_TOTAL_FLASH_BRT_MIN) / LM3646_TOTAL_FLASH_BRT_STEP)))
29
30
31
32
33 #define LM3646_TOTAL_TORCH_BRT_MIN 23040
34 #define LM3646_TOTAL_TORCH_BRT_STEP 23430
35 #define LM3646_TOTAL_TORCH_BRT_MAX 187100
36 #define LM3646_TOTAL_TORCH_BRT_uA_TO_REG(a) \
37 ((a) < LM3646_TOTAL_TORCH_BRT_MIN ? 0 : \
38 ((((a) - LM3646_TOTAL_TORCH_BRT_MIN) / LM3646_TOTAL_TORCH_BRT_STEP)))
39
40
41
42
43 #define LM3646_LED1_FLASH_BRT_MIN 23040
44 #define LM3646_LED1_FLASH_BRT_STEP 11718
45 #define LM3646_LED1_FLASH_BRT_MAX 1499600
46 #define LM3646_LED1_FLASH_BRT_uA_TO_REG(a) \
47 ((a) <= LM3646_LED1_FLASH_BRT_MIN ? 0 : \
48 ((((a) - LM3646_LED1_FLASH_BRT_MIN) / LM3646_LED1_FLASH_BRT_STEP))+1)
49
50
51
52
53 #define LM3646_LED1_TORCH_BRT_MIN 2530
54 #define LM3646_LED1_TORCH_BRT_STEP 1460
55 #define LM3646_LED1_TORCH_BRT_MAX 187100
56 #define LM3646_LED1_TORCH_BRT_uA_TO_REG(a) \
57 ((a) <= LM3646_LED1_TORCH_BRT_MIN ? 0 : \
58 ((((a) - LM3646_LED1_TORCH_BRT_MIN) / LM3646_LED1_TORCH_BRT_STEP))+1)
59
60
61
62
63 #define LM3646_FLASH_TOUT_MIN 50
64 #define LM3646_FLASH_TOUT_STEP 50
65 #define LM3646_FLASH_TOUT_MAX 400
66 #define LM3646_FLASH_TOUT_ms_TO_REG(a) \
67 ((a) <= LM3646_FLASH_TOUT_MIN ? 0 : \
68 (((a) - LM3646_FLASH_TOUT_MIN) / LM3646_FLASH_TOUT_STEP))
69
70
71
72
73
74
75
76 struct lm3646_platform_data {
77
78 u32 flash_timeout;
79
80 u32 led1_flash_brt;
81 u32 led1_torch_brt;
82 };
83
84 #endif