2 * Copyright (C) 2012 Spreadtrum Communications Inc.
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.
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.
13 #include <linux/module.h>
14 #include <linux/kernel.h>
15 #include <linux/init.h>
18 #include <mach/hardware.h>
19 #include <mach/board.h>
23 #include <linux/leds/flashlight.h>
25 struct flashlight_device* sprd_get_flashlight_by_name(void)
27 struct flashlight_device* flash_ptr = NULL;
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");
34 flashlight_set_mode(flash_ptr, FLASHLIGHT_MODE_FLASH);
38 int sprd_flash_on(void)
40 struct flashlight_device* flash_ptr = NULL;
42 flash_ptr = sprd_get_flashlight_by_name();
43 printk("sprd_flash_on kanas w \n");
44 flashlight_strobe(flash_ptr);
48 int sprd_flash_high_light(void)
50 struct flashlight_device* flash_ptr = NULL;
52 flash_ptr = sprd_get_flashlight_by_name();
53 printk("sprd_flash_high_light kanas w \n");
54 flashlight_strobe(flash_ptr);
58 int sprd_flash_close(void)
60 struct flashlight_device* flash_ptr = NULL;
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);