tizen 2.4 release
[profile/mobile/platform/kernel/linux-3.10-sc7730.git] / drivers / media / sprd_dcam / flash / flash_common.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 #ifndef CONFIG_64BIT
17 #include <soc/sprd/hardware.h>
18 #include <soc/sprd/board.h>
19 #endif
20 #include <soc/sprd/adi.h>
21 #include "../common/parse_hwinfo.h"
22
23 int sprd_flash_on(void)
24 {
25         printk("sprd_flash_on \n");
26         sci_adi_clr(SPRD_ADISLAVE_BASE + SPRD_FLASH_OFST, SPRD_FLASH_HIGH_VAL);
27         sci_adi_set(SPRD_ADISLAVE_BASE + SPRD_FLASH_OFST, SPRD_FLASH_CTRL_BIT | SPRD_FLASH_LOW_VAL); /*0x3 = 110ma*/
28         return 0;
29 }
30
31 int sprd_flash_high_light(void)
32 {
33         printk("sprd_flash_high_light \n");
34         sci_adi_set(SPRD_ADISLAVE_BASE + SPRD_FLASH_OFST, SPRD_FLASH_CTRL_BIT | SPRD_FLASH_HIGH_VAL); /*0xf = 470ma*/
35         return 0;
36 }
37
38 int sprd_flash_close(void)
39 {
40         printk("sprd_flash_close \n");
41         sci_adi_clr(SPRD_ADISLAVE_BASE + SPRD_FLASH_OFST, SPRD_FLASH_CTRL_BIT | SPRD_FLASH_HIGH_VAL);
42         return 0;
43 }