blob: de606207aa3a8e03564aafd68844d91a36be6dde (
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
|
/*
* Copyright (C) 2012 Spreadtrum Communications Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* 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.
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#ifndef CONFIG_64BIT
#include <mach/hardware.h>
#include <mach/board.h>
#include <mach/adi.h>
#endif
#include <linux/leds/flashlight.h>
struct flashlight_device* sprd_get_flashlight_by_name(void)
{
struct flashlight_device* flash_ptr = NULL;
flash_ptr = find_flashlight_by_name("rt-flash-led");
if (NULL == flash_ptr) {
printk("sprd_get_flashlight_by_name: flash_ptr is PNULL \n");
return NULL;
}
flashlight_set_mode(flash_ptr, FLASHLIGHT_MODE_FLASH);
return flash_ptr;
}
int sprd_flash_on(void)
{
struct flashlight_device* flash_ptr = NULL;
flash_ptr = sprd_get_flashlight_by_name();
printk("sprd_flash_on kanas w \n");
flashlight_strobe(flash_ptr);
return 0;
}
int sprd_flash_high_light(void)
{
struct flashlight_device* flash_ptr = NULL;
flash_ptr = sprd_get_flashlight_by_name();
printk("sprd_flash_high_light kanas w \n");
flashlight_strobe(flash_ptr);
return 0;
}
int sprd_flash_close(void)
{
struct flashlight_device* flash_ptr = NULL;
flash_ptr = sprd_get_flashlight_by_name();
printk("sprd_flash_close kanas w \n");
flashlight_set_mode(flash_ptr, FLASHLIGHT_MODE_OFF);
return 0;
}
|