On 11/25/2019 9:36 PM, Stephen Boyd wrote:
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 <akashast@xxxxxxxxxxxxxx>
Reviewed-by: Matthias Kaehlcke <mka@xxxxxxxxxxxx>
Reviewed-by: Stephen Boyd <swboyd@xxxxxxxxxxxx>
Ok sure.
---
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.
Yes, there is DT binding update for this. Ok I will update GENI SE
binding to 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);
+
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,\na Linux Foundation Collaborative Project