From patchwork Sun Mar 12 09:32:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Selvaraj X-Patchwork-Id: 13171180 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 F131EC76195 for ; Sun, 12 Mar 2023 09:33:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229668AbjCLJdM (ORCPT ); Sun, 12 Mar 2023 05:33:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbjCLJdL (ORCPT ); Sun, 12 Mar 2023 05:33:11 -0400 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 160451EBDD; Sun, 12 Mar 2023 01:33:09 -0800 (PST) Received: by mail-io1-xd29.google.com with SMTP id b5so3892898iow.0; Sun, 12 Mar 2023 01:33:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678613588; 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=ZTyur/y1Zf29WY4wvz+mTKnfsVL2wpjYMZL0OKfdL0w=; b=ShCVN+kJ9c4PDWZ4tT3jIzBc+VLDVk525D46LB7OMyWTmRBTDNvR2hAOk3zzz7TEaC 4hwjb5SjaXkubM+LC/BVmEjT3Ov1X3bMnHDaGcIgt2UCnlo+dYFQENvA1BVEuq0Xxi3n 2UUjMeChogMm2ZBEXxyHqZh1O4B0HotJoku2DC295Tp3vbLNVyld+4dg/eGch517tJ8J YUZU1kXmlmP6hXRyHRGol6J41fwdLj75XmBL254bxXMV56afiqUq7OpdjOKSsATbsRwu sR5PycdsTfkDWNxya4JIQ0jbh897QeSHPVqevYRwqg08DrooYwhxMEHsfg0KyYAnLW39 EICw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678613588; 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=ZTyur/y1Zf29WY4wvz+mTKnfsVL2wpjYMZL0OKfdL0w=; b=2XGpFY/GHC48tMV77PXUE5gElP9o9TGCF35AVC3zZii8UnIxXMOLnBR1zMVNEmXAYb Llzuu4OcCevgF4rmJn+MntFGtMroO7IBnqniTy0oemplDAUER+5QyImuVsAbLQDYgjr0 mFaqf3fDPinrj7JZg1IWinccrM26M9Gzc9ITH5MTHL79XS2g2pv8J+0lhXwClaMKGSqi 2i+naVxrnz+aOT8MDnJB38wNxNgpLMXS1qznUaQeOOqR0fDJ+41hG9g6txXJDC4pd48C K3qjNd3PhiIkAKXONKi3fkNamHVyA0UyBpGbMaXadWfN97CX82gVjHt790Ptlt3R9R8f X4Tg== X-Gm-Message-State: AO0yUKUdcZijIoCFuR3mReyHOwAAVvi9jE+RqRAKIIbaWgVz/LOjx7S2 B2BoKnjoTjn08VMO1XBX9Ow= X-Google-Smtp-Source: AK7set8etpHAUJ2iLzj9ZfQzJOpdcOxtbgHBophffrb16+rbZngmJ0rqRJXoNKm0EPk+cxBeCR6ODA== X-Received: by 2002:a5d:9606:0:b0:74e:8718:a174 with SMTP id w6-20020a5d9606000000b0074e8718a174mr6911103iol.1.1678613588388; Sun, 12 Mar 2023 01:33:08 -0800 (PST) Received: from JOEL-DESKTOP.. ([2604:2d80:4d87:cd00:9f51:32d7:1177:67d]) by smtp.gmail.com with ESMTPSA id r7-20020a6bfc07000000b00716eb44b97esm1585031ioh.27.2023.03.12.01.33.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Mar 2023 01:33:08 -0800 (PST) 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 , Neil Armstrong , Markuss Broks , Jean Delvare , Max Krummenacher , Job Noorman , Alistair Francis , Chris Morgan 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 1/5] dt-bindings: input: touchscreen: add bindings for focaltech,fts Date: Sun, 12 Mar 2023 04:32:45 -0500 Message-Id: <20230312093249.1846993-2-joelselvaraj.oss@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230312093249.1846993-1-joelselvaraj.oss@gmail.com> References: <20230312093249.1846993-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,fts.yaml | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/touchscreen/focaltech,fts.yaml diff --git a/Documentation/devicetree/bindings/input/touchscreen/focaltech,fts.yaml b/Documentation/devicetree/bindings/input/touchscreen/focaltech,fts.yaml new file mode 100644 index 000000000000..07fe595cc9ed --- /dev/null +++ b/Documentation/devicetree/bindings/input/touchscreen/focaltech,fts.yaml @@ -0,0 +1,81 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/touchscreen/focaltech,fts.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: a phandle for the regulator supplying analog power (2.6V to 3.3V). + + vddio-supply: + description: a phandle for the regulator supplying IO power (1.8V). + + focaltech,max-touch-number: + $ref: /schemas/types.yaml#/definitions/uint32 + description: max number of fingers supported + minimum: 2 + maximum: 10 + + touchscreen-size-x: true + touchscreen-size-y: true + +additionalProperties: false + +required: + - compatible + - reg + - reset-gpios + - focaltech,max-touch-number + - touchscreen-size-x + - touchscreen-size-y + +examples: + - | + #include + #include + &i2c5 { + status="okay"; + + touchscreen: focaltech@38 { + compatible = "focaltech,fts8719"; + reg = <0x38>; + interrupt-parent = <&tlmm>; + interrupts = <31 IRQ_TYPE_EDGE_RISING>; + + avdd-supply = <&vreg_l28a_3p0>; + 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>; + + reset-gpios = <&tlmm 32 GPIO_ACTIVE_LOW>; + + touchscreen-size-x = <1080>; + touchscreen-size-y = <2246>; + focaltech,max-touch-number = <10>; + }; + }; From patchwork Sun Mar 12 09:32:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Selvaraj X-Patchwork-Id: 13171181 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 E57F2C7618A for ; Sun, 12 Mar 2023 09:33:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229722AbjCLJdP (ORCPT ); Sun, 12 Mar 2023 05:33:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229694AbjCLJdN (ORCPT ); Sun, 12 Mar 2023 05:33:13 -0400 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8629718AA8; Sun, 12 Mar 2023 01:33:11 -0800 (PST) Received: by mail-io1-xd2d.google.com with SMTP id e11so3881647ioe.3; Sun, 12 Mar 2023 01:33:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678613590; 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=1LN3sd9DKz7j2+zBmckqi2cntUUkP3RrndKOHejU1WA=; b=Z3Jjk3swGa8z2sLCqi//bsqhwUclvURuxDX0k5vgl8DEvlANTwuI2ZjLhftwGutLR5 +LN/6lAKEHX37mDQyfC5INVRIvmTlPSuyg13sSWZ2OOgy08xa4lH+oIUJAi0Dj/VYBwD J2OtkJlg5fWb4jcmpiSfWNwjQVz4abeCqHEvGlHnPI95rGNJ5Thjjb1YPCMxGxd8qfVf iVQVyVNx1G7o826pQMeBlICVllC07y7k4W4OUUfEC85HH2jMRu13OO9bsFeqmifAj2xx TQjiLi4Ql2Yc9ZGEsQHfjZP0H81puLnmkB+FKNyO0UPLaNxRTuatjZkJdn4brAF8YF26 0JpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678613590; 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=1LN3sd9DKz7j2+zBmckqi2cntUUkP3RrndKOHejU1WA=; b=31PZXGFfsE58YY/bnK9BzEkOWFOi7PY8RzEFeHc1OdqdPRgX5tfH6+3DdFca5N2JGG ODZSb98Rt+3Bo1ryaSAezwm2g9FG36MMtYJP3N9oWq8eNVlWv7lnQGK/qAvyY/eaBMcl WJ0mAgbB6LMcANKCq4UJrrhJfUcwUNaRXHYXtWWN3VIFmVPGQdtUvimcT2XHAOVn9be+ SXWt5LrZO3waHZ52Ib1ES7JwwDqOlMG9Lm58f/e+B90n1iS7YG+PHRF9QisZGYSlQ3ou 3xSNexNe/xXgYeU6d6Kw2Ma4Q5hZIPbghhUuI8XCQl3l3PnBrmabR+Bkh/KylmQLiHEA eFmg== X-Gm-Message-State: AO0yUKVUR9Qx1vpdY/FHxwX53KW0GjR6S1X1zwaRXGxfpMoWdRN1WeeP zQgAx+4g/n/6zCfb0FGsPnWks+EQYM5pGQ== X-Google-Smtp-Source: AK7set9FLo7FlxyQ1xMOHJE+2U7IbslP1wxtKVbv78KO12uAKFJ104h9r7ZljElHLHBnxilwciQe3A== X-Received: by 2002:a6b:b40c:0:b0:74c:83ab:280c with SMTP id d12-20020a6bb40c000000b0074c83ab280cmr4490184iof.1.1678613590418; Sun, 12 Mar 2023 01:33:10 -0800 (PST) Received: from JOEL-DESKTOP.. ([2604:2d80:4d87:cd00:9f51:32d7:1177:67d]) by smtp.gmail.com with ESMTPSA id r7-20020a6bfc07000000b00716eb44b97esm1585031ioh.27.2023.03.12.01.33.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Mar 2023 01:33:10 -0800 (PST) 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 , Neil Armstrong , Markuss Broks , Jean Delvare , Max Krummenacher , Job Noorman , Alistair Francis , Chris Morgan 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 2/5] Input: add driver for Focaltech FTS touchscreen Date: Sun, 12 Mar 2023 04:32:46 -0500 Message-Id: <20230312093249.1846993-3-joelselvaraj.oss@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230312093249.1846993-1-joelselvaraj.oss@gmail.com> References: <20230312093249.1846993-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_fts.c | 448 ++++++++++++++++++++++ 4 files changed, 469 insertions(+) create mode 100644 drivers/input/touchscreen/focaltech_fts.c diff --git a/MAINTAINERS b/MAINTAINERS index 2892858cb040..deb561c356f2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7993,6 +7993,14 @@ L: linux-input@vger.kernel.org S: Maintained F: drivers/input/joystick/fsia6b.c +FOCALTECH FTS TOUCHSCREEN DRIVER +M: Joel Selvaraj +M: Caleb Connolly +L: linux-input@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/input/touchscreen/focaltech,fts.yaml +F: drivers/input/touchscreen/focaltech_fts.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 1a2049b336a6..320925bac3a1 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_FTS + 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 f2fd28cc34a6..83ea2e3ce754 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_FTS) += focaltech_fts.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_fts.c b/drivers/input/touchscreen/focaltech_fts.c new file mode 100644 index 000000000000..d389c8b88944 --- /dev/null +++ b/drivers/input/touchscreen/focaltech_fts.c @@ -0,0 +1,448 @@ +// 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 + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#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_DRIVER_NAME "fts-i2c" +#define INTERVAL_READ_REG 100 /* unit:ms */ +#define TIMEOUT_READ_REG 2000 /* unit:ms */ + +#define CHIP_TYPE_5452 0x5452 +#define CHIP_TYPE_8719 0x8719 + +struct fts_ts_data { + struct i2c_client *client; + struct input_dev *input_dev; + struct touchscreen_properties prop; + + struct regmap *regmap; + int irq; + + struct regulator_bulk_data regulators[2]; + + /* Touch data */ + u8 max_touch_number; + u8 *point_buf; + int point_buf_size; + + /* DT data */ + struct gpio_desc *reset_gpio; +}; + +static const struct regmap_config fts_ts_i2c_regmap_config = { + .reg_bits = 8, + .val_bits = 8, +}; + +static bool fts_chip_is_valid(struct fts_ts_data *data, u16 id) +{ + if (id != CHIP_TYPE_5452 && id != CHIP_TYPE_8719) + return false; + + return true; +} + +int fts_check_status(struct fts_ts_data *data) +{ + int count = 0; + unsigned int val, id; + + do { + regmap_read(data->regmap, FTS_REG_CHIP_ID_H, &val); + id = val << 8; + regmap_read(data->regmap, FTS_REG_CHIP_ID_L, &val); + id |= val; + + if (fts_chip_is_valid(data, id)) { + dev_dbg(&data->client->dev, "TS Ready: Chip ID = 0x%x", id); + return 0; + } + + count++; + msleep(INTERVAL_READ_REG); + } while ((count * INTERVAL_READ_REG) < TIMEOUT_READ_REG); + + return -EIO; +} + +static void 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_ratelimited(&data->client->dev, "I2C read failed: %d\n", + error); + return; + } + + for (i = 0; i < data->max_touch_number; i++) { + base = FTS_ONE_TOUCH_LEN * i; + + slot = (buf[base + FTS_TOUCH_ID_OFFSET]) >> 4; + if (slot >= data->max_touch_number) + 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_sync(input_dev); +} + +static irqreturn_t fts_ts_interrupt(int irq, void *dev_id) +{ + struct fts_ts_data *data = dev_id; + + fts_report_touch(data); + + return 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; + + /* Init and register Input device */ + 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); + + __set_bit(EV_SYN, input_dev->evbit); + __set_bit(EV_ABS, input_dev->evbit); + __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); + + input_mt_init_slots(input_dev, data->max_touch_number, + INPUT_MT_DIRECT); + 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 dts\n"); + return -EINVAL; + } + + data->point_buf_size = (data->max_touch_number * FTS_ONE_TOUCH_LEN) + 3; + data->point_buf = devm_kzalloc(dev, data->point_buf_size, GFP_KERNEL); + if (!data->point_buf) { + dev_err(dev, "Failed to alloc memory for point buffer\n"); + return -ENOMEM; + } + + error = input_register_device(input_dev); + if (error) { + dev_err(dev, "Failed to register input device\n"); + return error; + } + + return 0; +} + +static int fts_parse_dt(struct fts_ts_data *data) +{ + int error = 0; + struct device *dev = &data->client->dev; + struct device_node *np = dev->of_node; + u32 val; + + error = of_property_read_u32(np, "focaltech,max-touch-number", &val); + if (error) { + dev_err(dev, "Unable to read property 'focaltech,max-touch-number'"); + return -EINVAL; + } + if (val < 2 || val > FTS_MAX_POINTS_SUPPORT) { + dev_err(dev, "'focaltech,max-touch-number' out of range [2, %d]", + FTS_MAX_POINTS_SUPPORT); + return -EINVAL; + } + data->max_touch_number = val; + + data->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); + if (IS_ERR(data->reset_gpio)) { + error = PTR_ERR(data->reset_gpio); + dev_err(dev, "Failed to request reset gpio, error %d\n", error); + return error; + } + + return 0; +} + +static int fts_ts_probe(struct i2c_client *client) +{ + int error = 0; + struct fts_ts_data *data; + + 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; + + data->client = client; + + error = fts_parse_dt(data); + if (error) + return error; + + i2c_set_clientdata(client, data); + + data->regmap = devm_regmap_init_i2c(client, &fts_ts_i2c_regmap_config); + if (IS_ERR(data->regmap)) { + dev_err(&client->dev, "regmap allocation failed\n"); + return PTR_ERR(data->regmap); + } + + /* + * 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 const struct dev_pm_ops fts_dev_pm_ops = { + .suspend = fts_pm_suspend, + .resume = fts_pm_resume, +}; + +static const struct of_device_id fts_match_table[] = { + { .compatible = "focaltech,fts5452", }, + { .compatible = "focaltech,fts8719", }, + { /* sentinel */ }, +}; + +MODULE_DEVICE_TABLE(of, fts_match_table); + +static struct i2c_driver fts_ts_driver = { + .probe_new = fts_ts_probe, + .driver = { + .name = FTS_DRIVER_NAME, + .pm = &fts_dev_pm_ops, + .of_match_table = fts_match_table, + }, +}; +module_i2c_driver(fts_ts_driver); + +MODULE_AUTHOR("Joel Selvaraj "); +MODULE_AUTHOR("Caleb Connolly "); +MODULE_DESCRIPTION("FocalTech touchscreen Driver"); +MODULE_LICENSE("GPL"); From patchwork Sun Mar 12 09:32:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Selvaraj X-Patchwork-Id: 13171182 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 3CCB5C74A5B for ; Sun, 12 Mar 2023 09:33:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229756AbjCLJdQ (ORCPT ); Sun, 12 Mar 2023 05:33:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbjCLJdP (ORCPT ); Sun, 12 Mar 2023 05:33:15 -0400 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C28A20D0A; Sun, 12 Mar 2023 01:33:12 -0800 (PST) Received: by mail-io1-xd35.google.com with SMTP id f14so3876074iow.5; Sun, 12 Mar 2023 01:33:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678613592; 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=VNRgd4NTRjQ+aLNKYtGdatvuO6DMSMslESmreJpN/xA=; b=qCbaq/WcCmVahRzTAmUrFXZfJ3PmeYye5Sd68iOPO77W2OayBObwQ2lf7/gdgcU+kJ XPGT3Jv97B94LG5WOrVkQai9B262VmL9+obxyHwkRmZQ1j43xSXjQk3KjO20LnA8PCrd xrhIhO6I+jor4tqKt4NqI3vs7ktMcvO0MO10dJAFCqLvwt3ER+VnMO8dH/y9O31UtHHr 2tcWBV/Heqpm8242URpZTYRtfVmb9KGQxXIiyWoQ2Wv3xPfE2wPn+wjf6kgfKqcxSl1t qQncei1n7QdiJ549iYb7PesqrRlHCSVtb2twLJbkHq0y01nacukfm6nTazSEqixf3S/V MzPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678613592; 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=VNRgd4NTRjQ+aLNKYtGdatvuO6DMSMslESmreJpN/xA=; b=insE/uwHOtlmJqLxSHXse3/lwEhAUnDcC/BK3luIAGn8Ix0ZCjJeG0tQiCqHqQaju4 5KWJzOLERZKdgNgN39b8wsjcfQ4BsPHVK1P0v5/Po9gcDQgbcmVlnkEb8qUmM6CePkyj ryNgkuEObrnXX3THjO78piWoYOMT9kUQf/T4gkRhgepg3RBiZvOBRYt5doNrpAmVsdf1 u25tP6Q1uEw91Y6Lu9TBXTILNkTszVXLR9dgHFoZuRZsWhdnQD9aMD81gXIHaEgka0Ht x1/rzHg36k2z1LSWmJaMXKiI/2pfNaI9GWaCiGAqA0rr7Wp4frHQaxetVlhApcSFtzD5 VuqQ== X-Gm-Message-State: AO0yUKU9o5EBNQVMmyWdlm1c/E+dBnflKgxhuFUTc+u7iyENM3K9G9nM /t4EqsiKZKqYnjM/J0A7b/M= X-Google-Smtp-Source: AK7set8TT0yyqhpAPCnFp0XWp90qr0x8qc+KBNMbptwHFW5zfgGaJMZHgEClrjS4Zj0bT52FjvmnJg== X-Received: by 2002:a6b:dd04:0:b0:74c:c1ba:91fa with SMTP id f4-20020a6bdd04000000b0074cc1ba91famr4781768ioc.0.1678613592292; Sun, 12 Mar 2023 01:33:12 -0800 (PST) Received: from JOEL-DESKTOP.. ([2604:2d80:4d87:cd00:9f51:32d7:1177:67d]) by smtp.gmail.com with ESMTPSA id r7-20020a6bfc07000000b00716eb44b97esm1585031ioh.27.2023.03.12.01.33.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Mar 2023 01:33:12 -0800 (PST) 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 , Neil Armstrong , Markuss Broks , Jean Delvare , Max Krummenacher , Job Noorman , Alistair Francis , Chris Morgan 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 3/5] arm64: dts: qcom: sdm845-xiaomi-beryllium-common: add touchscreen related nodes Date: Sun, 12 Mar 2023 04:32:47 -0500 Message-Id: <20230312093249.1846993-4-joelselvaraj.oss@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230312093249.1846993-1-joelselvaraj.oss@gmail.com> References: <20230312093249.1846993-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 e0fda4d754fe..ecfd85bde966 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi @@ -270,6 +270,10 @@ &gmu { status = "okay"; }; +&gpi_dma1 { + status = "okay"; +}; + &gpu { status = "okay"; @@ -368,6 +372,10 @@ &qupv3_id_0 { status = "okay"; }; +&qupv3_id_1 { + status = "okay"; +}; + &sdhc_2 { status = "okay"; @@ -473,6 +481,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 Sun Mar 12 09:32:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Selvaraj X-Patchwork-Id: 13171189 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 7E029C6FD1F for ; Sun, 12 Mar 2023 09:33:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229828AbjCLJdZ (ORCPT ); Sun, 12 Mar 2023 05:33:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229752AbjCLJdQ (ORCPT ); Sun, 12 Mar 2023 05:33:16 -0400 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02E8621968; Sun, 12 Mar 2023 01:33:15 -0800 (PST) Received: by mail-io1-xd33.google.com with SMTP id m22so3878585ioy.4; Sun, 12 Mar 2023 01:33:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678613594; 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=gvTfQiKFBDSd/zMX2HWGSslwfM105BMRxBBQeK2kOrA=; b=ayEoh0xkYSoNvrw0GH8ZX5AuVZsRFJYnuCRj0btSWErNXboa63Xo1hK0e+19TFnMtZ SzZh528PwNAp3Z2QwHxtfi+sYcBOS6QBhtaH62ZkziKPLRFmJo/9Iim2Q/c2z0rLaQ3f 8YANTkunQ+JBnVFF2eE6L0uuCjk/Mu2ucBjp2mDuuQkhRRVw/C702zIdzbo3JZa8uGjC htooRB5GVUHsiQM41nu95N+EXXgWU3/m8Z4dbKEB46zVUjX/AI3b2QhUFO+CzEN07caX pLcBG5dfMPXPFTR3AxZAIL1O8b4sm+rm5qW2bZ7geHjpJ3qxYg/Z8ZV6PHCk3zea8dhZ QLlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678613594; 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=gvTfQiKFBDSd/zMX2HWGSslwfM105BMRxBBQeK2kOrA=; b=tsIQ5LjOVWAO00ckF0c3iB/Gj2PHlSdDUBjP9mJxAVLg2+QvCsqGHuKPmaaF4bLv/5 SOrcQiLfNQCCSLlTDrxdWfJuuzRKJj4rCfKBwB1hqT6V3HCHx+kPj+hkQqfJCVXKxIDN JgGuGFXQdb8LEokAtqv2qRtQtFmmIaGgGsxhzK+GBycag1J3F4f3l/Mrr8tySDT9P6F+ UQS+jInYPVqEoQhL8OOy+m7WpKp48mDS2wgdsqEFBdpxfX+UJJvYbV3SF1ZOyQZirg2A IFAldiw7wTXk0/sBOyKEMFd/UhN2s2cHbgKBYlcFWJz2PY9Zt/9uYVuTssO6YOmBCRNp jDVw== X-Gm-Message-State: AO0yUKVnxQSjXHsiDd0lg2GLvmEa8YqqyKcaFnIRfGfuT4/n0OohLWh1 F+UN+z4ETOWjUt91MwFWB6c= X-Google-Smtp-Source: AK7set/ZWn7P3400g15huY8EMBFQuB2wqeKtx8/NdwiOJ4nPeMX0YNehCXK+OH69Oyy2gKAqLEFezQ== X-Received: by 2002:a5d:9297:0:b0:74c:99e8:7f44 with SMTP id s23-20020a5d9297000000b0074c99e87f44mr3985500iom.2.1678613594221; Sun, 12 Mar 2023 01:33:14 -0800 (PST) Received: from JOEL-DESKTOP.. ([2604:2d80:4d87:cd00:9f51:32d7:1177:67d]) by smtp.gmail.com with ESMTPSA id r7-20020a6bfc07000000b00716eb44b97esm1585031ioh.27.2023.03.12.01.33.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Mar 2023 01:33:13 -0800 (PST) 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 , Neil Armstrong , Markuss Broks , Jean Delvare , Max Krummenacher , Job Noorman , Alistair Francis , Chris Morgan 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 4/5] arm64: dts: qcom: sdm845-xiaomi-beryllium-ebbg: introduce support for fts touchscreen Date: Sun, 12 Mar 2023 04:32:48 -0500 Message-Id: <20230312093249.1846993-5-joelselvaraj.oss@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230312093249.1846993-1-joelselvaraj.oss@gmail.com> References: <20230312093249.1846993-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 FTS touchscreen. Introduce support for it. Signed-off-by: Joel Selvaraj --- .../dts/qcom/sdm845-xiaomi-beryllium-ebbg.dts | 27 +++++++++++++++++++ 1 file changed, 27 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..a23be4c8e1bb 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,30 @@ &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: focaltech@38 { + compatible = "focaltech,fts8719"; + reg = <0x38>; + interrupt-parent = <&tlmm>; + interrupts = <31 IRQ_TYPE_EDGE_RISING>; + + 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>; + + reset-gpios = <&tlmm 32 GPIO_ACTIVE_LOW>; + + touchscreen-size-x = <1080>; + touchscreen-size-y = <2246>; + focaltech,max-touch-number = <10>; + }; +}; From patchwork Sun Mar 12 09:32:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Selvaraj X-Patchwork-Id: 13171190 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 AD5F3C7618D for ; Sun, 12 Mar 2023 09:33:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229844AbjCLJd0 (ORCPT ); Sun, 12 Mar 2023 05:33:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229771AbjCLJdR (ORCPT ); Sun, 12 Mar 2023 05:33:17 -0400 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 823CD211CD; Sun, 12 Mar 2023 01:33:16 -0800 (PST) Received: by mail-io1-xd2d.google.com with SMTP id e11so3881689ioe.3; Sun, 12 Mar 2023 01:33:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678613596; 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=Ss/4BRGrhm6+FoNff3JQmV9CH0Y2l6VI22WyegkG0eE=; b=ebv5CX9haG7RLtisEs27/Xrng5w3rG6DoCW5mU9VpNzRiFv/SuITns6TzNO3JzQXFZ vXxfIWd9/AOKCh9coIgP46OexCKUXgzJHXxD8JCrp6whNoM5LwJDsodtrag7bxZmSJHh rn38giC5cHBvgfvqfNHc6+brfAmTIA4o0HZX+7Wmrir4iBcoKv8R4MdxATWE8/Pj58QH zE6VXgjkVbuvJFF1wBxXGckk29UHBvWzD+dEAHwmtndlYHeba7O3XXKCkeg4E5VjRYEo oI7OUKsnwAwxxPQ/VKrnOPpfZznz47o90afU9o69z++ayMjyklufxnraVC5mWTRIJ/ba 8xYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678613596; 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=Ss/4BRGrhm6+FoNff3JQmV9CH0Y2l6VI22WyegkG0eE=; b=05eIXodnpTgmfqrJzCeVMzcX+LfilauTGtPJPmmmz3l+Qq/rsQTiBP+H1Ka9noZh4s mQ6qFCE5+d/ri9tPFAPf1GwNGOSvszWXr0oTE9plBmoNMeRzSN3ryLpNEs6DxTMUzhD6 dAJvuvwgIIifsuPYtwaBTrcd1nlsUMmd6RDc/ECEuBxQg3023OICCscOu9NDiuoL8DAw wzN2M0aqr7TaU2mSsOha0Epq5KmvUZeYz4HOLbkGuzJDAXaG4KOCeb1knnCgr2XiXpW+ tjbUXlCKjiNDADlZnOi2GYeZvuxiMzBAHHGAxkHoiybwPIP8Eva6KLEXKTVX14bjfE5T 7Qjg== X-Gm-Message-State: AO0yUKXJJpyftUpq8LX54U/6lWyUhwaRbaSGAH0X8kyCxRDTZcXXWhD9 V8X4SvL54/39lD3SzI33iEg= X-Google-Smtp-Source: AK7set/rlcOKqPPt3Z9gxDhI4N5FB4sRLhNgYXXTmad6vj1teuCZEyBqpON4PEz6lNDvA2upu/tPTQ== X-Received: by 2002:a6b:b40c:0:b0:74c:83ab:280c with SMTP id d12-20020a6bb40c000000b0074c83ab280cmr4490252iof.1.1678613596151; Sun, 12 Mar 2023 01:33:16 -0800 (PST) Received: from JOEL-DESKTOP.. ([2604:2d80:4d87:cd00:9f51:32d7:1177:67d]) by smtp.gmail.com with ESMTPSA id r7-20020a6bfc07000000b00716eb44b97esm1585031ioh.27.2023.03.12.01.33.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Mar 2023 01:33:15 -0800 (PST) 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 , Neil Armstrong , Markuss Broks , Jean Delvare , Max Krummenacher , Job Noorman , Alistair Francis , Chris Morgan 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 5/5] arm64: dts: qcom: sdm845-shift-axolotl: update focaltech touchscreen properties Date: Sun, 12 Mar 2023 04:32:49 -0500 Message-Id: <20230312093249.1846993-6-joelselvaraj.oss@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230312093249.1846993-1-joelselvaraj.oss@gmail.com> References: <20230312093249.1846993-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 --- .../boot/dts/qcom/sdm845-shift-axolotl.dts | 17 +++++++++-------- 1 file changed, 9 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..39f59ee3612a 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts +++ b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts @@ -473,21 +473,22 @@ zap-shader { &i2c5 { status = "okay"; - touchscreen@38 { - compatible = "focaltech,fts8719"; + touchscreen: focaltech@38 { + 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>; + + 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>; + reset-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>; + touchscreen-size-x = <1080>; touchscreen-size-y = <2160>; focaltech,max-touch-number = <5>;