diff options
Diffstat (limited to 'drivers/input/misc')
-rw-r--r-- | drivers/input/misc/88pm860x_onkey.c | 26 | ||||
-rw-r--r-- | drivers/input/misc/Kconfig | 5 | ||||
-rw-r--r-- | drivers/input/misc/cma3000_d0x.c | 2 | ||||
-rw-r--r-- | drivers/input/misc/mpu3050.c | 2 | ||||
-rw-r--r-- | drivers/input/misc/twl6040-vibra.c | 50 |
5 files changed, 67 insertions, 18 deletions
diff --git a/drivers/input/misc/88pm860x_onkey.c b/drivers/input/misc/88pm860x_onkey.c index f2e0cbc..f9ce183 100644 --- a/drivers/input/misc/88pm860x_onkey.c +++ b/drivers/input/misc/88pm860x_onkey.c @@ -105,6 +105,8 @@ static int __devinit pm860x_onkey_probe(struct platform_device *pdev) } platform_set_drvdata(pdev, info); + device_init_wakeup(&pdev->dev, 1); + return 0; out_irq: @@ -129,10 +131,34 @@ static int __devexit pm860x_onkey_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_PM_SLEEP +static int pm860x_onkey_suspend(struct device *dev) +{ + struct platform_device *pdev = to_platform_device(dev); + struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); + + if (device_may_wakeup(dev)) + chip->wakeup_flag |= 1 << PM8607_IRQ_ONKEY; + return 0; +} +static int pm860x_onkey_resume(struct device *dev) +{ + struct platform_device *pdev = to_platform_device(dev); + struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); + + if (device_may_wakeup(dev)) + chip->wakeup_flag &= ~(1 << PM8607_IRQ_ONKEY); + return 0; +} +#endif + +static SIMPLE_DEV_PM_OPS(pm860x_onkey_pm_ops, pm860x_onkey_suspend, pm860x_onkey_resume); + static struct platform_driver pm860x_onkey_driver = { .driver = { .name = "88pm860x-onkey", .owner = THIS_MODULE, + .pm = &pm860x_onkey_pm_ops, }, .probe = pm860x_onkey_probe, .remove = __devexit_p(pm860x_onkey_remove), diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index d628272..7faf4a7 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig @@ -380,8 +380,7 @@ config INPUT_TWL4030_VIBRA config INPUT_TWL6040_VIBRA tristate "Support for TWL6040 Vibrator" - depends on TWL4030_CORE - select TWL6040_CORE + depends on TWL6040_CORE select INPUT_FF_MEMLESS help This option enables support for TWL6040 Vibrator Driver. @@ -580,7 +579,7 @@ config INPUT_CMA3000_I2C config INPUT_XEN_KBDDEV_FRONTEND tristate "Xen virtual keyboard and mouse support" - depends on XEN_FBDEV_FRONTEND + depends on XEN default y select XEN_XENBUS_FRONTEND help diff --git a/drivers/input/misc/cma3000_d0x.c b/drivers/input/misc/cma3000_d0x.c index 06517e6..a3735a0 100644 --- a/drivers/input/misc/cma3000_d0x.c +++ b/drivers/input/misc/cma3000_d0x.c @@ -318,7 +318,7 @@ struct cma3000_accl_data *cma3000_init(struct device *dev, int irq, mutex_init(&data->mutex); data->mode = pdata->mode; - if (data->mode < CMAMODE_DEFAULT || data->mode > CMAMODE_POFF) { + if (data->mode > CMAMODE_POFF) { data->mode = CMAMODE_MOTDET; dev_warn(dev, "Invalid mode specified, assuming Motion Detect\n"); diff --git a/drivers/input/misc/mpu3050.c b/drivers/input/misc/mpu3050.c index 5403c57..306f84c 100644 --- a/drivers/input/misc/mpu3050.c +++ b/drivers/input/misc/mpu3050.c @@ -367,7 +367,7 @@ static int __devinit mpu3050_probe(struct i2c_client *client, error = request_threaded_irq(client->irq, NULL, mpu3050_interrupt_thread, - IRQF_TRIGGER_RISING, + IRQF_TRIGGER_RISING | IRQF_ONESHOT, "mpu3050", sensor); if (error) { dev_err(&client->dev, diff --git a/drivers/input/misc/twl6040-vibra.c b/drivers/input/misc/twl6040-vibra.c index 45874fe..c34f6c0 100644 --- a/drivers/input/misc/twl6040-vibra.c +++ b/drivers/input/misc/twl6040-vibra.c @@ -27,8 +27,9 @@ */ #include <linux/module.h> #include <linux/platform_device.h> +#include <linux/of.h> #include <linux/workqueue.h> -#include <linux/i2c/twl.h> +#include <linux/input.h> #include <linux/mfd/twl6040.h> #include <linux/slab.h> #include <linux/delay.h> @@ -257,11 +258,14 @@ static SIMPLE_DEV_PM_OPS(twl6040_vibra_pm_ops, twl6040_vibra_suspend, NULL); static int __devinit twl6040_vibra_probe(struct platform_device *pdev) { - struct twl4030_vibra_data *pdata = pdev->dev.platform_data; + struct twl6040_vibra_data *pdata = pdev->dev.platform_data; + struct device_node *node = pdev->dev.of_node; struct vibra_info *info; + int vddvibl_uV = 0; + int vddvibr_uV = 0; int ret; - if (!pdata) { + if (!pdata && !node) { dev_err(&pdev->dev, "platform_data not available\n"); return -EINVAL; } @@ -273,11 +277,26 @@ static int __devinit twl6040_vibra_probe(struct platform_device *pdev) } info->dev = &pdev->dev; + info->twl6040 = dev_get_drvdata(pdev->dev.parent); - info->vibldrv_res = pdata->vibldrv_res; - info->vibrdrv_res = pdata->vibrdrv_res; - info->viblmotor_res = pdata->viblmotor_res; - info->vibrmotor_res = pdata->vibrmotor_res; + if (pdata) { + info->vibldrv_res = pdata->vibldrv_res; + info->vibrdrv_res = pdata->vibrdrv_res; + info->viblmotor_res = pdata->viblmotor_res; + info->vibrmotor_res = pdata->vibrmotor_res; + vddvibl_uV = pdata->vddvibl_uV; + vddvibr_uV = pdata->vddvibr_uV; + } else { + of_property_read_u32(node, "vibldrv_res", &info->vibldrv_res); + of_property_read_u32(node, "vibrdrv_res", &info->vibrdrv_res); + of_property_read_u32(node, "viblmotor_res", + &info->viblmotor_res); + of_property_read_u32(node, "vibrmotor_res", + &info->vibrmotor_res); + of_property_read_u32(node, "vddvibl_uV", &vddvibl_uV); + of_property_read_u32(node, "vddvibr_uV", &vddvibr_uV); + } + if ((!info->vibldrv_res && !info->viblmotor_res) || (!info->vibrdrv_res && !info->vibrmotor_res)) { dev_err(info->dev, "invalid vibra driver/motor resistance\n"); @@ -339,10 +358,9 @@ static int __devinit twl6040_vibra_probe(struct platform_device *pdev) goto err_regulator; } - if (pdata->vddvibl_uV) { + if (vddvibl_uV) { ret = regulator_set_voltage(info->supplies[0].consumer, - pdata->vddvibl_uV, - pdata->vddvibl_uV); + vddvibl_uV, vddvibl_uV); if (ret) { dev_err(info->dev, "failed to set VDDVIBL volt %d\n", ret); @@ -350,10 +368,9 @@ static int __devinit twl6040_vibra_probe(struct platform_device *pdev) } } - if (pdata->vddvibr_uV) { + if (vddvibr_uV) { ret = regulator_set_voltage(info->supplies[1].consumer, - pdata->vddvibr_uV, - pdata->vddvibr_uV); + vddvibr_uV, vddvibr_uV); if (ret) { dev_err(info->dev, "failed to set VDDVIBR volt %d\n", ret); @@ -401,6 +418,12 @@ static int __devexit twl6040_vibra_remove(struct platform_device *pdev) return 0; } +static const struct of_device_id twl6040_vibra_of_match[] = { + {.compatible = "ti,twl6040-vibra", }, + { }, +}; +MODULE_DEVICE_TABLE(of, twl6040_vibra_of_match); + static struct platform_driver twl6040_vibra_driver = { .probe = twl6040_vibra_probe, .remove = __devexit_p(twl6040_vibra_remove), @@ -408,6 +431,7 @@ static struct platform_driver twl6040_vibra_driver = { .name = "twl6040-vibra", .owner = THIS_MODULE, .pm = &twl6040_vibra_pm_ops, + .of_match_table = twl6040_vibra_of_match, }, }; module_platform_driver(twl6040_vibra_driver); |