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>
__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);