tizen 2.4 release
[profile/mobile/platform/kernel/linux-3.10-sc7730.git] / drivers / media / sprd_dcam / flash / flash_sprd_sm5701.c
1 /*
2 * * Copyright (C) 2012 Spreadtrum Communications Inc.
3 * *
4 * * This software is licensed under the terms of the GNU General Public
5 * * License version 2, as published by the Free Software Foundation, and
6 * * may be copied, distributed, and modified under those terms.
7 * *
8 * * This program is distributed in the hope that it will be useful,
9 * * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 * * GNU General Public License for more details.
12 * */
13 #include <linux/module.h>
14 #include <linux/kernel.h>
15 #include <linux/init.h>
16 #include <soc/sprd/hardware.h>
17 #include <soc/sprd/board.h>
18 #include <soc/sprd/adi.h>
19 #include <linux/leds.h>
20 #include <linux/mfd/sprd_sm5701_core.h>
21
22 int sprd_flash_on(void)
23 {
24
25         sm5701_led_ready(MOVIE_MODE);
26         sm5701_set_fleden(SM5701_FLEDEN_ON_MOVIE);
27
28         return 0;
29 }
30
31 int sprd_flash_high_light(void)
32 {
33
34         sm5701_led_ready(FLASH_MODE);
35         sm5701_set_fleden(SM5701_FLEDEN_ON_FLASH);
36
37         return 0;
38 }
39
40 int sprd_flash_close(void)
41 {
42
43         sm5701_set_fleden(SM5701_FLEDEN_DISABLED);
44         sm5701_led_ready(LED_DISABLE);
45
46         return 0;
47 }
48