Thread (1 message) 1 message, 1 author, 2011-02-17

Re: [PATCH 7/7] serial: samsung: Get default port register settings from device tree

From: Grant Likely <hidden>
Date: 2011-02-17 16:56:08

On Thu, Feb 17, 2011 at 7:09 AM, Thomas Abraham
[off-list ref] wrote:
Hi Grant,

On 17 February 2011 05:56, Grant Likely [off-list ref] wrote:
quoted
On Sat, Feb 12, 2011 at 06:17:05PM +0530, Thomas Abraham wrote:
quoted
The default uart port register settings are obtained from the platform data.
In addition to that, this patch adds support for obtaining the default uart port
register values from the uart node in device tree.

Signed-off-by: Thomas Abraham <redacted>
---
 drivers/tty/serial/samsung.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index 66fece9..dda1d52 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -1148,9 +1148,22 @@ int s3c24xx_serial_probe(struct platform_device *dev,
 {
      struct s3c24xx_uart_port *ourport;
      int ret;
+     unsigned int len, *regdef;
+     struct s3c2410_uartcfg *cfg;

      dbg("s3c24xx_serial_probe(%p, %p) %d\n", dev, info, probe_index);

+     if (dev->dev.of_node) {
+             regdef = (u32 *)of_get_property(dev->dev.of_node,
+                                     "reg-defaults", &len);
+             if (regdef && (len / sizeof(unsigned int)) == 3) {
+                     cfg = s3c24xx_dev_to_cfg(&dev->dev);
+                     cfg->ucon = be32_to_cpu(regdef[0]);
+                     cfg->ulcon = be32_to_cpu(regdef[1]);
+                     cfg->ufcon = be32_to_cpu(regdef[2]);
+             }
+     }
+
Same comment as before, per-uart configuration belongs in each ports
device tree node.
The above configuration is obtained from the uart device tree node
(dev->dev.of_node).
Sorry for the noise, I wasn't paying enough attention here and I got confused.

g.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help