From d9d03e2c90553b5e329fc8c753211ab81ad43786 Mon Sep 17 00:00:00 2001 From: Russell King Date: Wed, 31 Aug 2016 08:49:52 +0100 Subject: serial: sa1100: add support for mctrl gpios Add support for the generic mctrl gpio helper. This will allow us to convert several board files to use the gpiod tables to assign GPIOs to serial ports, rather than needing to have private function callbacks. If the generic mctrl gpio helper fails, ignore the mctrl gpios rather than preventing the (possibly console) serial port from being created. Acked-by: Greg Kroah-Hartman Acked-by: Linus Walleij Signed-off-by: Russell King --- drivers/tty/serial/Kconfig | 1 + drivers/tty/serial/sa1100.c | 42 ++++++++++++++++++++++++++++++++++++++---- 2 files changed, 39 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index 0d31251e04cc..2c86d196fb3b 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig @@ -511,6 +511,7 @@ config SERIAL_SA1100 bool "SA1100 serial port support" depends on ARCH_SA1100 select SERIAL_CORE + select SERIAL_MCTRL_GPIO if GPIOLIB help If you have a machine based on a SA1100/SA1110 StrongARM(R) CPU you can enable its onboard serial port by enabling this option. diff --git a/drivers/tty/serial/sa1100.c b/drivers/tty/serial/sa1100.c index a399772be3fc..97bdfeccbea9 100644 --- a/drivers/tty/serial/sa1100.c +++ b/drivers/tty/serial/sa1100.c @@ -28,6 +28,8 @@ #include #include +#include "serial_mctrl_gpio.h" + /* We've been assigned a range on the "Low-density serial ports" major */ #define SERIAL_SA1100_MAJOR 204 #define MINOR_START 5 @@ -77,6 +79,7 @@ struct sa1100_port { struct uart_port port; struct timer_list timer; unsigned int old_status; + struct mctrl_gpios *gpios; }; /* @@ -174,6 +177,8 @@ static void sa1100_enable_ms(struct uart_port *port) container_of(port, struct sa1100_port, port); mod_timer(&sport->timer, jiffies); + + mctrl_gpio_enable_ms(sport->gpios); } static void @@ -322,11 +327,21 @@ static unsigned int sa1100_tx_empty(struct uart_port *port) static unsigned int sa1100_get_mctrl(struct uart_port *port) { - return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR; + struct sa1100_port *sport = + container_of(port, struct sa1100_port, port); + int ret = TIOCM_CTS | TIOCM_DSR | TIOCM_CAR; + + mctrl_gpio_get(sport->gpios, &ret); + + return ret; } static void sa1100_set_mctrl(struct uart_port *port, unsigned int mctrl) { + struct sa1100_port *sport = + container_of(port, struct sa1100_port, port); + + mctrl_gpio_set(sport->gpios, mctrl); } /* @@ -842,6 +857,27 @@ static int sa1100_serial_resume(struct platform_device *dev) return 0; } +static int sa1100_serial_add_one_port(struct sa1100_port *sport, struct platform_device *dev) +{ + sport->port.dev = &dev->dev; + sport->gpios = mctrl_gpio_init_noauto(sport->port.dev, 0); + if (IS_ERR(sport->gpios)) { + int err = PTR_ERR(sport->gpios); + + dev_err(sport->port.dev, "failed to get mctrl gpios: %d\n", + err); + + if (err == -EPROBE_DEFER) + return err; + + sport->gpios = NULL; + } + + platform_set_drvdata(dev, sport); + + return uart_add_one_port(&sa1100_reg, &sport->port); +} + static int sa1100_serial_probe(struct platform_device *dev) { struct resource *res = dev->resource; @@ -856,9 +892,7 @@ static int sa1100_serial_probe(struct platform_device *dev) if (sa1100_ports[i].port.mapbase != res->start) continue; - sa1100_ports[i].port.dev = &dev->dev; - uart_add_one_port(&sa1100_reg, &sa1100_ports[i].port); - platform_set_drvdata(dev, &sa1100_ports[i]); + sa1100_serial_add_one_port(&sa1100_ports[i], dev); break; } } -- cgit v1.2.3 From 0faf70ca948a506b7fbd1a245b46b0eeae628702 Mon Sep 17 00:00:00 2001 From: Russell King Date: Fri, 31 May 2019 16:21:28 +0100 Subject: serial: sa1100: add note about modem control signals As suggested by Uwe, add a note indicating that the modem control signals do not support interrupts, which precludes the driver from using mctrl_gpio_init(). Suggested-by: Uwe Kleine-König Signed-off-by: Russell King --- drivers/tty/serial/sa1100.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers') diff --git a/drivers/tty/serial/sa1100.c b/drivers/tty/serial/sa1100.c index 97bdfeccbea9..8e618129e65c 100644 --- a/drivers/tty/serial/sa1100.c +++ b/drivers/tty/serial/sa1100.c @@ -860,6 +860,10 @@ static int sa1100_serial_resume(struct platform_device *dev) static int sa1100_serial_add_one_port(struct sa1100_port *sport, struct platform_device *dev) { sport->port.dev = &dev->dev; + + // mctrl_gpio_init() requires that the GPIO driver supports interrupts, + // but we need to support GPIO drivers for hardware that has no such + // interrupts. Use mctrl_gpio_init_noauto() instead. sport->gpios = mctrl_gpio_init_noauto(sport->port.dev, 0); if (IS_ERR(sport->gpios)) { int err = PTR_ERR(sport->gpios); -- cgit v1.2.3 From 02af9f90941b6cce5fb672ee058c142adcc11a2f Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Thu, 2 May 2019 14:32:18 +0200 Subject: soc: renesas: Enable RZ/A1 IRQC on RZ/A1H and RZ/A2M Auto-enable support for the RZ/A1 Interrupt Controller when configuring a kernel which supports RZ/A1H or RZ/A2M SoCs. Keep selects sorted while at it. This is similar to how interrupt controllers for other Renesas SoCs are enabled. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- drivers/soc/renesas/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/soc/renesas/Kconfig b/drivers/soc/renesas/Kconfig index 68bfca6f20dd..2bbf49e5d441 100644 --- a/drivers/soc/renesas/Kconfig +++ b/drivers/soc/renesas/Kconfig @@ -57,14 +57,16 @@ config ARCH_R7S72100 bool "RZ/A1H (R7S72100)" select PM select PM_GENERIC_DOMAINS - select SYS_SUPPORTS_SH_MTU2 select RENESAS_OSTM + select RENESAS_RZA1_IRQC + select SYS_SUPPORTS_SH_MTU2 config ARCH_R7S9210 bool "RZ/A2 (R7S9210)" select PM select PM_GENERIC_DOMAINS select RENESAS_OSTM + select RENESAS_RZA1_IRQC config ARCH_R8A73A4 bool "R-Mobile APE6 (R8A73A40)" -- cgit v1.2.3 From 45450f36e569e5162957df488b0174c9a952e1b0 Mon Sep 17 00:00:00 2001 From: Keerthy Date: Mon, 29 Apr 2019 10:14:35 +0530 Subject: soc: ti: pm33xx: Add a print while entering RTC only mode with DDR in self-refresh Currently there is no way to distinguish if the SoC entered DS0 mode or the RTC only mode. Hence add a print before entering the RTC only mode. Signed-off-by: Keerthy Signed-off-by: Tony Lindgren --- drivers/soc/ti/pm33xx.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/soc/ti/pm33xx.c b/drivers/soc/ti/pm33xx.c index fc5802ccb1c0..bb77c220b6f8 100644 --- a/drivers/soc/ti/pm33xx.c +++ b/drivers/soc/ti/pm33xx.c @@ -178,6 +178,7 @@ static int am33xx_pm_suspend(suspend_state_t suspend_state) suspend_wfi_flags); suspend_wfi_flags &= ~WFI_FLAG_RTC_ONLY; + dev_info(pm33xx_dev, "Entering RTC Only mode with DDR in self-refresh\n"); if (!ret) { clk_restore_context(); -- cgit v1.2.3