Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 3/3] powerpc/512x: Remove pdm360ng platform setup in favor of mpc512x_generic
Date: Sun, 19 Jul 2026 05:33:49 +0000	[thread overview]
Message-ID: <20260719053349.8007F1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260718-ads7846-pdm360ng-v1-3-f318f85cda57@gmail.com>

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

      reply	other threads:[~2026-07-19  5:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260719053349.8007F1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox