[PATCH v3] gpio: mxc_gpio: fix reading state of GPIO pins in output mode

Lothar Waßmann LW at KARO-electronics.de
Wed Aug 28 09:58:32 CEST 2024


Hi,

On Wed, 28 Aug 2024 09:49:44 +0200 (CEST) Tomas Paukrt wrote:
> > You may give a look to this
> >
> > https://lore.kernel.org/u-boot/57015C5F.3080209@denx.de/
> >
> > Regards,
> > Peng.  
> 
> The Linux driver uses the DR register for about 9 years and
> the NXP U-Boot driver uses the DR register for about 7 years,
> so only the mainline U-Boot driver still uses the PSR register.
> 
> Please give a look to:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=442b2494b17d1a4f0a14721580271eb23ebffd42
> https://github.com/nxp-imx/uboot-imx/commit/4afc3f90943c6b117f79b66d2cd04e64f437b0c2
>
Reading the PSR (with SION set) has the advantage that it provides the
_actual_ pin state rather than the programmed output value even in case
external hardware drives against the output driver.
This is especially useful for Opendrain outputs or in case the output
driver is disabled via the pad_ctl register.


Lothar Waßmann


More information about the U-Boot mailing list