static void fl_lcdev_brightness_set(struct led_classdev *led_cdev,
						enum led_brightness brightness)
{
	struct flashlight_struct *fl_str;
	enum flashlight_mode_flags mode;

	fl_str = container_of(led_cdev, struct flashlight_struct, fl_lcdev);
	if (brightness > 0 && brightness <= LED_HALF) {
		/* Torch mode */
		if (brightness == (LED_HALF - 2))
			mode = FL_MODE_TORCH_LEVEL_1;
		else if (brightness == (LED_HALF - 1))
			mode = FL_MODE_TORCH_LEVEL_2;
		else if (brightness == 1 && fl_str->led_count)
			mode = FL_MODE_TORCH_LED_A;
		else if (brightness == 2 && fl_str->led_count)
			mode = FL_MODE_TORCH_LED_B;
		else if (brightness == 3)
			mode = FL_MODE_DEATH_RAY;
		else
			mode = FL_MODE_TORCH;
	} else if (brightness > LED_HALF && brightness <= LED_FULL) {
		/* Flashlight mode */
		if (brightness == (LED_HALF + 1))
			mode = FL_MODE_PRE_FLASH; /* pre-flash mode */
		else
			mode = FL_MODE_FLASH;
	} else
		/* off and else */
		mode = FL_MODE_OFF;
	aat1271_flashlight_control(mode);

	return;
}
static int flashlight_control(int mode)
{
#if CONFIG_FLASHLIGHT_AAT
	return aat1271_flashlight_control(mode);
#else
	return 0;
#endif
}
Example #3
0
static int flashlight_control(int mode)
{
	return aat1271_flashlight_control(mode);
}