From patchwork Mon Apr 10 16:01:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Selvaraj X-Patchwork-Id: 672397 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FB92C77B74 for ; Mon, 10 Apr 2023 16:02:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230152AbjDJQCK (ORCPT ); Mon, 10 Apr 2023 12:02:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229669AbjDJQCI (ORCPT ); Mon, 10 Apr 2023 12:02:08 -0400 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80C31E63; Mon, 10 Apr 2023 09:02:06 -0700 (PDT) Received: by mail-io1-xd2c.google.com with SMTP id ca18e2360f4ac-7606d6a2aa5so2412239f.1; Mon, 10 Apr 2023 09:02:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681142525; x=1683734525; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ml18rVYykM8RSPcNS38Utyfp7oGrBURSiK5dX/uCCMg=; b=Xb7DyguBz/havimHm+lI28ZuxYeIjMZcSFeL8Y5Tzq9jtTT2kGY5wHzMgomybXdwgw SGm8NxbqdmCz2JHdqkS66oSrPtgGsonTFCLNtx7eYUi3HQ1EktK1JhIITc9MEy04/t1N zSYsa1V1lX7fqgOrwYpMKlb3gs5yjvudfbDVmaTQ+IWBiHJnC1zrVIs20hUSWMaxaSJH N5v3TofZESwUNbDahV9Qndj+xuqpnHwI/7VUX8X8IytBtNSavPN5IPrOVEjUsJCs7hnd WyVUxVRqyxbqdegI8n/u5ceifFhcvFBiuLZk8QkpXt8ikLMVXDkqbqTBi/vXZI+O0KaS DWbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681142525; x=1683734525; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ml18rVYykM8RSPcNS38Utyfp7oGrBURSiK5dX/uCCMg=; b=3WZVN1YQvrmpMDsWScnYoKdynwryM+sWm+51Hl6g3KyMcdeHlImKecJ5jLzoYfMf8k x07s2comb00NZNEO0Db9XZk7Li6HI6J3wlGDmzEXnUbh6P60JwuVyVVy8V6s6U/58yPA c7ZsCmaU8YTMqgMFC3S80kRWnfgD2QEwkVl5ObvU9xxV6OctZqezjuYKc8KXFguAUb4l r8KsEjkRz4Nk5UiIi0OcITvOS3qY2tO15nNx+BNu9U/KMz5f1h752wqex/4Drz5mJlXJ Wrtfpt+2U98USPAW8iuN+ZdZkoR5vN7t0IhQjVBusaIexbd+2zlpy0vExU9UbptEo16U rHIQ== X-Gm-Message-State: AAQBX9ePaRH1S2j6KgvdMWeRbgz0doeNLkiSm/mOiOwHM+0YKR4F1XFo IHe9DnzxQwYdcp5v5X3RiWw= X-Google-Smtp-Source: AKy350Z//jb9iMw3Y2hMFp4YCE1amp7CtwmW4ptJyAQl/zovn0w+U9N1IIl/vHh9DLqiYe+YyAevaw== X-Received: by 2002:a05:6602:89d:b0:760:9027:3501 with SMTP id f29-20020a056602089d00b0076090273501mr182225ioz.0.1681142525680; Mon, 10 Apr 2023 09:02:05 -0700 (PDT) Received: from JOEL-DESKTOP.. ([2604:2d80:4d87:cd00:9f51:32d7:1177:67d]) by smtp.gmail.com with ESMTPSA id c7-20020a5d9a87000000b00746041ecbf9sm3184435iom.39.2023.04.10.09.02.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 09:02:05 -0700 (PDT) From: Joel Selvaraj To: Caleb Connolly , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Andy Gross , Bjorn Andersson , Konrad Dybcio , Henrik Rydberg , Arnd Bergmann , Robert Jarzmik , Jeff LaBundy , Markuss Broks , Jean Delvare , Job Noorman , Alistair Francis , Chris Morgan , Hans de Goede Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Joel Selvaraj Subject: [PATCH v2 1/5] dt-bindings: input: touchscreen: add bindings for focaltech,fts5452 Date: Mon, 10 Apr 2023 11:01:56 -0500 Message-Id: <20230410160200.57261-2-joelselvaraj.oss@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230410160200.57261-1-joelselvaraj.oss@gmail.com> References: <20230410160200.57261-1-joelselvaraj.oss@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add devicetree bindings for the Focaltech FTS touchscreen drivers. Signed-off-by: Joel Selvaraj Signed-off-by: Caleb Connolly --- .../input/touchscreen/focaltech,fts5452.yaml | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/touchscreen/focaltech,fts5452.yaml diff --git a/Documentation/devicetree/bindings/input/touchscreen/focaltech,fts5452.yaml b/Documentation/devicetree/bindings/input/touchscreen/focaltech,fts5452.yaml new file mode 100644 index 000000000000..f42868293439 --- /dev/null +++ b/Documentation/devicetree/bindings/input/touchscreen/focaltech,fts5452.yaml @@ -0,0 +1,71 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/touchscreen/focaltech,fts5452.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Focaltech FTS I2C Touchscreen Controller + +maintainers: + - Joel Selvaraj + - Caleb Connolly + +allOf: + - $ref: touchscreen.yaml# + +properties: + compatible: + enum: + - focaltech,fts5452 + - focaltech,fts8719 + + reg: + const: 0x38 + + interrupts: + maxItems: 1 + + reset-gpios: + maxItems: 1 + + avdd-supply: + description: regulator supplying analog power (2.6V to 3.3V). + + vddio-supply: + description: regulator supplying IO power (1.8V). + +unevaluatedProperties: false + +required: + - compatible + - reg + - touchscreen-size-x + - touchscreen-size-y + +examples: + - | + #include + #include + i2c { + #address-cells = <1>; + #size-cells = <0>; + + touchscreen@38 { + compatible = "focaltech,fts5452"; + reg = <0x38>; + + interrupt-parent = <&tlmm>; + interrupts = <125 IRQ_TYPE_EDGE_FALLING>; + reset-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>; + + avdd-supply = <&vreg_l28a_3p0>; + vddio-supply = <&vreg_l14a_1p88>; + + pinctrl-names = "default", "suspend"; + pinctrl-0 = <&ts_int_active &ts_reset_active>; + pinctrl-1 = <&ts_int_suspend &ts_reset_suspend>; + + touchscreen-size-x = <1080>; + touchscreen-size-y = <2160>; + }; + }; From patchwork Mon Apr 10 16:01:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Selvaraj X-Patchwork-Id: 672073 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7EEBC77B74 for ; Mon, 10 Apr 2023 16:02:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230243AbjDJQC1 (ORCPT ); Mon, 10 Apr 2023 12:02:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230219AbjDJQCY (ORCPT ); Mon, 10 Apr 2023 12:02:24 -0400 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9241E2D64; Mon, 10 Apr 2023 09:02:14 -0700 (PDT) Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-75d1e0ff8ecso7023139f.0; Mon, 10 Apr 2023 09:02:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681142534; x=1683734534; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=O2uBMdFyxdhtrqhapu2ahRDY229JhTGTzNiLljociWc=; b=HbBZfm0cxMPrpzfyDEaStb/G22P+OQTZXXgG0yuix2gewyMQtfANCOYKlShATj6kRm 9JPf6LEcd8ZL89iypnA5BKZubjmINem5aTMiuae8FhF0kpOb9mSqb15y8LWj//3subjI 7iXGZkEUfEJB9IRzFohUp3IbMHzUwpwAlijgdk03BVYymrsIix05bgGycwlIULwPQY/L hGZqtVypCA7ieAUTr4B+Rdmx0mQAmMfDAI2xtsWsFmQzKy1fSlYKsVJZAF10V8B8Kcco j6FIx6NDNKI35Ebs4D10q4xyQYLPF5z9Y8F9M3RJK6pvEZ6vf7hEuCmd1iZtZItRm9st +4KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681142534; x=1683734534; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O2uBMdFyxdhtrqhapu2ahRDY229JhTGTzNiLljociWc=; b=deJtsdpEBaM3KLeL1Axl43PL5hio6XkbkCalAteLbjVIQ5cHKTJeh+UiBZU9OAKgF4 Rz4M/czwhQ+HaiP4Rrzxz6Iqcnfg0SeGgaFlJX3KIQeGBXVuKz+Zs23ZSfIbdzyhpTG/ gjx7aiYQkyYnqRD62mcke5up/Y84xvJenHVU6xs1qnTdKjkU5TiT8b9dd47dqChrW0fQ N+pW/JXI8buK/Vrt3hMoDmjNnll1IDx8r2xATVcp1mFgsF+cdfBKGNCBFgakfC4DxwOa xBxG7rn/YTnXRl6tcFhnraebAZR8wobAbCWfKtLK3TYwdNTvt6WynAWaweoqvLQ7cSRd 1/sA== X-Gm-Message-State: AAQBX9cYNFSxvsj/KGlqWeQlsLFaAdsNGLDYYwaDBwauoyJiHQ9JmkrP MaBbCa2VW2e53p8Ew2BzV/I= X-Google-Smtp-Source: AKy350YMYzbVMJxb0Jq7QZrlR+TKCYJkOoct7TqI4Bqu2X5yLevrRo3MoZk3z/n06olG4iAgUOl2UA== X-Received: by 2002:a05:6602:3403:b0:758:5525:860a with SMTP id n3-20020a056602340300b007585525860amr4455707ioz.0.1681142527184; Mon, 10 Apr 2023 09:02:07 -0700 (PDT) Received: from JOEL-DESKTOP.. ([2604:2d80:4d87:cd00:9f51:32d7:1177:67d]) by smtp.gmail.com with ESMTPSA id c7-20020a5d9a87000000b00746041ecbf9sm3184435iom.39.2023.04.10.09.02.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 09:02:06 -0700 (PDT) From: Joel Selvaraj To: Caleb Connolly , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Andy Gross , Bjorn Andersson , Konrad Dybcio , Henrik Rydberg , Arnd Bergmann , Robert Jarzmik , Jeff LaBundy , Markuss Broks , Jean Delvare , Job Noorman , Alistair Francis , Chris Morgan , Hans de Goede Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Joel Selvaraj Subject: [PATCH v2 2/5] Input: add driver for Focaltech FTS touchscreen Date: Mon, 10 Apr 2023 11:01:57 -0500 Message-Id: <20230410160200.57261-3-joelselvaraj.oss@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230410160200.57261-1-joelselvaraj.oss@gmail.com> References: <20230410160200.57261-1-joelselvaraj.oss@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The Focaltech FTS driver supports several variants of focaltech touchscreens found in ~2018 era smartphones including variants found on the PocoPhone F1 and the SHIFT6mq which are already present in mainline. This driver is loosely based on the original driver from Focaltech but has been simplified and largely reworked. Co-developed-by: Caleb Connolly Signed-off-by: Caleb Connolly Signed-off-by: Joel Selvaraj --- MAINTAINERS | 8 + drivers/input/touchscreen/Kconfig | 12 + drivers/input/touchscreen/Makefile | 1 + drivers/input/touchscreen/focaltech_fts5452.c | 432 ++++++++++++++++++ 4 files changed, 453 insertions(+) create mode 100644 drivers/input/touchscreen/focaltech_fts5452.c diff --git a/MAINTAINERS b/MAINTAINERS index 7ec4ce64f66d..1a3ea61e1f52 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8028,6 +8028,14 @@ L: linux-input@vger.kernel.org S: Maintained F: drivers/input/joystick/fsia6b.c +FOCALTECH FTS5452 TOUCHSCREEN DRIVER +M: Joel Selvaraj +M: Caleb Connolly +L: linux-input@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/input/touchscreen/focaltech,fts5452.yaml +F: drivers/input/touchscreen/focaltech_fts5452.c + FOCUSRITE SCARLETT GEN 2/3 MIXER DRIVER M: Geoffrey D. Bennett L: alsa-devel@alsa-project.org (moderated for non-subscribers) diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index 1feecd7ed3cb..11af91504969 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig @@ -388,6 +388,18 @@ config TOUCHSCREEN_EXC3000 To compile this driver as a module, choose M here: the module will be called exc3000. +config TOUCHSCREEN_FOCALTECH_FTS5452 + tristate "Focaltech FTS Touchscreen" + depends on I2C + help + Say Y here to enable support for I2C connected Focaltech FTS + based touch panels, including the 5452 and 8917 panels. + + If unsure, say N. + + To compile this driver as a module, choose M here: the + module will be called focaltech_fts. + config TOUCHSCREEN_FUJITSU tristate "Fujitsu serial touchscreen" select SERIO diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile index 159cd5136fdb..47d78c9cff21 100644 --- a/drivers/input/touchscreen/Makefile +++ b/drivers/input/touchscreen/Makefile @@ -45,6 +45,7 @@ obj-$(CONFIG_TOUCHSCREEN_ELO) += elo.o obj-$(CONFIG_TOUCHSCREEN_EGALAX) += egalax_ts.o obj-$(CONFIG_TOUCHSCREEN_EGALAX_SERIAL) += egalax_ts_serial.o obj-$(CONFIG_TOUCHSCREEN_EXC3000) += exc3000.o +obj-$(CONFIG_TOUCHSCREEN_FOCALTECH_FTS5452) += focaltech_fts5452.o obj-$(CONFIG_TOUCHSCREEN_FUJITSU) += fujitsu_ts.o obj-$(CONFIG_TOUCHSCREEN_GOODIX) += goodix_ts.o obj-$(CONFIG_TOUCHSCREEN_HIDEEP) += hideep.o diff --git a/drivers/input/touchscreen/focaltech_fts5452.c b/drivers/input/touchscreen/focaltech_fts5452.c new file mode 100644 index 000000000000..abf8a2f271ca --- /dev/null +++ b/drivers/input/touchscreen/focaltech_fts5452.c @@ -0,0 +1,432 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * FocalTech touchscreen driver. + * + * Copyright (c) 2010-2017, FocalTech Systems, Ltd., all rights reserved. + * Copyright (C) 2018 XiaoMi, Inc. + * Copyright (c) 2021 Caleb Connolly + * Copyright (c) 2023 Joel Selvaraj + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define FTS_REG_CHIP_ID_H 0xA3 +#define FTS_REG_CHIP_ID_L 0x9F + +#define FTS_MAX_POINTS_SUPPORT 10 +#define FTS_ONE_TOUCH_LEN 6 + +#define FTS_TOUCH_X_H_OFFSET 3 +#define FTS_TOUCH_X_L_OFFSET 4 +#define FTS_TOUCH_Y_H_OFFSET 5 +#define FTS_TOUCH_Y_L_OFFSET 6 +#define FTS_TOUCH_PRESSURE_OFFSET 7 +#define FTS_TOUCH_AREA_OFFSET 8 +#define FTS_TOUCH_TYPE_OFFSET 3 +#define FTS_TOUCH_ID_OFFSET 5 + +#define FTS_TOUCH_DOWN 0 +#define FTS_TOUCH_UP 1 +#define FTS_TOUCH_CONTACT 2 + +#define FTS_INTERVAL_READ_REG_MS 100 +#define FTS_TIMEOUT_READ_REG_MS 2000 + +#define FTS_DRIVER_NAME "fts-i2c" + +static const u16 fts_chip_types[] = { + 0x5452, + 0x8719, +}; + +struct fts_ts_data { + struct i2c_client *client; + struct input_dev *input_dev; + struct regmap *regmap; + int irq; + struct regulator_bulk_data regulators[2]; + u8 max_touch_points; + u8 *point_buf; + int point_buf_size; + struct gpio_desc *reset_gpio; + struct touchscreen_properties prop; +}; + +struct fts_i2c_chip_data { + int max_touch_points; +}; + +int fts_check_status(struct fts_ts_data *data) +{ + int error, i = 0, count = 0; + unsigned int val, id; + + do { + error = regmap_read(data->regmap, FTS_REG_CHIP_ID_L, &id); + if (error) + dev_err(&data->client->dev, "I2C read failed: %d\n", error); + + error = regmap_read(data->regmap, FTS_REG_CHIP_ID_H, &val); + if (error) + dev_err(&data->client->dev, "I2C read failed: %d\n", error); + + id |= val << 8; + + for (i = 0; i < ARRAY_SIZE(fts_chip_types); i++) + if (id == fts_chip_types[i]) + return 0; + + count++; + msleep(FTS_INTERVAL_READ_REG_MS); + } while ((count * FTS_INTERVAL_READ_REG_MS) < FTS_TIMEOUT_READ_REG_MS); + + return -EIO; +} + +static int fts_report_touch(struct fts_ts_data *data) +{ + struct input_dev *input_dev = data->input_dev; + int base; + unsigned int x, y, z, maj; + u8 slot, type; + int error, i = 0; + + u8 *buf = data->point_buf; + + memset(buf, 0, data->point_buf_size); + + error = regmap_bulk_read(data->regmap, 0, buf, data->point_buf_size); + if (error) { + dev_err(&data->client->dev, "I2C read failed: %d\n", error); + return error; + } + + for (i = 0; i < data->max_touch_points; i++) { + base = FTS_ONE_TOUCH_LEN * i; + + slot = buf[base + FTS_TOUCH_ID_OFFSET] >> 4; + if (slot >= data->max_touch_points) + break; + + x = ((buf[base + FTS_TOUCH_X_H_OFFSET] & 0x0F) << 8) + + (buf[base + FTS_TOUCH_X_L_OFFSET] & 0xFF); + y = ((buf[base + FTS_TOUCH_Y_H_OFFSET] & 0x0F) << 8) + + (buf[base + FTS_TOUCH_Y_L_OFFSET] & 0xFF); + + z = buf[base + FTS_TOUCH_PRESSURE_OFFSET]; + if (z == 0) + z = 0x3f; + + maj = buf[base + FTS_TOUCH_AREA_OFFSET] >> 4; + if (maj == 0) + maj = 0x09; + + type = buf[base + FTS_TOUCH_TYPE_OFFSET] >> 6; + + input_mt_slot(input_dev, slot); + if (type == FTS_TOUCH_DOWN || type == FTS_TOUCH_CONTACT) { + input_mt_report_slot_state(input_dev, MT_TOOL_FINGER, true); + touchscreen_report_pos(data->input_dev, &data->prop, x, y, true); + input_report_abs(input_dev, ABS_MT_PRESSURE, z); + input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, maj); + input_report_key(data->input_dev, BTN_TOUCH, 1); + } else { + input_report_key(data->input_dev, BTN_TOUCH, 0); + input_mt_report_slot_inactive(input_dev); + } + } + input_mt_sync_frame(input_dev); + input_sync(input_dev); + + return 0; +} + +static irqreturn_t fts_ts_interrupt(int irq, void *dev_id) +{ + struct fts_ts_data *data = dev_id; + + return fts_report_touch(data) ? IRQ_NONE : IRQ_HANDLED; +} + +static void fts_power_off(void *d) +{ + struct fts_ts_data *data = d; + + regulator_bulk_disable(ARRAY_SIZE(data->regulators), data->regulators); +} + +static int fts_start(struct fts_ts_data *data) +{ + int error; + + error = regulator_bulk_enable(ARRAY_SIZE(data->regulators), + data->regulators); + if (error) { + dev_err(&data->client->dev, "failed to enable regulators\n"); + return error; + } + + gpiod_set_value_cansleep(data->reset_gpio, 0); + msleep(200); + + enable_irq(data->irq); + + return 0; +} + +static int fts_stop(struct fts_ts_data *data) +{ + disable_irq(data->irq); + gpiod_set_value_cansleep(data->reset_gpio, 1); + fts_power_off(data); + + return 0; +} + +static int fts_input_open(struct input_dev *dev) +{ + struct fts_ts_data *data = input_get_drvdata(dev); + int error; + + error = fts_start(data); + if (error) + return error; + + error = fts_check_status(data); + if (error) { + dev_err(&data->client->dev, "Failed to start or unsupported chip"); + return error; + } + + return 0; +} + +static void fts_input_close(struct input_dev *dev) +{ + struct fts_ts_data *data = input_get_drvdata(dev); + + fts_stop(data); +} + +static int fts_input_init(struct fts_ts_data *data) +{ + struct device *dev = &data->client->dev; + struct input_dev *input_dev; + int error = 0; + + input_dev = devm_input_allocate_device(dev); + if (!input_dev) + return -ENOMEM; + + data->input_dev = input_dev; + + input_dev->name = FTS_DRIVER_NAME; + input_dev->id.bustype = BUS_I2C; + input_dev->dev.parent = dev; + input_dev->open = fts_input_open; + input_dev->close = fts_input_close; + input_set_drvdata(input_dev, data); + + input_set_capability(input_dev, EV_ABS, ABS_MT_POSITION_X); + input_set_capability(input_dev, EV_ABS, ABS_MT_POSITION_Y); + input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0); + input_set_abs_params(input_dev, ABS_MT_PRESSURE, 0, 255, 0, 0); + + touchscreen_parse_properties(input_dev, true, &data->prop); + if (!data->prop.max_x || !data->prop.max_y) { + dev_err(dev, + "touchscreen-size-x and/or touchscreen-size-y not set in device properties\n"); + return -EINVAL; + } + + error = input_mt_init_slots(input_dev, data->max_touch_points, + INPUT_MT_DIRECT); + if (error) + return error; + + data->point_buf_size = (data->max_touch_points * FTS_ONE_TOUCH_LEN) + 3; + data->point_buf = devm_kzalloc(dev, data->point_buf_size, GFP_KERNEL); + if (!data->point_buf) + return -ENOMEM; + + error = input_register_device(input_dev); + if (error) { + dev_err(dev, "Failed to register input device\n"); + return error; + } + + return 0; +} + +static const struct regmap_config fts_ts_i2c_regmap_config = { + .reg_bits = 8, + .val_bits = 8, +}; + +static int fts_ts_probe(struct i2c_client *client) +{ + const struct i2c_device_id *id = i2c_client_get_device_id(client); + const struct fts_i2c_chip_data *chip_data; + struct fts_ts_data *data; + int error = 0; + + if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { + dev_err(&client->dev, "I2C not supported"); + return -ENODEV; + } + + if (!client->irq) { + dev_err(&client->dev, "No irq specified\n"); + return -EINVAL; + } + + data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + chip_data = device_get_match_data(&client->dev); + if (!chip_data) + chip_data = (const struct fts_i2c_chip_data *)id->driver_data; + if (!chip_data || !chip_data->max_touch_points) { + dev_err(&client->dev, "invalid or missing chip data\n"); + return -EINVAL; + } + if (chip_data->max_touch_points > FTS_MAX_POINTS_SUPPORT) { + dev_err(&client->dev, + "invalid chip data, max_touch_points should be less than or equal to %d\n", + FTS_MAX_POINTS_SUPPORT); + return -EINVAL; + } + data->max_touch_points = chip_data->max_touch_points; + + data->client = client; + i2c_set_clientdata(client, data); + + data->reset_gpio = devm_gpiod_get_optional(&client->dev, "reset", GPIOD_OUT_HIGH); + if (IS_ERR(data->reset_gpio)) { + error = PTR_ERR(data->reset_gpio); + dev_err(&client->dev, "Failed to request reset gpio, error %d\n", error); + return error; + } + + data->regmap = devm_regmap_init_i2c(client, &fts_ts_i2c_regmap_config); + if (IS_ERR(data->regmap)) { + error = PTR_ERR(data->regmap); + dev_err(&client->dev, "regmap allocation failed, error %d\n", error); + return error; + } + + /* + * AVDD is the analog voltage supply (2.6V to 3.3V) + * VDDIO is the digital voltage supply (1.8V) + */ + data->regulators[0].supply = "avdd"; + data->regulators[1].supply = "vddio"; + error = devm_regulator_bulk_get(&client->dev, ARRAY_SIZE(data->regulators), + data->regulators); + if (error) { + dev_err(&client->dev, "Failed to get regulators %d\n", error); + return error; + } + + error = devm_add_action_or_reset(&client->dev, fts_power_off, data); + if (error) { + dev_err(&client->dev, "failed to install power off handler\n"); + return error; + } + + error = devm_request_threaded_irq(&client->dev, client->irq, NULL, + fts_ts_interrupt, IRQF_ONESHOT, + client->name, data); + if (error) { + dev_err(&client->dev, "Failed to request IRQ: %d\n", error); + return error; + } + + error = fts_input_init(data); + if (error) + return error; + + return 0; +} + +static int fts_pm_suspend(struct device *dev) +{ + struct fts_ts_data *data = dev_get_drvdata(dev); + + mutex_lock(&data->input_dev->mutex); + + if (input_device_enabled(data->input_dev)) + fts_stop(data); + + mutex_unlock(&data->input_dev->mutex); + + return 0; +} + +static int fts_pm_resume(struct device *dev) +{ + struct fts_ts_data *data = dev_get_drvdata(dev); + int error = 0; + + mutex_lock(&data->input_dev->mutex); + + if (input_device_enabled(data->input_dev)) + error = fts_start(data); + + mutex_unlock(&data->input_dev->mutex); + + return error; +} + +static DEFINE_SIMPLE_DEV_PM_OPS(fts_dev_pm_ops, fts_pm_suspend, fts_pm_resume); + +static const struct fts_i2c_chip_data fts5452_chip_data = { + .max_touch_points = 5, +}; + +static const struct fts_i2c_chip_data fts8719_chip_data = { + .max_touch_points = 10, +}; + +static const struct i2c_device_id fts_i2c_id[] = { + { .name = "fts5452", .driver_data = (long)&fts5452_chip_data }, + { .name = "fts8719", .driver_data = (long)&fts8719_chip_data }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(i2c, fts_i2c_id); + +static const struct of_device_id fts_of_match[] = { + { .compatible = "focaltech,fts5452", .data = &fts5452_chip_data }, + { .compatible = "focaltech,fts8719", .data = &fts8719_chip_data }, + { /* sentinel */ } +}; + +MODULE_DEVICE_TABLE(of, fts_of_match); + +static struct i2c_driver fts_ts_driver = { + .probe_new = fts_ts_probe, + .id_table = fts_i2c_id, + .driver = { + .name = FTS_DRIVER_NAME, + .pm = pm_sleep_ptr(&fts_dev_pm_ops), + .of_match_table = fts_of_match, + }, +}; +module_i2c_driver(fts_ts_driver); + +MODULE_AUTHOR("Joel Selvaraj "); +MODULE_AUTHOR("Caleb Connolly "); +MODULE_DESCRIPTION("Focaltech Touchscreen Driver"); +MODULE_LICENSE("GPL"); From patchwork Mon Apr 10 16:01:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Selvaraj X-Patchwork-Id: 672074 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D68EC77B7A for ; Mon, 10 Apr 2023 16:02:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230175AbjDJQCM (ORCPT ); Mon, 10 Apr 2023 12:02:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230167AbjDJQCK (ORCPT ); Mon, 10 Apr 2023 12:02:10 -0400 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E2FA10A; Mon, 10 Apr 2023 09:02:09 -0700 (PDT) Received: by mail-io1-xd34.google.com with SMTP id ca18e2360f4ac-7606cf95ab8so2409839f.0; Mon, 10 Apr 2023 09:02:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681142528; x=1683734528; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=i9ictD2ajD9aXjz9JmrkJpMZfRuHbVQYL0A7CbsNnNc=; b=L0fLmYfs89b7e3MvR/JvH7a6FImHGeWQGG61pNPCAusCb3rZ2paAyCK3TbEscqvQ7D NtJ1LPt9440rFoiU21j0Jclmq2oYdtJ5LSSzD41mTfLil7E9D3bLBlLwlOYdz4fbKUGA m3BK3UKy+IPwbkTkBxg3GKDWE9GyYLJtNFb2BTIdVtDm0rKil3IWLJ4O9D5tqStVVYXF astVQ1FnIEdiJh2bXkAxi9mivfQ5lXTnZK/62gAEKYYUbULAQKkrh2vtG+/XsyN8JTLr fk0oARiol7BxZ8qJuIFK5W0EX03Vtn0pTr97K1LTcFzE26C/Vs/7HKh/l7PLTTcZjWVf M4xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681142528; x=1683734528; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i9ictD2ajD9aXjz9JmrkJpMZfRuHbVQYL0A7CbsNnNc=; b=Jhuth/o9LYKJ7oRNIHYq03jNUUd97xfABXYrKFgpuiRMfj5Zyux99RzfMTwKihRGfB iQqIIyGFBHJV1kb0rXEwhnpaq3C05tsCMKt468EnDWBd8K65o9jILNS702gcvcXgkIxH ReCaf51P1NrkofnIjZ4uekbCdcZVyhXE324jsgeuQ9sdAZtKt52vo9jw/R1kGd6Hgguf +MAHgte7LFdMWnoqx7kij1g4S484zpCBtg4LvnD9urVjVih8DPU1d0HlFrj2GIGyENUT IxqgsBzJptlWq6DOVzD7yRxszj1gAbXKzlJkcrkbuXGZYhK4b4TA7cCUtOSE5xSUNh9I lg3w== X-Gm-Message-State: AAQBX9fwwgguIg71aQTbhT+72FRyKdqxHeyAOwjCRMeqoORVUdC5DoMc VJM9zmZVQzmHS207eqjdn+0= X-Google-Smtp-Source: AKy350b3zYfAtKlvrYyAZoCOxYbFvXfoaU6UWjqsd56Hh28IsPQzAf4FqITYc486xxMzYiEHv4LJGw== X-Received: by 2002:a05:6e02:13d2:b0:325:e46f:a028 with SMTP id v18-20020a056e0213d200b00325e46fa028mr4778451ilj.3.1681142528669; Mon, 10 Apr 2023 09:02:08 -0700 (PDT) Received: from JOEL-DESKTOP.. ([2604:2d80:4d87:cd00:9f51:32d7:1177:67d]) by smtp.gmail.com with ESMTPSA id c7-20020a5d9a87000000b00746041ecbf9sm3184435iom.39.2023.04.10.09.02.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 09:02:08 -0700 (PDT) From: Joel Selvaraj To: Caleb Connolly , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Andy Gross , Bjorn Andersson , Konrad Dybcio , Henrik Rydberg , Arnd Bergmann , Robert Jarzmik , Jeff LaBundy , Markuss Broks , Jean Delvare , Job Noorman , Alistair Francis , Chris Morgan , Hans de Goede Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Joel Selvaraj Subject: [PATCH v2 3/5] arm64: dts: qcom: sdm845-xiaomi-beryllium-common: add touchscreen related nodes Date: Mon, 10 Apr 2023 11:01:58 -0500 Message-Id: <20230410160200.57261-4-joelselvaraj.oss@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230410160200.57261-1-joelselvaraj.oss@gmail.com> References: <20230410160200.57261-1-joelselvaraj.oss@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Enable qupv3_id_1 and gpi_dma1 as they are required for configuring touchscreen. Also add pinctrl configurations needed for touchscreen. These are common for both the tianma and ebbg touchscreen variant. In the subsequent patch, we will initially enable support for the focaltech touchscreen used in the EBBG variant. This is done in preparation for that. Signed-off-by: Joel Selvaraj --- .../qcom/sdm845-xiaomi-beryllium-common.dtsi | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi index 5ed975cc6ecb..b580a32fdc3b 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi @@ -268,6 +268,10 @@ &gmu { status = "okay"; }; +&gpi_dma1 { + status = "okay"; +}; + &gpu { status = "okay"; @@ -376,6 +380,10 @@ &qupv3_id_0 { status = "okay"; }; +&qupv3_id_1 { + status = "okay"; +}; + &sdhc_2 { status = "okay"; @@ -481,6 +489,37 @@ sdc2_card_det_n: sd-card-det-n-state { function = "gpio"; bias-pull-up; }; + + ts_int_default: ts-int-default-state { + pins = "gpio31"; + function = "gpio"; + drive-strength = <16>; + bias-pull-down; + input-enable; + }; + + ts_reset_default: ts-reset-default-state { + pins = "gpio32"; + function = "gpio"; + drive-strength = <16>; + output-high; + }; + + ts_int_sleep: ts-int-sleep-state { + pins = "gpio31"; + function = "gpio"; + drive-strength = <2>; + bias-pull-down; + input-enable; + }; + + ts_reset_sleep: ts-reset-sleep-state { + pins = "gpio32"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + output-low; + }; }; &uart6 { From patchwork Mon Apr 10 16:01:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Selvaraj X-Patchwork-Id: 672396 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC475C77B70 for ; Mon, 10 Apr 2023 16:02:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230193AbjDJQCO (ORCPT ); Mon, 10 Apr 2023 12:02:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230178AbjDJQCM (ORCPT ); Mon, 10 Apr 2023 12:02:12 -0400 Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2872171C; Mon, 10 Apr 2023 09:02:10 -0700 (PDT) Received: by mail-il1-x134.google.com with SMTP id e9e14a558f8ab-328990497e7so209815ab.1; Mon, 10 Apr 2023 09:02:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681142530; x=1683734530; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9WRbpW3m578x5MfQQ6H7U6/ppADfjexDu2jTLEQfa6Y=; b=fpWzPvsRs59pPJOjVNt3uOVg+XJI2QhYUCIsbOs8E+CZiPxXpQiGxWhJMUe5b44mmI F75WjKt2sZ7/5280GRSI3gp2pO2PT+BXTnGovyzJcxrc7gX1M69wvx2eIbpbEc3BvZQO s9gXhMXZCDwiLej8FD4Bah50C2F3PHiY9uRwV/JmAArvWG7mdsgdqpVtyz7VhfHtb4W6 K9tZBlTeeaaaI6AbqfR+LUn5+kzhv+eJW6tfcMferXYuGOAGZv/rQQDFe1p8BR7EIwxQ QMSAJeLVuMhPZlRS7V9WCaNdO3fOpkjWA6dXgfV5Buko8pXC8j7KWuoTiJsjeEbrG0O+ cQ4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681142530; x=1683734530; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9WRbpW3m578x5MfQQ6H7U6/ppADfjexDu2jTLEQfa6Y=; b=3DPTaCI7P/3CI9I/aOnehyeoJpDC2XLd7caBOFDJ6YfLhWUf/70YYBJZvxDrxDCrt7 xJiGv2IVw92qfxovT1ALd3NqSyujyL2TLKfx93U1TRF8nnbJcWjzKDk6SePeyrucTV2v xs9YJrnvf7dG4dd9DDEsEY+j3BDbjlgdHrwlEeBsml9OCceIYnn3mKosljz2kyDt4Cw/ wYVVN87kc8CXKL+eKQKdFz/fmhpNqCUUUQUpJsqGypH3mg2FSrhl3z3WoJPB9PbYUisc nlszogF0ecpTVzGR17b7OgGrHIQsXgYVW2cNnhjl2+flCysmUDt2gxenbwMo1xIi3aSg DxJw== X-Gm-Message-State: AAQBX9eNEFluucTAj5IvT244HV4puuNopuc4YmYNedx+ZFpI+o33UwAj bh8cpm54sIOu6r/X1dULrj8= X-Google-Smtp-Source: AKy350ZtDGhNGKQ9dSGRRaK2unA4PVBne5NvKZe0ZVg7cCZylzqjXjCSJM2YnzzOJMsbzTrMzCdZXA== X-Received: by 2002:a05:6602:2a48:b0:759:485:41d with SMTP id k8-20020a0566022a4800b007590485041dmr4376547iov.0.1681142530192; Mon, 10 Apr 2023 09:02:10 -0700 (PDT) Received: from JOEL-DESKTOP.. ([2604:2d80:4d87:cd00:9f51:32d7:1177:67d]) by smtp.gmail.com with ESMTPSA id c7-20020a5d9a87000000b00746041ecbf9sm3184435iom.39.2023.04.10.09.02.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 09:02:09 -0700 (PDT) From: Joel Selvaraj To: Caleb Connolly , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Andy Gross , Bjorn Andersson , Konrad Dybcio , Henrik Rydberg , Arnd Bergmann , Robert Jarzmik , Jeff LaBundy , Markuss Broks , Jean Delvare , Job Noorman , Alistair Francis , Chris Morgan , Hans de Goede Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Joel Selvaraj Subject: [PATCH v2 4/5] arm64: dts: qcom: sdm845-xiaomi-beryllium-ebbg: introduce support for fts touchscreen Date: Mon, 10 Apr 2023 11:01:59 -0500 Message-Id: <20230410160200.57261-5-joelselvaraj.oss@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230410160200.57261-1-joelselvaraj.oss@gmail.com> References: <20230410160200.57261-1-joelselvaraj.oss@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The Poco F1 EBBG variant uses Focaltech FTS8719 touchscreen. Introduce support for it. Signed-off-by: Joel Selvaraj --- .../dts/qcom/sdm845-xiaomi-beryllium-ebbg.dts | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-ebbg.dts b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-ebbg.dts index 76931ebad065..f857ed3e2df4 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-ebbg.dts +++ b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-ebbg.dts @@ -13,3 +13,29 @@ &display_panel { compatible = "ebbg,ft8719"; status = "okay"; }; + +&i2c14 { + status = "okay"; + + dmas = <&gpi_dma1 0 6 QCOM_GPI_I2C>, + <&gpi_dma1 1 6 QCOM_GPI_I2C>; + dma-names = "tx", "rx"; + + touchscreen@38 { + compatible = "focaltech,fts8719"; + reg = <0x38>; + + interrupt-parent = <&tlmm>; + interrupts = <31 IRQ_TYPE_EDGE_FALLING>; + reset-gpios = <&tlmm 32 GPIO_ACTIVE_LOW>; + + vddio-supply = <&vreg_l14a_1p8>; + + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&ts_int_default &ts_reset_default>; + pinctrl-1 = <&ts_int_sleep &ts_reset_sleep>; + + touchscreen-size-x = <1080>; + touchscreen-size-y = <2246>; + }; +}; From patchwork Mon Apr 10 16:02:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Selvaraj X-Patchwork-Id: 672395 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 757E1C76196 for ; Mon, 10 Apr 2023 16:02:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230283AbjDJQCg (ORCPT ); Mon, 10 Apr 2023 12:02:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230249AbjDJQC1 (ORCPT ); Mon, 10 Apr 2023 12:02:27 -0400 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9500959E9; Mon, 10 Apr 2023 09:02:19 -0700 (PDT) Received: by mail-io1-xd32.google.com with SMTP id ca18e2360f4ac-7606d7ca422so2227239f.1; Mon, 10 Apr 2023 09:02:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681142538; x=1683734538; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OimWLmHWLNmjUtWvHz0GKrLoEkNOAR/VpuvZ24QH1vk=; b=Z67vskReD6+pMfBslUhc+RH+EootiAkqi9MxvLJFKmNMJFGr3TNfo6qQs2vtQ/ENzm dVZ9MhetJTicu5Tr6AEnSCygtCKRVBHWe4Q6T+nzLcHRELlrWmJJxuhhcx0aUft/EhLF EIiWIDYbLOM0+jlZYFihdiUNcLWIpIHwYyzMXaCfrqeihWolofv9YPLZ9LeWQKYmvvyi aDb1ZFHn2kshzxK3o1RNbEFRMHXmgf5Ju9Ugq+knuePUZoZ0xKDMOmjxDQZTa+SSvkAz CDqZnDio0EXEuVYhqAKie023NDJnMT+SsLUSo+MDO3Y6IX/7VMwxlwFmi0sBPcXXqMQM cSqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681142538; x=1683734538; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OimWLmHWLNmjUtWvHz0GKrLoEkNOAR/VpuvZ24QH1vk=; b=V3VvzMrRo7XhOys/sASrIohpkem90dv3mVwbJ34p4JQdwSGM42BkURnLigc3hQ1LpF ZatmtSPzBTn5kBzh4saXMHXKJmPk/IgPwjAL/oL/zPOkByf4WulSnoXtYmxVyrAiu5ZS l64u5EdNtceYvK2tJgh98OOILr/UHf+8ciHQq57Jo9J48Epw7FXFutmyrcNMrc40ZFAM 85p2+spGFoi9XrJ6DXQ/3xIVauEhyvq0T9jGPbom01cZFmzRQse6GUP9FOXgL4CexBJ6 79yDNbf4JLJzWPrxjYiqlGIDUQiHcNcUhCW/0jZUFKY1xXhqjFj7jlNicMpvdEaK8HE6 J7Vw== X-Gm-Message-State: AAQBX9frToxysSY4+o4P2Fu1f0YDSWXCGnnPmcKMVTxLIcm58Qrk3tQd u5UQg+BzVka7FImCsoD8emY= X-Google-Smtp-Source: AKy350Z59s0GrsR0yuSD6xvISmlAK+CYc8yGMYknebPn6Ckygm3n7TfHVhI2mENciDQhDY2sfavmEA== X-Received: by 2002:a05:6e02:1b86:b0:326:3cfc:f702 with SMTP id h6-20020a056e021b8600b003263cfcf702mr3927375ili.2.1681142531732; Mon, 10 Apr 2023 09:02:11 -0700 (PDT) Received: from JOEL-DESKTOP.. ([2604:2d80:4d87:cd00:9f51:32d7:1177:67d]) by smtp.gmail.com with ESMTPSA id c7-20020a5d9a87000000b00746041ecbf9sm3184435iom.39.2023.04.10.09.02.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 09:02:11 -0700 (PDT) From: Joel Selvaraj To: Caleb Connolly , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Andy Gross , Bjorn Andersson , Konrad Dybcio , Henrik Rydberg , Arnd Bergmann , Robert Jarzmik , Jeff LaBundy , Markuss Broks , Jean Delvare , Job Noorman , Alistair Francis , Chris Morgan , Hans de Goede Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Joel Selvaraj Subject: [PATCH v2 5/5] arm64: dts: qcom: sdm845-shift-axolotl: update focaltech touchscreen properties Date: Mon, 10 Apr 2023 11:02:00 -0500 Message-Id: <20230410160200.57261-6-joelselvaraj.oss@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230410160200.57261-1-joelselvaraj.oss@gmail.com> References: <20230410160200.57261-1-joelselvaraj.oss@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The touchscreen nodes were added before the driver patches were merged. Update the focaltech touchscreen properties to match with the upstreamed focaltech driver. Also, the touchscreen used is in axolotl is fts5452 and not fts8719. Signed-off-by: Joel Selvaraj --- arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts index b54e304abf71..96dd4628d9a7 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts +++ b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts @@ -474,23 +474,22 @@ &i2c5 { status = "okay"; touchscreen@38 { - compatible = "focaltech,fts8719"; + compatible = "focaltech,fts5452"; reg = <0x38>; - wakeup-source; + interrupt-parent = <&tlmm>; - interrupts = <125 0x2>; - vdd-supply = <&vreg_l28a_3p0>; - vcc-i2c-supply = <&vreg_l14a_1p88>; + interrupts = <125 IRQ_TYPE_EDGE_FALLING>; + reset-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>; + + avdd-supply = <&vreg_l28a_3p0>; + vddio-supply = <&vreg_l14a_1p88>; pinctrl-names = "default", "suspend"; pinctrl-0 = <&ts_int_active &ts_reset_active>; pinctrl-1 = <&ts_int_suspend &ts_reset_suspend>; - reset-gpio = <&tlmm 99 GPIO_ACTIVE_HIGH>; - irq-gpio = <&tlmm 125 GPIO_TRANSITORY>; touchscreen-size-x = <1080>; touchscreen-size-y = <2160>; - focaltech,max-touch-number = <5>; }; };