blob: d86ea6d94633c129ec3637b3c0d78a815be101c2 [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,
Ethan Chen4eb43ec2013-08-31 15:09:56 -070050 FL_MODE_VIDEO_TORCH = 30,
51 FL_MODE_VIDEO_TORCH_1,
52 FL_MODE_VIDEO_TORCH_2,
53 FL_MODE_VIDEO_TORCH_3,
54 FL_MODE_VIDEO_TORCH_4,
Flemmard6cc4dbb2013-05-20 01:01:06 -070055};
56
57#ifdef CONFIG_FLASHLIGHT_AAT
Flemmard4a883982014-02-07 16:15:23 +010058#define AAT_FLT_DEV_NAME "FLASHLIGHT_AAT"
Flemmard6cc4dbb2013-05-20 01:01:06 -070059struct flashlight_platform_data {
60 void (*gpio_init) (void);
61 uint32_t torch;
62 uint32_t flash;
63 uint32_t flash_adj;
64 uint32_t torch_set1;
65 uint32_t torch_set2;
66 uint32_t flash_duration_ms;
67 uint8_t led_count;
68 uint32_t chip_model;
69};
70
71enum flashlight_chip{
72 AAT1271 = 0,
Flemmard6cc4dbb2013-05-20 01:01:06 -070073 AAT1277,
74};
Flemmard5191e222014-03-23 18:58:15 +010075int aat1271_flashlight_control(int mode);
76int adp1650_flashlight_control(int mode);
77int aat3177_flashlight_control(int mode);
78int aat1277_flashlight_control(int mode);
Flemmard6cc4dbb2013-05-20 01:01:06 -070079#endif
80
81#ifdef CONFIG_FLASHLIGHT_TPS61310
82struct TPS61310_flashlight_platform_data {
83 void (*gpio_init) (void);
84 uint32_t flash_duration_ms;
85 uint8_t led_count;
86 uint32_t tps61310_strb0;
87 uint32_t tps61310_strb1;
Ethan Chen4eb43ec2013-08-31 15:09:56 -070088 uint32_t tps61310_reset;
Flemmard6cc4dbb2013-05-20 01:01:06 -070089 uint8_t mode_pin_suspend_state_low;
Ethan Chen4eb43ec2013-08-31 15:09:56 -070090 uint8_t enable_FLT_1500mA;
91 uint8_t disable_tx_mask;
92 uint32_t power_save;
93 uint32_t power_save_2;
Flemmard6cc4dbb2013-05-20 01:01:06 -070094};
95
Flemmard6cc4dbb2013-05-20 01:01:06 -070096int tps61310_flashlight_control(int mode);
Flemmard6cc4dbb2013-05-20 01:01:06 -070097#endif
Flemmard5191e222014-03-23 18:58:15 +010098int htc_flashlight_control(int flashlight_mode);
Flemmard6cc4dbb2013-05-20 01:01:06 -070099
100#undef __HTC_FLASHLIGHT_H
101#endif