public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] Revert "sc16is7xx: Separate GPIOs from modem control lines"
@ 2023-05-15 16:02 Hugo Villeneuve
  2023-05-15 16:20 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 8+ messages in thread
From: Hugo Villeneuve @ 2023-05-15 16:02 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, Lech Perczak, Tomasz Moń
  Cc: hugo, Hugo Villeneuve, linux-serial, linux-kernel

From: Hugo Villeneuve <hvilleneuve@dimonoff.com>

This reverts commit 679875d1d8802669590ef4d69b0e7d13207ebd61.

Because of this commit, it is no longer possible to use the 16 GPIO
lines as dedicated GPIOs on the SC16IS752.

Reverting it makes it work again.

The log message of the original commit states:
    "Export only the GPIOs that are not shared with hardware modem
    control lines"

But there is no explanation as to why this decision was taken to
permanently set the function of the GPIO lines as modem control
lines. AFAIK, there is no problem with using these lines as GPIO or modem
control lines.

Maybe after reverting this commit, we could define a new
device-tree property named, for example,
"use-modem-control-lines", so that both options can be supported.

Fixes: 679875d1d880 ("sc16is7xx: Separate GPIOs from modem control
lines")

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
---
 drivers/tty/serial/sc16is7xx.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index 5bd98e4316f5..25f1b2f6ec51 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -306,7 +306,6 @@ struct sc16is7xx_devtype {
 	char	name[10];
 	int	nr_gpio;
 	int	nr_uart;
-	int	has_mctrl;
 };
 
 #define SC16IS7XX_RECONF_MD		(1 << 0)
@@ -447,35 +446,30 @@ static const struct sc16is7xx_devtype sc16is74x_devtype = {
 	.name		= "SC16IS74X",
 	.nr_gpio	= 0,
 	.nr_uart	= 1,
-	.has_mctrl	= 0,
 };
 
 static const struct sc16is7xx_devtype sc16is750_devtype = {
 	.name		= "SC16IS750",
-	.nr_gpio	= 4,
+	.nr_gpio	= 8,
 	.nr_uart	= 1,
-	.has_mctrl	= 1,
 };
 
 static const struct sc16is7xx_devtype sc16is752_devtype = {
 	.name		= "SC16IS752",
-	.nr_gpio	= 0,
+	.nr_gpio	= 8,
 	.nr_uart	= 2,
-	.has_mctrl	= 1,
 };
 
 static const struct sc16is7xx_devtype sc16is760_devtype = {
 	.name		= "SC16IS760",
-	.nr_gpio	= 4,
+	.nr_gpio	= 8,
 	.nr_uart	= 1,
-	.has_mctrl	= 1,
 };
 
 static const struct sc16is7xx_devtype sc16is762_devtype = {
 	.name		= "SC16IS762",
-	.nr_gpio	= 0,
+	.nr_gpio	= 8,
 	.nr_uart	= 2,
-	.has_mctrl	= 1,
 };
 
 static bool sc16is7xx_regmap_volatile(struct device *dev, unsigned int reg)
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-05-17 13:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-15 16:02 [RFC PATCH] Revert "sc16is7xx: Separate GPIOs from modem control lines" Hugo Villeneuve
2023-05-15 16:20 ` Greg Kroah-Hartman
2023-05-15 16:51   ` Hugo Villeneuve
2023-05-16  8:50     ` Lech Perczak
2023-05-16 15:59       ` Hugo Villeneuve
2023-05-16 22:09         ` Hugo Villeneuve
2023-05-17  9:18           ` Lech Perczak
2023-05-17 13:58             ` Hugo Villeneuve

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox