aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2014-02-20 13:15:53 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-28 19:27:18 -0500
commit9277285f98f08522e646211e32adbdb6ae2469a1 (patch)
tree9a96edf031555786f9806d4eb9d6a141ad1607dd /drivers/tty
parent5811712ffbf593d98b6cc56461df5be4e9580245 (diff)
tty: serial: bcm63xx_uart: add support for DT probing
Add a matching table for the the bcm63xx_uart driver on the compatible string "brcm,bcm6345-uart" which covers all BCM63xx implementations and reflects the fact that this block was first introduced with the BCM6345 SoC. Also make sure that we convert the id based on the uart aliases provided by the relevant Device Tree. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/bcm63xx_uart.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c
index 37e7e336f70a..a47421e4627c 100644
--- a/drivers/tty/serial/bcm63xx_uart.c
+++ b/drivers/tty/serial/bcm63xx_uart.c
@@ -31,6 +31,7 @@
31#include <linux/serial_core.h> 31#include <linux/serial_core.h>
32#include <linux/serial_bcm63xx.h> 32#include <linux/serial_bcm63xx.h>
33#include <linux/io.h> 33#include <linux/io.h>
34#include <linux/of.h>
34 35
35#define BCM63XX_NR_UARTS 2 36#define BCM63XX_NR_UARTS 2
36 37
@@ -806,6 +807,9 @@ static int bcm_uart_probe(struct platform_device *pdev)
806 struct clk *clk; 807 struct clk *clk;
807 int ret; 808 int ret;
808 809
810 if (pdev->dev.of_node)
811 pdev->id = of_alias_get_id(pdev->dev.of_node, "uart");
812
809 if (pdev->id < 0 || pdev->id >= BCM63XX_NR_UARTS) 813 if (pdev->id < 0 || pdev->id >= BCM63XX_NR_UARTS)
810 return -EINVAL; 814 return -EINVAL;
811 815
@@ -857,6 +861,12 @@ static int bcm_uart_remove(struct platform_device *pdev)
857 return 0; 861 return 0;
858} 862}
859 863
864static const struct of_device_id bcm63xx_of_match[] = {
865 { .compatible = "brcm,bcm6345-uart" },
866 { /* sentinel */ }
867};
868MODULE_DEVICE_TABLE(of, bcm63xx_of_match);
869
860/* 870/*
861 * platform driver stuff 871 * platform driver stuff
862 */ 872 */
@@ -866,6 +876,7 @@ static struct platform_driver bcm_uart_platform_driver = {
866 .driver = { 876 .driver = {
867 .owner = THIS_MODULE, 877 .owner = THIS_MODULE,
868 .name = "bcm63xx_uart", 878 .name = "bcm63xx_uart",
879 .of_match_table = bcm63xx_of_match,
869 }, 880 },
870}; 881};
871 882