Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: 8250_of: Add reset support

This adds the hooks for an optional reset controller in the 8250 device
tree node.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Joel Stanley and committed by
Greg Kroah-Hartman
e2860e1f 71e07791

+11
+1
Documentation/devicetree/bindings/serial/8250.txt
··· 47 47 property. 48 48 - tx-threshold: Specify the TX FIFO low water indication for parts with 49 49 programmable TX FIFO thresholds. 50 + - resets : phandle + reset specifier pairs 50 51 51 52 Note: 52 53 * fsl,ns16550:
+10
drivers/tty/serial/8250/8250_of.c
··· 19 19 #include <linux/of_irq.h> 20 20 #include <linux/of_platform.h> 21 21 #include <linux/clk.h> 22 + #include <linux/reset.h> 22 23 23 24 #include "8250.h" 24 25 25 26 struct of_serial_info { 26 27 struct clk *clk; 28 + struct reset_control *rst; 27 29 int type; 28 30 int line; 29 31 }; ··· 134 132 } 135 133 } 136 134 135 + info->rst = devm_reset_control_get_optional_shared(&ofdev->dev, NULL); 136 + if (IS_ERR(info->rst)) 137 + goto out; 138 + ret = reset_control_deassert(info->rst); 139 + if (ret) 140 + goto out; 141 + 137 142 port->type = type; 138 143 port->uartclk = clk; 139 144 port->flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP ··· 238 229 239 230 serial8250_unregister_port(info->line); 240 231 232 + reset_control_assert(info->rst); 241 233 if (info->clk) 242 234 clk_disable_unprepare(info->clk); 243 235 kfree(info);