提交 040b28fc 编写于 作者: B Ben Nizette 提交者: Haavard Skinnemoen

avr32: pass i2c board info through at32_add_device_twi

New-style I2C drivers require that motherboard-mounted I2C devices are
registered with the I2C core, typically at arch_initcall time.  This
can be done nice and neat by passing the struct i2c_board_info[]
through at32_add_device_twi just like we do for the SPI board info.

While we've got the hood up, remove a duplicate declaration of
at32_add_device_twi() in board.h.

[hskinnemoen@atmel.com: add missing i2c_board_info forward-declaration]
Signed-Off-By: NBen Nizette <bn@niasdigital.com>
Signed-off-by: NHaavard Skinnemoen <hskinnemoen@atmel.com>
上级 e573ebb0
...@@ -990,7 +990,9 @@ static struct clk atmel_twi0_pclk = { ...@@ -990,7 +990,9 @@ static struct clk atmel_twi0_pclk = {
.index = 2, .index = 2,
}; };
struct platform_device *__init at32_add_device_twi(unsigned int id) struct platform_device *__init at32_add_device_twi(unsigned int id,
struct i2c_board_info *b,
unsigned int n)
{ {
struct platform_device *pdev; struct platform_device *pdev;
...@@ -1010,6 +1012,9 @@ struct platform_device *__init at32_add_device_twi(unsigned int id) ...@@ -1010,6 +1012,9 @@ struct platform_device *__init at32_add_device_twi(unsigned int id)
atmel_twi0_pclk.dev = &pdev->dev; atmel_twi0_pclk.dev = &pdev->dev;
if (b)
i2c_register_board_info(id, b, n);
platform_device_add(pdev); platform_device_add(pdev);
return pdev; return pdev;
......
...@@ -66,7 +66,10 @@ struct platform_device *at32_add_device_pwm(u32 mask); ...@@ -66,7 +66,10 @@ struct platform_device *at32_add_device_pwm(u32 mask);
struct platform_device * struct platform_device *
at32_add_device_ssc(unsigned int id, unsigned int flags); at32_add_device_ssc(unsigned int id, unsigned int flags);
struct platform_device *at32_add_device_twi(unsigned int id); struct i2c_board_info;
struct platform_device *at32_add_device_twi(unsigned int id,
struct i2c_board_info *b,
unsigned int n);
struct platform_device *at32_add_device_mci(unsigned int id); struct platform_device *at32_add_device_mci(unsigned int id);
struct platform_device *at32_add_device_ac97c(unsigned int id); struct platform_device *at32_add_device_ac97c(unsigned int id);
struct platform_device *at32_add_device_abdac(unsigned int id); struct platform_device *at32_add_device_abdac(unsigned int id);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册