diff --git a/drivers/input/keyboard/cypress_touchkey/cypress-touchkey.c b/drivers/input/keyboard/cypress_touchkey/cypress-touchkey.c index 3a41c786bac0..6b74e80cfef3 100644 --- a/drivers/input/keyboard/cypress_touchkey/cypress-touchkey.c +++ b/drivers/input/keyboard/cypress_touchkey/cypress-touchkey.c @@ -2590,7 +2590,7 @@ static int __devinit cypress_touchkey_probe(struct i2c_client *client, ret = request_threaded_irq(client->irq, NULL, cypress_touchkey_interrupt, - IRQF_TRIGGER_FALLING, client->dev.driver->name, info); + IRQF_ONESHOT | IRQF_TRIGGER_FALLING, client->dev.driver->name, info); if (ret < 0) { dev_info(&client->dev, "Failed to request IRQ %d (err: %d).\n", client->irq, ret); diff --git a/drivers/input/keyboard/cypress_touchkey_h/cypress-touchkey.c b/drivers/input/keyboard/cypress_touchkey_h/cypress-touchkey.c index d22a9bf1db7c..e65ee02eae4d 100644 --- a/drivers/input/keyboard/cypress_touchkey_h/cypress-touchkey.c +++ b/drivers/input/keyboard/cypress_touchkey_h/cypress-touchkey.c @@ -2155,7 +2155,7 @@ static int __devinit cypress_touchkey_probe(struct i2c_client *client, ret = request_threaded_irq(client->irq, NULL, cypress_touchkey_interrupt, - IRQF_TRIGGER_FALLING, client->dev.driver->name, info); + IRQF_ONESHOT | IRQF_TRIGGER_FALLING, client->dev.driver->name, info); if (ret < 0) { dev_info(&client->dev, "Failed to request IRQ %d (err: %d).\n", client->irq, ret); diff --git a/drivers/input/keyboard/cypress_touchkey_ks01/cypress-touchkey.c b/drivers/input/keyboard/cypress_touchkey_ks01/cypress-touchkey.c index 10cc2a0a44f5..ea09a74f9b52 100644 --- a/drivers/input/keyboard/cypress_touchkey_ks01/cypress-touchkey.c +++ b/drivers/input/keyboard/cypress_touchkey_ks01/cypress-touchkey.c @@ -1902,7 +1902,7 @@ static int __devinit cypress_touchkey_probe(struct i2c_client *client, ret = request_threaded_irq(client->irq, NULL, cypress_touchkey_interrupt, - IRQF_TRIGGER_FALLING, client->dev.driver->name, info); + IRQF_ONESHOT | IRQF_TRIGGER_FALLING, client->dev.driver->name, info); if (ret < 0) { dev_info(&client->dev, "Failed to request IRQ %d (err: %d).\n", client->irq, ret); diff --git a/drivers/input/touchscreen/synaptics_s5000/synaptics_i2c_rmi.c b/drivers/input/touchscreen/synaptics_s5000/synaptics_i2c_rmi.c index 58d9eda69e48..32305340ea01 100644 --- a/drivers/input/touchscreen/synaptics_s5000/synaptics_i2c_rmi.c +++ b/drivers/input/touchscreen/synaptics_s5000/synaptics_i2c_rmi.c @@ -31,6 +31,9 @@ #include #include #include +#ifdef CONFIG_FB +#include +#endif #define DRIVER_NAME "synaptics_rmi4_i2c" @@ -2061,7 +2064,7 @@ static int synaptics_rmi4_irq_enable(struct synaptics_rmi4_data *rmi4_data, return retval; retval = request_threaded_irq(rmi4_data->irq, NULL, - synaptics_rmi4_irq, IRQF_TRIGGER_FALLING, + synaptics_rmi4_irq, IRQF_ONESHOT | IRQF_TRIGGER_FALLING, DRIVER_NAME, rmi4_data); if (retval < 0) { dev_err(&rmi4_data->i2c_client->dev, @@ -3987,6 +3990,11 @@ static void alloc_tsp_reboot_mode(void) } #endif +#ifdef CONFIG_FB +static int fb_notifier_callback(struct notifier_block *self, + unsigned long event, void *data); +#endif + /** * synaptics_rmi4_probe() * @@ -4261,6 +4269,13 @@ static int __devinit synaptics_rmi4_probe(struct i2c_client *client, #ifdef TSP_TURNOFF_AFTER_PROBE synaptics_rmi4_stop_device(rmi4_data); #endif + +#ifdef CONFIG_FB + rmi4_data->fb_notif.notifier_call = fb_notifier_callback; + if (fb_register_client(&rmi4_data->fb_notif)) + pr_err("%s: could not create fb notifier\n", __func__); +#endif + return retval; err_sysfs: @@ -4328,6 +4343,10 @@ static int __devexit synaptics_rmi4_remove(struct i2c_client *client) input_free_device(rmi4_data->input_dev); +#ifdef CONFIG_FB + fb_unregister_client(&rmi4_data->fb_notif); +#endif + kfree(rmi4_data); return 0; @@ -4700,6 +4719,36 @@ static int synaptics_rmi4_resume(struct device *dev) } #endif +#ifdef CONFIG_FB +static int fb_notifier_callback(struct notifier_block *self, + unsigned long event, void *data) +{ + struct fb_event *evdata = data; + struct synaptics_rmi4_data *rmi4_data = + container_of(self, struct synaptics_rmi4_data, fb_notif); + + if (evdata && evdata->data && event == FB_EVENT_BLANK) { + int *blank = evdata->data; + switch (*blank) { + case FB_BLANK_UNBLANK: + case FB_BLANK_NORMAL: + case FB_BLANK_VSYNC_SUSPEND: + case FB_BLANK_HSYNC_SUSPEND: + synaptics_rmi4_resume(&rmi4_data->i2c_client->dev); + break; + case FB_BLANK_POWERDOWN: + synaptics_rmi4_suspend(&rmi4_data->i2c_client->dev); + break; + default: + /* Don't handle what we don't understand */ + break; + } + } + + return 0; +} +#endif + static const struct dev_pm_ops synaptics_rmi4_dev_pm_ops = { .suspend = synaptics_rmi4_suspend, .resume = synaptics_rmi4_resume, diff --git a/drivers/input/touchscreen/synaptics_s5000/synaptics_i2c_rmi.h b/drivers/input/touchscreen/synaptics_s5000/synaptics_i2c_rmi.h index 281fd11cb2eb..1b59094a1110 100644 --- a/drivers/input/touchscreen/synaptics_s5000/synaptics_i2c_rmi.h +++ b/drivers/input/touchscreen/synaptics_s5000/synaptics_i2c_rmi.h @@ -59,6 +59,11 @@ * Synpatics IC report those data through F51's edge swipe * fucntionality. */ + +#ifdef CONFIG_FB +#include +#endif + #define SURFACE_TOUCH #define USE_OPEN_CLOSE @@ -404,6 +409,11 @@ struct synaptics_rmi4_data { void (*register_cb)(struct synaptics_rmi_callbacks *); struct synaptics_rmi_callbacks callbacks; #endif + +#ifdef CONFIG_FB + struct notifier_block fb_notif; +#endif + int (*i2c_read)(struct synaptics_rmi4_data *pdata, unsigned short addr, unsigned char *data, unsigned short length); int (*i2c_write)(struct synaptics_rmi4_data *pdata, unsigned short addr,