diff options
author | Tony Lindgren <tony@atomide.com> | 2013-10-03 00:39:40 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2013-10-10 18:30:47 -0400 |
commit | dc7743aa3c49fabbc6dc9edbcf7df74d776ac32e (patch) | |
tree | 1b1d6a7f26fd1d899c5ee043bc255fdb4e8f7ddb | |
parent | 3e6cee1786a13cb2308609b5f8c020e1754e37cf (diff) |
pinctrl: single: Add support for auxdata
For omaps, we still have dependencies to the legacy code
for handling the PRM (Power Reset Management) interrupts,
and also for reconfiguring the io wake-up chain after
changes.
Let's pass the PRM interrupt and the rearm functions via
auxdata. Then when at some point we have a proper PRM
driver, we can get the interrupt via device tree and
set up the rearm function as exported function in the
PRM driver.
By using auxdata we can remove a dependency to the
wake-up events for converting omap3 to be device
tree only.
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Prakash Manjunathappa <prakash.pm@ti.com>
Cc: Roger Quadros <rogerq@ti.com>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Tested-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r-- | drivers/pinctrl/pinctrl-single.c | 23 | ||||
-rw-r--r-- | include/linux/platform_data/pinctrl-single.h | 12 |
2 files changed, 35 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index dad65df36f4b..c2aada71c915 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c | |||
@@ -28,6 +28,8 @@ | |||
28 | #include <linux/pinctrl/pinmux.h> | 28 | #include <linux/pinctrl/pinmux.h> |
29 | #include <linux/pinctrl/pinconf-generic.h> | 29 | #include <linux/pinctrl/pinconf-generic.h> |
30 | 30 | ||
31 | #include <linux/platform_data/pinctrl-single.h> | ||
32 | |||
31 | #include "core.h" | 33 | #include "core.h" |
32 | #include "pinconf.h" | 34 | #include "pinconf.h" |
33 | 35 | ||
@@ -159,12 +161,14 @@ struct pcs_name { | |||
159 | * @irq: optional interrupt for the controller | 161 | * @irq: optional interrupt for the controller |
160 | * @irq_enable_mask: optional SoC specific interrupt enable mask | 162 | * @irq_enable_mask: optional SoC specific interrupt enable mask |
161 | * @irq_status_mask: optional SoC specific interrupt status mask | 163 | * @irq_status_mask: optional SoC specific interrupt status mask |
164 | * @rearm: optional SoC specific wake-up rearm function | ||
162 | */ | 165 | */ |
163 | struct pcs_soc_data { | 166 | struct pcs_soc_data { |
164 | unsigned flags; | 167 | unsigned flags; |
165 | int irq; | 168 | int irq; |
166 | unsigned irq_enable_mask; | 169 | unsigned irq_enable_mask; |
167 | unsigned irq_status_mask; | 170 | unsigned irq_status_mask; |
171 | void (*rearm)(void); | ||
168 | }; | 172 | }; |
169 | 173 | ||
170 | /** | 174 | /** |
@@ -1622,6 +1626,8 @@ static void pcs_irq_unmask(struct irq_data *d) | |||
1622 | struct pcs_soc_data *pcs_soc = irq_data_get_irq_chip_data(d); | 1626 | struct pcs_soc_data *pcs_soc = irq_data_get_irq_chip_data(d); |
1623 | 1627 | ||
1624 | pcs_irq_set(pcs_soc, d->irq, true); | 1628 | pcs_irq_set(pcs_soc, d->irq, true); |
1629 | if (pcs_soc->rearm) | ||
1630 | pcs_soc->rearm(); | ||
1625 | } | 1631 | } |
1626 | 1632 | ||
1627 | /** | 1633 | /** |
@@ -1672,6 +1678,11 @@ static int pcs_irq_handle(struct pcs_soc_data *pcs_soc) | |||
1672 | } | 1678 | } |
1673 | } | 1679 | } |
1674 | 1680 | ||
1681 | /* | ||
1682 | * For debugging on omaps, you may want to call pcs_soc->rearm() | ||
1683 | * here to see wake-up interrupts during runtime also. | ||
1684 | */ | ||
1685 | |||
1675 | return count; | 1686 | return count; |
1676 | } | 1687 | } |
1677 | 1688 | ||
@@ -1835,6 +1846,7 @@ static int pcs_probe(struct platform_device *pdev) | |||
1835 | { | 1846 | { |
1836 | struct device_node *np = pdev->dev.of_node; | 1847 | struct device_node *np = pdev->dev.of_node; |
1837 | const struct of_device_id *match; | 1848 | const struct of_device_id *match; |
1849 | struct pcs_pdata *pdata; | ||
1838 | struct resource *res; | 1850 | struct resource *res; |
1839 | struct pcs_device *pcs; | 1851 | struct pcs_device *pcs; |
1840 | const struct pcs_soc_data *soc; | 1852 | const struct pcs_soc_data *soc; |
@@ -1949,6 +1961,17 @@ static int pcs_probe(struct platform_device *pdev) | |||
1949 | if (pcs->socdata.irq) | 1961 | if (pcs->socdata.irq) |
1950 | pcs->flags |= PCS_FEAT_IRQ; | 1962 | pcs->flags |= PCS_FEAT_IRQ; |
1951 | 1963 | ||
1964 | /* We still need auxdata for some omaps for PRM interrupts */ | ||
1965 | pdata = dev_get_platdata(&pdev->dev); | ||
1966 | if (pdata) { | ||
1967 | if (pdata->rearm) | ||
1968 | pcs->socdata.rearm = pdata->rearm; | ||
1969 | if (pdata->irq) { | ||
1970 | pcs->socdata.irq = pdata->irq; | ||
1971 | pcs->flags |= PCS_FEAT_IRQ; | ||
1972 | } | ||
1973 | } | ||
1974 | |||
1952 | if (PCS_HAS_IRQ) { | 1975 | if (PCS_HAS_IRQ) { |
1953 | ret = pcs_irq_init_chained_handler(pcs, np); | 1976 | ret = pcs_irq_init_chained_handler(pcs, np); |
1954 | if (ret < 0) | 1977 | if (ret < 0) |
diff --git a/include/linux/platform_data/pinctrl-single.h b/include/linux/platform_data/pinctrl-single.h new file mode 100644 index 000000000000..72eacda9b360 --- /dev/null +++ b/include/linux/platform_data/pinctrl-single.h | |||
@@ -0,0 +1,12 @@ | |||
1 | /** | ||
2 | * irq: optional wake-up interrupt | ||
3 | * rearm: optional soc specific rearm function | ||
4 | * | ||
5 | * Note that the irq and rearm setup should come from device | ||
6 | * tree except for omap where there are still some dependencies | ||
7 | * to the legacy PRM code. | ||
8 | */ | ||
9 | struct pcs_pdata { | ||
10 | int irq; | ||
11 | void (*rearm)(void); | ||
12 | }; | ||