diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-11-16 13:08:45 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-11-16 13:08:45 -0500 |
commit | f4bcd79c88d25508643084e6fed25920485db0eb (patch) | |
tree | f51f5c1761a4ab40b5c5b630852f070c61fe4d5a | |
parent | 5a0c02ba1a3bcd0de9353767b5ee83d2c7d76227 (diff) | |
parent | 6658d6a5957662d0b9b2da8cc2466de2dad09a1a (diff) |
Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC fixes from Olof Johansson:
"We've been sitting on this longer than we meant to due to travel and
other activities, but the number of patches is luckily not that high.
Biggest changes are from a batch of OMAP bugfixes, but there are a few
for the broader set of SoCs too (bcm2835, pxa, highbank, tegra, at91
and i.MX).
The OMAP patches contain some fixes for MUSB/PHY on omap4 which ends
up being a bit on the large side but needed for legacy (non-DT)
platforms. Beyond that there are a handful of hwmod/pm changes.
So, fairly noncontroversial stuff all in all, and as usual around this
time the fixes are well targeted at specific problems."
* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
ARM: imx: ehci: fix host power mask bit
ARM i.MX: fix error-valued pointer dereference in clk_register_gate2()
ARM: at91/usbh: fix overcurrent gpio setup
ARM: at91/AT91SAM9G45: fix crypto peripherals irq issue due to sparse irq support
ARM: boot: Fix usage of kecho
ARM: OMAP: ocp2scp: create omap device for ocp2scp
ARM: OMAP4: add _dev_attr_ to ocp2scp for representing usb_phy
drivers: bus: ocp2scp: add pdata support
irqchip: irq-bcm2835: Add terminating entry for of_device_id table
ARM: highbank: retry wfi on reset request
ARM: OMAP4: PM: fix regulator name for VDD_MPU
ARM: OMAP4: hwmod data: do not enable or reset the McPDM during kernel init
ARM: OMAP2+: hwmod: add flag to prevent hwmod code from touching IP block during init
ARM: dt: tegra: fix length of pad control and mux registers
ARM: OMAP: hwmod: wait for sysreset complete after enabling hwmod
ARM: OMAP2+: clockdomain: Fix OMAP4 ISS clk domain to support only SWSUP
ARM: pxa/spitz_pm: Fix hang when resuming from STR
ARM: pxa: hx4700: Fix backlight PWM device number
ARM: OMAP2+: PM: add missing newline to VC warning message
24 files changed, 303 insertions, 50 deletions
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile index f2aa09eb658e..9137df539b61 100644 --- a/arch/arm/boot/Makefile +++ b/arch/arm/boot/Makefile | |||
@@ -33,7 +33,7 @@ ifeq ($(CONFIG_XIP_KERNEL),y) | |||
33 | 33 | ||
34 | $(obj)/xipImage: vmlinux FORCE | 34 | $(obj)/xipImage: vmlinux FORCE |
35 | $(call if_changed,objcopy) | 35 | $(call if_changed,objcopy) |
36 | $(kecho) ' Kernel: $@ is ready (physical address: $(CONFIG_XIP_PHYS_ADDR))' | 36 | @$(kecho) ' Kernel: $@ is ready (physical address: $(CONFIG_XIP_PHYS_ADDR))' |
37 | 37 | ||
38 | $(obj)/Image $(obj)/zImage: FORCE | 38 | $(obj)/Image $(obj)/zImage: FORCE |
39 | @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)' | 39 | @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)' |
@@ -48,14 +48,14 @@ $(obj)/xipImage: FORCE | |||
48 | 48 | ||
49 | $(obj)/Image: vmlinux FORCE | 49 | $(obj)/Image: vmlinux FORCE |
50 | $(call if_changed,objcopy) | 50 | $(call if_changed,objcopy) |
51 | $(kecho) ' Kernel: $@ is ready' | 51 | @$(kecho) ' Kernel: $@ is ready' |
52 | 52 | ||
53 | $(obj)/compressed/vmlinux: $(obj)/Image FORCE | 53 | $(obj)/compressed/vmlinux: $(obj)/Image FORCE |
54 | $(Q)$(MAKE) $(build)=$(obj)/compressed $@ | 54 | $(Q)$(MAKE) $(build)=$(obj)/compressed $@ |
55 | 55 | ||
56 | $(obj)/zImage: $(obj)/compressed/vmlinux FORCE | 56 | $(obj)/zImage: $(obj)/compressed/vmlinux FORCE |
57 | $(call if_changed,objcopy) | 57 | $(call if_changed,objcopy) |
58 | $(kecho) ' Kernel: $@ is ready' | 58 | @$(kecho) ' Kernel: $@ is ready' |
59 | 59 | ||
60 | endif | 60 | endif |
61 | 61 | ||
@@ -90,7 +90,7 @@ fi | |||
90 | $(obj)/uImage: $(obj)/zImage FORCE | 90 | $(obj)/uImage: $(obj)/zImage FORCE |
91 | @$(check_for_multiple_loadaddr) | 91 | @$(check_for_multiple_loadaddr) |
92 | $(call if_changed,uimage) | 92 | $(call if_changed,uimage) |
93 | $(kecho) ' Image $@ is ready' | 93 | @$(kecho) ' Image $@ is ready' |
94 | 94 | ||
95 | $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE | 95 | $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE |
96 | $(Q)$(MAKE) $(build)=$(obj)/bootp $@ | 96 | $(Q)$(MAKE) $(build)=$(obj)/bootp $@ |
@@ -98,7 +98,7 @@ $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE | |||
98 | 98 | ||
99 | $(obj)/bootpImage: $(obj)/bootp/bootp FORCE | 99 | $(obj)/bootpImage: $(obj)/bootp/bootp FORCE |
100 | $(call if_changed,objcopy) | 100 | $(call if_changed,objcopy) |
101 | $(kecho) ' Kernel: $@ is ready' | 101 | @$(kecho) ' Kernel: $@ is ready' |
102 | 102 | ||
103 | PHONY += initrd FORCE | 103 | PHONY += initrd FORCE |
104 | initrd: | 104 | initrd: |
diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi index b1497c7d7d68..df7f2270fc91 100644 --- a/arch/arm/boot/dts/tegra30.dtsi +++ b/arch/arm/boot/dts/tegra30.dtsi | |||
@@ -73,8 +73,8 @@ | |||
73 | 73 | ||
74 | pinmux: pinmux { | 74 | pinmux: pinmux { |
75 | compatible = "nvidia,tegra30-pinmux"; | 75 | compatible = "nvidia,tegra30-pinmux"; |
76 | reg = <0x70000868 0xd0 /* Pad control registers */ | 76 | reg = <0x70000868 0xd4 /* Pad control registers */ |
77 | 0x70003000 0x3e0>; /* Mux registers */ | 77 | 0x70003000 0x3e4>; /* Mux registers */ |
78 | }; | 78 | }; |
79 | 79 | ||
80 | serial@70006000 { | 80 | serial@70006000 { |
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c index 1e122bcd7845..3cee0e6ea7c3 100644 --- a/arch/arm/mach-at91/at91rm9200_devices.c +++ b/arch/arm/mach-at91/at91rm9200_devices.c | |||
@@ -68,7 +68,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) | |||
68 | 68 | ||
69 | /* Enable overcurrent notification */ | 69 | /* Enable overcurrent notification */ |
70 | for (i = 0; i < data->ports; i++) { | 70 | for (i = 0; i < data->ports; i++) { |
71 | if (data->overcurrent_pin[i]) | 71 | if (gpio_is_valid(data->overcurrent_pin[i])) |
72 | at91_set_gpio_input(data->overcurrent_pin[i], 1); | 72 | at91_set_gpio_input(data->overcurrent_pin[i], 1); |
73 | } | 73 | } |
74 | 74 | ||
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index aa1e58729885..414bd855fb0c 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c | |||
@@ -72,7 +72,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) | |||
72 | 72 | ||
73 | /* Enable overcurrent notification */ | 73 | /* Enable overcurrent notification */ |
74 | for (i = 0; i < data->ports; i++) { | 74 | for (i = 0; i < data->ports; i++) { |
75 | if (data->overcurrent_pin[i]) | 75 | if (gpio_is_valid(data->overcurrent_pin[i])) |
76 | at91_set_gpio_input(data->overcurrent_pin[i], 1); | 76 | at91_set_gpio_input(data->overcurrent_pin[i], 1); |
77 | } | 77 | } |
78 | 78 | ||
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index b9487696b7be..cd604aad8e96 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c | |||
@@ -72,7 +72,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) | |||
72 | 72 | ||
73 | /* Enable overcurrent notification */ | 73 | /* Enable overcurrent notification */ |
74 | for (i = 0; i < data->ports; i++) { | 74 | for (i = 0; i < data->ports; i++) { |
75 | if (data->overcurrent_pin[i]) | 75 | if (gpio_is_valid(data->overcurrent_pin[i])) |
76 | at91_set_gpio_input(data->overcurrent_pin[i], 1); | 76 | at91_set_gpio_input(data->overcurrent_pin[i], 1); |
77 | } | 77 | } |
78 | 78 | ||
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index cb85da2eccea..9c61e59a2104 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c | |||
@@ -78,7 +78,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) | |||
78 | 78 | ||
79 | /* Enable overcurrent notification */ | 79 | /* Enable overcurrent notification */ |
80 | for (i = 0; i < data->ports; i++) { | 80 | for (i = 0; i < data->ports; i++) { |
81 | if (data->overcurrent_pin[i]) | 81 | if (gpio_is_valid(data->overcurrent_pin[i])) |
82 | at91_set_gpio_input(data->overcurrent_pin[i], 1); | 82 | at91_set_gpio_input(data->overcurrent_pin[i], 1); |
83 | } | 83 | } |
84 | 84 | ||
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c index b1596072dcc2..fcd233cb33d2 100644 --- a/arch/arm/mach-at91/at91sam9g45_devices.c +++ b/arch/arm/mach-at91/at91sam9g45_devices.c | |||
@@ -1841,8 +1841,8 @@ static struct resource sha_resources[] = { | |||
1841 | .flags = IORESOURCE_MEM, | 1841 | .flags = IORESOURCE_MEM, |
1842 | }, | 1842 | }, |
1843 | [1] = { | 1843 | [1] = { |
1844 | .start = AT91SAM9G45_ID_AESTDESSHA, | 1844 | .start = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA, |
1845 | .end = AT91SAM9G45_ID_AESTDESSHA, | 1845 | .end = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA, |
1846 | .flags = IORESOURCE_IRQ, | 1846 | .flags = IORESOURCE_IRQ, |
1847 | }, | 1847 | }, |
1848 | }; | 1848 | }; |
@@ -1874,8 +1874,8 @@ static struct resource tdes_resources[] = { | |||
1874 | .flags = IORESOURCE_MEM, | 1874 | .flags = IORESOURCE_MEM, |
1875 | }, | 1875 | }, |
1876 | [1] = { | 1876 | [1] = { |
1877 | .start = AT91SAM9G45_ID_AESTDESSHA, | 1877 | .start = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA, |
1878 | .end = AT91SAM9G45_ID_AESTDESSHA, | 1878 | .end = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA, |
1879 | .flags = IORESOURCE_IRQ, | 1879 | .flags = IORESOURCE_IRQ, |
1880 | }, | 1880 | }, |
1881 | }; | 1881 | }; |
@@ -1910,8 +1910,8 @@ static struct resource aes_resources[] = { | |||
1910 | .flags = IORESOURCE_MEM, | 1910 | .flags = IORESOURCE_MEM, |
1911 | }, | 1911 | }, |
1912 | [1] = { | 1912 | [1] = { |
1913 | .start = AT91SAM9G45_ID_AESTDESSHA, | 1913 | .start = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA, |
1914 | .end = AT91SAM9G45_ID_AESTDESSHA, | 1914 | .end = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA, |
1915 | .flags = IORESOURCE_IRQ, | 1915 | .flags = IORESOURCE_IRQ, |
1916 | }, | 1916 | }, |
1917 | }; | 1917 | }; |
diff --git a/arch/arm/mach-highbank/system.c b/arch/arm/mach-highbank/system.c index 82c27230d4a9..86e37cd9376c 100644 --- a/arch/arm/mach-highbank/system.c +++ b/arch/arm/mach-highbank/system.c | |||
@@ -28,6 +28,7 @@ void highbank_restart(char mode, const char *cmd) | |||
28 | hignbank_set_pwr_soft_reset(); | 28 | hignbank_set_pwr_soft_reset(); |
29 | 29 | ||
30 | scu_power_mode(scu_base_addr, SCU_PM_POWEROFF); | 30 | scu_power_mode(scu_base_addr, SCU_PM_POWEROFF); |
31 | cpu_do_idle(); | 31 | while (1) |
32 | cpu_do_idle(); | ||
32 | } | 33 | } |
33 | 34 | ||
diff --git a/arch/arm/mach-imx/clk-gate2.c b/arch/arm/mach-imx/clk-gate2.c index 3c1b8ff9a0a6..cc49c7ae186e 100644 --- a/arch/arm/mach-imx/clk-gate2.c +++ b/arch/arm/mach-imx/clk-gate2.c | |||
@@ -112,7 +112,7 @@ struct clk *clk_register_gate2(struct device *dev, const char *name, | |||
112 | 112 | ||
113 | clk = clk_register(dev, &gate->hw); | 113 | clk = clk_register(dev, &gate->hw); |
114 | if (IS_ERR(clk)) | 114 | if (IS_ERR(clk)) |
115 | kfree(clk); | 115 | kfree(gate); |
116 | 116 | ||
117 | return clk; | 117 | return clk; |
118 | } | 118 | } |
diff --git a/arch/arm/mach-imx/ehci-imx25.c b/arch/arm/mach-imx/ehci-imx25.c index 412c583a24b0..576af7446952 100644 --- a/arch/arm/mach-imx/ehci-imx25.c +++ b/arch/arm/mach-imx/ehci-imx25.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #define MX25_H1_SIC_SHIFT 21 | 30 | #define MX25_H1_SIC_SHIFT 21 |
31 | #define MX25_H1_SIC_MASK (0x3 << MX25_H1_SIC_SHIFT) | 31 | #define MX25_H1_SIC_MASK (0x3 << MX25_H1_SIC_SHIFT) |
32 | #define MX25_H1_PP_BIT (1 << 18) | 32 | #define MX25_H1_PP_BIT (1 << 18) |
33 | #define MX25_H1_PM_BIT (1 << 8) | 33 | #define MX25_H1_PM_BIT (1 << 16) |
34 | #define MX25_H1_IPPUE_UP_BIT (1 << 7) | 34 | #define MX25_H1_IPPUE_UP_BIT (1 << 7) |
35 | #define MX25_H1_IPPUE_DOWN_BIT (1 << 6) | 35 | #define MX25_H1_IPPUE_DOWN_BIT (1 << 6) |
36 | #define MX25_H1_TLL_BIT (1 << 5) | 36 | #define MX25_H1_TLL_BIT (1 << 5) |
diff --git a/arch/arm/mach-imx/ehci-imx35.c b/arch/arm/mach-imx/ehci-imx35.c index 779e16eb65cb..293397852e4e 100644 --- a/arch/arm/mach-imx/ehci-imx35.c +++ b/arch/arm/mach-imx/ehci-imx35.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #define MX35_H1_SIC_SHIFT 21 | 30 | #define MX35_H1_SIC_SHIFT 21 |
31 | #define MX35_H1_SIC_MASK (0x3 << MX35_H1_SIC_SHIFT) | 31 | #define MX35_H1_SIC_MASK (0x3 << MX35_H1_SIC_SHIFT) |
32 | #define MX35_H1_PP_BIT (1 << 18) | 32 | #define MX35_H1_PP_BIT (1 << 18) |
33 | #define MX35_H1_PM_BIT (1 << 8) | 33 | #define MX35_H1_PM_BIT (1 << 16) |
34 | #define MX35_H1_IPPUE_UP_BIT (1 << 7) | 34 | #define MX35_H1_IPPUE_UP_BIT (1 << 7) |
35 | #define MX35_H1_IPPUE_DOWN_BIT (1 << 6) | 35 | #define MX35_H1_IPPUE_DOWN_BIT (1 << 6) |
36 | #define MX35_H1_TLL_BIT (1 << 5) | 36 | #define MX35_H1_TLL_BIT (1 << 5) |
diff --git a/arch/arm/mach-omap2/clockdomains44xx_data.c b/arch/arm/mach-omap2/clockdomains44xx_data.c index b56d06b48782..95192a062d5d 100644 --- a/arch/arm/mach-omap2/clockdomains44xx_data.c +++ b/arch/arm/mach-omap2/clockdomains44xx_data.c | |||
@@ -359,7 +359,7 @@ static struct clockdomain iss_44xx_clkdm = { | |||
359 | .clkdm_offs = OMAP4430_CM2_CAM_CAM_CDOFFS, | 359 | .clkdm_offs = OMAP4430_CM2_CAM_CAM_CDOFFS, |
360 | .wkdep_srcs = iss_wkup_sleep_deps, | 360 | .wkdep_srcs = iss_wkup_sleep_deps, |
361 | .sleepdep_srcs = iss_wkup_sleep_deps, | 361 | .sleepdep_srcs = iss_wkup_sleep_deps, |
362 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 362 | .flags = CLKDM_CAN_SWSUP, |
363 | }; | 363 | }; |
364 | 364 | ||
365 | static struct clockdomain l3_dss_44xx_clkdm = { | 365 | static struct clockdomain l3_dss_44xx_clkdm = { |
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index cba60e05e32e..c72b5a727720 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/of.h> | 19 | #include <linux/of.h> |
20 | #include <linux/pinctrl/machine.h> | 20 | #include <linux/pinctrl/machine.h> |
21 | #include <linux/platform_data/omap4-keypad.h> | 21 | #include <linux/platform_data/omap4-keypad.h> |
22 | #include <linux/platform_data/omap_ocp2scp.h> | ||
22 | 23 | ||
23 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
24 | #include <asm/mach/map.h> | 25 | #include <asm/mach/map.h> |
@@ -613,6 +614,83 @@ static void omap_init_vout(void) | |||
613 | static inline void omap_init_vout(void) {} | 614 | static inline void omap_init_vout(void) {} |
614 | #endif | 615 | #endif |
615 | 616 | ||
617 | #if defined(CONFIG_OMAP_OCP2SCP) || defined(CONFIG_OMAP_OCP2SCP_MODULE) | ||
618 | static int count_ocp2scp_devices(struct omap_ocp2scp_dev *ocp2scp_dev) | ||
619 | { | ||
620 | int cnt = 0; | ||
621 | |||
622 | while (ocp2scp_dev->drv_name != NULL) { | ||
623 | cnt++; | ||
624 | ocp2scp_dev++; | ||
625 | } | ||
626 | |||
627 | return cnt; | ||
628 | } | ||
629 | |||
630 | static void omap_init_ocp2scp(void) | ||
631 | { | ||
632 | struct omap_hwmod *oh; | ||
633 | struct platform_device *pdev; | ||
634 | int bus_id = -1, dev_cnt = 0, i; | ||
635 | struct omap_ocp2scp_dev *ocp2scp_dev; | ||
636 | const char *oh_name, *name; | ||
637 | struct omap_ocp2scp_platform_data *pdata; | ||
638 | |||
639 | if (!cpu_is_omap44xx()) | ||
640 | return; | ||
641 | |||
642 | oh_name = "ocp2scp_usb_phy"; | ||
643 | name = "omap-ocp2scp"; | ||
644 | |||
645 | oh = omap_hwmod_lookup(oh_name); | ||
646 | if (!oh) { | ||
647 | pr_err("%s: could not find omap_hwmod for %s\n", __func__, | ||
648 | oh_name); | ||
649 | return; | ||
650 | } | ||
651 | |||
652 | pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); | ||
653 | if (!pdata) { | ||
654 | pr_err("%s: No memory for ocp2scp pdata\n", __func__); | ||
655 | return; | ||
656 | } | ||
657 | |||
658 | ocp2scp_dev = oh->dev_attr; | ||
659 | dev_cnt = count_ocp2scp_devices(ocp2scp_dev); | ||
660 | |||
661 | if (!dev_cnt) { | ||
662 | pr_err("%s: No devices connected to ocp2scp\n", __func__); | ||
663 | kfree(pdata); | ||
664 | return; | ||
665 | } | ||
666 | |||
667 | pdata->devices = kzalloc(sizeof(struct omap_ocp2scp_dev *) | ||
668 | * dev_cnt, GFP_KERNEL); | ||
669 | if (!pdata->devices) { | ||
670 | pr_err("%s: No memory for ocp2scp pdata devices\n", __func__); | ||
671 | kfree(pdata); | ||
672 | return; | ||
673 | } | ||
674 | |||
675 | for (i = 0; i < dev_cnt; i++, ocp2scp_dev++) | ||
676 | pdata->devices[i] = ocp2scp_dev; | ||
677 | |||
678 | pdata->dev_cnt = dev_cnt; | ||
679 | |||
680 | pdev = omap_device_build(name, bus_id, oh, pdata, sizeof(*pdata), NULL, | ||
681 | 0, false); | ||
682 | if (IS_ERR(pdev)) { | ||
683 | pr_err("Could not build omap_device for %s %s\n", | ||
684 | name, oh_name); | ||
685 | kfree(pdata->devices); | ||
686 | kfree(pdata); | ||
687 | return; | ||
688 | } | ||
689 | } | ||
690 | #else | ||
691 | static inline void omap_init_ocp2scp(void) { } | ||
692 | #endif | ||
693 | |||
616 | /*-------------------------------------------------------------------------*/ | 694 | /*-------------------------------------------------------------------------*/ |
617 | 695 | ||
618 | static int __init omap2_init_devices(void) | 696 | static int __init omap2_init_devices(void) |
@@ -640,6 +718,7 @@ static int __init omap2_init_devices(void) | |||
640 | omap_init_sham(); | 718 | omap_init_sham(); |
641 | omap_init_aes(); | 719 | omap_init_aes(); |
642 | omap_init_vout(); | 720 | omap_init_vout(); |
721 | omap_init_ocp2scp(); | ||
643 | 722 | ||
644 | return 0; | 723 | return 0; |
645 | } | 724 | } |
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index b969ab1d258b..87cc6d058de2 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -422,6 +422,38 @@ static int _set_softreset(struct omap_hwmod *oh, u32 *v) | |||
422 | } | 422 | } |
423 | 423 | ||
424 | /** | 424 | /** |
425 | * _wait_softreset_complete - wait for an OCP softreset to complete | ||
426 | * @oh: struct omap_hwmod * to wait on | ||
427 | * | ||
428 | * Wait until the IP block represented by @oh reports that its OCP | ||
429 | * softreset is complete. This can be triggered by software (see | ||
430 | * _ocp_softreset()) or by hardware upon returning from off-mode (one | ||
431 | * example is HSMMC). Waits for up to MAX_MODULE_SOFTRESET_WAIT | ||
432 | * microseconds. Returns the number of microseconds waited. | ||
433 | */ | ||
434 | static int _wait_softreset_complete(struct omap_hwmod *oh) | ||
435 | { | ||
436 | struct omap_hwmod_class_sysconfig *sysc; | ||
437 | u32 softrst_mask; | ||
438 | int c = 0; | ||
439 | |||
440 | sysc = oh->class->sysc; | ||
441 | |||
442 | if (sysc->sysc_flags & SYSS_HAS_RESET_STATUS) | ||
443 | omap_test_timeout((omap_hwmod_read(oh, sysc->syss_offs) | ||
444 | & SYSS_RESETDONE_MASK), | ||
445 | MAX_MODULE_SOFTRESET_WAIT, c); | ||
446 | else if (sysc->sysc_flags & SYSC_HAS_RESET_STATUS) { | ||
447 | softrst_mask = (0x1 << sysc->sysc_fields->srst_shift); | ||
448 | omap_test_timeout(!(omap_hwmod_read(oh, sysc->sysc_offs) | ||
449 | & softrst_mask), | ||
450 | MAX_MODULE_SOFTRESET_WAIT, c); | ||
451 | } | ||
452 | |||
453 | return c; | ||
454 | } | ||
455 | |||
456 | /** | ||
425 | * _set_dmadisable: set OCP_SYSCONFIG.DMADISABLE bit in @v | 457 | * _set_dmadisable: set OCP_SYSCONFIG.DMADISABLE bit in @v |
426 | * @oh: struct omap_hwmod * | 458 | * @oh: struct omap_hwmod * |
427 | * | 459 | * |
@@ -1282,6 +1314,18 @@ static void _enable_sysc(struct omap_hwmod *oh) | |||
1282 | if (!oh->class->sysc) | 1314 | if (!oh->class->sysc) |
1283 | return; | 1315 | return; |
1284 | 1316 | ||
1317 | /* | ||
1318 | * Wait until reset has completed, this is needed as the IP | ||
1319 | * block is reset automatically by hardware in some cases | ||
1320 | * (off-mode for example), and the drivers require the | ||
1321 | * IP to be ready when they access it | ||
1322 | */ | ||
1323 | if (oh->flags & HWMOD_CONTROL_OPT_CLKS_IN_RESET) | ||
1324 | _enable_optional_clocks(oh); | ||
1325 | _wait_softreset_complete(oh); | ||
1326 | if (oh->flags & HWMOD_CONTROL_OPT_CLKS_IN_RESET) | ||
1327 | _disable_optional_clocks(oh); | ||
1328 | |||
1285 | v = oh->_sysc_cache; | 1329 | v = oh->_sysc_cache; |
1286 | sf = oh->class->sysc->sysc_flags; | 1330 | sf = oh->class->sysc->sysc_flags; |
1287 | 1331 | ||
@@ -1804,7 +1848,7 @@ static int _am33xx_disable_module(struct omap_hwmod *oh) | |||
1804 | */ | 1848 | */ |
1805 | static int _ocp_softreset(struct omap_hwmod *oh) | 1849 | static int _ocp_softreset(struct omap_hwmod *oh) |
1806 | { | 1850 | { |
1807 | u32 v, softrst_mask; | 1851 | u32 v; |
1808 | int c = 0; | 1852 | int c = 0; |
1809 | int ret = 0; | 1853 | int ret = 0; |
1810 | 1854 | ||
@@ -1834,19 +1878,7 @@ static int _ocp_softreset(struct omap_hwmod *oh) | |||
1834 | if (oh->class->sysc->srst_udelay) | 1878 | if (oh->class->sysc->srst_udelay) |
1835 | udelay(oh->class->sysc->srst_udelay); | 1879 | udelay(oh->class->sysc->srst_udelay); |
1836 | 1880 | ||
1837 | if (oh->class->sysc->sysc_flags & SYSS_HAS_RESET_STATUS) | 1881 | c = _wait_softreset_complete(oh); |
1838 | omap_test_timeout((omap_hwmod_read(oh, | ||
1839 | oh->class->sysc->syss_offs) | ||
1840 | & SYSS_RESETDONE_MASK), | ||
1841 | MAX_MODULE_SOFTRESET_WAIT, c); | ||
1842 | else if (oh->class->sysc->sysc_flags & SYSC_HAS_RESET_STATUS) { | ||
1843 | softrst_mask = (0x1 << oh->class->sysc->sysc_fields->srst_shift); | ||
1844 | omap_test_timeout(!(omap_hwmod_read(oh, | ||
1845 | oh->class->sysc->sysc_offs) | ||
1846 | & softrst_mask), | ||
1847 | MAX_MODULE_SOFTRESET_WAIT, c); | ||
1848 | } | ||
1849 | |||
1850 | if (c == MAX_MODULE_SOFTRESET_WAIT) | 1882 | if (c == MAX_MODULE_SOFTRESET_WAIT) |
1851 | pr_warning("omap_hwmod: %s: softreset failed (waited %d usec)\n", | 1883 | pr_warning("omap_hwmod: %s: softreset failed (waited %d usec)\n", |
1852 | oh->name, MAX_MODULE_SOFTRESET_WAIT); | 1884 | oh->name, MAX_MODULE_SOFTRESET_WAIT); |
@@ -2352,6 +2384,9 @@ static int __init _setup_reset(struct omap_hwmod *oh) | |||
2352 | if (oh->_state != _HWMOD_STATE_INITIALIZED) | 2384 | if (oh->_state != _HWMOD_STATE_INITIALIZED) |
2353 | return -EINVAL; | 2385 | return -EINVAL; |
2354 | 2386 | ||
2387 | if (oh->flags & HWMOD_EXT_OPT_MAIN_CLK) | ||
2388 | return -EPERM; | ||
2389 | |||
2355 | if (oh->rst_lines_cnt == 0) { | 2390 | if (oh->rst_lines_cnt == 0) { |
2356 | r = _enable(oh); | 2391 | r = _enable(oh); |
2357 | if (r) { | 2392 | if (r) { |
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c index 652d0285bd6d..0b1249e00398 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
22 | #include <linux/platform_data/gpio-omap.h> | 22 | #include <linux/platform_data/gpio-omap.h> |
23 | #include <linux/power/smartreflex.h> | 23 | #include <linux/power/smartreflex.h> |
24 | #include <linux/platform_data/omap_ocp2scp.h> | ||
24 | 25 | ||
25 | #include <plat/omap_hwmod.h> | 26 | #include <plat/omap_hwmod.h> |
26 | #include <plat/i2c.h> | 27 | #include <plat/i2c.h> |
@@ -2125,6 +2126,14 @@ static struct omap_hwmod omap44xx_mcpdm_hwmod = { | |||
2125 | .name = "mcpdm", | 2126 | .name = "mcpdm", |
2126 | .class = &omap44xx_mcpdm_hwmod_class, | 2127 | .class = &omap44xx_mcpdm_hwmod_class, |
2127 | .clkdm_name = "abe_clkdm", | 2128 | .clkdm_name = "abe_clkdm", |
2129 | /* | ||
2130 | * It's suspected that the McPDM requires an off-chip main | ||
2131 | * functional clock, controlled via I2C. This IP block is | ||
2132 | * currently reset very early during boot, before I2C is | ||
2133 | * available, so it doesn't seem that we have any choice in | ||
2134 | * the kernel other than to avoid resetting it. | ||
2135 | */ | ||
2136 | .flags = HWMOD_EXT_OPT_MAIN_CLK, | ||
2128 | .mpu_irqs = omap44xx_mcpdm_irqs, | 2137 | .mpu_irqs = omap44xx_mcpdm_irqs, |
2129 | .sdma_reqs = omap44xx_mcpdm_sdma_reqs, | 2138 | .sdma_reqs = omap44xx_mcpdm_sdma_reqs, |
2130 | .main_clk = "mcpdm_fck", | 2139 | .main_clk = "mcpdm_fck", |
@@ -2681,6 +2690,32 @@ static struct omap_hwmod_class omap44xx_ocp2scp_hwmod_class = { | |||
2681 | .sysc = &omap44xx_ocp2scp_sysc, | 2690 | .sysc = &omap44xx_ocp2scp_sysc, |
2682 | }; | 2691 | }; |
2683 | 2692 | ||
2693 | /* ocp2scp dev_attr */ | ||
2694 | static struct resource omap44xx_usb_phy_and_pll_addrs[] = { | ||
2695 | { | ||
2696 | .name = "usb_phy", | ||
2697 | .start = 0x4a0ad080, | ||
2698 | .end = 0x4a0ae000, | ||
2699 | .flags = IORESOURCE_MEM, | ||
2700 | }, | ||
2701 | { | ||
2702 | /* XXX: Remove this once control module driver is in place */ | ||
2703 | .name = "ctrl_dev", | ||
2704 | .start = 0x4a002300, | ||
2705 | .end = 0x4a002303, | ||
2706 | .flags = IORESOURCE_MEM, | ||
2707 | }, | ||
2708 | { } | ||
2709 | }; | ||
2710 | |||
2711 | static struct omap_ocp2scp_dev ocp2scp_dev_attr[] = { | ||
2712 | { | ||
2713 | .drv_name = "omap-usb2", | ||
2714 | .res = omap44xx_usb_phy_and_pll_addrs, | ||
2715 | }, | ||
2716 | { } | ||
2717 | }; | ||
2718 | |||
2684 | /* ocp2scp_usb_phy */ | 2719 | /* ocp2scp_usb_phy */ |
2685 | static struct omap_hwmod omap44xx_ocp2scp_usb_phy_hwmod = { | 2720 | static struct omap_hwmod omap44xx_ocp2scp_usb_phy_hwmod = { |
2686 | .name = "ocp2scp_usb_phy", | 2721 | .name = "ocp2scp_usb_phy", |
@@ -2694,6 +2729,7 @@ static struct omap_hwmod omap44xx_ocp2scp_usb_phy_hwmod = { | |||
2694 | .modulemode = MODULEMODE_HWCTRL, | 2729 | .modulemode = MODULEMODE_HWCTRL, |
2695 | }, | 2730 | }, |
2696 | }, | 2731 | }, |
2732 | .dev_attr = ocp2scp_dev_attr, | ||
2697 | }; | 2733 | }; |
2698 | 2734 | ||
2699 | /* | 2735 | /* |
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index 635e109f5ad3..44c42057b61c 100644 --- a/arch/arm/mach-omap2/twl-common.c +++ b/arch/arm/mach-omap2/twl-common.c | |||
@@ -366,7 +366,7 @@ static struct regulator_init_data omap4_clk32kg_idata = { | |||
366 | }; | 366 | }; |
367 | 367 | ||
368 | static struct regulator_consumer_supply omap4_vdd1_supply[] = { | 368 | static struct regulator_consumer_supply omap4_vdd1_supply[] = { |
369 | REGULATOR_SUPPLY("vcc", "mpu.0"), | 369 | REGULATOR_SUPPLY("vcc", "cpu0"), |
370 | }; | 370 | }; |
371 | 371 | ||
372 | static struct regulator_consumer_supply omap4_vdd2_supply[] = { | 372 | static struct regulator_consumer_supply omap4_vdd2_supply[] = { |
diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c index 880249b17012..75878c37959b 100644 --- a/arch/arm/mach-omap2/vc.c +++ b/arch/arm/mach-omap2/vc.c | |||
@@ -264,7 +264,7 @@ static void __init omap_vc_i2c_init(struct voltagedomain *voltdm) | |||
264 | 264 | ||
265 | if (initialized) { | 265 | if (initialized) { |
266 | if (voltdm->pmic->i2c_high_speed != i2c_high_speed) | 266 | if (voltdm->pmic->i2c_high_speed != i2c_high_speed) |
267 | pr_warn("%s: I2C config for vdd_%s does not match other channels (%u).", | 267 | pr_warn("%s: I2C config for vdd_%s does not match other channels (%u).\n", |
268 | __func__, voltdm->name, i2c_high_speed); | 268 | __func__, voltdm->name, i2c_high_speed); |
269 | return; | 269 | return; |
270 | } | 270 | } |
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c index 5ecbd17b5641..e2c6391863fe 100644 --- a/arch/arm/mach-pxa/hx4700.c +++ b/arch/arm/mach-pxa/hx4700.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/mfd/asic3.h> | 28 | #include <linux/mfd/asic3.h> |
29 | #include <linux/mtd/physmap.h> | 29 | #include <linux/mtd/physmap.h> |
30 | #include <linux/pda_power.h> | 30 | #include <linux/pda_power.h> |
31 | #include <linux/pwm.h> | ||
31 | #include <linux/pwm_backlight.h> | 32 | #include <linux/pwm_backlight.h> |
32 | #include <linux/regulator/driver.h> | 33 | #include <linux/regulator/driver.h> |
33 | #include <linux/regulator/gpio-regulator.h> | 34 | #include <linux/regulator/gpio-regulator.h> |
@@ -556,7 +557,7 @@ static struct platform_device hx4700_lcd = { | |||
556 | */ | 557 | */ |
557 | 558 | ||
558 | static struct platform_pwm_backlight_data backlight_data = { | 559 | static struct platform_pwm_backlight_data backlight_data = { |
559 | .pwm_id = 1, | 560 | .pwm_id = -1, /* Superseded by pwm_lookup */ |
560 | .max_brightness = 200, | 561 | .max_brightness = 200, |
561 | .dft_brightness = 100, | 562 | .dft_brightness = 100, |
562 | .pwm_period_ns = 30923, | 563 | .pwm_period_ns = 30923, |
@@ -571,6 +572,10 @@ static struct platform_device backlight = { | |||
571 | }, | 572 | }, |
572 | }; | 573 | }; |
573 | 574 | ||
575 | static struct pwm_lookup hx4700_pwm_lookup[] = { | ||
576 | PWM_LOOKUP("pxa27x-pwm.1", 0, "pwm-backlight", NULL), | ||
577 | }; | ||
578 | |||
574 | /* | 579 | /* |
575 | * USB "Transceiver" | 580 | * USB "Transceiver" |
576 | */ | 581 | */ |
@@ -872,6 +877,7 @@ static void __init hx4700_init(void) | |||
872 | pxa_set_stuart_info(NULL); | 877 | pxa_set_stuart_info(NULL); |
873 | 878 | ||
874 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 879 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
880 | pwm_add_table(hx4700_pwm_lookup, ARRAY_SIZE(hx4700_pwm_lookup)); | ||
875 | 881 | ||
876 | pxa_set_ficp_info(&ficp_info); | 882 | pxa_set_ficp_info(&ficp_info); |
877 | pxa27x_set_i2c_power_info(NULL); | 883 | pxa27x_set_i2c_power_info(NULL); |
diff --git a/arch/arm/mach-pxa/spitz_pm.c b/arch/arm/mach-pxa/spitz_pm.c index 438f02fe122a..842596d4d31e 100644 --- a/arch/arm/mach-pxa/spitz_pm.c +++ b/arch/arm/mach-pxa/spitz_pm.c | |||
@@ -86,10 +86,7 @@ static void spitz_discharge1(int on) | |||
86 | gpio_set_value(SPITZ_GPIO_LED_GREEN, on); | 86 | gpio_set_value(SPITZ_GPIO_LED_GREEN, on); |
87 | } | 87 | } |
88 | 88 | ||
89 | static unsigned long gpio18_config[] = { | 89 | static unsigned long gpio18_config = GPIO18_GPIO; |
90 | GPIO18_RDY, | ||
91 | GPIO18_GPIO, | ||
92 | }; | ||
93 | 90 | ||
94 | static void spitz_presuspend(void) | 91 | static void spitz_presuspend(void) |
95 | { | 92 | { |
@@ -112,7 +109,7 @@ static void spitz_presuspend(void) | |||
112 | PGSR3 &= ~SPITZ_GPIO_G3_STROBE_BIT; | 109 | PGSR3 &= ~SPITZ_GPIO_G3_STROBE_BIT; |
113 | PGSR2 |= GPIO_bit(SPITZ_GPIO_KEY_STROBE0); | 110 | PGSR2 |= GPIO_bit(SPITZ_GPIO_KEY_STROBE0); |
114 | 111 | ||
115 | pxa2xx_mfp_config(&gpio18_config[0], 1); | 112 | pxa2xx_mfp_config(&gpio18_config, 1); |
116 | gpio_request_one(18, GPIOF_OUT_INIT_HIGH, "Unknown"); | 113 | gpio_request_one(18, GPIOF_OUT_INIT_HIGH, "Unknown"); |
117 | gpio_free(18); | 114 | gpio_free(18); |
118 | 115 | ||
@@ -131,7 +128,6 @@ static void spitz_presuspend(void) | |||
131 | 128 | ||
132 | static void spitz_postsuspend(void) | 129 | static void spitz_postsuspend(void) |
133 | { | 130 | { |
134 | pxa2xx_mfp_config(&gpio18_config[1], 1); | ||
135 | } | 131 | } |
136 | 132 | ||
137 | static int spitz_should_wakeup(unsigned int resume_on_alarm) | 133 | static int spitz_should_wakeup(unsigned int resume_on_alarm) |
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h index b3349f7b1a2c..1db029438022 100644 --- a/arch/arm/plat-omap/include/plat/omap_hwmod.h +++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h | |||
@@ -443,6 +443,11 @@ struct omap_hwmod_omap4_prcm { | |||
443 | * in order to complete the reset. Optional clocks will be disabled | 443 | * in order to complete the reset. Optional clocks will be disabled |
444 | * again after the reset. | 444 | * again after the reset. |
445 | * HWMOD_16BIT_REG: Module has 16bit registers | 445 | * HWMOD_16BIT_REG: Module has 16bit registers |
446 | * HWMOD_EXT_OPT_MAIN_CLK: The only main functional clock source for | ||
447 | * this IP block comes from an off-chip source and is not always | ||
448 | * enabled. This prevents the hwmod code from being able to | ||
449 | * enable and reset the IP block early. XXX Eventually it should | ||
450 | * be possible to query the clock framework for this information. | ||
446 | */ | 451 | */ |
447 | #define HWMOD_SWSUP_SIDLE (1 << 0) | 452 | #define HWMOD_SWSUP_SIDLE (1 << 0) |
448 | #define HWMOD_SWSUP_MSTANDBY (1 << 1) | 453 | #define HWMOD_SWSUP_MSTANDBY (1 << 1) |
@@ -453,6 +458,7 @@ struct omap_hwmod_omap4_prcm { | |||
453 | #define HWMOD_NO_IDLEST (1 << 6) | 458 | #define HWMOD_NO_IDLEST (1 << 6) |
454 | #define HWMOD_CONTROL_OPT_CLKS_IN_RESET (1 << 7) | 459 | #define HWMOD_CONTROL_OPT_CLKS_IN_RESET (1 << 7) |
455 | #define HWMOD_16BIT_REG (1 << 8) | 460 | #define HWMOD_16BIT_REG (1 << 8) |
461 | #define HWMOD_EXT_OPT_MAIN_CLK (1 << 9) | ||
456 | 462 | ||
457 | /* | 463 | /* |
458 | * omap_hwmod._int_flags definitions | 464 | * omap_hwmod._int_flags definitions |
diff --git a/arch/arm/tools/Makefile b/arch/arm/tools/Makefile index cd60a81163e9..32d05c8219dc 100644 --- a/arch/arm/tools/Makefile +++ b/arch/arm/tools/Makefile | |||
@@ -5,6 +5,6 @@ | |||
5 | # | 5 | # |
6 | 6 | ||
7 | include/generated/mach-types.h: $(src)/gen-mach-types $(src)/mach-types | 7 | include/generated/mach-types.h: $(src)/gen-mach-types $(src)/mach-types |
8 | $(kecho) ' Generating $@' | 8 | @$(kecho) ' Generating $@' |
9 | @mkdir -p $(dir $@) | 9 | @mkdir -p $(dir $@) |
10 | $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; } | 10 | $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; } |
diff --git a/drivers/bus/omap-ocp2scp.c b/drivers/bus/omap-ocp2scp.c index ff63560b8467..0c48b0e05ed6 100644 --- a/drivers/bus/omap-ocp2scp.c +++ b/drivers/bus/omap-ocp2scp.c | |||
@@ -22,6 +22,26 @@ | |||
22 | #include <linux/pm_runtime.h> | 22 | #include <linux/pm_runtime.h> |
23 | #include <linux/of.h> | 23 | #include <linux/of.h> |
24 | #include <linux/of_platform.h> | 24 | #include <linux/of_platform.h> |
25 | #include <linux/platform_data/omap_ocp2scp.h> | ||
26 | |||
27 | /** | ||
28 | * _count_resources - count for the number of resources | ||
29 | * @res: struct resource * | ||
30 | * | ||
31 | * Count and return the number of resources populated for the device that is | ||
32 | * connected to ocp2scp. | ||
33 | */ | ||
34 | static unsigned _count_resources(struct resource *res) | ||
35 | { | ||
36 | int cnt = 0; | ||
37 | |||
38 | while (res->start != res->end) { | ||
39 | cnt++; | ||
40 | res++; | ||
41 | } | ||
42 | |||
43 | return cnt; | ||
44 | } | ||
25 | 45 | ||
26 | static int ocp2scp_remove_devices(struct device *dev, void *c) | 46 | static int ocp2scp_remove_devices(struct device *dev, void *c) |
27 | { | 47 | { |
@@ -34,20 +54,62 @@ static int ocp2scp_remove_devices(struct device *dev, void *c) | |||
34 | 54 | ||
35 | static int __devinit omap_ocp2scp_probe(struct platform_device *pdev) | 55 | static int __devinit omap_ocp2scp_probe(struct platform_device *pdev) |
36 | { | 56 | { |
37 | int ret; | 57 | int ret; |
38 | struct device_node *np = pdev->dev.of_node; | 58 | unsigned res_cnt, i; |
59 | struct device_node *np = pdev->dev.of_node; | ||
60 | struct platform_device *pdev_child; | ||
61 | struct omap_ocp2scp_platform_data *pdata = pdev->dev.platform_data; | ||
62 | struct omap_ocp2scp_dev *dev; | ||
39 | 63 | ||
40 | if (np) { | 64 | if (np) { |
41 | ret = of_platform_populate(np, NULL, NULL, &pdev->dev); | 65 | ret = of_platform_populate(np, NULL, NULL, &pdev->dev); |
42 | if (ret) { | 66 | if (ret) { |
43 | dev_err(&pdev->dev, "failed to add resources for ocp2scp child\n"); | 67 | dev_err(&pdev->dev, |
68 | "failed to add resources for ocp2scp child\n"); | ||
44 | goto err0; | 69 | goto err0; |
45 | } | 70 | } |
71 | } else if (pdata) { | ||
72 | for (i = 0, dev = *pdata->devices; i < pdata->dev_cnt; i++, | ||
73 | dev++) { | ||
74 | res_cnt = _count_resources(dev->res); | ||
75 | |||
76 | pdev_child = platform_device_alloc(dev->drv_name, | ||
77 | PLATFORM_DEVID_AUTO); | ||
78 | if (!pdev_child) { | ||
79 | dev_err(&pdev->dev, | ||
80 | "failed to allocate mem for ocp2scp child\n"); | ||
81 | goto err0; | ||
82 | } | ||
83 | |||
84 | ret = platform_device_add_resources(pdev_child, | ||
85 | dev->res, res_cnt); | ||
86 | if (ret) { | ||
87 | dev_err(&pdev->dev, | ||
88 | "failed to add resources for ocp2scp child\n"); | ||
89 | goto err1; | ||
90 | } | ||
91 | |||
92 | pdev_child->dev.parent = &pdev->dev; | ||
93 | |||
94 | ret = platform_device_add(pdev_child); | ||
95 | if (ret) { | ||
96 | dev_err(&pdev->dev, | ||
97 | "failed to register ocp2scp child device\n"); | ||
98 | goto err1; | ||
99 | } | ||
100 | } | ||
101 | } else { | ||
102 | dev_err(&pdev->dev, "OCP2SCP initialized without plat data\n"); | ||
103 | return -EINVAL; | ||
46 | } | 104 | } |
105 | |||
47 | pm_runtime_enable(&pdev->dev); | 106 | pm_runtime_enable(&pdev->dev); |
48 | 107 | ||
49 | return 0; | 108 | return 0; |
50 | 109 | ||
110 | err1: | ||
111 | platform_device_put(pdev_child); | ||
112 | |||
51 | err0: | 113 | err0: |
52 | device_for_each_child(&pdev->dev, NULL, ocp2scp_remove_devices); | 114 | device_for_each_child(&pdev->dev, NULL, ocp2scp_remove_devices); |
53 | 115 | ||
diff --git a/drivers/irqchip/irq-bcm2835.c b/drivers/irqchip/irq-bcm2835.c index dc670ccc6978..16c78f1c5ef2 100644 --- a/drivers/irqchip/irq-bcm2835.c +++ b/drivers/irqchip/irq-bcm2835.c | |||
@@ -168,7 +168,8 @@ static int __init armctrl_of_init(struct device_node *node, | |||
168 | } | 168 | } |
169 | 169 | ||
170 | static struct of_device_id irq_of_match[] __initconst = { | 170 | static struct of_device_id irq_of_match[] __initconst = { |
171 | { .compatible = "brcm,bcm2835-armctrl-ic", .data = armctrl_of_init } | 171 | { .compatible = "brcm,bcm2835-armctrl-ic", .data = armctrl_of_init }, |
172 | { } | ||
172 | }; | 173 | }; |
173 | 174 | ||
174 | void __init bcm2835_init_irq(void) | 175 | void __init bcm2835_init_irq(void) |
diff --git a/include/linux/platform_data/omap_ocp2scp.h b/include/linux/platform_data/omap_ocp2scp.h new file mode 100644 index 000000000000..5c6c3939355f --- /dev/null +++ b/include/linux/platform_data/omap_ocp2scp.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * omap_ocp2scp.h -- ocp2scp header file | ||
3 | * | ||
4 | * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * Author: Kishon Vijay Abraham I <kishon@ti.com> | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | */ | ||
18 | |||
19 | #ifndef __DRIVERS_OMAP_OCP2SCP_H | ||
20 | #define __DRIVERS_OMAP_OCP2SCP_H | ||
21 | |||
22 | struct omap_ocp2scp_dev { | ||
23 | const char *drv_name; | ||
24 | struct resource *res; | ||
25 | }; | ||
26 | |||
27 | struct omap_ocp2scp_platform_data { | ||
28 | int dev_cnt; | ||
29 | struct omap_ocp2scp_dev **devices; | ||
30 | }; | ||
31 | #endif /* __DRIVERS_OMAP_OCP2SCP_H */ | ||