htcleo: add flashlight driver
This commit is contained in:
parent
772ab54360
commit
543147e02b
@ -40,6 +40,7 @@
|
||||
#include <mach/msm_iomap.h>
|
||||
#include <mach/perflock.h>
|
||||
#include <mach/htc_usb.h>
|
||||
#include <mach/msm_flashlight.h>
|
||||
|
||||
#include "board-htcleo.h"
|
||||
#include "board-htcleo-ts.h"
|
||||
@ -228,6 +229,39 @@ unsigned htcleo_get_vbus_state(void)
|
||||
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
// Flashlight
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
static uint32_t flashlight_gpio_table[] =
|
||||
{
|
||||
PCOM_GPIO_CFG(HTCLEO_GPIO_FLASHLIGHT_TORCH, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA),
|
||||
PCOM_GPIO_CFG(HTCLEO_GPIO_FLASHLIGHT_FLASH, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA),
|
||||
};
|
||||
|
||||
static int config_htcleo_flashlight_gpios(void)
|
||||
{
|
||||
config_gpio_table(flashlight_gpio_table, ARRAY_SIZE(flashlight_gpio_table));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct flashlight_platform_data htcleo_flashlight_data =
|
||||
{
|
||||
.gpio_init = config_htcleo_flashlight_gpios,
|
||||
.torch = HTCLEO_GPIO_FLASHLIGHT_TORCH,
|
||||
.flash = HTCLEO_GPIO_FLASHLIGHT_FLASH,
|
||||
.flash_duration_ms = 600
|
||||
};
|
||||
|
||||
static struct platform_device htcleo_flashlight_device =
|
||||
{
|
||||
.name = "flashlight",
|
||||
.dev =
|
||||
{
|
||||
.platform_data = &htcleo_flashlight_data,
|
||||
},
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
// KGSL (HW3D support)#include <linux/android_pmem.h>
|
||||
|
||||
@ -364,7 +398,7 @@ static struct platform_device *devices[] __initdata =
|
||||
// &msm_kgsl_device,
|
||||
// &capella_cm3602,
|
||||
// &msm_camera_sensor_s5k3e2fx,
|
||||
// &htcleo_flashlight_device,
|
||||
&htcleo_flashlight_device,
|
||||
&htcleo_power,
|
||||
&qsd_device_spi,
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user