tizen 2.4 release
[profile/mobile/platform/kernel/linux-3.10-sc7730.git] / drivers / media / sprd_dcam / flash / flash_kanas_w.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
17 #ifndef CONFIG_64BIT
18 #include <mach/hardware.h>
19 #include <mach/board.h>
20 #include <mach/adi.h>
21 #endif
22
23 #include <linux/leds/flashlight.h>
24
25 struct flashlight_device* sprd_get_flashlight_by_name(void)
26 {
27         struct flashlight_device* flash_ptr = NULL;
28
29         flash_ptr = find_flashlight_by_name("rt-flash-led");
30         if (NULL == flash_ptr) {
31                 printk("sprd_get_flashlight_by_name: flash_ptr is PNULL  \n");
32                 return NULL;
33         }
34         flashlight_set_mode(flash_ptr, FLASHLIGHT_MODE_FLASH);
35         return flash_ptr;
36 }
37
38 int sprd_flash_on(void)
39 {
40         struct flashlight_device* flash_ptr = NULL;
41
42         flash_ptr = sprd_get_flashlight_by_name();
43         printk("sprd_flash_on kanas w \n");
44         flashlight_strobe(flash_ptr);
45         return 0;
46 }
47
48 int sprd_flash_high_light(void)
49 {
50         struct flashlight_device* flash_ptr = NULL;
51
52         flash_ptr = sprd_get_flashlight_by_name();
53         printk("sprd_flash_high_light kanas w \n");
54         flashlight_strobe(flash_ptr);
55         return 0;
56 }
57
58 int sprd_flash_close(void)
59 {
60         struct flashlight_device* flash_ptr = NULL;
61
62         flash_ptr = sprd_get_flashlight_by_name();
63         printk("sprd_flash_close kanas w \n");
64         flashlight_set_mode(flash_ptr, FLASHLIGHT_MODE_OFF);
65         return 0;
66 }