diff options
author | Stephen Warren <swarren@nvidia.com> | 2012-03-02 15:05:47 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-03-05 05:22:59 -0500 |
commit | 6e5e959dde0d92d177f035652aeaa77f9330c9c6 (patch) | |
tree | c2d874df6a1c591b558a17591a1c8fbc2ba7a1e1 /drivers/tty | |
parent | 0e3db173e2b9fd3b82246516e72c17763eb5f98d (diff) |
pinctrl: API changes to support multiple states per device
The API model is changed from:
p = pinctrl_get(dev, "state1");
pinctrl_enable(p);
...
pinctrl_disable(p);
pinctrl_put(p);
p = pinctrl_get(dev, "state2");
pinctrl_enable(p);
...
pinctrl_disable(p);
pinctrl_put(p);
to this:
p = pinctrl_get(dev);
s1 = pinctrl_lookup_state(p, "state1");
s2 = pinctrl_lookup_state(p, "state2");
pinctrl_select_state(p, s1);
...
pinctrl_select_state(p, s2);
...
pinctrl_put(p);
This allows devices to directly transition between states without
disabling the pin controller programming and put()/get()ing the
configuration data each time. This model will also better suit pinconf
programming, which doesn't have a concept of "disable".
The special-case hogging feature of pin controllers is re-written to use
the regular APIs instead of special-case code. Hence, the pinmux-hogs
debugfs file is removed; see the top-level pinctrl-handles files for
equivalent data.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/sirfsoc_uart.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/tty/serial/sirfsoc_uart.c b/drivers/tty/serial/sirfsoc_uart.c index 3cabb650a1c1..5b3eda2024fe 100644 --- a/drivers/tty/serial/sirfsoc_uart.c +++ b/drivers/tty/serial/sirfsoc_uart.c | |||
@@ -673,12 +673,10 @@ int sirfsoc_uart_probe(struct platform_device *pdev) | |||
673 | port->irq = res->start; | 673 | port->irq = res->start; |
674 | 674 | ||
675 | if (sirfport->hw_flow_ctrl) { | 675 | if (sirfport->hw_flow_ctrl) { |
676 | sirfport->p = pinctrl_get(&pdev->dev, PINCTRL_STATE_DEFAULT); | 676 | sirfport->p = pinctrl_get_select_default(&pdev->dev); |
677 | ret = IS_ERR(sirfport->p); | 677 | ret = IS_ERR(sirfport->p); |
678 | if (ret) | 678 | if (ret) |
679 | goto pin_err; | 679 | goto pin_err; |
680 | |||
681 | pinctrl_enable(sirfport->p); | ||
682 | } | 680 | } |
683 | 681 | ||
684 | port->ops = &sirfsoc_uart_ops; | 682 | port->ops = &sirfsoc_uart_ops; |
@@ -695,10 +693,8 @@ int sirfsoc_uart_probe(struct platform_device *pdev) | |||
695 | 693 | ||
696 | port_err: | 694 | port_err: |
697 | platform_set_drvdata(pdev, NULL); | 695 | platform_set_drvdata(pdev, NULL); |
698 | if (sirfport->hw_flow_ctrl) { | 696 | if (sirfport->hw_flow_ctrl) |
699 | pinctrl_disable(sirfport->p); | ||
700 | pinctrl_put(sirfport->p); | 697 | pinctrl_put(sirfport->p); |
701 | } | ||
702 | pin_err: | 698 | pin_err: |
703 | irq_err: | 699 | irq_err: |
704 | devm_iounmap(&pdev->dev, port->membase); | 700 | devm_iounmap(&pdev->dev, port->membase); |
@@ -711,10 +707,8 @@ static int sirfsoc_uart_remove(struct platform_device *pdev) | |||
711 | struct sirfsoc_uart_port *sirfport = platform_get_drvdata(pdev); | 707 | struct sirfsoc_uart_port *sirfport = platform_get_drvdata(pdev); |
712 | struct uart_port *port = &sirfport->port; | 708 | struct uart_port *port = &sirfport->port; |
713 | platform_set_drvdata(pdev, NULL); | 709 | platform_set_drvdata(pdev, NULL); |
714 | if (sirfport->hw_flow_ctrl) { | 710 | if (sirfport->hw_flow_ctrl) |
715 | pinctrl_disable(sirfport->p); | ||
716 | pinctrl_put(sirfport->p); | 711 | pinctrl_put(sirfport->p); |
717 | } | ||
718 | devm_iounmap(&pdev->dev, port->membase); | 712 | devm_iounmap(&pdev->dev, port->membase); |
719 | uart_remove_one_port(&sirfsoc_uart_drv, port); | 713 | uart_remove_one_port(&sirfsoc_uart_drv, port); |
720 | return 0; | 714 | return 0; |