From nobody Thu Apr 9 11:15:06 2026 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D95DD285050 for ; Mon, 9 Mar 2026 11:01:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773054074; cv=none; b=peHL1jzIM3FAsB+QZiOVF5lct30eJdhTtNXUAQGgrH0y6yKXuyhVKBTuIA2//ywdKp0wyGI9i4WqEnWxYcQpv6ao8ZH+umfF/iHCsf0U1aj9ahB5adtBCK6ElgR+nffmwBlS5+SPUBCOX4ygCEyr7dc5lQGW8uq7XqIEuZ9wHOE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773054074; c=relaxed/simple; bh=L2/qOxKHTQKz7tTe9NevqobBIQclt/atXpIP78HnnLI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ULp79EiuY7veN+7nl4JQnb4MnS0nba2uDkk6YvTuUGaTsbx+Dls65Q2favc+FWgYHH5pi0dn7MRsdxvC1UM94Aw1iCN1LcAjJRbxS+Em3Gv7/FO6wHBikrLIQNFCjRtV6IOKOFn0G0nMGKA2LD/ep1aEO73wovz7oIAxY0+vb74= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CZM8EwBj; arc=none smtp.client-ip=209.85.216.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CZM8EwBj" Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-359866a1d02so7167557a91.0 for ; Mon, 09 Mar 2026 04:01:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773054071; x=1773658871; darn=vger.kernel.org; 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=vdfZbw3s1pisbWO+qyvAF+lK8p/8MUQFjHrM1SRRAD4=; b=CZM8EwBjuXYzMb/pKHsYz6zESqsuMGqyek9eo/kqQEoGdarIYPDJkQL8zeG42vDLeU YAirayWNoIgnbJoHdNfb0yPJNZ2qie3QBuTADlmCz8FT6xPJF6QcIdaeQsmCVNA95dDV qymShDUkDXI1m3SLPWhvc/5Dxv9kBkwVJD+h/hnGKamW+e50SQvcHJ/xysqAnlpY8tdV hpScboRWdKFynu7pYbjhPM3ZicfGYFlQOC0S6gr9xzZqx1Yq082id+OPob8/6hdsNKty d8PfwD761yDkI5YtMxRxAWeFdIXTGQZ40xD56jR9UdD7GkA2diIS0AqRAkSlRL6TVrhW DTTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773054071; x=1773658871; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=vdfZbw3s1pisbWO+qyvAF+lK8p/8MUQFjHrM1SRRAD4=; b=pH+WA+a8otLZcW9siKfPPIsbOuRKIHMW+aeudVs1t4Kzh7fA4p3OzGPYYCZbADCQsV 3/UAKgUELLt1zR0v617rfsc1d0UgzJIFsyK/b11HVmko5sSyDfyTrhuNwuNK2OQrLuG9 TN/Ec5Zd5+v+xlTQM7d9n7GRCvSqCJlj6mjnKtV0WlEIvVtqQYF4D6miX3TGFDY5w/9p xAmkPy5DBiKPNfca3FFrE4kd6JWQetHTZly27dRdE2bF6tr38g6na7hG/CFUwDqHiE1G Po55Tw/HIgpHmyGWHHA9kTDvGDdD/BU3S2zobCi5QYSZurjaOO7hc4J2Nrd0TeIVlibF 3LwQ== X-Forwarded-Encrypted: i=1; AJvYcCUX5b6J2+CsKsCFao4NA0s7OL7+sAh0ZBzrL10N2lWG+2RMIZ6+9jIbcN+7JgaQnbN/G7SVk1oYjr3QK+w=@vger.kernel.org X-Gm-Message-State: AOJu0Yx6cSW/HJXSVVLlOQwggLQ4bM05KkiyU4nNtLHZUW9JIPDjYOYB zJx2OQTdKtxJQtJ6wjm96xz0N5+F96XL+a/sXtodTr1kKL+KQiLr+e8U X-Gm-Gg: ATEYQzw5FLjMkSj0hn/OyZViyp0trvINoodESfbfHP1/ez5SDV5MdAlPnXo8iP6Rq5o rjxoLn6rCrz0WKfmxVoJq5++YIvBttcmCEa1IitGFa9izla4oZJ0VvPUe/K1Fsf3IcypqPu7pRV NifybWeb5UDfX3dKbSYlpiCKk6jYsWA/fZeAxPxPxk8dartQPfzKY/oguVpLlNdSKjwzPrhZ0Vf Ql8vzn7OVGTVKfNnuhOCthCy3KLosoBd25nZGzuy9vv5xjdElKOiVGc9DKz/6xqWzR5VIrMAIUP fS9X7EZgshqX7ukOC085yrjvXqZzKSjH1Z0TOM2wvnCYV75SQqrq6ZT7Zrg8ywIp6k2sEcFoiho CjQso3D9+moXyA372D5KjSWk8bgjnGxduK//y1vKQNJzlbbfRV85E6e/R9Zd2bDoeaLFfCUfAbb PaoTZxjWsTYlpmFwC8XRtOrZQFyGAz6cHkkaceA1mzPGHwLNPdPretW8giUw== X-Received: by 2002:a17:90b:2891:b0:359:8ed3:8a65 with SMTP id 98e67ed59e1d1-359be349690mr9632532a91.34.1773054071032; Mon, 09 Mar 2026 04:01:11 -0700 (PDT) Received: from phuc-desktop.. ([183.91.15.56]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-359bff279f4sm13268296a91.0.2026.03.09.04.01.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2026 04:01:10 -0700 (PDT) From: phucduc.bui@gmail.com To: Dmitry Torokhov , Rob Herring Cc: Krzysztof Kozlowski , Conor Dooley , Ingo Molnar , Thomas Gleixner , Marek Vasut , Michael Welling , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, phucduc.bui@gmail.com Subject: [PATCH 1/2] dt-bindings: input: touchscreen: ti,tsc2005: Add wakeup-source Date: Mon, 9 Mar 2026 18:00:43 +0700 Message-ID: <20260309110045.108209-2-phucduc.bui@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260309110045.108209-1-phucduc.bui@gmail.com> References: <20260309110045.108209-1-phucduc.bui@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: bui duc phuc The tsc200x driver uses the "wakeup-source" device tree property to determine whether the device should be configured as a system wakeup source. In the driver, this property is read with: device_init_wakeup(dev, device_property_read_bool(dev, "wakeup-source")); Document this property in the binding to make it visible to DT schema validation tools and to clarify its usage in device tree descriptions. Signed-off-by: bui duc phuc --- .../devicetree/bindings/input/touchscreen/ti,tsc2005.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/input/touchscreen/ti,tsc2005= .yaml b/Documentation/devicetree/bindings/input/touchscreen/ti,tsc2005.yaml index 7187c390b2f5..c0aae044d7d4 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/ti,tsc2005.yaml +++ b/Documentation/devicetree/bindings/input/touchscreen/ti,tsc2005.yaml @@ -55,6 +55,9 @@ properties: touchscreen-size-x: true touchscreen-size-y: true =20 + wakeup-source: + type: boolean + allOf: - $ref: touchscreen.yaml# - if: @@ -97,6 +100,8 @@ examples: =20 ti,x-plate-ohms =3D <280>; ti,esd-recovery-timeout-ms =3D <8000>; + + wakeup-source; }; }; - | @@ -124,5 +129,7 @@ examples: =20 ti,x-plate-ohms =3D <280>; ti,esd-recovery-timeout-ms =3D <8000>; + + wakeup-source; }; }; --=20 2.43.0 From nobody Thu Apr 9 11:15:06 2026 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 84DF8394488 for ; Mon, 9 Mar 2026 11:01:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773054081; cv=none; b=CfoWCafsu0MtIrMo5V28o7b5zml94cbqmGTpXAUUkc8MF3jw1gvIepMSOI5SwSU7KMlyTYTuX9TP7+icaBqYervOaYzLBG7sbVB+8lcMKoIj991U8/TBOdOo97kGzw8SZtE3KZLVFNMGTC61zAqHbWy6MO+5b+kKgu7dt2IlDLg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773054081; c=relaxed/simple; bh=M4dFRmrmPmhqXhKhFaGDOffAf2JzsWF1o/D8Jy2z8eM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=flXzYkEDjjMA3rzfPV9q6cYwOJVvdioig1EmZjrUWykXBiHUE5vfAXy6msR22i1M4yhe5RvCSyC4Ch/ePfLgWC9XRZwnHDPzRo0wEnEDFjnYf7itNmH2QExDfw/XAww5wPDjQRS7WRY0LsgX2mOWRX0ViSlFVQS/1UfarBDbi14= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Z8LdREfO; arc=none smtp.client-ip=209.85.216.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Z8LdREfO" Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-3598df39444so5004736a91.2 for ; Mon, 09 Mar 2026 04:01:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773054079; x=1773658879; darn=vger.kernel.org; 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=nrsLA8b8vlkhz1DvrsNbbbbTjquCC3GRn0AkHrSsHTM=; b=Z8LdREfOIQ7Zk9G2Z2hCU1DMEfz0JH9wIu4bWu7USPc8NAeDUiZ0loQBN+aWCVmfH9 Sx9KSS6Y6gDWjMaVKkXTuHI7Vpt/51CEqcb/VByD5DvDMC5AXTu/sOqisKyRraPqYhMq InyE+fxwYCD5ORBmt7lP7n40ZrypjL0mtnSGiNe47hf5BlX3I1lSXhV1z5aN8AfymWi8 8c5191PYvkVaoT65+raydbVsMZacXLon4fxHvSjUQSCPNvW8eJQRdELk5AF0yVMd2caV JVYNh1uCjNeIeHrrCPE9PiuO5Zo77gkoP4ZeWWxW2c8Mg1OebJLxiqPoRAUnqRe3+QbU bQ8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773054079; x=1773658879; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=nrsLA8b8vlkhz1DvrsNbbbbTjquCC3GRn0AkHrSsHTM=; b=gqiVrUwHwSspS7+DO8s9epGaAZe8eccdkrUObW5sfOOlXIoAhtxKU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:b0:359:87ff:f352 with SMTP id 98e67ed59e1d1-359be250d8emr9942768a91.8.1773054076002; Mon, 09 Mar 2026 04:01:16 -0700 (PDT) Received: from phuc-desktop.. ([183.91.15.56]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-359bff279f4sm13268296a91.0.2026.03.09.04.01.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2026 04:01:15 -0700 (PDT) From: phucduc.bui@gmail.com To: Dmitry Torokhov , Rob Herring Cc: Krzysztof Kozlowski , Conor Dooley , Ingo Molnar , Thomas Gleixner , Marek Vasut , Michael Welling , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, phucduc.bui@gmail.com Subject: [PATCH 2/2] Input: Touchscreen: tsc200x - delegate wakeup IRQ management to I2C core Date: Mon, 9 Mar 2026 18:00:44 +0700 Message-ID: <20260309110045.108209-3-phucduc.bui@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260309110045.108209-1-phucduc.bui@gmail.com> References: <20260309110045.108209-1-phucduc.bui@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: bui duc phuc The tsc200x driver supports both I2C (tsc2004) and SPI (tsc2005) interfaces. Currently, the driver attempts to manually manage the wakeup interrupt by calling enable_irq_wake() and disable_irq_wake() during suspend and resume. However, for I2C devices, the I2C core already automatically handles the wakeup source initialization and IRQ management if the "wakeup-source" property is present in the device tree. Manually managing it again in the driver is redundant and can lead to unbalanced IRQ wake reference counts. Clean up the wakeup IRQ handling by checking the bus type: - For I2C (BUS_I2C): Rely entirely on the I2C core for wakeup management. - For SPI (BUS_SPI): Explicitly call device_init_wakeup() in probe and manually manage enable/disable_irq_wake() during suspend/resume. The ts->wake_irq_enabled flag is also updated accordingly to ensure the driver accurately tracks the wakeup state across both buses. Note: This patch is based on code analysis of the I2C subsystem and has not been verified on actual hardware yet. Signed-off-by: bui duc phuc --- drivers/input/touchscreen/tsc200x-core.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/input/touchscreen/tsc200x-core.c b/drivers/input/touch= screen/tsc200x-core.c index eba53613b005..d14d967845c8 100644 --- a/drivers/input/touchscreen/tsc200x-core.c +++ b/drivers/input/touchscreen/tsc200x-core.c @@ -465,6 +465,7 @@ int tsc200x_probe(struct device *dev, int irq, const st= ruct input_id *tsc_id, ts->idev =3D input_dev; ts->regmap =3D regmap; ts->tsc200x_cmd =3D tsc200x_cmd; + ts->bustype =3D tsc_id->bustype; =20 error =3D device_property_read_u32(dev, "ti,x-plate-ohms", &x_plate_ohm); ts->x_plate_ohm =3D error ? TSC200X_DEF_RESISTOR : x_plate_ohm; @@ -547,8 +548,9 @@ int tsc200x_probe(struct device *dev, int irq, const st= ruct input_id *tsc_id, return error; } =20 - device_init_wakeup(dev, - device_property_read_bool(dev, "wakeup-source")); + if (ts->bustype =3D=3D BUS_SPI) + device_init_wakeup(dev, + device_property_read_bool(dev, "wakeup-source")); =20 return 0; } @@ -565,8 +567,13 @@ static int tsc200x_suspend(struct device *dev) =20 ts->suspended =3D true; =20 - if (device_may_wakeup(dev)) - ts->wake_irq_enabled =3D enable_irq_wake(ts->irq) =3D=3D 0; + if (device_may_wakeup(dev)) { + if (ts->bustype =3D=3D BUS_SPI) + ts->wake_irq_enabled =3D enable_irq_wake(ts->irq) =3D=3D 0; + else + ts->wake_irq_enabled =3D true; + } else + ts->wake_irq_enabled =3D false; =20 return 0; } @@ -578,7 +585,8 @@ static int tsc200x_resume(struct device *dev) guard(mutex)(&ts->mutex); =20 if (ts->wake_irq_enabled) { - disable_irq_wake(ts->irq); + if (ts->bustype =3D=3D BUS_SPI) + disable_irq_wake(ts->irq); ts->wake_irq_enabled =3D false; } =20 --=20 2.43.0