aboutsummaryrefslogtreecommitdiff
path: root/include/linux/htc_flashlight.h
blob: 8f2d3e643091a052639110b71a0de32ccd9babe8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
 * arch/arm/mach-msm/include/mach/msm_flashlight.h - The flashlight header
 * Copyright (C) 2009-2015  HTC Corporation
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#ifndef __HTC_FLASHLIGHT_H
#define __HTC_FLASHLIGHT_H

#include <linux/list.h>

enum flashlight_mode_flags {
	FL_MODE_OFF = 0,
	FL_MODE_TORCH,
	FL_MODE_FLASH,
	FL_MODE_PRE_FLASH,
	FL_MODE_TORCH_LED_A,
	FL_MODE_TORCH_LED_B,
	FL_MODE_TORCH_LEVEL_0,
	FL_MODE_TORCH_LEVEL_1,
	FL_MODE_TORCH_LEVEL_2,
	FL_MODE_CAMERA_EFFECT_FLASH,
	FL_MODE_CAMERA_EFFECT_PRE_FLASH,
	FL_MODE_FLASH_LEVEL1,
	FL_MODE_FLASH_LEVEL2,
	FL_MODE_FLASH_LEVEL3,
	FL_MODE_FLASH_LEVEL4,
	FL_MODE_FLASH_LEVEL5,
	FL_MODE_FLASH_LEVEL6,
	FL_MODE_FLASH_LEVEL7,
	FL_MODE_VIDEO_TORCH = 30,
	FL_MODE_VIDEO_TORCH_1,
	FL_MODE_VIDEO_TORCH_2,
	FL_MODE_VIDEO_TORCH_3,
	FL_MODE_VIDEO_TORCH_4,
};

struct htc_flashlight_dev {
	u8 id;
	struct list_head list;

	int (*flash_func)(struct htc_flashlight_dev *, int, int);
	int (*torch_func)(struct htc_flashlight_dev *, int, int);
};

extern int (*htc_flash_main)(int, int);
extern int (*htc_torch_main)(int, int);
extern int (*htc_flash_front)(int, int);
extern int (*htc_torch_front)(int, int);

#ifdef __KERNEL__
#ifdef CONFIG_HTC_FLASHLIGHT
int register_htc_flashlight(struct htc_flashlight_dev *);
int unregister_htc_flashlight(struct htc_flashlight_dev *);
#else
static inline int register_htc_flashlight(struct htc_flashlight_dev *dev)
{
	return -EINVAL;
}

static inline int unregister_htc_flashlight(struct htc_flashlight_dev *dev)
{
	return -EINVAL;
}
#endif
#endif

#endif