Thread (2 messages) 2 messages, 2 authors, 2019-11-26

Re: [PATCH V7 1/2] tty: serial: qcom_geni_serial: Wakeup IRQ cleanup

From: Stephen Boyd <hidden>
Date: 2019-11-25 16:06:06
Also in: linux-arm-msm

Possibly related (same subject, not in this thread)

Quoting Akash Asthana (2019-11-25 07:08:50)
This patch is the continuation of below mentioned commits which adds wakeup
feature over the UART RX line.
1)commit 3e4aaea7a039 ("tty: serial: qcom_geni_serial: IRQ cleanup")[v2]
2)commit 8b7103f31950 ("tty: serial: qcom_geni_serial: Wakeup over UART
  RX")[v2]

The following cleanup is done based on upstream comment received on
subsequent versions of the above-mentioned commits to simplifying the code.
 - Use devm_kasprintf API in place of scnprintf.
 - Use dev_pm_set_dedicated_wake_irq API that will take care of
   requesting and attaching wakeup irqs for devices. Also, it sets wakeirq
   status to WAKE_IRQ_DEDICATED_ALLOCATED as a result enabling/disabling of
   wake irq will be managed by suspend/resume framework. We can remove the
   code for enabling and disabling of wake irq from the this driver.
 - Use platform_get_irq_optional API to get optional wakeup IRQ for
   device.
 - Move ISR registration later in probe after uart port gets register with
   serial core.

Patch link:
 - https://patchwork.kernel.org/patch/11189717/ (v3)
 - https://patchwork.kernel.org/patch/11227435/ (v4)
 - https://patchwork.kernel.org/patch/11241669/ (v5)
 - https://patchwork.kernel.org/patch/11258045/ (v6)

Signed-off-by: Akash Asthana <redacted>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Stephen Boyd <redacted>
Ok sure.
quoted hunk
---
diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
index ff63728..55b1d8b 100644
--- a/drivers/tty/serial/qcom_geni_serial.c
+++ b/drivers/tty/serial/qcom_geni_serial.c
@@ -1302,50 +1294,58 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
        port->rx_fifo_depth = DEF_FIFO_DEPTH_WORDS;
        port->tx_fifo_width = DEF_FIFO_WIDTH_BITS;
 
-       scnprintf(port->name, sizeof(port->name), "qcom_geni_serial_%s%d",
-               (uart_console(uport) ? "console" : "uart"), uport->line);
+       port->name = devm_kasprintf(uport->dev, GFP_KERNEL,
+                       "qcom_geni_serial_%s%d",
+                       uart_console(uport) ? "console" : "uart", uport->line);
+       if (!port->name)
+               return -ENOMEM;
+
        irq = platform_get_irq(pdev, 0);
        if (irq < 0)
                return irq;
        uport->irq = irq;
 
+       if (!console)
+               port->wakeup_irq = platform_get_irq_optional(pdev, 1);
Is there a DT binding update for this? It would be nice if the GENI SE
binding was updated to by YAML.
+
+       uport->private_data = drv;
+       platform_set_drvdata(pdev, port);
+       port->handle_rx = console ? handle_rx_console : handle_rx_uart;
+       if (!console)
+               device_create_file(uport->dev, &dev_attr_loopback);
+
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help