aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-08-20 07:56:29 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-08-20 07:58:25 -0400
commit1e66a3da4f7d73c027200fb18bb452fbde17fbd7 (patch)
tree3d1df7041ed755d0c40292f2afcbe89ec5ab64a0
parent8478d266c5efe5c55c161a36b9af6c627e8e0b01 (diff)
ARM: ux500: fix up the I2C devices
The I2C device registration on the different ux500 board was buggy due to a switch to dynamically assigned I2C host addresses. This I2C host is still there, but we have to add the devices dynamically instead of using board data. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--arch/arm/mach-ux500/board-mop500.c33
1 files changed, 13 insertions, 20 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 4e7ab3a0dd60..ad0806eff762 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -324,21 +324,19 @@ static struct lp55xx_platform_data __initdata lp5521_sec_data = {
324 .clock_mode = LP55XX_CLOCK_EXT, 324 .clock_mode = LP55XX_CLOCK_EXT,
325}; 325};
326 326
327/* I2C0 devices only available on the first HREF/MOP500 */
327static struct i2c_board_info __initdata mop500_i2c0_devices[] = { 328static struct i2c_board_info __initdata mop500_i2c0_devices[] = {
328 { 329 {
329 I2C_BOARD_INFO("tc3589x", 0x42), 330 I2C_BOARD_INFO("tc3589x", 0x42),
330 .irq = NOMADIK_GPIO_TO_IRQ(217), 331 .irq = NOMADIK_GPIO_TO_IRQ(217),
331 .platform_data = &mop500_tc35892_data, 332 .platform_data = &mop500_tc35892_data,
332 }, 333 },
333 /* I2C0 devices only available prior to HREFv60 */
334 { 334 {
335 I2C_BOARD_INFO("tps61052", 0x33), 335 I2C_BOARD_INFO("tps61052", 0x33),
336 .platform_data = &mop500_tps61052_data, 336 .platform_data = &mop500_tps61052_data,
337 }, 337 },
338}; 338};
339 339
340#define NUM_PRE_V60_I2C0_DEVICES 1
341
342static struct i2c_board_info __initdata mop500_i2c2_devices[] = { 340static struct i2c_board_info __initdata mop500_i2c2_devices[] = {
343 { 341 {
344 /* lp5521 LED driver, 1st device */ 342 /* lp5521 LED driver, 1st device */
@@ -356,6 +354,17 @@ static struct i2c_board_info __initdata mop500_i2c2_devices[] = {
356 }, 354 },
357}; 355};
358 356
357static int __init mop500_i2c_board_init(void)
358{
359 if (machine_is_u8500())
360 mop500_uib_i2c_add(0, mop500_i2c0_devices,
361 ARRAY_SIZE(mop500_i2c0_devices));
362 mop500_uib_i2c_add(2, mop500_i2c2_devices,
363 ARRAY_SIZE(mop500_i2c2_devices));
364 return 0;
365}
366device_initcall(mop500_i2c_board_init);
367
359static void __init mop500_i2c_init(struct device *parent) 368static void __init mop500_i2c_init(struct device *parent)
360{ 369{
361 db8500_add_i2c0(parent, NULL); 370 db8500_add_i2c0(parent, NULL);
@@ -564,7 +573,6 @@ static struct platform_device *snowball_platform_devs[] __initdata = {
564static void __init mop500_init_machine(void) 573static void __init mop500_init_machine(void)
565{ 574{
566 struct device *parent = NULL; 575 struct device *parent = NULL;
567 int i2c0_devs;
568 int i; 576 int i;
569 577
570 platform_device_register(&db8500_prcmu_device); 578 platform_device_register(&db8500_prcmu_device);
@@ -587,19 +595,13 @@ static void __init mop500_init_machine(void)
587 mop500_spi_init(parent); 595 mop500_spi_init(parent);
588 mop500_audio_init(parent); 596 mop500_audio_init(parent);
589 mop500_uart_init(parent); 597 mop500_uart_init(parent);
590
591 u8500_cryp1_hash1_init(parent); 598 u8500_cryp1_hash1_init(parent);
592 599
593 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
594
595 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
596 i2c_register_board_info(2, mop500_i2c2_devices,
597 ARRAY_SIZE(mop500_i2c2_devices));
598
599 /* This board has full regulator constraints */ 600 /* This board has full regulator constraints */
600 regulator_has_full_constraints(); 601 regulator_has_full_constraints();
601} 602}
602 603
604
603static void __init snowball_init_machine(void) 605static void __init snowball_init_machine(void)
604{ 606{
605 struct device *parent = NULL; 607 struct device *parent = NULL;
@@ -634,7 +636,6 @@ static void __init snowball_init_machine(void)
634static void __init hrefv60_init_machine(void) 636static void __init hrefv60_init_machine(void)
635{ 637{
636 struct device *parent = NULL; 638 struct device *parent = NULL;
637 int i2c0_devs;
638 int i; 639 int i;
639 640
640 platform_device_register(&db8500_prcmu_device); 641 platform_device_register(&db8500_prcmu_device);
@@ -663,14 +664,6 @@ static void __init hrefv60_init_machine(void)
663 mop500_audio_init(parent); 664 mop500_audio_init(parent);
664 mop500_uart_init(parent); 665 mop500_uart_init(parent);
665 666
666 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
667
668 i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES;
669
670 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
671 i2c_register_board_info(2, mop500_i2c2_devices,
672 ARRAY_SIZE(mop500_i2c2_devices));
673
674 /* This board has full regulator constraints */ 667 /* This board has full regulator constraints */
675 regulator_has_full_constraints(); 668 regulator_has_full_constraints();
676} 669}