2024-06-03 15:26:49

by Hugo Villeneuve

[permalink] [raw]
Subject: [PATCH 0/2] serial: sc16is7xx: Kconfig fixes after I2C/SPI driver split

From: Hugo Villeneuve <[email protected]>

Hello,
this patch series brings some Kconfig fixes to the sc16is7xx driver. These fixes
are related to the I2C/SPI driver split:

https://lore.kernel.org/all/[email protected]/

I have tested the changes on a custom board with two SC16IS752 DUART over
a SPI interface using a Variscite IMX8MN NANO SOM. The four UARTs are
configured in RS-485 mode.

I did not test the change on a SC16is7xx using I2C interface, as my custom
board is only using SPI.

Thank you.

Hugo Villeneuve (2):
serial: sc16is7xx: rename Kconfig CONFIG_SERIAL_SC16IS7XX_CORE
serial: sc16is7xx: re-add Kconfig SPI or I2C dependency

drivers/tty/serial/Kconfig | 3 ++-
drivers/tty/serial/Makefile | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)


base-commit: c3f38fa61af77b49866b006939479069cd451173
--
2.39.2



2024-06-03 15:26:49

by Hugo Villeneuve

[permalink] [raw]
Subject: [PATCH 2/2] serial: sc16is7xx: re-add Kconfig SPI or I2C dependency

From: Hugo Villeneuve <[email protected]>

Commit d49216438139
("serial: sc16is7xx: split into core and I2C/SPI parts (core)")
removed Kconfig SPI_MASTER or I2C dependency for SERIAL_SC16IS7XX (core).
This removal was done because I inadvertently misinterpreted some review
comments.

Because of that, the driver question now pops up if both I2C and
SPI_MASTER are disabled.

Re-add Kconfig SPI_MASTER or I2C dependency to fix the problem.

Suggested-by: Geert Uytterhoeven <[email protected]>
Fixes: d49216438139 ("serial: sc16is7xx: split into core and I2C/SPI parts (core)")
Signed-off-by: Hugo Villeneuve <[email protected]>
---
Cc: Andy Shevchenko <[email protected]>
---
drivers/tty/serial/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 2a0da35c0ef8..28e4beeabf8f 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -1025,6 +1025,7 @@ config SERIAL_SCCNXP_CONSOLE

config SERIAL_SC16IS7XX
tristate "NXP SC16IS7xx UART support"
+ depends on SPI_MASTER || I2C
select SERIAL_CORE
select SERIAL_SC16IS7XX_SPI if SPI_MASTER
select SERIAL_SC16IS7XX_I2C if I2C
--
2.39.2


2024-06-03 15:26:54

by Hugo Villeneuve

[permalink] [raw]
Subject: [PATCH 1/2] serial: sc16is7xx: rename Kconfig CONFIG_SERIAL_SC16IS7XX_CORE

From: Hugo Villeneuve <[email protected]>

Commit d49216438139
("serial: sc16is7xx: split into core and I2C/SPI parts (core)")
renamed SERIAL_SC16IS7XX_CORE by SERIAL_SC16IS7XX. This means that some
configs should have been updated when I submitted the original patch, but
unfortunately they were not. Geert mentioned for example:
arch/mips/configs/cu1??0-neo_defconfig

Rename SERIAL_SC16IS7XX to SERIAL_SC16IS7XX_CORE so that existing configs
will still work correctly.

Suggested-by: Geert Uytterhoeven <[email protected]>
Fixes: d49216438139 ("serial: sc16is7xx: split into core and I2C/SPI parts (core)")
Signed-off-by: Hugo Villeneuve <[email protected]>
---
Cc: Andy Shevchenko <[email protected]>
---
drivers/tty/serial/Kconfig | 2 +-
drivers/tty/serial/Makefile | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 4fdd7857ef4d..2a0da35c0ef8 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -1023,7 +1023,7 @@ config SERIAL_SCCNXP_CONSOLE
help
Support for console on SCCNXP serial ports.

-config SERIAL_SC16IS7XX_CORE
+config SERIAL_SC16IS7XX
tristate "NXP SC16IS7xx UART support"
select SERIAL_CORE
select SERIAL_SC16IS7XX_SPI if SPI_MASTER
diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
index faa45f2b8bb0..6ff74f0a9530 100644
--- a/drivers/tty/serial/Makefile
+++ b/drivers/tty/serial/Makefile
@@ -75,7 +75,7 @@ obj-$(CONFIG_SERIAL_SA1100) += sa1100.o
obj-$(CONFIG_SERIAL_SAMSUNG) += samsung_tty.o
obj-$(CONFIG_SERIAL_SB1250_DUART) += sb1250-duart.o
obj-$(CONFIG_SERIAL_SCCNXP) += sccnxp.o
-obj-$(CONFIG_SERIAL_SC16IS7XX_CORE) += sc16is7xx.o
+obj-$(CONFIG_SERIAL_SC16IS7XX) += sc16is7xx.o
obj-$(CONFIG_SERIAL_SC16IS7XX_SPI) += sc16is7xx_spi.o
obj-$(CONFIG_SERIAL_SC16IS7XX_I2C) += sc16is7xx_i2c.o
obj-$(CONFIG_SERIAL_SH_SCI) += sh-sci.o
--
2.39.2


2024-06-04 07:08:41

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH 1/2] serial: sc16is7xx: rename Kconfig CONFIG_SERIAL_SC16IS7XX_CORE

On Mon, Jun 3, 2024 at 5:26 PM Hugo Villeneuve <[email protected]> wrote:
> From: Hugo Villeneuve <[email protected]>
>
> Commit d49216438139
> ("serial: sc16is7xx: split into core and I2C/SPI parts (core)")
> renamed SERIAL_SC16IS7XX_CORE by SERIAL_SC16IS7XX. This means that some
> configs should have been updated when I submitted the original patch, but
> unfortunately they were not. Geert mentioned for example:
> arch/mips/configs/cu1??0-neo_defconfig
>
> Rename SERIAL_SC16IS7XX to SERIAL_SC16IS7XX_CORE so that existing configs
> will still work correctly.
>
> Suggested-by: Geert Uytterhoeven <[email protected]>
> Fixes: d49216438139 ("serial: sc16is7xx: split into core and I2C/SPI parts (core)")
> Signed-off-by: Hugo Villeneuve <[email protected]>

Reviewed-by: Geert Uytterhoeven <[email protected]>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2024-06-04 07:11:16

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH 2/2] serial: sc16is7xx: re-add Kconfig SPI or I2C dependency

Hi Hugo,

On Mon, Jun 3, 2024 at 5:26 PM Hugo Villeneuve <[email protected]> wrote:
> From: Hugo Villeneuve <[email protected]>
>
> Commit d49216438139
> ("serial: sc16is7xx: split into core and I2C/SPI parts (core)")
> removed Kconfig SPI_MASTER or I2C dependency for SERIAL_SC16IS7XX (core).
> This removal was done because I inadvertently misinterpreted some review
> comments.
>
> Because of that, the driver question now pops up if both I2C and
> SPI_MASTER are disabled.
>
> Re-add Kconfig SPI_MASTER or I2C dependency to fix the problem.
>
> Suggested-by: Geert Uytterhoeven <[email protected]>
> Fixes: d49216438139 ("serial: sc16is7xx: split into core and I2C/SPI parts (core)")
> Signed-off-by: Hugo Villeneuve <[email protected]>

Thanks for your patch!

> --- a/drivers/tty/serial/Kconfig
> +++ b/drivers/tty/serial/Kconfig
> @@ -1025,6 +1025,7 @@ config SERIAL_SCCNXP_CONSOLE
>
> config SERIAL_SC16IS7XX
> tristate "NXP SC16IS7xx UART support"
> + depends on SPI_MASTER || I2C

You may want to add "|| COMPILE_TEST".

> select SERIAL_CORE
> select SERIAL_SC16IS7XX_SPI if SPI_MASTER
> select SERIAL_SC16IS7XX_I2C if I2C

Reviewed-by: Geert Uytterhoeven <[email protected]>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2024-06-04 12:33:01

by Hugo Villeneuve

[permalink] [raw]
Subject: Re: [PATCH 2/2] serial: sc16is7xx: re-add Kconfig SPI or I2C dependency

On Tue, 4 Jun 2024 09:09:12 +0200
Geert Uytterhoeven <[email protected]> wrote:

> Hi Hugo,
>
> On Mon, Jun 3, 2024 at 5:26 PM Hugo Villeneuve <[email protected]> wrote:
> > From: Hugo Villeneuve <[email protected]>
> >
> > Commit d49216438139
> > ("serial: sc16is7xx: split into core and I2C/SPI parts (core)")
> > removed Kconfig SPI_MASTER or I2C dependency for SERIAL_SC16IS7XX (core).
> > This removal was done because I inadvertently misinterpreted some review
> > comments.
> >
> > Because of that, the driver question now pops up if both I2C and
> > SPI_MASTER are disabled.
> >
> > Re-add Kconfig SPI_MASTER or I2C dependency to fix the problem.
> >
> > Suggested-by: Geert Uytterhoeven <[email protected]>
> > Fixes: d49216438139 ("serial: sc16is7xx: split into core and I2C/SPI parts (core)")
> > Signed-off-by: Hugo Villeneuve <[email protected]>
>
> Thanks for your patch!
>
> > --- a/drivers/tty/serial/Kconfig
> > +++ b/drivers/tty/serial/Kconfig
> > @@ -1025,6 +1025,7 @@ config SERIAL_SCCNXP_CONSOLE
> >
> > config SERIAL_SC16IS7XX
> > tristate "NXP SC16IS7xx UART support"
> > + depends on SPI_MASTER || I2C
>
> You may want to add "|| COMPILE_TEST".

Hi Geert,
I will add this to my TODO list, since this patch series is already in Greg's tty tree.

Hugo

>
> > select SERIAL_CORE
> > select SERIAL_SC16IS7XX_SPI if SPI_MASTER
> > select SERIAL_SC16IS7XX_I2C if I2C
>
> Reviewed-by: Geert Uytterhoeven <[email protected]>
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
>


--
Hugo Villeneuve <[email protected]>