diff options
-rw-r--r-- | arch/arm/mach-s3c2442/gta02-fiq.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-s3c2442/mach-gta02.c | 27 |
2 files changed, 37 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2442/gta02-fiq.c b/arch/arm/mach-s3c2442/gta02-fiq.c index d2c825c17ad..2b46597c41e 100644 --- a/arch/arm/mach-s3c2442/gta02-fiq.c +++ b/arch/arm/mach-s3c2442/gta02-fiq.c @@ -21,6 +21,11 @@ extern int hdq_fiq_handler(void); #endif +#ifdef CONFIG_LEDS_GTA02_VIBRATOR +#define FIQ_DIVISOR_VIBRATOR DIVISOR_FROM_US(100) +extern int gta02_vibrator_fiq_handler(void); +#endif + /* Global data related to our fiq source */ static uint32_t gta02_fiq_ack_mask; static struct s3c2410_pwm gta02_fiq_pwm_timer; @@ -44,6 +49,11 @@ void gta02_fiq_handler(void) divisor = FIQ_DIVISOR_HDQ; #endif +#ifdef CONFIG_LEDS_GTA02_VIBRATOR + if (gta02_vibrator_fiq_handler()) + divisor = FIQ_DIVISOR_VIBRATOR; +#endif + if (divisor == 0xffff) /* mask the fiq irq source */ __raw_writel(__raw_readl(S3C2410_INTMSK) | gta02_fiq_ack_mask, S3C2410_INTMSK); diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2442/mach-gta02.c index 2df92e8e071..3eff24bdd04 100644 --- a/arch/arm/mach-s3c2442/mach-gta02.c +++ b/arch/arm/mach-s3c2442/mach-gta02.c @@ -106,6 +106,8 @@ #include <linux/hdq.h> #include <linux/bq27000_battery.h> +#include <linux/gta02-vibrator.h> + struct pcf50633 *gta02_pcf; /* @@ -888,6 +890,30 @@ struct platform_device gta02_hdq_device = { }, }; +/* vibrator (child of FIQ) */ + +static struct resource gta02_vibrator_resources[] = { + [0] = { + .start = GTA02_GPIO_VIBRATOR_ON, + .end = GTA02_GPIO_VIBRATOR_ON, + }, +}; + +struct gta02_vib_platform_data gta02_vib_pdata = { + .enable_fiq = gta02_fiq_enable, + .disable_fiq = gta02_fiq_disable, + .kick_fiq = gta02_fiq_kick, +}; + +static struct platform_device gta02_vibrator_device = { + .name = "gta02-vibrator", + .num_resources = ARRAY_SIZE(gta02_vibrator_resources), + .resource = gta02_vibrator_resources, + .dev = { + .platform_data = >a02_vib_pdata, + }, +}; + static void __init gta02_map_io(void) { s3c24xx_init_io(gta02_iodesc, ARRAY_SIZE(gta02_iodesc)); @@ -921,6 +947,7 @@ static struct platform_device *gta02_devices[] __initdata = { static struct platform_device *gta02_devices_pmu_children[] = { >a02_glamo_dev, >a02_hdq_device, + >a02_vibrator_device, }; |