Skip to contentSkip to conversation

ARM: getting rid of mx5/devices.c and mxc_register_device

PATCH New Uwe Kleine-König 1 participant 9 messages Aug 1, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover ARM: getting rid of mx5/devices.c and mxc_register_device

Hello,

this series is based on current Linus' master as there is no post-3.0 tag yet.

The first patch was already sent, but as this series either conflicts with it or needs it, so I added it here, too.

Note that building the branch below currently fails for mx51_defconfig, because Shawn's build fix for drivers/usb/host/ehci-mxc.c [1] is still missing.

See below for diffstat and shortlog.

Best regards
Uwe

[1] http://mid.gmane.org/1311258250-22013-1-git-send-email-shawn.guo at linaro.org

The following changes since commit 3da3f872aa175f59e20766ed30aaea67fd4fa7d1:

Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6 (2011-07-31 14:31:44 -1000)

are available in the git repository at:

git://git.pengutronix.de/git/ukl/linux-2.6.git imx-cleanup

Uwe Kleine-K?nig (8):
ARM: mx5: fix remaining unconsistent names for irqs
ARM: mx5: remove unused #includes of devices.h
ARM: mx5: dynamically allocate mxc-ehci devices
ARM: mx5: dynamically allocate fsl-usb2-udc devices
ARM: mx5: dynamically allocate high speed i2c (imx-i2c actually)
ARM: imx/mx1ads: dynamically allocate physmap-flash device
ARM: imx/armadillo5x0: dynamically allocate physmap-flash device
ARM: mxc: drop now unused function mxc_register_device

 arch/arm/mach-imx/mach-armadillo5x0.c             |   18 +--
 arch/arm/mach-imx/mach-mx1ads.c                   |   15 +--
 arch/arm/mach-mx5/Kconfig                         |    9 +-
 arch/arm/mach-mx5/Makefile                        |    2 +-
 arch/arm/mach-mx5/board-cpuimx51.c                |   17 +-
 arch/arm/mach-mx5/board-cpuimx51sd.c              |   17 +-
 arch/arm/mach-mx5/board-mx51_3ds.c                |    1 -
 arch/arm/mach-mx5/board-mx51_babbage.c            |   21 ++--
 arch/arm/mach-mx5/board-mx51_efikamx.c            |    1 -
 arch/arm/mach-mx5/board-mx51_efikasb.c            |    5 +-
 arch/arm/mach-mx5/clock-mx51-mx53.c               |    2 +-
 arch/arm/mach-mx5/devices-imx51.h                 |   13 ++
 arch/arm/mach-mx5/devices.c                       |  120 ---------------
 arch/arm/mach-mx5/devices.h                       |    5 -
 arch/arm/mach-mx5/ehci.c                          |    2 +-
 arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c      |    1 -
 arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c      |    1 -
 arch/arm/mach-mx5/mm.c                            |    8 +-
 arch/arm/mach-mx5/mx51_efika.c                    |   14 +-
 arch/arm/plat-mxc/devices.c                       |   14 --
 arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c |    5 +
 arch/arm/plat-mxc/devices/platform-imx-i2c.c      |    6 +
 arch/arm/plat-mxc/devices/platform-mxc-ehci.c     |    9 +
 arch/arm/plat-mxc/include/mach/common.h           |    1 -
 arch/arm/plat-mxc/include/mach/mx51.h             |  167 +++++++++++----------
 25 files changed, 179 insertions(+), 295 deletions(-)
 delete mode 100644 arch/arm/mach-mx5/devices.c
 delete mode 100644 arch/arm/mach-mx5/devices.h
Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#1 lore raw

PATCH 1/8 ARM: mx5: fix remaining unconsistent names for irqs

---
 arch/arm/mach-mx5/clock-mx51-mx53.c   |    2 +-
 arch/arm/mach-mx5/devices.c           |   10 +-
 arch/arm/mach-mx5/mm.c                |    8 +-
 arch/arm/plat-mxc/include/mach/mx51.h |  162 ++++++++++++++++----------------
 4 files changed, 91 insertions(+), 91 deletions(-)
arch/arm/mach-mx5/clock-mx51-mx53.c +1 -1
index 7f20308..bd5f697 100644
@@ -1564,7 +1564,7 @@ int __init mx51_clocks_init(unsigned long ckil, unsigned long osc,
 
 	/* System timer */
 	mxc_timer_init(&gpt_clk, MX51_IO_ADDRESS(MX51_GPT1_BASE_ADDR),
-		MX51_MXC_INT_GPT);
+		MX51_INT_GPT);
 	return 0;
 }
 
arch/arm/mach-mx5/devices.c +5 -5
index 371ca8c..5fd8f0c 100644
@@ -23,8 +23,8 @@ static struct resource mxc_hsi2c_resources[] = {
 		.flags = IORESOURCE_MEM,
 	},
 	{
-		.start = MX51_MXC_INT_HS_I2C,
-		.end = MX51_MXC_INT_HS_I2C,
+		.start = MX51_INT_HS_I2C,
+		.end = MX51_INT_HS_I2C,
 		.flags = IORESOURCE_IRQ,
 	},
 };
@@ -45,7 +45,7 @@ static struct resource usbotg_resources[] = {
 		.flags = IORESOURCE_MEM,
 	},
 	{
-		.start = MX51_MXC_INT_USB_OTG,
+		.start = MX51_INT_USB_OTG,
 		.flags = IORESOURCE_IRQ,
 	},
 };
@@ -80,7 +80,7 @@ static struct resource usbh1_resources[] = {
 		.flags = IORESOURCE_MEM,
 	},
 	{
-		.start = MX51_MXC_INT_USB_H1,
+		.start = MX51_INT_USB_H1,
 		.flags = IORESOURCE_IRQ,
 	},
 };
@@ -103,7 +103,7 @@ static struct resource usbh2_resources[] = {
 		.flags = IORESOURCE_MEM,
 	},
 	{
-		.start = MX51_MXC_INT_USB_H2,
+		.start = MX51_INT_USB_H2,
 		.flags = IORESOURCE_IRQ,
 	},
 };
arch/arm/mach-mx5/mm.c +4 -4
index baea6e5..fcc5c4c 100644
@@ -141,10 +141,10 @@ static struct sdma_platform_data imx53_sdma_pdata __initdata = {
 void __init imx51_soc_init(void)
 {
 	/* i.mx51 has the i.mx31 type gpio */
-	mxc_register_gpio("imx31-gpio", 0, MX51_GPIO1_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO1_LOW, MX51_MXC_INT_GPIO1_HIGH);
-	mxc_register_gpio("imx31-gpio", 1, MX51_GPIO2_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO2_LOW, MX51_MXC_INT_GPIO2_HIGH);
-	mxc_register_gpio("imx31-gpio", 2, MX51_GPIO3_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO3_LOW, MX51_MXC_INT_GPIO3_HIGH);
-	mxc_register_gpio("imx31-gpio", 3, MX51_GPIO4_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO4_LOW, MX51_MXC_INT_GPIO4_HIGH);
+	mxc_register_gpio("imx31-gpio", 0, MX51_GPIO1_BASE_ADDR, SZ_16K, MX51_INT_GPIO1_LOW, MX51_INT_GPIO1_HIGH);
+	mxc_register_gpio("imx31-gpio", 1, MX51_GPIO2_BASE_ADDR, SZ_16K, MX51_INT_GPIO2_LOW, MX51_INT_GPIO2_HIGH);
+	mxc_register_gpio("imx31-gpio", 2, MX51_GPIO3_BASE_ADDR, SZ_16K, MX51_INT_GPIO3_LOW, MX51_INT_GPIO3_HIGH);
+	mxc_register_gpio("imx31-gpio", 3, MX51_GPIO4_BASE_ADDR, SZ_16K, MX51_INT_GPIO4_LOW, MX51_INT_GPIO4_HIGH);
 
 	/* i.mx51 has the i.mx35 type sdma */
 	imx_add_imx_sdma("imx35-sdma", MX51_SDMA_BASE_ADDR, MX51_INT_SDMA, &imx51_sdma_pdata);
arch/arm/plat-mxc/include/mach/mx51.h +81 -81

191 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#2 lore raw

PATCH 2/8 ARM: mx5: remove unused #includes of devices.h

---
 arch/arm/mach-mx5/board-mx51_3ds.c           |    1 -
 arch/arm/mach-mx5/board-mx51_efikamx.c       |    1 -
 arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c |    1 -
 arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c |    1 -
 4 files changed, 0 insertions(+), 4 deletions(-)
arch/arm/mach-mx5/board-mx51_3ds.c +0 -1
index 07a3815..e5db7c1 100644
@@ -25,7 +25,6 @@
 #include <mach/3ds_debugboard.h>
 
 #include "devices-imx51.h"
-#include "devices.h"
 
 #define EXPIO_PARENT_INT	gpio_to_irq(IMX_GPIO_NR(1, 6))
 #define MX51_3DS_ECSPI2_CS	(GPIO_PORTC + 28)
arch/arm/mach-mx5/board-mx51_efikamx.c +0 -1
index f70700d..43ac100 100644
@@ -39,7 +39,6 @@
 #include <asm/mach/time.h>
 
 #include "devices-imx51.h"
-#include "devices.h"
 #include "efika.h"
 
 #define EFIKAMX_PCBID0		IMX_GPIO_NR(3, 16)
arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c +0 -1
index bbf4564..72ce755 100644
@@ -28,7 +28,6 @@
 #include <asm/mach/arch.h>
 
 #include "devices-imx51.h"
-#include "devices.h"
 
 #define MBIMX51_TSC2007_GPIO	IMX_GPIO_NR(3, 30)
 #define MBIMX51_LED0		IMX_GPIO_NR(3, 5)
arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c +0 -1
index 2619239..90f5c9c 100644
@@ -41,7 +41,6 @@
 #include <mach/audmux.h>
 
 #include "devices-imx51.h"
-#include "devices.h"
 
 static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
 	/* LED */
Signature · 1 line
1.7.5.4
#3 lore raw

PATCH 3/8 ARM: mx5: dynamically allocate mxc-ehci devices

In reply to Uwe Kleine-König

Additionally make the usb related defines consistent with the other imx SoCs.

---
 arch/arm/mach-mx5/Kconfig                     |    6 ++-
 arch/arm/mach-mx5/board-cpuimx51.c            |   12 +++---
 arch/arm/mach-mx5/board-cpuimx51sd.c          |   12 +++---
 arch/arm/mach-mx5/board-mx51_babbage.c        |   12 +++---
 arch/arm/mach-mx5/board-mx51_efikasb.c        |    5 +-
 arch/arm/mach-mx5/devices-imx51.h             |    7 +++
 arch/arm/mach-mx5/devices.c                   |   61 +------------------------
 arch/arm/mach-mx5/devices.h                   |    3 -
 arch/arm/mach-mx5/ehci.c                      |    2 +-
 arch/arm/mach-mx5/mx51_efika.c                |   14 +++---
 arch/arm/plat-mxc/devices/platform-mxc-ehci.c |    9 ++++
 arch/arm/plat-mxc/include/mach/mx51.h         |   11 +++--
 12 files changed, 57 insertions(+), 97 deletions(-)
arch/arm/mach-mx5/Kconfig +5 -1
index b4e7c58..2905110 100644
@@ -68,6 +68,7 @@ config MACH_MX51_BABBAGE
 	select IMX_HAVE_PLATFORM_IMX2_WDT
 	select IMX_HAVE_PLATFORM_IMX_I2C
 	select IMX_HAVE_PLATFORM_IMX_UART
+	select IMX_HAVE_PLATFORM_MXC_EHCI
 	select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
 	select IMX_HAVE_PLATFORM_SPI_IMX
 	help
@@ -93,6 +94,7 @@ config MACH_EUKREA_CPUIMX51
 	select SOC_IMX51
 	select IMX_HAVE_PLATFORM_IMX_I2C
 	select IMX_HAVE_PLATFORM_IMX_UART
+	select IMX_HAVE_PLATFORM_MXC_EHCI
 	select IMX_HAVE_PLATFORM_MXC_NAND
 	select IMX_HAVE_PLATFORM_SPI_IMX
 	help
@@ -120,9 +122,10 @@ config MACH_EUKREA_CPUIMX51SD
 	bool "Support Eukrea CPUIMX51SD module"
 	select SOC_IMX51
 	select IMX_HAVE_PLATFORM_IMX_I2C
-	select IMX_HAVE_PLATFORM_SPI_IMX
 	select IMX_HAVE_PLATFORM_IMX_UART
+	select IMX_HAVE_PLATFORM_MXC_EHCI
 	select IMX_HAVE_PLATFORM_MXC_NAND
+	select IMX_HAVE_PLATFORM_SPI_IMX
 	help
 	  Include support for Eukrea CPUIMX51SD platform. This includes
 	  specific configurations for the module and its peripherals.
@@ -147,6 +150,7 @@ config MX51_EFIKA_COMMON
 	bool
 	select SOC_IMX51
 	select IMX_HAVE_PLATFORM_IMX_UART
+	select IMX_HAVE_PLATFORM_MXC_EHCI
 	select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
 	select IMX_HAVE_PLATFORM_SPI_IMX
 	select MXC_ULPI if USB_ULPI
arch/arm/mach-mx5/board-cpuimx51.c +6 -6
index 7c893fa..aa1ff79 100644
@@ -167,7 +167,7 @@ static int initialize_otg_port(struct platform_device *pdev)
 	void __iomem *usb_base;
 	void __iomem *usbother_base;
 
-	usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
+	usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
 	if (!usb_base)
 		return -ENOMEM;
 	usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
@@ -190,7 +190,7 @@ static int initialize_usbh1_port(struct platform_device *pdev)
 	void __iomem *usb_base;
 	void __iomem *usbother_base;
 
-	usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
+	usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
 	if (!usb_base)
 		return -ENOMEM;
 	usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
@@ -206,7 +206,7 @@ static int initialize_usbh1_port(struct platform_device *pdev)
 			MXC_EHCI_ITC_NO_THRESHOLD);
 }
 
-static struct mxc_usbh_platform_data dr_utmi_config = {
+static const struct mxc_usbh_platform_data dr_utmi_config __initconst = {
 	.init		= initialize_otg_port,
 	.portsc	= MXC_EHCI_UTMI_16BIT,
 };
@@ -216,7 +216,7 @@ static struct fsl_usb2_platform_data usb_pdata = {
 	.phy_mode	= FSL_USB2_PHY_UTMI_WIDE,
 };
 
-static struct mxc_usbh_platform_data usbh1_config = {
+static const struct mxc_usbh_platform_data usbh1_config __initconst = {
 	.init		= initialize_usbh1_port,
 	.portsc	= MXC_EHCI_MODE_ULPI,
 };
@@ -270,12 +270,12 @@ static void __init eukrea_cpuimx51_init(void)
 				ARRAY_SIZE(eukrea_cpuimx51_i2c_devices));
 
 	if (otg_mode_host)
-		mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config);
+		imx51_add_mxc_ehci_otg(&dr_utmi_config);
 	else {
 		initialize_otg_port(NULL);
 		mxc_register_device(&mxc_usbdr_udc_device, &usb_pdata);
 	}
-	mxc_register_device(&mxc_usbh1_device, &usbh1_config);
+	imx51_add_mxc_ehci_hs(1, &usbh1_config);
 
 #ifdef CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD
 	eukrea_mbimx51_baseboard_init();
arch/arm/mach-mx5/board-cpuimx51sd.c +6 -6
index ff096d5..bca3719 100644
@@ -149,7 +149,7 @@ static int initialize_otg_port(struct platform_device *pdev)
 	void __iomem *usb_base;
 	void __iomem *usbother_base;
 
-	usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
+	usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
 	if (!usb_base)
 		return -ENOMEM;
 	usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
@@ -172,7 +172,7 @@ static int initialize_usbh1_port(struct platform_device *pdev)
 	void __iomem *usb_base;
 	void __iomem *usbother_base;
 
-	usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
+	usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
 	if (!usb_base)
 		return -ENOMEM;
 	usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
@@ -189,7 +189,7 @@ static int initialize_usbh1_port(struct platform_device *pdev)
 			MXC_EHCI_ITC_NO_THRESHOLD);
 }
 
-static struct mxc_usbh_platform_data dr_utmi_config = {
+static const struct mxc_usbh_platform_data dr_utmi_config __initconst = {
 	.init		= initialize_otg_port,
 	.portsc	= MXC_EHCI_UTMI_16BIT,
 };
@@ -199,7 +199,7 @@ static struct fsl_usb2_platform_data usb_pdata = {
 	.phy_mode	= FSL_USB2_PHY_UTMI_WIDE,
 };
 
-static struct mxc_usbh_platform_data usbh1_config = {
+static const struct mxc_usbh_platform_data usbh1_config __initconst = {
 	.init		= initialize_usbh1_port,
 	.portsc	= MXC_EHCI_MODE_ULPI,
 };
@@ -303,7 +303,7 @@ static void __init eukrea_cpuimx51sd_init(void)
 	platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
 
 	if (otg_mode_host)
-		mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config);
+		imx51_add_mxc_ehci_otg(&dr_utmi_config);
 	else {
 		initialize_otg_port(NULL);
 		mxc_register_device(&mxc_usbdr_udc_device, &usb_pdata);
@@ -313,7 +313,7 @@ static void __init eukrea_cpuimx51sd_init(void)
 	gpio_direction_output(USBH1_RST, 0);
 	msleep(20);
 	gpio_set_value(USBH1_RST, 1);
-	mxc_register_device(&mxc_usbh1_device, &usbh1_config);
+	imx51_add_mxc_ehci_hs(1, &usbh1_config);
 
 #ifdef CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD
 	eukrea_mbimxsd51_baseboard_init();
arch/arm/mach-mx5/board-mx51_babbage.c +6 -6
index e400b09..1d15297 100644
@@ -249,7 +249,7 @@ static int initialize_otg_port(struct platform_device *pdev)
 	void __iomem *usb_base;
 	void __iomem *usbother_base;
 
-	usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
+	usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
 	if (!usb_base)
 		return -ENOMEM;
 	usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
@@ -272,7 +272,7 @@ static int initialize_usbh1_port(struct platform_device *pdev)
 	void __iomem *usb_base;
 	void __iomem *usbother_base;
 
-	usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
+	usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
 	if (!usb_base)
 		return -ENOMEM;
 	usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
@@ -288,7 +288,7 @@ static int initialize_usbh1_port(struct platform_device *pdev)
 			MXC_EHCI_ITC_NO_THRESHOLD);
 }
 
-static struct mxc_usbh_platform_data dr_utmi_config = {
+static const struct mxc_usbh_platform_data dr_utmi_config __initconst = {
 	.init		= initialize_otg_port,
 	.portsc	= MXC_EHCI_UTMI_16BIT,
 };
@@ -298,7 +298,7 @@ static struct fsl_usb2_platform_data usb_pdata = {
 	.phy_mode	= FSL_USB2_PHY_UTMI_WIDE,
 };
 
-static struct mxc_usbh_platform_data usbh1_config = {
+static const struct mxc_usbh_platform_data usbh1_config __initconst = {
 	.init		= initialize_usbh1_port,
 	.portsc	= MXC_EHCI_MODE_ULPI,
 };
@@ -384,14 +384,14 @@ static void __init mx51_babbage_init(void)
 	mxc_register_device(&mxc_hsi2c_device, &babbage_hsi2c_data);
 
 	if (otg_mode_host)
-		mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config);
+		imx51_add_mxc_ehci_otg(&dr_utmi_config);
 	else {
 		initialize_otg_port(NULL);
 		mxc_register_device(&mxc_usbdr_udc_device, &usb_pdata);
 	}
 
 	gpio_usbh1_active();
-	mxc_register_device(&mxc_usbh1_device, &usbh1_config);
+	imx51_add_mxc_ehci_hs(1, &usbh1_config);
 	/* setback USBH1_STP to be function */
 	mxc_iomux_v3_setup_pad(usbh1stp);
 	babbage_usbhub_reset();
arch/arm/mach-mx5/board-mx51_efikasb.c +2 -3
index 2e4d9d3..10f0562 100644
@@ -42,7 +42,6 @@
 #include <asm/mach/time.h>
 
 #include "devices-imx51.h"
-#include "devices.h"
 #include "efika.h"
 
 #define EFIKASB_USBH2_STP	IMX_GPIO_NR(2, 20)
@@ -119,7 +118,7 @@ static int initialize_usbh2_port(struct platform_device *pdev)
 	return mx51_initialize_usb_hw(pdev->id, MXC_EHCI_ITC_NO_THRESHOLD);
 }
 
-static struct mxc_usbh_platform_data usbh2_config = {
+static struct mxc_usbh_platform_data usbh2_config __initdata = {
 	.init   = initialize_usbh2_port,
 	.portsc = MXC_EHCI_MODE_ULPI,
 };
@@ -129,7 +128,7 @@ static void __init mx51_efikasb_usb(void)
 	usbh2_config.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
 			ULPI_OTG_DRVVBUS_EXT | ULPI_OTG_EXTVBUSIND);
 	if (usbh2_config.otg)
-		mxc_register_device(&mxc_usbh2_device, &usbh2_config);
+		imx51_add_mxc_ehci_hs(2, &usbh2_config);
 }
 
 static const struct gpio_led mx51_efikasb_leds[] __initconst = {
arch/arm/mach-mx5/devices-imx51.h +7 -0
index e11bc0e..f42acf5 100644
@@ -25,6 +25,13 @@ extern const struct imx_imx_uart_1irq_data imx51_imx_uart_data[];
 #define imx51_add_imx_uart(id, pdata)	\
 	imx_add_imx_uart_1irq(&imx51_imx_uart_data[id], pdata)
 
+extern const struct imx_mxc_ehci_data imx51_mxc_ehci_otg_data;
+#define imx51_add_mxc_ehci_otg(pdata)	\
+	imx_add_mxc_ehci(&imx51_mxc_ehci_otg_data, pdata)
+extern const struct imx_mxc_ehci_data imx51_mxc_ehci_hs_data[];
+#define imx51_add_mxc_ehci_hs(id, pdata)	\
+	imx_add_mxc_ehci(&imx51_mxc_ehci_hs_data[id - 1], pdata)
+
 extern const struct imx_mxc_nand_data imx51_mxc_nand_data;
 #define imx51_add_mxc_nand(pdata)	\
 	imx_add_mxc_nand(&imx51_mxc_nand_data, pdata)
arch/arm/mach-mx5/devices.c +2 -59

70 lines not on this page · raw message

arch/arm/mach-mx5/devices.h +0 -3
index 55a5129..0f30a6e 100644
@@ -1,5 +1,2 @@
-extern struct platform_device mxc_usbdr_host_device;
-extern struct platform_device mxc_usbh1_device;
-extern struct platform_device mxc_usbh2_device;
 extern struct platform_device mxc_usbdr_udc_device;
 extern struct platform_device mxc_hsi2c_device;
arch/arm/mach-mx5/ehci.c +1 -1
index 7ce12c8..c17fa13 100644
@@ -52,7 +52,7 @@ int mx51_initialize_usb_hw(int port, unsigned int flags)
 	void __iomem *usbother_base;
 	int ret = 0;
 
-	usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
+	usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
 	if (!usb_base) {
 		printk(KERN_ERR "%s(): ioremap failed\n", __func__);
 		return -ENOMEM;
arch/arm/mach-mx5/mx51_efika.c +6 -8
index 4435e03..e99dead 100644
@@ -41,7 +41,6 @@
 #include <asm/mach/time.h>
 
 #include "devices-imx51.h"
-#include "devices.h"
 #include "efika.h"
 #include "cpu_op-mx51.h"
 
@@ -133,7 +132,7 @@ static int initialize_otg_port(struct platform_device *pdev)
 	u32 v;
 	void __iomem *usb_base;
 	void __iomem *usbother_base;
-	usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
+	usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
 	if (!usb_base)
 		return -ENOMEM;
 	usbother_base = (void __iomem *)(usb_base + MX5_USBOTHER_REGS_OFFSET);
@@ -150,7 +149,7 @@ static int initialize_otg_port(struct platform_device *pdev)
 	return mx51_initialize_usb_hw(pdev->id, MXC_EHCI_INTERNAL_PHY);
 }
 
-static struct mxc_usbh_platform_data dr_utmi_config = {
+static const struct mxc_usbh_platform_data dr_utmi_config __initconst = {
 	.init   = initialize_otg_port,
 	.portsc = MXC_EHCI_UTMI_16BIT,
 };
@@ -170,7 +169,7 @@ static int initialize_usbh1_port(struct platform_device *pdev)
 	gpio_set_value(EFIKAMX_USBH1_STP, 1);
 	msleep(1);
 
-	usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
+	usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
 	socregs_base = (void __iomem *)(usb_base + MX5_USBOTHER_REGS_OFFSET);
 
 	/* The clock for the USBH1 ULPI port will come externally */
@@ -189,7 +188,7 @@ static int initialize_usbh1_port(struct platform_device *pdev)
 	return mx51_initialize_usb_hw(0, MXC_EHCI_ITC_NO_THRESHOLD);
 }
 
-static struct mxc_usbh_platform_data usbh1_config = {
+static struct mxc_usbh_platform_data usbh1_config __initdata = {
 	.init   = initialize_usbh1_port,
 	.portsc = MXC_EHCI_MODE_ULPI,
 };
@@ -217,9 +216,9 @@ static void __init mx51_efika_usb(void)
 	usbh1_config.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
 			ULPI_OTG_DRVVBUS_EXT | ULPI_OTG_EXTVBUSIND);
 
-	mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config);
+	imx51_add_mxc_ehci_otg(&dr_utmi_config);
 	if (usbh1_config.otg)
-		mxc_register_device(&mxc_usbh1_device, &usbh1_config);
+		imx51_add_mxc_ehci_hs(1, &usbh1_config);
 }
 
 static struct mtd_partition mx51_efika_spi_nor_partitions[] = {
@@ -631,4 +630,3 @@ void __init efika_board_common_init(void)
 	get_cpu_op = mx51_get_cpu_op;
 #endif
 }
-
arch/arm/plat-mxc/devices/platform-mxc-ehci.c +9 -0
index e1763e0..35851d8 100644
@@ -49,6 +49,15 @@ const struct imx_mxc_ehci_data imx35_mxc_ehci_hs_data __initconst =
 	imx_mxc_ehci_data_entry_single(MX35, 1, HS);
 #endif /* ifdef CONFIG_SOC_IMX35 */
 
+#ifdef CONFIG_SOC_IMX51
+const struct imx_mxc_ehci_data imx51_mxc_ehci_otg_data __initconst =
+	imx_mxc_ehci_data_entry_single(MX51, 0, OTG);
+const struct imx_mxc_ehci_data imx51_mxc_ehci_hs_data[] __initconst = {
+	imx_mxc_ehci_data_entry_single(MX51, 1, HS1),
+	imx_mxc_ehci_data_entry_single(MX51, 2, HS2),
+};
+#endif /* ifdef CONFIG_SOC_IMX51 */
+
 struct platform_device *__init imx_add_mxc_ehci(
 		const struct imx_mxc_ehci_data *data,
 		const struct mxc_usbh_platform_data *pdata)
arch/arm/plat-mxc/include/mach/mx51.h +7 -4
index d240b6f..9666e31 100644
@@ -55,7 +55,10 @@
 #define MX51_AIPS1_BASE_ADDR		0x73f00000
 #define MX51_AIPS1_SIZE			SZ_1M
 
-#define MX51_OTG_BASE_ADDR		(MX51_AIPS1_BASE_ADDR + 0x80000)
+#define MX51_USB_BASE_ADDR		(MX51_AIPS1_BASE_ADDR + 0x80000)
+#define MX51_USB_OTG_BASE_ADDR		(MX51_USB_BASE_ADDR + 0x0000)
+#define MX51_USB_HS1_BASE_ADDR		(MX51_USB_BASE_ADDR + 0x0200)
+#define MX51_USB_HS2_BASE_ADDR		(MX51_USB_BASE_ADDR + 0x0400)
 #define MX51_GPIO1_BASE_ADDR		(MX51_AIPS1_BASE_ADDR + 0x84000)
 #define MX51_GPIO2_BASE_ADDR		(MX51_AIPS1_BASE_ADDR + 0x88000)
 #define MX51_GPIO3_BASE_ADDR		(MX51_AIPS1_BASE_ADDR + 0x8c000)
@@ -255,10 +258,10 @@
 #define MX51_INT_IPU_SYN		11
 #define MX51_INT_GPU			12
 #define MX51_INT_RESV13			13
-#define MX51_INT_USB_H1			14
+#define MX51_INT_USB_HS1		14
 #define MX51_INT_EMI			15
-#define MX51_INT_USB_H2			16
-#define MX51_INT_USB_H3			17
+#define MX51_INT_USB_HS2		16
+#define MX51_INT_USB_HS3		17
 #define MX51_INT_USB_OTG		18
 #define MX51_INT_SAHARA_H0		19
 #define MX51_INT_SAHARA_H1		20
Signature · 1 line
1.7.5.4
#4 lore raw

PATCH 4/8 ARM: mx5: dynamically allocate fsl-usb2-udc devices

In reply to Uwe Kleine-König
---
 arch/arm/mach-mx5/Kconfig                         |    3 ++
 arch/arm/mach-mx5/board-cpuimx51.c                |    5 +--
 arch/arm/mach-mx5/board-cpuimx51sd.c              |    5 +--
 arch/arm/mach-mx5/board-mx51_babbage.c            |    4 +-
 arch/arm/mach-mx5/devices-imx51.h                 |    4 +++
 arch/arm/mach-mx5/devices.c                       |   26 ---------------------
 arch/arm/mach-mx5/devices.h                       |    1 -
 arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c |    5 ++++
 8 files changed, 18 insertions(+), 35 deletions(-)
arch/arm/mach-mx5/Kconfig +3 -0
index 2905110..d8691a0 100644
@@ -65,6 +65,7 @@ comment "i.MX51 machines:"
 config MACH_MX51_BABBAGE
 	bool "Support MX51 BABBAGE platforms"
 	select SOC_IMX51
+	select IMX_HAVE_PLATFORM_FSL_USB2_UDC
 	select IMX_HAVE_PLATFORM_IMX2_WDT
 	select IMX_HAVE_PLATFORM_IMX_I2C
 	select IMX_HAVE_PLATFORM_IMX_UART
@@ -92,6 +93,7 @@ config MACH_MX51_3DS
 config MACH_EUKREA_CPUIMX51
 	bool "Support Eukrea CPUIMX51 module"
 	select SOC_IMX51
+	select IMX_HAVE_PLATFORM_FSL_USB2_UDC
 	select IMX_HAVE_PLATFORM_IMX_I2C
 	select IMX_HAVE_PLATFORM_IMX_UART
 	select IMX_HAVE_PLATFORM_MXC_EHCI
@@ -121,6 +123,7 @@ endchoice
 config MACH_EUKREA_CPUIMX51SD
 	bool "Support Eukrea CPUIMX51SD module"
 	select SOC_IMX51
+	select IMX_HAVE_PLATFORM_FSL_USB2_UDC
 	select IMX_HAVE_PLATFORM_IMX_I2C
 	select IMX_HAVE_PLATFORM_IMX_UART
 	select IMX_HAVE_PLATFORM_MXC_EHCI
arch/arm/mach-mx5/board-cpuimx51.c +2 -3
index aa1ff79..e2afe0c 100644
@@ -36,7 +36,6 @@
 #include <asm/mach/time.h>
 
 #include "devices-imx51.h"
-#include "devices.h"
 
 #define CPUIMX51_USBH1_STP	IMX_GPIO_NR(1, 27)
 #define CPUIMX51_QUARTA_GPIO	IMX_GPIO_NR(3, 28)
@@ -211,7 +210,7 @@ static const struct mxc_usbh_platform_data dr_utmi_config __initconst = {
 	.portsc	= MXC_EHCI_UTMI_16BIT,
 };
 
-static struct fsl_usb2_platform_data usb_pdata = {
+static const struct fsl_usb2_platform_data usb_pdata __initconst = {
 	.operating_mode	= FSL_USB2_DR_DEVICE,
 	.phy_mode	= FSL_USB2_PHY_UTMI_WIDE,
 };
@@ -273,7 +272,7 @@ static void __init eukrea_cpuimx51_init(void)
 		imx51_add_mxc_ehci_otg(&dr_utmi_config);
 	else {
 		initialize_otg_port(NULL);
-		mxc_register_device(&mxc_usbdr_udc_device, &usb_pdata);
+		imx51_add_fsl_usb2_udc(&usb_pdata);
 	}
 	imx51_add_mxc_ehci_hs(1, &usbh1_config);
 
arch/arm/mach-mx5/board-cpuimx51sd.c +2 -3
index bca3719..71a5832 100644
@@ -39,7 +39,6 @@
 #include <asm/mach/time.h>
 
 #include "devices-imx51.h"
-#include "devices.h"
 #include "cpu_op-mx51.h"
 
 #define USBH1_RST		IMX_GPIO_NR(2, 28)
@@ -194,7 +193,7 @@ static const struct mxc_usbh_platform_data dr_utmi_config __initconst = {
 	.portsc	= MXC_EHCI_UTMI_16BIT,
 };
 
-static struct fsl_usb2_platform_data usb_pdata = {
+static const struct fsl_usb2_platform_data usb_pdata __initconst = {
 	.operating_mode	= FSL_USB2_DR_DEVICE,
 	.phy_mode	= FSL_USB2_PHY_UTMI_WIDE,
 };
@@ -306,7 +305,7 @@ static void __init eukrea_cpuimx51sd_init(void)
 		imx51_add_mxc_ehci_otg(&dr_utmi_config);
 	else {
 		initialize_otg_port(NULL);
-		mxc_register_device(&mxc_usbdr_udc_device, &usb_pdata);
+		imx51_add_fsl_usb2_udc(&usb_pdata);
 	}
 
 	gpio_request(USBH1_RST, "usb_rst");
arch/arm/mach-mx5/board-mx51_babbage.c +2 -2
index 1d15297..576a799 100644
@@ -293,7 +293,7 @@ static const struct mxc_usbh_platform_data dr_utmi_config __initconst = {
 	.portsc	= MXC_EHCI_UTMI_16BIT,
 };
 
-static struct fsl_usb2_platform_data usb_pdata = {
+static const struct fsl_usb2_platform_data usb_pdata __initconst = {
 	.operating_mode	= FSL_USB2_DR_DEVICE,
 	.phy_mode	= FSL_USB2_PHY_UTMI_WIDE,
 };
@@ -387,7 +387,7 @@ static void __init mx51_babbage_init(void)
 		imx51_add_mxc_ehci_otg(&dr_utmi_config);
 	else {
 		initialize_otg_port(NULL);
-		mxc_register_device(&mxc_usbdr_udc_device, &usb_pdata);
+		imx51_add_fsl_usb2_udc(&usb_pdata);
 	}
 
 	gpio_usbh1_active();
arch/arm/mach-mx5/devices-imx51.h +4 -0
index f42acf5..2f2cdb9 100644
@@ -13,6 +13,10 @@ extern const struct imx_fec_data imx51_fec_data;
 #define imx51_add_fec(pdata)	\
 	imx_add_fec(&imx51_fec_data, pdata)
 
+extern const struct imx_fsl_usb2_udc_data imx51_fsl_usb2_udc_data;
+#define imx51_add_fsl_usb2_udc(pdata)	\
+	imx_add_fsl_usb2_udc(&imx51_fsl_usb2_udc_data, pdata)
+
 extern const struct imx_imx_i2c_data imx51_imx_i2c_data[];
 #define imx51_add_imx_i2c(id, pdata)	\
 	imx_add_imx_i2c(&imx51_imx_i2c_data[id], pdata)
arch/arm/mach-mx5/devices.c +0 -26
index 88edf26..1c09026 100644
@@ -35,29 +35,3 @@ struct platform_device mxc_hsi2c_device = {
 	.num_resources = ARRAY_SIZE(mxc_hsi2c_resources),
 	.resource = mxc_hsi2c_resources
 };
-
-static u64 usb_dma_mask = DMA_BIT_MASK(32);
-
-static struct resource usbotg_resources[] = {
-	{
-		.start = MX51_USB_OTG_BASE_ADDR,
-		.end = MX51_USB_OTG_BASE_ADDR + 0x1ff,
-		.flags = IORESOURCE_MEM,
-	},
-	{
-		.start = MX51_INT_USB_OTG,
-		.flags = IORESOURCE_IRQ,
-	},
-};
-
-/* OTG gadget device */
-struct platform_device mxc_usbdr_udc_device = {
-	.name		= "fsl-usb2-udc",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(usbotg_resources),
-	.resource	= usbotg_resources,
-	.dev		= {
-		.dma_mask		= &usb_dma_mask,
-		.coherent_dma_mask	= DMA_BIT_MASK(32),
-	},
-};
arch/arm/mach-mx5/devices.h +0 -1
index 0f30a6e..6b2edfe 100644
@@ -1,2 +1 @@
-extern struct platform_device mxc_usbdr_udc_device;
 extern struct platform_device mxc_hsi2c_device;
arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c +5 -0
index 23ce08e..848038f 100644
@@ -36,6 +36,11 @@ const struct imx_fsl_usb2_udc_data imx35_fsl_usb2_udc_data __initconst =
 	imx_fsl_usb2_udc_data_entry_single(MX35);
 #endif /* ifdef CONFIG_SOC_IMX35 */
 
+#ifdef CONFIG_SOC_IMX51
+const struct imx_fsl_usb2_udc_data imx51_fsl_usb2_udc_data __initconst =
+	imx_fsl_usb2_udc_data_entry_single(MX51);
+#endif
+
 struct platform_device *__init imx_add_fsl_usb2_udc(
 		const struct imx_fsl_usb2_udc_data *data,
 		const struct fsl_usb2_platform_data *pdata)
Signature · 1 line
1.7.5.4
#5 lore raw

PATCH 5/8 ARM: mx5: dynamically allocate high speed i2c (imx-i2c actually)

In reply to Uwe Kleine-König

This removes the last device from devices.c.

---
 arch/arm/mach-mx5/Makefile                   |    2 +-
 arch/arm/mach-mx5/board-mx51_babbage.c       |    5 +--
 arch/arm/mach-mx5/devices-imx51.h            |    2 +
 arch/arm/mach-mx5/devices.c                  |   37 --------------------------
 arch/arm/mach-mx5/devices.h                  |    1 -
 arch/arm/plat-mxc/devices/platform-imx-i2c.c |    6 ++++
 6 files changed, 11 insertions(+), 42 deletions(-)
 delete mode 100644 arch/arm/mach-mx5/devices.c
 delete mode 100644 arch/arm/mach-mx5/devices.h
arch/arm/mach-mx5/Makefile +1 -1
index 383e7cd..7f45243 100644
@@ -3,7 +3,7 @@
 #
 
 # Object file lists.
-obj-y   := cpu.o mm.o clock-mx51-mx53.o devices.o ehci.o system.o
+obj-y   := cpu.o mm.o clock-mx51-mx53.o ehci.o system.o
 obj-$(CONFIG_SOC_IMX50) += mm-mx50.o
 
 obj-$(CONFIG_PM) += pm-imx5.o
arch/arm/mach-mx5/board-mx51_babbage.c +2 -3
index 576a799..41a911f 100644
@@ -31,7 +31,6 @@
 #include <asm/mach/time.h>
 
 #include "devices-imx51.h"
-#include "devices.h"
 #include "cpu_op-mx51.h"
 
 #define BABBAGE_USB_HUB_RESET	IMX_GPIO_NR(1, 7)
@@ -176,7 +175,7 @@ static const struct imxi2c_platform_data babbage_i2c_data __initconst = {
 	.bitrate = 100000,
 };
 
-static struct imxi2c_platform_data babbage_hsi2c_data = {
+static const struct imxi2c_platform_data babbage_hsi2c_data __initconst = {
 	.bitrate = 400000,
 };
 
@@ -381,7 +380,7 @@ static void __init mx51_babbage_init(void)
 
 	imx51_add_imx_i2c(0, &babbage_i2c_data);
 	imx51_add_imx_i2c(1, &babbage_i2c_data);
-	mxc_register_device(&mxc_hsi2c_device, &babbage_hsi2c_data);
+	imx51_add_hsi2c(&babbage_hsi2c_data);
 
 	if (otg_mode_host)
 		imx51_add_mxc_ehci_otg(&dr_utmi_config);
arch/arm/mach-mx5/devices-imx51.h +2 -0
index 2f2cdb9..f311c96 100644
@@ -20,6 +20,8 @@ extern const struct imx_fsl_usb2_udc_data imx51_fsl_usb2_udc_data;
 extern const struct imx_imx_i2c_data imx51_imx_i2c_data[];
 #define imx51_add_imx_i2c(id, pdata)	\
 	imx_add_imx_i2c(&imx51_imx_i2c_data[id], pdata)
+#define imx51_add_hsi2c(pdata)	\
+	imx51_add_imx_i2c(2, pdata)
 
 extern const struct imx_imx_ssi_data imx51_imx_ssi_data[];
 #define imx51_add_imx_ssi(id, pdata)	\
arch/arm/mach-mx5/devices.c deleted +0 -37
deleted file mode 100644
index 1c09026..0000000
@@ -1,37 +0,0 @@
-/*
- * Copyright 2009 Amit Kucheria <[email protected]>
- * Copyright (C) 2010 Freescale Semiconductor, Inc.
- *
- * The code contained herein is licensed under the GNU General Public
- * License. You may obtain a copy of the GNU General Public License
- * Version 2 or later at the following locations:
- *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
- */
-
-#include <linux/platform_device.h>
-#include <linux/dma-mapping.h>
-#include <mach/hardware.h>
-#include <mach/imx-uart.h>
-#include <mach/irqs.h>
-
-static struct resource mxc_hsi2c_resources[] = {
-	{
-		.start = MX51_HSI2C_DMA_BASE_ADDR,
-		.end = MX51_HSI2C_DMA_BASE_ADDR + SZ_16K - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	{
-		.start = MX51_INT_HS_I2C,
-		.end = MX51_INT_HS_I2C,
-		.flags = IORESOURCE_IRQ,
-	},
-};
-
-struct platform_device mxc_hsi2c_device = {
-	.name = "imx-i2c",
-	.id = 2,
-	.num_resources = ARRAY_SIZE(mxc_hsi2c_resources),
-	.resource = mxc_hsi2c_resources
-};
arch/arm/mach-mx5/devices.h deleted +0 -1
deleted file mode 100644
index 6b2edfe..0000000
@@ -1 +0,0 @@
-extern struct platform_device mxc_hsi2c_device;
arch/arm/plat-mxc/devices/platform-imx-i2c.c +6 -0
index afe60f7..19ad580 100644
@@ -85,6 +85,12 @@ const struct imx_imx_i2c_data imx51_imx_i2c_data[] __initconst = {
 	imx_imx_i2c_data_entry(MX51, _id, _hwid, SZ_4K)
 	imx51_imx_i2c_data_entry(0, 1),
 	imx51_imx_i2c_data_entry(1, 2),
+	{
+		.id = 2,
+		.iobase = MX51_HSI2C_DMA_BASE_ADDR,
+		.iosize = SZ_16K,
+		.irq = MX51_INT_HS_I2C,
+	},
 };
 #endif /* ifdef CONFIG_SOC_IMX51 */
 
Signature · 1 line
1.7.5.4
#6 lore raw

PATCH 6/8 ARM: imx/mx1ads: dynamically allocate physmap-flash device

In reply to Uwe Kleine-König
---
 arch/arm/mach-imx/mach-mx1ads.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)
arch/arm/mach-imx/mach-mx1ads.c +5 -10
index 5cd8bee..e8867ff 100644
@@ -68,23 +68,16 @@ static const struct imxuart_platform_data uart1_pdata __initconst = {
  * Physmap flash
  */
 
-static struct physmap_flash_data mx1ads_flash_data = {
+static const struct physmap_flash_data mx1ads_flash_data __initconst = {
 	.width		= 4,		/* bankwidth in bytes */
 };
 
-static struct resource flash_resource = {
+static const struct resource flash_resource __initconst = {
 	.start	= MX1_CS0_PHYS,
 	.end	= MX1_CS0_PHYS + SZ_32M - 1,
 	.flags	= IORESOURCE_MEM,
 };
 
-static struct platform_device flash_device = {
-	.name	= "physmap-flash",
-	.id	= 0,
-	.resource = &flash_resource,
-	.num_resources = 1,
-};
-
 /*
  * I2C
  */
@@ -125,7 +118,9 @@ static void __init mx1ads_init(void)
 	imx1_add_imx_uart1(&uart1_pdata);
 
 	/* Physmap flash */
-	mxc_register_device(&flash_device, &mx1ads_flash_data);
+	platform_device_register_resndata(NULL, "physmap-flash", 0,
+			&flash_resource, 1,
+			&mx1ads_flash_data, sizeof(mx1ads_flash_data));
 
 	/* I2C */
 	i2c_register_board_info(0, mx1ads_i2c_devices,
Signature · 1 line
1.7.5.4
#7 lore raw

PATCH 7/8 ARM: imx/armadillo5x0: dynamically allocate physmap-flash device

In reply to Uwe Kleine-König
---
 arch/arm/mach-imx/mach-armadillo5x0.c |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)
arch/arm/mach-imx/mach-armadillo5x0.c +7 -11
index ede2710..83e5e3a 100644
@@ -314,25 +314,19 @@ static struct mtd_partition armadillo5x0_nor_flash_partitions[] = {
 	},
 };
 
-static struct physmap_flash_data armadillo5x0_nor_flash_pdata = {
+static const struct physmap_flash_data
+		armadillo5x0_nor_flash_pdata __initconst = {
 	.width		= 2,
 	.parts		= armadillo5x0_nor_flash_partitions,
 	.nr_parts	= ARRAY_SIZE(armadillo5x0_nor_flash_partitions),
 };
 
-static struct resource armadillo5x0_nor_flash_resource = {
+static const struct resource armadillo5x0_nor_flash_resource __initconst = {
 	.flags		= IORESOURCE_MEM,
 	.start		= MX31_CS0_BASE_ADDR,
 	.end		= MX31_CS0_BASE_ADDR + SZ_64M - 1,
 };
 
-static struct platform_device armadillo5x0_nor_flash = {
-	.name			= "physmap-flash",
-	.id			= -1,
-	.num_resources		= 1,
-	.resource		= &armadillo5x0_nor_flash_resource,
-};
-
 /*
  * FB support
  */
@@ -514,8 +508,10 @@ static void __init armadillo5x0_init(void)
 	imx31_add_mx3_sdc_fb(&mx3fb_pdata);
 
 	/* Register NOR Flash */
-	mxc_register_device(&armadillo5x0_nor_flash,
-			    &armadillo5x0_nor_flash_pdata);
+	platform_device_register_resndata(NULL, "physmap-flash", -1,
+			&armadillo5x0_nor_flash_resource, 1,
+			&armadillo5x0_nor_flash_pdata,
+			sizeof(armadillo5x0_nor_flash_pdata));
 
 	/* Register NAND Flash */
 	imx31_add_mxc_nand(&armadillo5x0_nand_board_info);
Signature · 1 line
1.7.5.4
#8 lore raw

PATCH 8/8 ARM: mxc: drop now unused function mxc_register_device

In reply to Uwe Kleine-König
---
 arch/arm/plat-mxc/devices.c             |   14 --------------
 arch/arm/plat-mxc/include/mach/common.h |    1 -
 2 files changed, 0 insertions(+), 15 deletions(-)
arch/arm/plat-mxc/devices.c +0 -14
index 0d6ed31..5aaa8c5 100644
@@ -23,20 +23,6 @@
 #include <linux/platform_device.h>
 #include <mach/common.h>
 
-int __init mxc_register_device(struct platform_device *pdev, void *data)
-{
-	int ret;
-
-	pdev->dev.platform_data = data;
-
-	ret = platform_device_register(pdev);
-	if (ret)
-		pr_debug("Unable to register platform device '%s': %d\n",
-			 pdev->name, ret);
-
-	return ret;
-}
-
 struct platform_device *__init imx_add_platform_device_dmamask(
 		const char *name, int id,
 		const struct resource *res, unsigned int num_resources,
arch/arm/plat-mxc/include/mach/common.h +0 -1
index 4e3d978..91d810ce 100644
@@ -66,7 +66,6 @@ extern int mx53_clocks_init(unsigned long ckil, unsigned long osc,
 			unsigned long ckih1, unsigned long ckih2);
 extern struct platform_device *mxc_register_gpio(char *name, int id,
 	resource_size_t iobase, resource_size_t iosize, int irq, int irq_high);
-extern int mxc_register_device(struct platform_device *pdev, void *data);
 extern void mxc_set_cpu_type(unsigned int type);
 extern void mxc_arch_reset_init(void __iomem *);
 extern void mx51_efikamx_reset(void);
Signature · 1 line
1.7.5.4