diff options
author | Jonas Gorski <jonas.gorski@gmail.com> | 2017-09-20 07:14:04 -0400 |
---|---|---|
committer | James Hogan <jhogan@kernel.org> | 2017-11-07 13:33:18 -0500 |
commit | fa1e6a8aec47d5623f8361907f57e44f112a8f4f (patch) | |
tree | 4ae6fe3bae3e94544aac57bee71ab7ab3492b9ac | |
parent | 9a9cc02a6a558cf4d9ebeeda0832c5e2b8128f33 (diff) |
tty/bcm63xx_uart: allow naming clock in device tree
Codify using a named clock for the refclk of the uart. This makes it
easier if we might need to add a gating clock (like present on the
BCM6345).
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: linux-mips@linux-mips.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-serial@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: bcm-kernel-feedback-list@broadcom.com
Patchwork: https://patchwork.linux-mips.org/patch/17328/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: James Hogan <jhogan@kernel.org>
-rw-r--r-- | Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt | 6 | ||||
-rw-r--r-- | drivers/tty/serial/bcm63xx_uart.c | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt b/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt index 5c52e5eef16d..8b2b0460259a 100644 --- a/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt +++ b/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt | |||
@@ -11,6 +11,11 @@ Required properties: | |||
11 | - clocks: Clock driving the hardware; used to figure out the baud rate | 11 | - clocks: Clock driving the hardware; used to figure out the baud rate |
12 | divisor. | 12 | divisor. |
13 | 13 | ||
14 | |||
15 | Optional properties: | ||
16 | |||
17 | - clock-names: Should be "refclk". | ||
18 | |||
14 | Example: | 19 | Example: |
15 | 20 | ||
16 | uart0: serial@14e00520 { | 21 | uart0: serial@14e00520 { |
@@ -19,6 +24,7 @@ Example: | |||
19 | interrupt-parent = <&periph_intc>; | 24 | interrupt-parent = <&periph_intc>; |
20 | interrupts = <2>; | 25 | interrupts = <2>; |
21 | clocks = <&periph_clk>; | 26 | clocks = <&periph_clk>; |
27 | clock-names = "refclk"; | ||
22 | }; | 28 | }; |
23 | 29 | ||
24 | clocks { | 30 | clocks { |
diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c index afcc0418831b..0385bd361f4f 100644 --- a/drivers/tty/serial/bcm63xx_uart.c +++ b/drivers/tty/serial/bcm63xx_uart.c | |||
@@ -846,8 +846,10 @@ static int bcm_uart_probe(struct platform_device *pdev) | |||
846 | if (!res_irq) | 846 | if (!res_irq) |
847 | return -ENODEV; | 847 | return -ENODEV; |
848 | 848 | ||
849 | clk = pdev->dev.of_node ? of_clk_get(pdev->dev.of_node, 0) : | 849 | clk = clk_get(&pdev->dev, "refclk"); |
850 | clk_get(&pdev->dev, "refclk"); | 850 | if (IS_ERR(clk) && pdev->dev.of_node) |
851 | clk = of_clk_get(pdev->dev.of_node, 0); | ||
852 | |||
851 | if (IS_ERR(clk)) | 853 | if (IS_ERR(clk)) |
852 | return -ENODEV; | 854 | return -ENODEV; |
853 | 855 | ||