diff options
Diffstat (limited to 'drivers/tty/serial/amba-pl011.c')
-rw-r--r-- | drivers/tty/serial/amba-pl011.c | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index ad41319d1d9b..28b35ad9c6cd 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c | |||
@@ -150,10 +150,6 @@ struct pl011_dmatx_data { | |||
150 | struct uart_amba_port { | 150 | struct uart_amba_port { |
151 | struct uart_port port; | 151 | struct uart_port port; |
152 | struct clk *clk; | 152 | struct clk *clk; |
153 | /* Two optional pin states - default & sleep */ | ||
154 | struct pinctrl *pinctrl; | ||
155 | struct pinctrl_state *pins_default; | ||
156 | struct pinctrl_state *pins_sleep; | ||
157 | const struct vendor_data *vendor; | 153 | const struct vendor_data *vendor; |
158 | unsigned int dmacr; /* dma control reg */ | 154 | unsigned int dmacr; /* dma control reg */ |
159 | unsigned int im; /* interrupt mask */ | 155 | unsigned int im; /* interrupt mask */ |
@@ -1479,12 +1475,7 @@ static int pl011_hwinit(struct uart_port *port) | |||
1479 | int retval; | 1475 | int retval; |
1480 | 1476 | ||
1481 | /* Optionaly enable pins to be muxed in and configured */ | 1477 | /* Optionaly enable pins to be muxed in and configured */ |
1482 | if (!IS_ERR(uap->pins_default)) { | 1478 | pinctrl_pm_select_default_state(port->dev); |
1483 | retval = pinctrl_select_state(uap->pinctrl, uap->pins_default); | ||
1484 | if (retval) | ||
1485 | dev_err(port->dev, | ||
1486 | "could not set default pins\n"); | ||
1487 | } | ||
1488 | 1479 | ||
1489 | /* | 1480 | /* |
1490 | * Try to enable the clock producer. | 1481 | * Try to enable the clock producer. |
@@ -1610,7 +1601,6 @@ static void pl011_shutdown(struct uart_port *port) | |||
1610 | { | 1601 | { |
1611 | struct uart_amba_port *uap = (struct uart_amba_port *)port; | 1602 | struct uart_amba_port *uap = (struct uart_amba_port *)port; |
1612 | unsigned int cr; | 1603 | unsigned int cr; |
1613 | int retval; | ||
1614 | 1604 | ||
1615 | /* | 1605 | /* |
1616 | * disable all interrupts | 1606 | * disable all interrupts |
@@ -1653,13 +1643,7 @@ static void pl011_shutdown(struct uart_port *port) | |||
1653 | */ | 1643 | */ |
1654 | clk_disable_unprepare(uap->clk); | 1644 | clk_disable_unprepare(uap->clk); |
1655 | /* Optionally let pins go into sleep states */ | 1645 | /* Optionally let pins go into sleep states */ |
1656 | if (!IS_ERR(uap->pins_sleep)) { | 1646 | pinctrl_pm_select_sleep_state(port->dev); |
1657 | retval = pinctrl_select_state(uap->pinctrl, uap->pins_sleep); | ||
1658 | if (retval) | ||
1659 | dev_err(port->dev, | ||
1660 | "could not set pins to sleep state\n"); | ||
1661 | } | ||
1662 | |||
1663 | 1647 | ||
1664 | if (uap->port.dev->platform_data) { | 1648 | if (uap->port.dev->platform_data) { |
1665 | struct amba_pl011_data *plat; | 1649 | struct amba_pl011_data *plat; |
@@ -2012,12 +1996,7 @@ static int __init pl011_console_setup(struct console *co, char *options) | |||
2012 | return -ENODEV; | 1996 | return -ENODEV; |
2013 | 1997 | ||
2014 | /* Allow pins to be muxed in and configured */ | 1998 | /* Allow pins to be muxed in and configured */ |
2015 | if (!IS_ERR(uap->pins_default)) { | 1999 | pinctrl_pm_select_default_state(uap->port.dev); |
2016 | ret = pinctrl_select_state(uap->pinctrl, uap->pins_default); | ||
2017 | if (ret) | ||
2018 | dev_err(uap->port.dev, | ||
2019 | "could not set default pins\n"); | ||
2020 | } | ||
2021 | 2000 | ||
2022 | ret = clk_prepare(uap->clk); | 2001 | ret = clk_prepare(uap->clk); |
2023 | if (ret) | 2002 | if (ret) |
@@ -2131,21 +2110,6 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) | |||
2131 | goto out; | 2110 | goto out; |
2132 | } | 2111 | } |
2133 | 2112 | ||
2134 | uap->pinctrl = devm_pinctrl_get(&dev->dev); | ||
2135 | if (IS_ERR(uap->pinctrl)) { | ||
2136 | ret = PTR_ERR(uap->pinctrl); | ||
2137 | goto out; | ||
2138 | } | ||
2139 | uap->pins_default = pinctrl_lookup_state(uap->pinctrl, | ||
2140 | PINCTRL_STATE_DEFAULT); | ||
2141 | if (IS_ERR(uap->pins_default)) | ||
2142 | dev_err(&dev->dev, "could not get default pinstate\n"); | ||
2143 | |||
2144 | uap->pins_sleep = pinctrl_lookup_state(uap->pinctrl, | ||
2145 | PINCTRL_STATE_SLEEP); | ||
2146 | if (IS_ERR(uap->pins_sleep)) | ||
2147 | dev_dbg(&dev->dev, "could not get sleep pinstate\n"); | ||
2148 | |||
2149 | uap->clk = devm_clk_get(&dev->dev, NULL); | 2113 | uap->clk = devm_clk_get(&dev->dev, NULL); |
2150 | if (IS_ERR(uap->clk)) { | 2114 | if (IS_ERR(uap->clk)) { |
2151 | ret = PTR_ERR(uap->clk); | 2115 | ret = PTR_ERR(uap->clk); |