aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAlessandro Rubini <rubini@gnudd.com>2012-06-11 16:56:38 -0400
committerWolfram Sang <w.sang@pengutronix.de>2012-07-09 05:40:46 -0400
commit235602146ec9c1882edf1ccc68389c1176be8198 (patch)
tree7b3afcf452f9b8aa65d8091ac700f3dad7f524e7 /arch
parentaf97bace2cca58ee7c94bf4d31e820f29688d7a5 (diff)
i2c-nomadik: turn the platform driver to an amba driver
The i2c-nomadik gateware is really a PrimeCell APB device. By hosting the driver under the amba bus we can access it more easily, for example using the generic pci-amba driver. The patch also fixes the mach-ux500 users, so they register an amba device instead than a platform device. Signed-off-by: Alessandro Rubini <rubini@gnudd.com> Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com> Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-ux500/devices-common.h22
1 files changed, 5 insertions, 17 deletions
diff --git a/arch/arm/mach-ux500/devices-common.h b/arch/arm/mach-ux500/devices-common.h
index 23cf734b5384..ecdd8386cffb 100644
--- a/arch/arm/mach-ux500/devices-common.h
+++ b/arch/arm/mach-ux500/devices-common.h
@@ -56,27 +56,15 @@ dbx500_add_uart(struct device *parent, const char *name, resource_size_t base,
56 56
57struct nmk_i2c_controller; 57struct nmk_i2c_controller;
58 58
59static inline struct platform_device * 59static inline struct amba_device *
60dbx500_add_i2c(struct device *parent, int id, resource_size_t base, int irq, 60dbx500_add_i2c(struct device *parent, int id, resource_size_t base, int irq,
61 struct nmk_i2c_controller *data) 61 struct nmk_i2c_controller *data)
62{ 62{
63 struct resource res[] = { 63 /* Conjure a name similar to what the platform device used to have */
64 DEFINE_RES_MEM(base, SZ_4K), 64 char name[16];
65 DEFINE_RES_IRQ(irq),
66 };
67 65
68 struct platform_device_info pdevinfo = { 66 snprintf(name, sizeof(name), "nmk-i2c.%d", id);
69 .parent = parent, 67 return amba_apb_device_add(parent, name, base, SZ_4K, irq, 0, data, 0);
70 .name = "nmk-i2c",
71 .id = id,
72 .res = res,
73 .num_res = ARRAY_SIZE(res),
74 .data = data,
75 .size_data = sizeof(*data),
76 .dma_mask = DMA_BIT_MASK(32),
77 };
78
79 return platform_device_register_full(&pdevinfo);
80} 68}
81 69
82static inline struct amba_device * 70static inline struct amba_device *