[ARM] pxa: add I2C (TWSI) devices to pxa168/pxa910

Signed-off-by: Paul Shen <paul.shen@marvell.com>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
This commit is contained in:
Eric Miao
2009-04-13 15:34:54 +08:00
committed by Eric Miao
parent f0a8370139
commit 1a77920e4c
5 changed files with 64 additions and 0 deletions

View File

@@ -1,10 +1,14 @@
#ifndef __ASM_MACH_PXA910_H
#define __ASM_MACH_PXA910_H
#include <linux/i2c.h>
#include <mach/devices.h>
#include <plat/i2c.h>
extern struct pxa_device_desc pxa910_device_uart1;
extern struct pxa_device_desc pxa910_device_uart2;
extern struct pxa_device_desc pxa910_device_twsi0;
extern struct pxa_device_desc pxa910_device_twsi1;
static inline int pxa910_add_uart(int id)
{
@@ -20,4 +24,24 @@ static inline int pxa910_add_uart(int id)
return pxa_register_device(d, NULL, 0);
}
static inline int pxa910_add_twsi(int id, struct i2c_pxa_platform_data *data,
struct i2c_board_info *info, unsigned size)
{
struct pxa_device_desc *d = NULL;
int ret;
switch (id) {
case 0: d = &pxa910_device_twsi0; break;
case 1: d = &pxa910_device_twsi1; break;
default:
return -EINVAL;
}
ret = i2c_register_board_info(id, info, size);
if (ret)
return ret;
return pxa_register_device(d, data, sizeof(*data));
}
#endif /* __ASM_MACH_PXA910_H */