Commit d80808e1 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Benson Leung

Input: atmel_mxt_ts - do not pass suspend mode in platform data

The way we are supposed to put controller to sleep and wake it up does not
depend on the platform, but rather on controller itself, so we want to get
rid of suspend mode in platform data (and eventually get rid of platform
data completely). Unfortunately some early chromebooks (the original Pixel,
Acer C720) were shipped with config that requires manually re-enabling
touch reporting in T9. We will sort it out, but in the meantime let's
switch to a simple DMI quirk.

We'll keep pdata->suspend_mode for now and remove it when we rework
chromeos-laptop driver.
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: default avatarBenson Leung <bleung@chromium.org>
parent 3eb2ce82
......@@ -324,6 +324,8 @@ struct mxt_data {
/* for config update handling */
struct completion crc_completion;
enum mxt_suspend_mode suspend_mode;
};
struct mxt_vb2_buffer {
......@@ -2868,7 +2870,7 @@ static const struct attribute_group mxt_attr_group = {
static void mxt_start(struct mxt_data *data)
{
switch (data->pdata->suspend_mode) {
switch (data->suspend_mode) {
case MXT_SUSPEND_T9_CTRL:
mxt_soft_reset(data);
......@@ -2886,12 +2888,11 @@ static void mxt_start(struct mxt_data *data)
mxt_t6_command(data, MXT_COMMAND_CALIBRATE, 1, false);
break;
}
}
static void mxt_stop(struct mxt_data *data)
{
switch (data->pdata->suspend_mode) {
switch (data->suspend_mode) {
case MXT_SUSPEND_T9_CTRL:
/* Touch disable */
mxt_write_object(data,
......@@ -2954,8 +2955,6 @@ static const struct mxt_platform_data *mxt_parse_dt(struct i2c_client *client)
pdata->t19_keymap = keymap;
}
pdata->suspend_mode = MXT_SUSPEND_DEEP_SLEEP;
return pdata;
}
#else
......@@ -3109,6 +3108,21 @@ mxt_get_platform_data(struct i2c_client *client)
return ERR_PTR(-EINVAL);
}
static const struct dmi_system_id chromebook_T9_suspend_dmi[] = {
{
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"),
DMI_MATCH(DMI_PRODUCT_NAME, "Link"),
},
},
{
.matches = {
DMI_MATCH(DMI_PRODUCT_NAME, "Peppy"),
},
},
{ }
};
static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
struct mxt_data *data;
......@@ -3135,6 +3149,9 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id)
init_completion(&data->reset_completion);
init_completion(&data->crc_completion);
data->suspend_mode = dmi_check_system(chromebook_T9_suspend_dmi) ?
MXT_SUSPEND_T9_CTRL : MXT_SUSPEND_DEEP_SLEEP;
data->reset_gpio = devm_gpiod_get_optional(&client->dev,
"reset", GPIOD_OUT_LOW);
if (IS_ERR(data->reset_gpio)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment