diff options
author | codeworkx <codeworkx@cyanogenmod.com> | 2012-09-22 09:48:20 +0200 |
---|---|---|
committer | codeworkx <codeworkx@cyanogenmod.com> | 2012-09-22 14:02:16 +0200 |
commit | 2489007e7d740ccbc3e0a202914e243ad5178787 (patch) | |
tree | b8e6380ea7b1da63474ad68a5dba997e01146043 /drivers/motor/tspdrv.c | |
parent | 5f67568eb31e3a813c7c52461dcf66ade15fc2e7 (diff) | |
download | kernel_samsung_smdk4412-2489007e7d740ccbc3e0a202914e243ad5178787.zip kernel_samsung_smdk4412-2489007e7d740ccbc3e0a202914e243ad5178787.tar.gz kernel_samsung_smdk4412-2489007e7d740ccbc3e0a202914e243ad5178787.tar.bz2 |
merge opensource jb u5
Change-Id: I1aaec157aa196f3448eff8636134fce89a814cf2
Diffstat (limited to 'drivers/motor/tspdrv.c')
-rw-r--r-- | drivers/motor/tspdrv.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/drivers/motor/tspdrv.c b/drivers/motor/tspdrv.c index 257fbfc..73cb277 100644 --- a/drivers/motor/tspdrv.c +++ b/drivers/motor/tspdrv.c @@ -45,6 +45,13 @@ #include <linux/wakelock.h> #include <linux/io.h> #include <mach/map.h> + +#if defined(CONFIG_MACH_GRANDE) +#include <linux/regulator/consumer.h> +#include <linux/regulator/driver.h> +#include <linux/regulator/machine.h> +#endif + #include "tspdrv.h" #ifdef CONFIG_MOTOR_DRV_ISA1200 #include "ImmVibeSPI_isa1200.c" @@ -485,7 +492,12 @@ static long unlocked_ioctl(struct file *file, unsigned int cmd, #ifdef QA_TEST int i; #endif - +#if defined(CONFIG_MACH_GRANDE) + struct regulator *regulator; + regulator = regulator_get(NULL, "vmotor"); + if (IS_ERR(regulator)) + return 0; +#endif DbgOut((KERN_INFO "tspdrv: ioctl cmd[0x%x].\n", cmd)); switch (cmd) { @@ -522,9 +534,15 @@ static long unlocked_ioctl(struct file *file, unsigned int cmd, case TSPDRV_ENABLE_AMP: wake_lock(&vib_wake_lock); + #if defined(CONFIG_MACH_GRANDE) + regulator_enable(regulator); + printk(KERN_INFO "[TSPDRV] vmotor power on\n"); + regulator_put(regulator); + #else ImmVibeSPI_ForceOut_AmpEnable(arg); DbgRecorderReset((arg)); DbgRecord((arg, ";------- TSPDRV_ENABLE_AMP ---------\n")); + #endif break; case TSPDRV_DISABLE_AMP: @@ -533,8 +551,14 @@ static long unlocked_ioctl(struct file *file, unsigned int cmd, * If a stop was requested, ignore the request as the amp * will be disabled by the timer proc when it's ready */ + #if defined(CONFIG_MACH_GRANDE) + regulator_disable(regulator); + printk(KERN_INFO "[TSPDRV] vmotor power on\n"); + regulator_put(regulator); + #else if (!g_bStopRequested) ImmVibeSPI_ForceOut_AmpDisable(arg); + #endif wake_unlock(&vib_wake_lock); break; |