[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:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user