From 26f45c29e3c18c6f41a6bf64c791a5dcbd239683 Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Fri, 17 May 2013 10:45:10 -0700 Subject: ARM: OMAP2+: Legacy support for wl12xx when booted with devicetree Without WLAN we cannot switch omap4 to use device tree only booting. This patch can be reverted when the binding for wl12xx is added. Cc: Benoit Cousson Cc: Rajendra Nayak Cc: devicetree-discuss@lists.ozlabs.org Tested-by: Luciano Coelho Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/devices.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'arch/arm/mach-omap2/devices.c') diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 4269fc145698..d428b95bd137 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -15,12 +15,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include @@ -633,6 +635,40 @@ static void __init omap_init_ocp2scp(void) static inline void omap_init_ocp2scp(void) { } #endif +#if IS_ENABLED(CONFIG_WL12XX) + +static struct wl12xx_platform_data wl12xx __initdata; + +void __init omap_init_wl12xx_of(void) +{ + int ret; + + if (!of_have_populated_dt()) + return; + + if (of_machine_is_compatible("ti,omap4-sdp")) { + wl12xx.board_ref_clock = WL12XX_REFCLOCK_26; + wl12xx.board_tcxo_clock = WL12XX_TCXOCLOCK_26; + wl12xx.irq = gpio_to_irq(53); + } else if (of_machine_is_compatible("ti,omap4-panda")) { + wl12xx.board_ref_clock = WL12XX_REFCLOCK_38; + wl12xx.irq = gpio_to_irq(53); + } else { + return; + } + + ret = wl12xx_set_platform_data(&wl12xx); + if (ret) { + pr_err("error setting wl12xx data: %d\n", ret); + return; + } +} +#else +static inline void omap_init_wl12xx_of(void) +{ +} +#endif + /*-------------------------------------------------------------------------*/ static int __init omap2_init_devices(void) @@ -657,6 +693,9 @@ static int __init omap2_init_devices(void) omap_init_mcspi(); omap_init_sham(); omap_init_aes(); + } else { + /* These can be removed when bindings are done */ + omap_init_wl12xx_of(); } omap_init_sti(); omap_init_rng(); -- cgit v1.2.1 From 608d19380c67d3a68ef53568a8ea4f82fefa618e Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Thu, 30 May 2013 12:53:06 -0700 Subject: ARM: OMAP2+: Remove omap4 pdata for USB This is no longer needed as omap4 is now booted using device tree. Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/devices.c | 45 ------------------------------------------- 1 file changed, 45 deletions(-) (limited to 'arch/arm/mach-omap2/devices.c') diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index d428b95bd137..350116906f18 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include @@ -255,49 +254,6 @@ static inline void omap_init_camera(void) #endif } -#if IS_ENABLED(CONFIG_OMAP_CONTROL_USB) -static struct omap_control_usb_platform_data omap4_control_usb_pdata = { - .type = 1, -}; - -struct resource omap4_control_usb_res[] = { - { - .name = "control_dev_conf", - .start = 0x4a002300, - .end = 0x4a002303, - .flags = IORESOURCE_MEM, - }, - { - .name = "otghs_control", - .start = 0x4a00233c, - .end = 0x4a00233f, - .flags = IORESOURCE_MEM, - }, -}; - -static struct platform_device omap4_control_usb = { - .name = "omap-control-usb", - .id = -1, - .dev = { - .platform_data = &omap4_control_usb_pdata, - }, - .num_resources = 2, - .resource = omap4_control_usb_res, -}; - -static inline void __init omap_init_control_usb(void) -{ - if (!cpu_is_omap44xx()) - return; - - if (platform_device_register(&omap4_control_usb)) - pr_err("Error registering omap_control_usb device\n"); -} - -#else -static inline void omap_init_control_usb(void) { } -#endif /* CONFIG_OMAP_CONTROL_USB */ - int __init omap4_keyboard_init(struct omap4_keypad_platform_data *sdp4430_keypad_data, struct omap_board_data *bdata) { @@ -687,7 +643,6 @@ static int __init omap2_init_devices(void) omap_init_mbox(); /* If dtb is there, the devices will be created dynamically */ if (!of_have_populated_dt()) { - omap_init_control_usb(); omap_init_dmic(); omap_init_mcpdm(); omap_init_mcspi(); -- cgit v1.2.1 From 82c5cde1c4b01a62c9a19c9118b4b434c333ce86 Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Thu, 30 May 2013 12:53:07 -0700 Subject: ARM: OMAP2+: Remove omap4 ocp2scp pdata This is omap4+ only and no longer needed as omap4+ can be booted using device tree. Also remove the related pdata handling from the driver and the now unneeded platform_data/omap_ocp2scp.h. Cc: Arnd Bergmann Cc: Olof Johansson Reviewed-by: Kishon Vijay Abraham I Acked-by: Felipe Balbi Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/devices.c | 78 ------------------------------------------- 1 file changed, 78 deletions(-) (limited to 'arch/arm/mach-omap2/devices.c') diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 350116906f18..721da484d8ec 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include @@ -515,82 +514,6 @@ static void omap_init_vout(void) static inline void omap_init_vout(void) {} #endif -#if defined(CONFIG_OMAP_OCP2SCP) || defined(CONFIG_OMAP_OCP2SCP_MODULE) -static int count_ocp2scp_devices(struct omap_ocp2scp_dev *ocp2scp_dev) -{ - int cnt = 0; - - while (ocp2scp_dev->drv_name != NULL) { - cnt++; - ocp2scp_dev++; - } - - return cnt; -} - -static void __init omap_init_ocp2scp(void) -{ - struct omap_hwmod *oh; - struct platform_device *pdev; - int bus_id = -1, dev_cnt = 0, i; - struct omap_ocp2scp_dev *ocp2scp_dev; - const char *oh_name, *name; - struct omap_ocp2scp_platform_data *pdata; - - if (!cpu_is_omap44xx()) - return; - - oh_name = "ocp2scp_usb_phy"; - name = "omap-ocp2scp"; - - oh = omap_hwmod_lookup(oh_name); - if (!oh) { - pr_err("%s: could not find omap_hwmod for %s\n", __func__, - oh_name); - return; - } - - pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); - if (!pdata) { - pr_err("%s: No memory for ocp2scp pdata\n", __func__); - return; - } - - ocp2scp_dev = oh->dev_attr; - dev_cnt = count_ocp2scp_devices(ocp2scp_dev); - - if (!dev_cnt) { - pr_err("%s: No devices connected to ocp2scp\n", __func__); - kfree(pdata); - return; - } - - pdata->devices = kzalloc(sizeof(struct omap_ocp2scp_dev *) - * dev_cnt, GFP_KERNEL); - if (!pdata->devices) { - pr_err("%s: No memory for ocp2scp pdata devices\n", __func__); - kfree(pdata); - return; - } - - for (i = 0; i < dev_cnt; i++, ocp2scp_dev++) - pdata->devices[i] = ocp2scp_dev; - - pdata->dev_cnt = dev_cnt; - - pdev = omap_device_build(name, bus_id, oh, pdata, sizeof(*pdata)); - if (IS_ERR(pdev)) { - pr_err("Could not build omap_device for %s %s\n", - name, oh_name); - kfree(pdata->devices); - kfree(pdata); - return; - } -} -#else -static inline void omap_init_ocp2scp(void) { } -#endif - #if IS_ENABLED(CONFIG_WL12XX) static struct wl12xx_platform_data wl12xx __initdata; @@ -655,7 +578,6 @@ static int __init omap2_init_devices(void) omap_init_sti(); omap_init_rng(); omap_init_vout(); - omap_init_ocp2scp(); return 0; } -- cgit v1.2.1 From da4f9d28264913b1b8ece1f365ac0f3776389f77 Mon Sep 17 00:00:00 2001 From: Jarkko Nikula Date: Sat, 15 Jun 2013 11:31:05 +0300 Subject: ARM: OMAP2+: Remove dma.h All definitions in arch/arm/mach-omap2/dma.h are removed so it can be removed now. Signed-off-by: Jarkko Nikula Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/devices.c | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/arm/mach-omap2/devices.c') diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 4269fc145698..36135c3d8c86 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -37,7 +37,6 @@ #include "mux.h" #include "control.h" #include "devices.h" -#include "dma.h" #define L3_MODULES_MAX_LEN 12 #define L3_MODULES 3 -- cgit v1.2.1