1 /* SPDX-License-Identifier: GPL-2.0-only */ << 2 /* 1 /* 3 * include/media/i2c/lm3646.h 2 * include/media/i2c/lm3646.h 4 * 3 * 5 * Copyright (C) 2014 Texas Instruments 4 * Copyright (C) 2014 Texas Instruments 6 * 5 * 7 * Contact: Daniel Jeong <gshark.jeong@gmail.c 6 * Contact: Daniel Jeong <gshark.jeong@gmail.com> 8 * Ldd-Mlp <ldd-mlp@list. 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. 9 */ 12 */ 10 13 11 #ifndef __LM3646_H__ 14 #ifndef __LM3646_H__ 12 #define __LM3646_H__ 15 #define __LM3646_H__ 13 16 14 #include <media/v4l2-subdev.h> 17 #include <media/v4l2-subdev.h> 15 18 16 #define LM3646_NAME "lm3646" 19 #define LM3646_NAME "lm3646" 17 #define LM3646_I2C_ADDR_REV1 (0x67) 20 #define LM3646_I2C_ADDR_REV1 (0x67) 18 #define LM3646_I2C_ADDR_REV0 (0x63) 21 #define LM3646_I2C_ADDR_REV0 (0x63) 19 22 20 /* TOTAL FLASH Brightness Max 23 /* TOTAL FLASH Brightness Max 21 * min 93350uA, step 93750uA, max 1499600 24 * min 93350uA, step 93750uA, max 1499600uA 22 */ 25 */ 23 #define LM3646_TOTAL_FLASH_BRT_MIN 93350 26 #define LM3646_TOTAL_FLASH_BRT_MIN 93350 24 #define LM3646_TOTAL_FLASH_BRT_STEP 93750 27 #define LM3646_TOTAL_FLASH_BRT_STEP 93750 25 #define LM3646_TOTAL_FLASH_BRT_MAX 1499600 28 #define LM3646_TOTAL_FLASH_BRT_MAX 1499600 26 #define LM3646_TOTAL_FLASH_BRT_uA_TO_REG(a) 29 #define LM3646_TOTAL_FLASH_BRT_uA_TO_REG(a) \ 27 ((a) < LM3646_TOTAL_FLASH_BRT_MIN ? 0 30 ((a) < LM3646_TOTAL_FLASH_BRT_MIN ? 0 : \ 28 ((((a) - LM3646_TOTAL_FLASH_BRT_MIN) 31 ((((a) - LM3646_TOTAL_FLASH_BRT_MIN) / LM3646_TOTAL_FLASH_BRT_STEP))) 29 32 30 /* TOTAL TORCH Brightness Max 33 /* TOTAL TORCH Brightness Max 31 * min 23040uA, step 23430uA, max 187100u 34 * min 23040uA, step 23430uA, max 187100uA 32 */ 35 */ 33 #define LM3646_TOTAL_TORCH_BRT_MIN 23040 36 #define LM3646_TOTAL_TORCH_BRT_MIN 23040 34 #define LM3646_TOTAL_TORCH_BRT_STEP 23430 37 #define LM3646_TOTAL_TORCH_BRT_STEP 23430 35 #define LM3646_TOTAL_TORCH_BRT_MAX 187100 38 #define LM3646_TOTAL_TORCH_BRT_MAX 187100 36 #define LM3646_TOTAL_TORCH_BRT_uA_TO_REG(a) 39 #define LM3646_TOTAL_TORCH_BRT_uA_TO_REG(a) \ 37 ((a) < LM3646_TOTAL_TORCH_BRT_MIN ? 0 40 ((a) < LM3646_TOTAL_TORCH_BRT_MIN ? 0 : \ 38 ((((a) - LM3646_TOTAL_TORCH_BRT_MIN) 41 ((((a) - LM3646_TOTAL_TORCH_BRT_MIN) / LM3646_TOTAL_TORCH_BRT_STEP))) 39 42 40 /* LED1 FLASH Brightness 43 /* LED1 FLASH Brightness 41 * min 23040uA, step 11718uA, max 1499600 44 * min 23040uA, step 11718uA, max 1499600uA 42 */ 45 */ 43 #define LM3646_LED1_FLASH_BRT_MIN 23040 46 #define LM3646_LED1_FLASH_BRT_MIN 23040 44 #define LM3646_LED1_FLASH_BRT_STEP 11718 47 #define LM3646_LED1_FLASH_BRT_STEP 11718 45 #define LM3646_LED1_FLASH_BRT_MAX 1499600 48 #define LM3646_LED1_FLASH_BRT_MAX 1499600 46 #define LM3646_LED1_FLASH_BRT_uA_TO_REG(a) 49 #define LM3646_LED1_FLASH_BRT_uA_TO_REG(a) \ 47 ((a) <= LM3646_LED1_FLASH_BRT_MIN ? 0 50 ((a) <= LM3646_LED1_FLASH_BRT_MIN ? 0 : \ 48 ((((a) - LM3646_LED1_FLASH_BRT_MIN) / 51 ((((a) - LM3646_LED1_FLASH_BRT_MIN) / LM3646_LED1_FLASH_BRT_STEP))+1) 49 52 50 /* LED1 TORCH Brightness 53 /* LED1 TORCH Brightness 51 * min 2530uA, step 1460uA, max 187100uA 54 * min 2530uA, step 1460uA, max 187100uA 52 */ 55 */ 53 #define LM3646_LED1_TORCH_BRT_MIN 2530 56 #define LM3646_LED1_TORCH_BRT_MIN 2530 54 #define LM3646_LED1_TORCH_BRT_STEP 1460 57 #define LM3646_LED1_TORCH_BRT_STEP 1460 55 #define LM3646_LED1_TORCH_BRT_MAX 187100 58 #define LM3646_LED1_TORCH_BRT_MAX 187100 56 #define LM3646_LED1_TORCH_BRT_uA_TO_REG(a) 59 #define LM3646_LED1_TORCH_BRT_uA_TO_REG(a) \ 57 ((a) <= LM3646_LED1_TORCH_BRT_MIN ? 0 60 ((a) <= LM3646_LED1_TORCH_BRT_MIN ? 0 : \ 58 ((((a) - LM3646_LED1_TORCH_BRT_MIN) / 61 ((((a) - LM3646_LED1_TORCH_BRT_MIN) / LM3646_LED1_TORCH_BRT_STEP))+1) 59 62 60 /* FLASH TIMEOUT DURATION 63 /* FLASH TIMEOUT DURATION 61 * min 50ms, step 50ms, max 400ms 64 * min 50ms, step 50ms, max 400ms 62 */ 65 */ 63 #define LM3646_FLASH_TOUT_MIN 50 66 #define LM3646_FLASH_TOUT_MIN 50 64 #define LM3646_FLASH_TOUT_STEP 50 67 #define LM3646_FLASH_TOUT_STEP 50 65 #define LM3646_FLASH_TOUT_MAX 400 68 #define LM3646_FLASH_TOUT_MAX 400 66 #define LM3646_FLASH_TOUT_ms_TO_REG(a) \ 69 #define LM3646_FLASH_TOUT_ms_TO_REG(a) \ 67 ((a) <= LM3646_FLASH_TOUT_MIN ? 0 : 70 ((a) <= LM3646_FLASH_TOUT_MIN ? 0 : \ 68 (((a) - LM3646_FLASH_TOUT_MIN) / LM36 71 (((a) - LM3646_FLASH_TOUT_MIN) / LM3646_FLASH_TOUT_STEP)) 69 72 70 /* struct lm3646_platform_data 73 /* struct lm3646_platform_data 71 * 74 * 72 * @flash_timeout: flash timeout 75 * @flash_timeout: flash timeout 73 * @led1_flash_brt: led1 flash mode brightness 76 * @led1_flash_brt: led1 flash mode brightness, uA 74 * @led1_torch_brt: led1 torch mode brightness 77 * @led1_torch_brt: led1 torch mode brightness, uA 75 */ 78 */ 76 struct lm3646_platform_data { 79 struct lm3646_platform_data { 77 80 78 u32 flash_timeout; 81 u32 flash_timeout; 79 82 80 u32 led1_flash_brt; 83 u32 led1_flash_brt; 81 u32 led1_torch_brt; 84 u32 led1_torch_brt; 82 }; 85 }; 83 86 84 #endif /* __LM3646_H__ */ 87 #endif /* __LM3646_H__ */ 85 88
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.