Commit 23560214 authored by Alessandro Rubini's avatar Alessandro Rubini Committed by Wolfram Sang

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: default avatarAlessandro Rubini <rubini@gnudd.com>
Acked-by: default avatarGiancarlo Asnaghi <giancarlo.asnaghi@st.com>
Tested-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
parent af97bace
...@@ -56,27 +56,15 @@ dbx500_add_uart(struct device *parent, const char *name, resource_size_t base, ...@@ -56,27 +56,15 @@ dbx500_add_uart(struct device *parent, const char *name, resource_size_t base,
struct nmk_i2c_controller; struct nmk_i2c_controller;
static inline struct platform_device * static inline struct amba_device *
dbx500_add_i2c(struct device *parent, int id, resource_size_t base, int irq, dbx500_add_i2c(struct device *parent, int id, resource_size_t base, int irq,
struct nmk_i2c_controller *data) struct nmk_i2c_controller *data)
{ {
struct resource res[] = { /* Conjure a name similar to what the platform device used to have */
DEFINE_RES_MEM(base, SZ_4K), char name[16];
DEFINE_RES_IRQ(irq),
};
struct platform_device_info pdevinfo = { snprintf(name, sizeof(name), "nmk-i2c.%d", id);
.parent = parent, return amba_apb_device_add(parent, name, base, SZ_4K, irq, 0, data, 0);
.name = "nmk-i2c",
.id = id,
.res = res,
.num_res = ARRAY_SIZE(res),
.data = data,
.size_data = sizeof(*data),
.dma_mask = DMA_BIT_MASK(32),
};
return platform_device_register_full(&pdevinfo);
} }
static inline struct amba_device * static inline struct amba_device *
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment