]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Input: cyapa - do not try to enable proximity reporting on older devices
authorDudley Du <dudl@cypress.com>
Thu, 30 Jul 2015 18:26:39 +0000 (11:26 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 30 Jul 2015 18:34:00 +0000 (11:34 -0700)
Avoid the driver generate warning message when the cyapa driver working
with the old Gen5 trackpad device which does not support the proximity
function.  Those old Gen5 trackpad device all have the platform version
less than 2.

Signed-off-by: Dudley Du <dudl@cypress.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/mouse/cyapa_gen5.c

index 6d7abbed67e44aa1e8207fd60d76fcf20abaeee4..118ba977181e55c212386493162ee21ff8379664 100644 (file)
@@ -2519,10 +2519,13 @@ static int cyapa_gen5_do_operational_check(struct cyapa *cyapa)
                                __func__);
 
                /* By default, the trackpad proximity function is enabled. */
-               error = cyapa_pip_set_proximity(cyapa, true);
-               if (error)
-                       dev_warn(dev, "%s: failed to enable proximity.\n",
-                               __func__);
+               if (cyapa->platform_ver >= 2) {
+                       error = cyapa_pip_set_proximity(cyapa, true);
+                       if (error)
+                               dev_warn(dev,
+                                       "%s: failed to enable proximity.\n",
+                                       __func__);
+               }
 
                /* Get trackpad product information. */
                error = cyapa_gen5_get_query_data(cyapa);