1/* 2* Simple driver for Texas Instruments LM3630 LED Flash driver chip 3* Copyright (C) 2012 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 __LINUX_LM3639_H 12#define __LINUX_LM3639_H 13 14#define LM3639_NAME "lm3639_bl" 15 16enum lm3639_pwm { 17 LM3639_PWM_DISABLE = 0x00, 18 LM3639_PWM_EN_ACTLOW = 0x48, 19 LM3639_PWM_EN_ACTHIGH = 0x40, 20}; 21 22enum lm3639_strobe { 23 LM3639_STROBE_DISABLE = 0x00, 24 LM3639_STROBE_EN_ACTLOW = 0x10, 25 LM3639_STROBE_EN_ACTHIGH = 0x30, 26}; 27 28enum lm3639_txpin { 29 LM3639_TXPIN_DISABLE = 0x00, 30 LM3639_TXPIN_EN_ACTLOW = 0x04, 31 LM3639_TXPIN_EN_ACTHIGH = 0x0C, 32}; 33 34enum lm3639_fleds { 35 LM3639_FLED_DIASBLE_ALL = 0x00, 36 LM3639_FLED_EN_1 = 0x40, 37 LM3639_FLED_EN_2 = 0x20, 38 LM3639_FLED_EN_ALL = 0x60, 39}; 40 41enum lm3639_bleds { 42 LM3639_BLED_DIASBLE_ALL = 0x00, 43 LM3639_BLED_EN_1 = 0x10, 44 LM3639_BLED_EN_2 = 0x08, 45 LM3639_BLED_EN_ALL = 0x18, 46}; 47enum lm3639_bled_mode { 48 LM3639_BLED_MODE_EXPONETIAL = 0x00, 49 LM3639_BLED_MODE_LINEAR = 0x10, 50}; 51 52struct lm3639_platform_data { 53 unsigned int max_brt_led; 54 unsigned int init_brt_led; 55 56 /* input pins */ 57 enum lm3639_pwm pin_pwm; 58 enum lm3639_strobe pin_strobe; 59 enum lm3639_txpin pin_tx; 60 61 /* output pins */ 62 enum lm3639_fleds fled_pins; 63 enum lm3639_bleds bled_pins; 64 enum lm3639_bled_mode bled_mode; 65 66 void (*pwm_set_intensity) (int brightness, int max_brightness); 67 int (*pwm_get_intensity) (void); 68}; 69#endif /* __LINUX_LM3639_H */ 70