Received: by 10.213.65.68 with SMTP id h4csp787437imn; Tue, 20 Mar 2018 15:37:14 -0700 (PDT) X-Google-Smtp-Source: AG47ELt9SmZnsno/v3SO2GI2BAESXRx1+2LS7GToZ8naaSOYqvm/z4iqbKaZPAq5bOj5ANUbpqZv X-Received: by 10.98.161.10 with SMTP id b10mr14856233pff.240.1521585434534; Tue, 20 Mar 2018 15:37:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521585434; cv=none; d=google.com; s=arc-20160816; b=BYzBicIHq42bAB1ulJg9E7oxj25KZ4Y5qXthtC4PgvcTq2Yd2mKk0uT1xFQdty4CCX g/KTCxPLNX+8h5p8E34mqvMHkUpbn+wVUJxbywH5tfXuJrRGVU5uVXsVzOQD/qHf+XUl gmNSgMLzBpdMOYDOaqlYTYrWyK9eKcWDZ8QWrQemZVShwk48GIuu2F2ACwSiZrrKDRI7 tF1/7QE9ovVOHnxjfUCa6cJVmC/e8c2Q8eso4xoKJasoFymV50RDrNmBd68TeycPm/F1 Y/0Ssmj04FcQrIwDEfjlqP2ZAJcW6Vrtw0vYPQMcO+Y0iyPrPpuylkuFPTnsWrNp94tq 2Vgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=MJQV4GlanPEhO+x0w04lq3kF6VtKeS58YUdvUHK00nE=; b=TknukVocmDdXtbXuzIHtRz8MQ1JNhXk0s61NNPswAPDJxt8hEEcmYf+6iWbPwOc2Lp U7fQiLx17qjB6HPdTcIQg54zztoFGLdLKA/4hzCz9twtLNhNXuaRIwIxFk6PEnOg1KEN j/a8+9TNwLKrbL7xgaLUQ5mmmJ5A3blmo6nu24k5EKZWGq1XfZiSLAR+SoK0nFTaQGjb iMgMUE5eIk8sNLU6xq4IaQmkBs7fC9c/C3RGrL6r/g6MHlWXVEV5MRzWw4c3NxPxpc2Z K8mo7+VaH8+iqhYWlsP1mU7TIJGyGgt6Ls+SYnmu9w8/zRUgtrn9j5AMrxD8NC+ndrG7 x9KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Hq0XAZpg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x4si1771852pgv.315.2018.03.20.15.37.00; Tue, 20 Mar 2018 15:37:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Hq0XAZpg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751728AbeCTWf2 (ORCPT + 99 others); Tue, 20 Mar 2018 18:35:28 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:43036 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751730AbeCTWbo (ORCPT ); Tue, 20 Mar 2018 18:31:44 -0400 Received: by mail-pl0-f65.google.com with SMTP id f23-v6so1909451plr.10; Tue, 20 Mar 2018 15:31:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MJQV4GlanPEhO+x0w04lq3kF6VtKeS58YUdvUHK00nE=; b=Hq0XAZpgqtwd2xO1pOr6GWd62TEktEAKqRMwfYz3hQmp/hALW289hb7AqYRjt47YyS cs09hMtPtFnIEAQZededYYRlubBmdKS9wQk+DTtziWa9sVRKTz5zC8pgD/OlSlXDCKgj D5fhZ8Q5Ml26yTM2MjBsviGhWhRhFAWo8B91fHYLe21ydLzPLtIM+6isFzwCPHsj913g bYbYQL0iY04VqyWiYHsIEJgAeKmf1htel0IxMf1ogP24Jjh49ly9OL9WJSHurpH+fVWZ u3bni2yCMGNHYy3eTIhmOzOHSn/0ANGL+hueeC0IplPSvBRAl0W2KOHK/H+kBAszwUZj Yatw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MJQV4GlanPEhO+x0w04lq3kF6VtKeS58YUdvUHK00nE=; b=RAHY6tGDS4lZtMzPOqSMy0hwRWViJNeYn0tRbcQtfEUcOWsc8FMIQEuIjc3URPUKKj IIoKaSM4immahvsr4tKW7+mSXQOyDxyilnTBCQOFZfctILLoUWmebrDzM3v7QMKDUb8J qHPU8AnDS13NPSm7X4FgypHFW9EUXadvctp0sKrGhQc++a+gLJCqwzS+sygQFhnJ2TAC wti4MxrT93CrKujaHLtdSA6ZGoyNsn3PJu43FPf5sDdGT4euskcMhu4QshFwnluTzXX9 cMvJEbz37vCaJrugpAxH3UAAEhj+nykSTKQOJCJjn3kNe7xvLglUF2ws14baSwM6RyCz hIgg== X-Gm-Message-State: AElRT7GyZux8PIYzFsMU3N7EOHSY4EunVCFJN7axKxlOMxvjgLdhcBzP XzpEbEocFqv/TPRAahUFqHYZ5CC/ X-Received: by 2002:a17:902:bb81:: with SMTP id m1-v6mr17815016pls.71.1521585103504; Tue, 20 Mar 2018 15:31:43 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:0:1000:1511:8de6:27a8:ed13:2ef5]) by smtp.gmail.com with ESMTPSA id r20sm6108360pff.165.2018.03.20.15.31.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Mar 2018 15:31:42 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org, Benson Leung Cc: Nick Dyer , Olof Johansson , linux-kernel@vger.kernel.org Subject: [PATCH v2 01/14] Input: atmel_mxt_ts - do not pass suspend mode in platform data Date: Tue, 20 Mar 2018 15:31:25 -0700 Message-Id: <20180320223138.234724-2-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.16.2.804.g6dcf76e118-goog In-Reply-To: <20180320223138.234724-1-dmitry.torokhov@gmail.com> References: <20180320223138.234724-1-dmitry.torokhov@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: Dmitry Torokhov --- drivers/input/touchscreen/atmel_mxt_ts.c | 27 +++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 7659bc48f1db8..20e1224d1a6db 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -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)) { -- 2.16.2.804.g6dcf76e118-goog