Re: [PATCH] ARM: dts: imx6sx: Add missing uart mux function

From: Uwe Kleine-König
Date: Thu Feb 13 2020 - 02:27:19 EST


On Thu, Feb 13, 2020 at 02:43:09PM +0800, Anson Huang wrote:
> From: Anson Huang <b20788@xxxxxxxxxxxxx>
>
> Update i.MX6SX pinfunc header to add uart mux function.

I'm aware you add the macros in a consistent way to the already existing
stuff. Still I think there is something to improve here. We now have
definitions like:

MX6SX_PAD_GPIO1_IO06__UART1_RTS_B
MX6SX_PAD_GPIO1_IO06__UART1_CTS_B

MX6SX_PAD_GPIO1_IO07__UART1_CTS_B
MX6SX_PAD_GPIO1_IO07__UART1_RTS_B

where (ignoring other pins that could be used) only the following
combinations are valid:

MX6SX_PAD_GPIO1_IO04__UART1_TX
MX6SX_PAD_GPIO1_IO05__UART1_RX
MX6SX_PAD_GPIO1_IO06__UART1_RTS_B
MX6SX_PAD_GPIO1_IO07__UART1_CTS_B

(in DCE mode) and

MX6SX_PAD_GPIO1_IO04__UART1_RX
MX6SX_PAD_GPIO1_IO05__UART1_TX
MX6SX_PAD_GPIO1_IO06__UART1_CTS_B
MX6SX_PAD_GPIO1_IO07__UART1_RTS_B

(in DTE mode).

For i.MX6SLL, i.MX6UL, imx6ULL and i.MX7 the naming convention is saner,
a typical definition there is:

MX7D_PAD_LPSR_GPIO1_IO04__UART5_DTE_RTS

where the name includes DTE and where is it (more) obvious that this
cannot be combined with

MX7D_PAD_LPSR_GPIO1_IO07__UART5_DCE_TX

.

I suggest to adapt the latter naming convention also for the other i.MX
pinfunc headers, probably with introducing defines for not breaking
existing dts files.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |