Merge branch 'develop-3.0' of ssh://192.168.1.29/rk/kernel into develop-3.0
[firefly-linux-kernel-4.4.55.git] / drivers / input / touchscreen / cy8ctmg110_ts.c
index 5ec0946938fe71e105dc519191debb8cc5c607c1..a93c5c26ab3fa7d858238d13b1c27e919958c8c9 100644 (file)
@@ -206,9 +206,9 @@ static int __devinit cy8ctmg110_probe(struct i2c_client *client,
        input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
 
        input_set_abs_params(input_dev, ABS_X,
-                       CY8CTMG110_X_MIN, CY8CTMG110_X_MAX, 0, 0);
+                       CY8CTMG110_X_MIN, CY8CTMG110_X_MAX, 4, 0);
        input_set_abs_params(input_dev, ABS_Y,
-                       CY8CTMG110_Y_MIN, CY8CTMG110_Y_MAX, 0, 0);
+                       CY8CTMG110_Y_MIN, CY8CTMG110_Y_MAX, 4, 0);
 
        if (ts->reset_pin) {
                err = gpio_request(ts->reset_pin, NULL);
@@ -280,8 +280,9 @@ err_free_mem:
 }
 
 #ifdef CONFIG_PM
-static int cy8ctmg110_suspend(struct i2c_client *client, pm_message_t mesg)
+static int cy8ctmg110_suspend(struct device *dev)
 {
+       struct i2c_client *client = to_i2c_client(dev);
        struct cy8ctmg110 *ts = i2c_get_clientdata(client);
 
        if (device_may_wakeup(&client->dev))
@@ -293,8 +294,9 @@ static int cy8ctmg110_suspend(struct i2c_client *client, pm_message_t mesg)
        return 0;
 }
 
-static int cy8ctmg110_resume(struct i2c_client *client)
+static int cy8ctmg110_resume(struct device *dev)
 {
+       struct i2c_client *client = to_i2c_client(dev);
        struct cy8ctmg110 *ts = i2c_get_clientdata(client);
 
        if (device_may_wakeup(&client->dev))
@@ -305,6 +307,8 @@ static int cy8ctmg110_resume(struct i2c_client *client)
        }
        return 0;
 }
+
+static SIMPLE_DEV_PM_OPS(cy8ctmg110_pm, cy8ctmg110_suspend, cy8ctmg110_resume);
 #endif
 
 static int __devexit cy8ctmg110_remove(struct i2c_client *client)
@@ -335,14 +339,13 @@ static struct i2c_driver cy8ctmg110_driver = {
        .driver         = {
                .owner  = THIS_MODULE,
                .name   = CY8CTMG110_DRIVER_NAME,
+#ifdef CONFIG_PM
+               .pm     = &cy8ctmg110_pm,
+#endif
        },
        .id_table       = cy8ctmg110_idtable,
        .probe          = cy8ctmg110_probe,
        .remove         = __devexit_p(cy8ctmg110_remove),
-#ifdef CONFIG_PM
-       .suspend        = cy8ctmg110_suspend,
-       .resume         = cy8ctmg110_resume,
-#endif
 };
 
 static int __init cy8ctmg110_init(void)