From 0a0300dc8c4b3f3ce5c9ef5a0a4be5442590398f Mon Sep 17 00:00:00 2001 From: Russell King Date: Tue, 12 Jan 2010 12:28:00 +0000 Subject: ARM: Consolidate clks_register() and similar Most machine classes want some way to register a block of clk_lookup structures, and most do it by implementing a clks_register() type function which walks an array, or by open-coding a loop. Consolidate all this into clkdev_add_table(). Acked-by: H Hartley Sweeten Reviewed-by: Kevin Hilman Acked-by: Eric Miao Signed-off-by: Russell King --- arch/arm/mach-mx2/clock_imx21.c | 4 +--- arch/arm/mach-mx2/clock_imx27.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'arch/arm/mach-mx2') diff --git a/arch/arm/mach-mx2/clock_imx21.c b/arch/arm/mach-mx2/clock_imx21.c index 91901b5d56c2..e82b489d1215 100644 --- a/arch/arm/mach-mx2/clock_imx21.c +++ b/arch/arm/mach-mx2/clock_imx21.c @@ -968,7 +968,6 @@ static struct clk_lookup lookups[] = { */ int __init mx21_clocks_init(unsigned long lref, unsigned long href) { - int i; u32 cscr; external_low_reference = lref; @@ -986,8 +985,7 @@ int __init mx21_clocks_init(unsigned long lref, unsigned long href) else spll_clk.parent = &fpm_clk; - for (i = 0; i < ARRAY_SIZE(lookups); i++) - clkdev_add(&lookups[i]); + clkdev_add_table(lookups, ARRAY_SIZE(lookups)); /* Turn off all clock gates */ __raw_writel(0, CCM_PCCR0); diff --git a/arch/arm/mach-mx2/clock_imx27.c b/arch/arm/mach-mx2/clock_imx27.c index b010bf9ceaab..18c53a6487fa 100644 --- a/arch/arm/mach-mx2/clock_imx27.c +++ b/arch/arm/mach-mx2/clock_imx27.c @@ -719,7 +719,6 @@ static void __init to2_adjust_clocks(void) int __init mx27_clocks_init(unsigned long fref) { u32 cscr = __raw_readl(CCM_CSCR); - int i; external_high_reference = fref; @@ -736,8 +735,7 @@ int __init mx27_clocks_init(unsigned long fref) to2_adjust_clocks(); - for (i = 0; i < ARRAY_SIZE(lookups); i++) - clkdev_add(&lookups[i]); + clkdev_add_table(lookups, ARRAY_SIZE(lookups)); /* Turn off all clocks we do not need */ __raw_writel(0, CCM_PCCR0); -- cgit v1.2.2 From 3eb352c73c99602fd379782284ea2de1476c4f9d Mon Sep 17 00:00:00 2001 From: Martin Fuzzey Date: Sat, 21 Nov 2009 12:14:54 +0100 Subject: USB: MXC: use DMA_BIT_MASK macro rather than hardcoded constants. Also fixes tab/space issue causing checkpatch to complain. Signed-off-by: Martin Fuzzey Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-mx2/devices.c | 53 +++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 26 deletions(-) (limited to 'arch/arm/mach-mx2') diff --git a/arch/arm/mach-mx2/devices.c b/arch/arm/mach-mx2/devices.c index 3d398ce09b31..4acab18bf1f3 100644 --- a/arch/arm/mach-mx2/devices.c +++ b/arch/arm/mach-mx2/devices.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -292,7 +293,7 @@ struct platform_device mxc_fb_device = { .num_resources = ARRAY_SIZE(mxc_fb), .resource = mxc_fb, .dev = { - .coherent_dma_mask = 0xFFFFFFFF, + .coherent_dma_mask = DMA_BIT_MASK(32), }, }; @@ -395,17 +396,17 @@ static struct resource mxc_sdhc1_resources[] = { }, }; -static u64 mxc_sdhc1_dmamask = 0xffffffffUL; +static u64 mxc_sdhc1_dmamask = DMA_BIT_MASK(32); struct platform_device mxc_sdhc_device0 = { - .name = "mxc-mmc", - .id = 0, - .dev = { - .dma_mask = &mxc_sdhc1_dmamask, - .coherent_dma_mask = 0xffffffff, - }, - .num_resources = ARRAY_SIZE(mxc_sdhc1_resources), - .resource = mxc_sdhc1_resources, + .name = "mxc-mmc", + .id = 0, + .dev = { + .dma_mask = &mxc_sdhc1_dmamask, + .coherent_dma_mask = DMA_BIT_MASK(32), + }, + .num_resources = ARRAY_SIZE(mxc_sdhc1_resources), + .resource = mxc_sdhc1_resources, }; static struct resource mxc_sdhc2_resources[] = { @@ -424,17 +425,17 @@ static struct resource mxc_sdhc2_resources[] = { }, }; -static u64 mxc_sdhc2_dmamask = 0xffffffffUL; +static u64 mxc_sdhc2_dmamask = DMA_BIT_MASK(32); struct platform_device mxc_sdhc_device1 = { - .name = "mxc-mmc", - .id = 1, - .dev = { - .dma_mask = &mxc_sdhc2_dmamask, - .coherent_dma_mask = 0xffffffff, - }, - .num_resources = ARRAY_SIZE(mxc_sdhc2_resources), - .resource = mxc_sdhc2_resources, + .name = "mxc-mmc", + .id = 1, + .dev = { + .dma_mask = &mxc_sdhc2_dmamask, + .coherent_dma_mask = DMA_BIT_MASK(32), + }, + .num_resources = ARRAY_SIZE(mxc_sdhc2_resources), + .resource = mxc_sdhc2_resources, }; #ifdef CONFIG_MACH_MX27 @@ -450,7 +451,7 @@ static struct resource otg_resources[] = { }, }; -static u64 otg_dmamask = 0xffffffffUL; +static u64 otg_dmamask = DMA_BIT_MASK(32); /* OTG gadget device */ struct platform_device mxc_otg_udc_device = { @@ -458,7 +459,7 @@ struct platform_device mxc_otg_udc_device = { .id = -1, .dev = { .dma_mask = &otg_dmamask, - .coherent_dma_mask = 0xffffffffUL, + .coherent_dma_mask = DMA_BIT_MASK(32), }, .resource = otg_resources, .num_resources = ARRAY_SIZE(otg_resources), @@ -469,7 +470,7 @@ struct platform_device mxc_otg_host = { .name = "mxc-ehci", .id = 0, .dev = { - .coherent_dma_mask = 0xffffffff, + .coherent_dma_mask = DMA_BIT_MASK(32), .dma_mask = &otg_dmamask, }, .resource = otg_resources, @@ -478,7 +479,7 @@ struct platform_device mxc_otg_host = { /* USB host 1 */ -static u64 usbh1_dmamask = 0xffffffffUL; +static u64 usbh1_dmamask = DMA_BIT_MASK(32); static struct resource mxc_usbh1_resources[] = { { @@ -496,7 +497,7 @@ struct platform_device mxc_usbh1 = { .name = "mxc-ehci", .id = 1, .dev = { - .coherent_dma_mask = 0xffffffff, + .coherent_dma_mask = DMA_BIT_MASK(32), .dma_mask = &usbh1_dmamask, }, .resource = mxc_usbh1_resources, @@ -504,7 +505,7 @@ struct platform_device mxc_usbh1 = { }; /* USB host 2 */ -static u64 usbh2_dmamask = 0xffffffffUL; +static u64 usbh2_dmamask = DMA_BIT_MASK(32); static struct resource mxc_usbh2_resources[] = { { @@ -522,7 +523,7 @@ struct platform_device mxc_usbh2 = { .name = "mxc-ehci", .id = 2, .dev = { - .coherent_dma_mask = 0xffffffff, + .coherent_dma_mask = DMA_BIT_MASK(32), .dma_mask = &usbh2_dmamask, }, .resource = mxc_usbh2_resources, -- cgit v1.2.2 From 4e0fa90d1de10d68429afa9353e10bb9436455db Mon Sep 17 00:00:00 2001 From: Martin Fuzzey Date: Sat, 21 Nov 2009 12:14:58 +0100 Subject: USB: MXC: add platform resources for i.MX21 USB host controller. Signed-off-by: Martin Fuzzey Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-mx2/devices.c | 27 +++++++++++++++++++++++++++ arch/arm/mach-mx2/devices.h | 1 + 2 files changed, 28 insertions(+) (limited to 'arch/arm/mach-mx2') diff --git a/arch/arm/mach-mx2/devices.c b/arch/arm/mach-mx2/devices.c index 4acab18bf1f3..3956d82b7c4e 100644 --- a/arch/arm/mach-mx2/devices.c +++ b/arch/arm/mach-mx2/devices.c @@ -643,3 +643,30 @@ int __init mxc_register_gpios(void) { return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports)); } + +#ifdef CONFIG_MACH_MX21 +static struct resource mx21_usbhc_resources[] = { + { + .start = USBOTG_BASE_ADDR, + .end = USBOTG_BASE_ADDR + 0x1FFF, + .flags = IORESOURCE_MEM, + }, + { + .start = MXC_INT_USBHOST, + .end = MXC_INT_USBHOST, + .flags = IORESOURCE_IRQ, + }, +}; + +struct platform_device mx21_usbhc_device = { + .name = "imx21-hcd", + .id = 0, + .dev = { + .dma_mask = &mx21_usbhc_device.dev.coherent_dma_mask, + .coherent_dma_mask = DMA_BIT_MASK(32), + }, + .num_resources = ARRAY_SIZE(mx21_usbhc_resources), + .resource = mx21_usbhc_resources, +}; +#endif + diff --git a/arch/arm/mach-mx2/devices.h b/arch/arm/mach-mx2/devices.h index 97306aa18f1c..f12694b07369 100644 --- a/arch/arm/mach-mx2/devices.h +++ b/arch/arm/mach-mx2/devices.h @@ -26,5 +26,6 @@ extern struct platform_device mxc_usbh2; extern struct platform_device mxc_spi_device0; extern struct platform_device mxc_spi_device1; extern struct platform_device mxc_spi_device2; +extern struct platform_device mx21_usbhc_device; extern struct platform_device imx_ssi_device0; extern struct platform_device imx_ssi_device1; -- cgit v1.2.2