int flashlight_control(int mode) { #ifdef CONFIG_FLASHLIGHT_TPS61310 return tps61310_flashlight_control(mode); #else return 0; #endif }
int flashlight_control(int mode) { pr_info("%s, linear led, mode=%d", __func__, mode); #ifdef CONFIG_FLASHLIGHT_TPS61310 return tps61310_flashlight_control(mode); #else return 0; #endif }
int flashlight_control(int mode) { #ifdef CONFIG_FLASHLIGHT_TPS61310 /* HTC_START Turn off backlight when flash on */ int rc; static int brightness = 255; static int backlight_off = 0; pr_info("[CAM] %s, linear led, mode %d backlight_off %d", __func__, mode, backlight_off); if (mode != FL_MODE_PRE_FLASH && mode != FL_MODE_OFF) { if (!backlight_off) { /* restore backlight brightness value first */ brightness = led_brightness_value_get("lcd-backlight"); if (brightness >= 0 && brightness <= 255) { pr_info("[CAM] %s, Turn off backlight before flashlight, brightness %d", __func__, brightness); led_brightness_value_set("lcd-backlight", 0); backlight_off = 1; } else pr_err("[CAM] %s, Invalid brightness value!! brightness %d", __func__, brightness); } } rc = tps61310_flashlight_control(mode); if (mode == FL_MODE_PRE_FLASH || mode == FL_MODE_OFF) { if(backlight_off) { pr_info("[CAM] %s, Turn on backlight after flashlight, brightness %d", __func__, brightness); led_brightness_value_set("lcd-backlight", brightness); backlight_off = 0; } } return rc; /* HTC_END */ #else return 0; #endif }