[PATCH v4] gpio: mxc_gpio: fix reading state of GPIO pins in output mode
Fabio Estevam
festevam at gmail.com
Wed Aug 28 21:39:55 CEST 2024
Hi Tomas,
On Wed, Aug 28, 2024 at 10:09 AM Tomas Paukrt <tomaspaukrt at email.cz> wrote:
>
> The PSR register works correctly for GPIO pins in input mode,
> but always returns 0 for GPIO pins in output mode unless the SION
> bit is set.
>
> The DR register should be used for GPIO pins in output mode
> to allow correct getting of previously set output value.
>
> Please note that the Linux gpio-mxc driver and the NXP U-Boot mxc_gpio
> driver already use the DR register for all GPIO pins in output mode:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=442b2494b17d1a4f0a14721580271eb23ebffd42
Yes, it makes sense to align the i.MX GPIO behavior with the Linux
driver, thanks:
Reviewed-by: Fabio Estevam <festevam at gmail.com>
Tested-by: Fabio Estevam <festevam at gmail.com>
More information about the U-Boot
mailing list