blob: 15be78627904c331e0168bcd6ba3c393fd7dc70a [file] [log] [blame]
Flemmard6cc4dbb2013-05-20 01:01:06 -07001/*
2 * arch/arm/mach-msm/include/mach/msm_flashlight.h - The flashlight header
3 * Copyright (C) 2009 HTC Corporation
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20#ifndef __HTC_FLASHLIGHT_H
21#define __HTC_FLASHLIGHT_H
22#include <linux/earlysuspend.h>
23
24#define FLASHLIGHT_NAME "flashlight"
25
26#define FLASHLIGHT_OFF 0
27#define FLASHLIGHT_TORCH 1
28#define FLASHLIGHT_FLASH 2
29#define FLASHLIGHT_NUM 3
30
31
32enum flashlight_mode_flags {
33 FL_MODE_OFF = 0,
34 FL_MODE_TORCH,
35 FL_MODE_FLASH,
36 FL_MODE_PRE_FLASH,
37 FL_MODE_TORCH_LED_A,
38 FL_MODE_TORCH_LED_B,
39 FL_MODE_TORCH_LEVEL_1,
40 FL_MODE_TORCH_LEVEL_2,
41 FL_MODE_CAMERA_EFFECT_FLASH,
42 FL_MODE_CAMERA_EFFECT_PRE_FLASH,
43 FL_MODE_FLASH_LEVEL1,
44 FL_MODE_FLASH_LEVEL2,
45 FL_MODE_FLASH_LEVEL3,
46 FL_MODE_FLASH_LEVEL4,
47 FL_MODE_FLASH_LEVEL5,
48 FL_MODE_FLASH_LEVEL6,
49 FL_MODE_FLASH_LEVEL7,
50
51};
52
53#ifdef CONFIG_FLASHLIGHT_AAT
54struct flashlight_platform_data {
55 void (*gpio_init) (void);
56 uint32_t torch;
57 uint32_t flash;
58 uint32_t flash_adj;
59 uint32_t torch_set1;
60 uint32_t torch_set2;
61 uint32_t flash_duration_ms;
62 uint8_t led_count;
63 uint32_t chip_model;
64};
65
66enum flashlight_chip{
67 AAT1271 = 0,
68 AAT3177,
69 AAT1277,
70};
71#endif
72
73#ifdef CONFIG_FLASHLIGHT_TPS61310
74struct TPS61310_flashlight_platform_data {
75 void (*gpio_init) (void);
76 uint32_t flash_duration_ms;
77 uint8_t led_count;
78 uint32_t tps61310_strb0;
79 uint32_t tps61310_strb1;
80 uint8_t mode_pin_suspend_state_low;
81};
82
83int aat1271_flashlight_control(int mode);
84int adp1650_flashlight_control(int mode);
85int aat3177_flashlight_control(int mode);
86int aat1277_flashlight_control(int mode);
87int tps61310_flashlight_control(int mode);
88int htc_flashlight_control(int flashlight_mode);
89#endif
90
91#undef __HTC_FLASHLIGHT_H
92#endif