* [PATCH 0/3] powerpc: 512x: Convert ADS7845 touchscreen on PDM360NG to device tree
@ 2026-07-19 5:22 Dmitry Torokhov
2026-07-19 5:22 ` [PATCH 1/3] powerpc/dts: mpc5121: Move GPIO controller properties to SoC dtsi Dmitry Torokhov
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Dmitry Torokhov @ 2026-07-19 5:22 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP), Anatolij Gustschin
Cc: devicetree, linuxppc-dev, linux-kernel
The reason for this series is to remove support for platform data in the
ads7846 touchscreen driver, as pdm360ng is the last user of legacy
platform data in the kernel for this driver.
This series converts the ADS7845 touchscreen on the PDM360NG board to
use Device Tree bindings instead of legacy platform data callbacks:
- Move GPIO controller capabilities into mpc5121.dtsi so all MPC5121
boards inherit proper controller definitions, and remove redundant
local declarations from ac14xx.dts
- Update pdm360ng.dts to use "ti,ads7845" with pendown-gpio and
interrupt-parent referencing gpio_pic
- Add "ifm,pdm360ng" to mpc512x_generic.c and delete obsolete
pdm360ng.c.
This change has been discussed in '24i but I just got around to
implementing this:
https://lore.kernel.org/r/ZoNHLjmSvCN12vU5@google.com/
Note that this should compile but I have not tried this on real
hardware.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
Dmitry Torokhov (3):
powerpc/dts: mpc5121: Move GPIO controller properties to SoC dtsi
powerpc/dts: pdm360ng: Convert ADS7845 touchscreen to DT bindings
powerpc/512x: Remove pdm360ng platform setup in favor of mpc512x_generic
arch/powerpc/boot/dts/ac14xx.dts | 13 ---
arch/powerpc/boot/dts/mpc5121.dtsi | 6 +-
arch/powerpc/boot/dts/pdm360ng.dts | 7 +-
arch/powerpc/platforms/512x/Kconfig | 3 +-
arch/powerpc/platforms/512x/Makefile | 1 -
arch/powerpc/platforms/512x/mpc512x_generic.c | 1 +
arch/powerpc/platforms/512x/pdm360ng.c | 126 --------------------------
7 files changed, 12 insertions(+), 145 deletions(-)
---
base-commit: 8e9685d3c41c35dd1b37df70d854137abcb2fbac
change-id: 20260717-ads7846-pdm360ng-ec7ed9f72f82
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 1/3] powerpc/dts: mpc5121: Move GPIO controller properties to SoC dtsi 2026-07-19 5:22 [PATCH 0/3] powerpc: 512x: Convert ADS7845 touchscreen on PDM360NG to device tree Dmitry Torokhov @ 2026-07-19 5:22 ` Dmitry Torokhov 2026-07-19 5:34 ` sashiko-bot 2026-07-19 5:22 ` [PATCH 2/3] powerpc/dts: pdm360ng: Convert ADS7845 touchscreen to DT bindings Dmitry Torokhov 2026-07-19 5:22 ` [PATCH 3/3] powerpc/512x: Remove pdm360ng platform setup in favor of mpc512x_generic Dmitry Torokhov 2 siblings, 1 reply; 7+ messages in thread From: Dmitry Torokhov @ 2026-07-19 5:22 UTC (permalink / raw) To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP), Anatolij Gustschin Cc: devicetree, linuxppc-dev, linux-kernel Define gpio@1100 with label gpio_pic as a GPIO controller and interrupt controller directly in mpc5121.dtsi so all MPC5121 boards inherit the correct controller capabilities. Remove the redundant local controller property declaration block from ac14xx.dts. Assisted-by: Antigravity:gemini-3.5-flash Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> --- arch/powerpc/boot/dts/ac14xx.dts | 13 ------------- arch/powerpc/boot/dts/mpc5121.dtsi | 6 +++++- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/arch/powerpc/boot/dts/ac14xx.dts b/arch/powerpc/boot/dts/ac14xx.dts index 5d8877e1f4ad..05fcf08df1ca 100644 --- a/arch/powerpc/boot/dts/ac14xx.dts +++ b/arch/powerpc/boot/dts/ac14xx.dts @@ -148,19 +148,6 @@ clock@f00 { compatible = "fsl,mpc5121rev2-clock", "fsl,mpc5121-clock"; }; - /* - * GPIO PIC: - * interrupts cell = <pin nr, sense> - * sense == 8: Level, low assertion - * sense == 2: Edge, high-to-low change - */ - gpio_pic: gpio@1100 { - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - }; - sdhc@1500 { cd-gpios = <&gpio_pic 23 0>; /* card detect */ wp-gpios = <&gpio_pic 24 0>; /* write protect */ diff --git a/arch/powerpc/boot/dts/mpc5121.dtsi b/arch/powerpc/boot/dts/mpc5121.dtsi index a278fb7b9e71..9c5dacb94b92 100644 --- a/arch/powerpc/boot/dts/mpc5121.dtsi +++ b/arch/powerpc/boot/dts/mpc5121.dtsi @@ -146,10 +146,14 @@ pmc@1000 { interrupts = <83 0x8>; }; - gpio@1100 { + gpio_pic: gpio@1100 { compatible = "fsl,mpc5121-gpio"; reg = <0x1100 0x100>; interrupts = <78 0x8>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; }; can@1300 { -- 2.55.0.229.g6434b31f56-goog ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] powerpc/dts: mpc5121: Move GPIO controller properties to SoC dtsi 2026-07-19 5:22 ` [PATCH 1/3] powerpc/dts: mpc5121: Move GPIO controller properties to SoC dtsi Dmitry Torokhov @ 2026-07-19 5:34 ` sashiko-bot 0 siblings, 0 replies; 7+ messages in thread From: sashiko-bot @ 2026-07-19 5:34 UTC (permalink / raw) To: Dmitry Torokhov; +Cc: robh, conor+dt, devicetree Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: Pre-existing issues: - [High] The ads7846 touchscreen driver and gpio-mpc8xxx driver both claim IPIC IRQ 78, leading to an IRQ request conflict and masked interrupts. -- --- Patch [1]: [PATCH 1/3] powerpc/dts: mpc5121: Move GPIO controller properties to SoC dtsi --- commit 9f0c3f1fd5a726a9eddf4e07512d2ccf88203d01 Author: Dmitry Torokhov <dmitry.torokhov@gmail.com> powerpc/dts: mpc5121: Move GPIO controller properties to SoC dtsi Define gpio@1100 with label gpio_pic as a GPIO controller and interrupt controller directly in mpc5121.dtsi so all MPC5121 boards inherit the correct controller capabilities. > diff --git a/arch/powerpc/boot/dts/mpc5121.dtsi b/arch/powerpc/boot/dts/mpc5121.dtsi > index a278fb7b9e711..9c5dacb94b924 100644 > --- a/arch/powerpc/boot/dts/mpc5121.dtsi > +++ b/arch/powerpc/boot/dts/mpc5121.dtsi [ ... ] > @@ -146,10 +146,14 @@ pmc@1000 { > interrupts = <83 0x8>; > }; > > - gpio@1100 { > + gpio_pic: gpio@1100 { > compatible = "fsl,mpc5121-gpio"; > reg = <0x1100 0x100>; > interrupts = <78 0x8>; > + gpio-controller; > + #gpio-cells = <2>; > + interrupt-controller; > + #interrupt-cells = <2>; [Severity: High] This is a pre-existing issue, but does centralizing this interrupt controller declaration leave an unresolved IRQ request conflict on the pdm360ng board? In arch/powerpc/boot/dts/pdm360ng.dts, the touchscreen node directly claims IPIC IRQ 78 instead of routing through the GPIO controller: ts@0 { ... interrupts = <78 0x8>; }; Additionally, in arch/powerpc/platforms/512x/pdm360ng.c, pdm360ng_penirq_init() directly manipulates the GPIO controller's IMR register: setbits32(pdm360ng_gpio_base + 0x10, 0x40); When both the ads7846 touchscreen driver and gpio-mpc8xxx driver try to claim IRQ 78, could the request fail with -EBUSY? Even if they could share the IRQ, the gpio-mpc8xxx driver clears the GPIO IMR register on probe, which would silently overwrite the earlier setup done by pdm360ng_penirq_init() and mask the touchscreen's interrupt. Could this cause a permanent loss of touch input on boot for the pdm360ng when both drivers are enabled? > }; > > can@1300 { -- Sashiko AI review · https://sashiko.dev/#/patchset/20260718-ads7846-pdm360ng-v1-0-f318f85cda57@gmail.com?part=1 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] powerpc/dts: pdm360ng: Convert ADS7845 touchscreen to DT bindings 2026-07-19 5:22 [PATCH 0/3] powerpc: 512x: Convert ADS7845 touchscreen on PDM360NG to device tree Dmitry Torokhov 2026-07-19 5:22 ` [PATCH 1/3] powerpc/dts: mpc5121: Move GPIO controller properties to SoC dtsi Dmitry Torokhov @ 2026-07-19 5:22 ` Dmitry Torokhov 2026-07-19 5:35 ` sashiko-bot 2026-07-19 5:22 ` [PATCH 3/3] powerpc/512x: Remove pdm360ng platform setup in favor of mpc512x_generic Dmitry Torokhov 2 siblings, 1 reply; 7+ messages in thread From: Dmitry Torokhov @ 2026-07-19 5:22 UTC (permalink / raw) To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP), Anatolij Gustschin Cc: devicetree, linuxppc-dev, linux-kernel The PDM360NG board is equipped with an ADS7845 touchscreen controller. Previously, pdm360ng.dts used "ti,ads7846" as a placeholder and relied on platform data in pdm360ng.c to override the model to 7845. Update the ts@0 touchscreen node in pdm360ng.dts to use the correct "ti,ads7845" compatible string along with pendown-gpio and interrupt-parent properties referencing gpio_pic. Assisted-by: Antigravity:gemini-3.5-flash Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> --- arch/powerpc/boot/dts/pdm360ng.dts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/boot/dts/pdm360ng.dts b/arch/powerpc/boot/dts/pdm360ng.dts index 67c3b9db75d7..69d8b6a0241c 100644 --- a/arch/powerpc/boot/dts/pdm360ng.dts +++ b/arch/powerpc/boot/dts/pdm360ng.dts @@ -176,11 +176,12 @@ psc@11900 { /* ADS7845 touch screen controller */ ts@0 { - compatible = "ti,ads7846"; + compatible = "ti,ads7845"; reg = <0x0>; spi-max-frequency = <3000000>; - /* pen irq is GPIO25 */ - interrupts = <78 0x8>; + interrupt-parent = <&gpio_pic>; + interrupts = <25 0x8>; + pendown-gpio = <&gpio_pic 25 0>; }; }; -- 2.55.0.229.g6434b31f56-goog ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] powerpc/dts: pdm360ng: Convert ADS7845 touchscreen to DT bindings 2026-07-19 5:22 ` [PATCH 2/3] powerpc/dts: pdm360ng: Convert ADS7845 touchscreen to DT bindings Dmitry Torokhov @ 2026-07-19 5:35 ` sashiko-bot 0 siblings, 0 replies; 7+ messages in thread From: sashiko-bot @ 2026-07-19 5:35 UTC (permalink / raw) To: Dmitry Torokhov; +Cc: devicetree, robh, conor+dt Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] The `pendown-gpio` property is configured with active-high polarity instead of active-low, which breaks touchscreen input and causes an interrupt storm. - [High] Legacy platform data and raw initialization code for the touchscreen were not removed, leaving dead code and conflicting hardware initialization. -- --- Patch [2]: [PATCH 2/3] powerpc/dts: pdm360ng: Convert ADS7845 touchscreen to DT bindings --- commit 1e38d4980520e39bd3a703aa35c53c86099afebb Author: Dmitry Torokhov <dmitry.torokhov@gmail.com> powerpc/dts: pdm360ng: Convert ADS7845 touchscreen to DT bindings The PDM360NG board is equipped with an ADS7845 touchscreen controller. Previously, pdm360ng.dts used "ti,ads7846" as a placeholder and relied on platform data in pdm360ng.c to override the model to 7845. Update the ts@0 touchscreen node in pdm360ng.dts to use the correct "ti,ads7845" compatible string along with pendown-gpio and interrupt-parent properties referencing gpio_pic. > diff --git a/arch/powerpc/boot/dts/pdm360ng.dts b/arch/powerpc/boot/dts/pdm360ng.dts > index 67c3b9db75d76..69d8b6a0241cb 100644 > --- a/arch/powerpc/boot/dts/pdm360ng.dts > +++ b/arch/powerpc/boot/dts/pdm360ng.dts > @@ -176,11 +176,12 @@ psc@11900 { > > /* ADS7845 touch screen controller */ > ts@0 { > - compatible = "ti,ads7846"; > + compatible = "ti,ads7845"; [Severity: High] Will updating the compatible string here leave conflicting legacy initialization active in arch/powerpc/platforms/512x/pdm360ng.c? Since pdm360ng_touchscreen_notifier_call() checks for "ti,ads7846", this change will cause the notifier to silently fail, abandoning the platform data injection and leaving it as dead code. Additionally, pdm360ng_penirq_init() still executes unconditionally on boot, performing uncoordinated direct memory writes to configure the GPIO controller interrupt. Since the touchscreen is now natively bound to the GPIO subsystem via DT, will this raw memory manipulation conflict with the subsystem's state? > reg = <0x0>; > spi-max-frequency = <3000000>; > - /* pen irq is GPIO25 */ > - interrupts = <78 0x8>; > + interrupt-parent = <&gpio_pic>; > + interrupts = <25 0x8>; > + pendown-gpio = <&gpio_pic 25 0>; [Severity: High] Is this pendown-gpio configuration expected to use the GPIO_ACTIVE_HIGH flag (0)? The interrupts property correctly defines a level-low trigger (0x8), but the pendown-gpio property uses 0. When the pen is down, the driver's gpiod_get_value() in get_pendown_state() reads the physical 0 and returns a logical 0. This signals to ads7846_irq() that the pen is up, aborting without executing the SPI sequence needed to clear the hardware interrupt. Because the interrupt is level-triggered and never cleared, it fires continuously. Should this use GPIO_ACTIVE_LOW (1) instead to prevent an interrupt storm? > }; > }; -- Sashiko AI review · https://sashiko.dev/#/patchset/20260718-ads7846-pdm360ng-v1-0-f318f85cda57@gmail.com?part=2 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] powerpc/512x: Remove pdm360ng platform setup in favor of mpc512x_generic 2026-07-19 5:22 [PATCH 0/3] powerpc: 512x: Convert ADS7845 touchscreen on PDM360NG to device tree Dmitry Torokhov 2026-07-19 5:22 ` [PATCH 1/3] powerpc/dts: mpc5121: Move GPIO controller properties to SoC dtsi Dmitry Torokhov 2026-07-19 5:22 ` [PATCH 2/3] powerpc/dts: pdm360ng: Convert ADS7845 touchscreen to DT bindings Dmitry Torokhov @ 2026-07-19 5:22 ` Dmitry Torokhov 2026-07-19 5:33 ` sashiko-bot 2 siblings, 1 reply; 7+ messages in thread From: Dmitry Torokhov @ 2026-07-19 5:22 UTC (permalink / raw) To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP), Anatolij Gustschin Cc: devicetree, linuxppc-dev, linux-kernel Now that the ADS7845 touchscreen on PDM360NG is fully described in the device tree, custom platform setup in pdm360ng.c is no longer needed. Add ifm,pdm360ng to the board match list in mpc512x_generic.c, update Kconfig to select MPC512x_GENERIC for PDM360NG, and remove pdm360ng.c. Assisted-by: Antigravity:gemini-3.5-flash Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> --- arch/powerpc/platforms/512x/Kconfig | 3 +- arch/powerpc/platforms/512x/Makefile | 1 - arch/powerpc/platforms/512x/mpc512x_generic.c | 1 + arch/powerpc/platforms/512x/pdm360ng.c | 126 -------------------------- 4 files changed, 3 insertions(+), 128 deletions(-) diff --git a/arch/powerpc/platforms/512x/Kconfig b/arch/powerpc/platforms/512x/Kconfig index deecede78776..9d46d791af05 100644 --- a/arch/powerpc/platforms/512x/Kconfig +++ b/arch/powerpc/platforms/512x/Kconfig @@ -32,11 +32,12 @@ config MPC512x_GENERIC which do not need custom platform specific setup. Compatible boards include: Protonic LVT base boards (ZANMCU - and VICVT2), Freescale MPC5125 Tower system. + and VICVT2), Freescale MPC5125 Tower system, IFM PDM360NG. config PDM360NG bool "ifm PDM360NG board" depends on PPC_MPC512x + select MPC512x_GENERIC select DEFAULT_UIMAGE help This option enables support for the PDM360NG board. diff --git a/arch/powerpc/platforms/512x/Makefile b/arch/powerpc/platforms/512x/Makefile index 2daf22ee26a0..4da6f6923d8f 100644 --- a/arch/powerpc/platforms/512x/Makefile +++ b/arch/powerpc/platforms/512x/Makefile @@ -7,4 +7,3 @@ obj-y += mpc512x_shared.o obj-$(CONFIG_MPC5121_ADS) += mpc5121_ads.o mpc5121_ads_cpld.o obj-$(CONFIG_MPC512x_GENERIC) += mpc512x_generic.o obj-$(CONFIG_MPC512x_LPBFIFO) += mpc512x_lpbfifo.o -obj-$(CONFIG_PDM360NG) += pdm360ng.o diff --git a/arch/powerpc/platforms/512x/mpc512x_generic.c b/arch/powerpc/platforms/512x/mpc512x_generic.c index d4fa6c302ccf..d330d3d85887 100644 --- a/arch/powerpc/platforms/512x/mpc512x_generic.c +++ b/arch/powerpc/platforms/512x/mpc512x_generic.c @@ -24,6 +24,7 @@ static const char * const board[] __initconst = { "prt,prtlvt", "fsl,mpc5125ads", "ifm,ac14xx", + "ifm,pdm360ng", NULL }; diff --git a/arch/powerpc/platforms/512x/pdm360ng.c b/arch/powerpc/platforms/512x/pdm360ng.c deleted file mode 100644 index 8bbbf78bb42b..000000000000 --- a/arch/powerpc/platforms/512x/pdm360ng.c +++ /dev/null @@ -1,126 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (C) 2010 DENX Software Engineering - * - * Anatolij Gustschin, <agust@denx.de> - * - * PDM360NG board setup - */ - -#include <linux/device.h> -#include <linux/kernel.h> -#include <linux/io.h> -#include <linux/of.h> -#include <linux/of_address.h> -#include <linux/of_fdt.h> - -#include <asm/machdep.h> -#include <asm/ipic.h> - -#include "mpc512x.h" - -#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ - defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) -#include <linux/interrupt.h> -#include <linux/spi/ads7846.h> -#include <linux/spi/spi.h> -#include <linux/notifier.h> - -static void *pdm360ng_gpio_base; - -static int pdm360ng_get_pendown_state(void) -{ - u32 reg; - - reg = in_be32(pdm360ng_gpio_base + 0xc); - if (reg & 0x40) - setbits32(pdm360ng_gpio_base + 0xc, 0x40); - - reg = in_be32(pdm360ng_gpio_base + 0x8); - - /* return 1 if pen is down */ - return (reg & 0x40) == 0; -} - -static struct ads7846_platform_data pdm360ng_ads7846_pdata = { - .model = 7845, - .get_pendown_state = pdm360ng_get_pendown_state, - .irq_flags = IRQF_TRIGGER_LOW, -}; - -static int __init pdm360ng_penirq_init(void) -{ - struct device_node *np; - - np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-gpio"); - if (!np) { - pr_err("%s: Can't find 'mpc5121-gpio' node\n", __func__); - return -ENODEV; - } - - pdm360ng_gpio_base = of_iomap(np, 0); - of_node_put(np); - if (!pdm360ng_gpio_base) { - pr_err("%s: Can't map gpio regs.\n", __func__); - return -ENODEV; - } - out_be32(pdm360ng_gpio_base + 0xc, 0xffffffff); - setbits32(pdm360ng_gpio_base + 0x18, 0x2000); - setbits32(pdm360ng_gpio_base + 0x10, 0x40); - - return 0; -} - -static int pdm360ng_touchscreen_notifier_call(struct notifier_block *nb, - unsigned long event, void *__dev) -{ - struct device *dev = __dev; - - if ((event == BUS_NOTIFY_ADD_DEVICE) && - of_device_is_compatible(dev->of_node, "ti,ads7846")) { - dev->platform_data = &pdm360ng_ads7846_pdata; - return NOTIFY_OK; - } - return NOTIFY_DONE; -} - -static struct notifier_block pdm360ng_touchscreen_nb = { - .notifier_call = pdm360ng_touchscreen_notifier_call, -}; - -static void __init pdm360ng_touchscreen_init(void) -{ - if (pdm360ng_penirq_init()) - return; - - bus_register_notifier(&spi_bus_type, &pdm360ng_touchscreen_nb); -} -#else -static inline void __init pdm360ng_touchscreen_init(void) -{ -} -#endif /* CONFIG_TOUCHSCREEN_ADS7846 */ - -static void __init pdm360ng_init(void) -{ - mpc512x_init(); - pdm360ng_touchscreen_init(); -} - -static int __init pdm360ng_probe(void) -{ - mpc512x_init_early(); - - return 1; -} - -define_machine(pdm360ng) { - .name = "PDM360NG", - .compatible = "ifm,pdm360ng", - .probe = pdm360ng_probe, - .setup_arch = mpc512x_setup_arch, - .init = pdm360ng_init, - .init_IRQ = mpc512x_init_IRQ, - .get_irq = ipic_get_irq, - .restart = mpc512x_restart, -}; -- 2.55.0.229.g6434b31f56-goog ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] powerpc/512x: Remove pdm360ng platform setup in favor of mpc512x_generic 2026-07-19 5:22 ` [PATCH 3/3] powerpc/512x: Remove pdm360ng platform setup in favor of mpc512x_generic Dmitry Torokhov @ 2026-07-19 5:33 ` sashiko-bot 0 siblings, 0 replies; 7+ messages in thread From: sashiko-bot @ 2026-07-19 5:33 UTC (permalink / raw) To: Dmitry Torokhov; +Cc: conor+dt, robh, devicetree Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] Removing the custom `get_pendown_state` hook exposes an incorrect active-high polarity in the device tree, breaking the touchscreen. -- --- Patch [3]: [PATCH 3/3] powerpc/512x: Remove pdm360ng platform setup in favor of mpc512x_generic --- commit 9b77e36fa4d0feb9318830af9ed4e14fde12adec Author: Dmitry Torokhov <dmitry.torokhov@gmail.com> Subject: powerpc/512x: Remove pdm360ng platform setup in favor of mpc512x_generic This commit removes the custom platform setup file pdm360ng.c for the PDM360NG board, stating that its ADS7845 touchscreen is now fully described in the device tree. It also adds the board to the mpc512x_generic match list and updates Kconfig to remove the specific board file. > diff --git a/arch/powerpc/platforms/512x/pdm360ng.c b/arch/powerpc/platforms/512x/pdm360ng.c > deleted file mode 100644 > index 8bbbf78bb42bd..0000000000000 > --- a/arch/powerpc/platforms/512x/pdm360ng.c > +++ /dev/null > @@ -1,126 +0,0 @@ [ ... ] > -static int pdm360ng_get_pendown_state(void) > -{ > - u32 reg; > - > - reg = in_be32(pdm360ng_gpio_base + 0xc); > - if (reg & 0x40) > - setbits32(pdm360ng_gpio_base + 0xc, 0x40); > - > - reg = in_be32(pdm360ng_gpio_base + 0x8); > - > - /* return 1 if pen is down */ > - return (reg & 0x40) == 0; > -} [Severity: High] Will removing this custom pendown handler break the touchscreen due to an incorrect polarity specified in the device tree? The custom pdm360ng_get_pendown_state() function returned 1 when the pen was down, properly inverting the active-low hardware signal: return (reg & 0x40) == 0; With this custom code removed, the ads7846 driver falls back to using the pendown-gpio property defined in arch/powerpc/boot/dts/pdm360ng.dts: pendown-gpio = <&gpio_pic 25 0>; Since this property specifies 0 (GPIO_ACTIVE_HIGH) instead of active-low, gpiod_get_value() will return 0 when the pin is physically low. This causes ads7846_hard_irq() to incorrectly interpret the pen as being UP and return IRQ_HANDLED instead of waking the thread, effectively dropping all touch events. -- Sashiko AI review · https://sashiko.dev/#/patchset/20260718-ads7846-pdm360ng-v1-0-f318f85cda57@gmail.com?part=3 ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-07-19 5:35 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-07-19 5:22 [PATCH 0/3] powerpc: 512x: Convert ADS7845 touchscreen on PDM360NG to device tree Dmitry Torokhov 2026-07-19 5:22 ` [PATCH 1/3] powerpc/dts: mpc5121: Move GPIO controller properties to SoC dtsi Dmitry Torokhov 2026-07-19 5:34 ` sashiko-bot 2026-07-19 5:22 ` [PATCH 2/3] powerpc/dts: pdm360ng: Convert ADS7845 touchscreen to DT bindings Dmitry Torokhov 2026-07-19 5:35 ` sashiko-bot 2026-07-19 5:22 ` [PATCH 3/3] powerpc/512x: Remove pdm360ng platform setup in favor of mpc512x_generic Dmitry Torokhov 2026-07-19 5:33 ` sashiko-bot
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox