diff options
author | Lee Jones <lee.jones@linaro.org> | 2012-04-19 16:36:40 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-05-01 18:40:36 -0400 |
commit | 4809f90aadb299743b8f8021ff386f0ef0392c86 (patch) | |
tree | 9cd7368326b6e2cfd49a203936b4605e872a8b2e /arch/arm/mach-ux500/board-mop500.c | |
parent | 3de3d74956e26af0a5647e98f73eaf8efd0d07bd (diff) |
ARM: ux500: Do not attempt to register non-existent i2c devices on Snowball
This patch prevents i2c devices which are not present on the Snowball
low-cost development board from being registered. Devices such as;
tc3589x, bu1780 and lp5521 are present on other supported boards,
but are not located on Snowball.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500.c')
-rw-r--r-- | arch/arm/mach-ux500/board-mop500.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 539da3f3c1c7..b885f271e04a 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c | |||
@@ -646,7 +646,6 @@ static void __init mop500_init_machine(void) | |||
646 | static void __init snowball_init_machine(void) | 646 | static void __init snowball_init_machine(void) |
647 | { | 647 | { |
648 | struct device *parent = NULL; | 648 | struct device *parent = NULL; |
649 | int i2c0_devs; | ||
650 | int i; | 649 | int i; |
651 | 650 | ||
652 | parent = u8500_init_devices(); | 651 | parent = u8500_init_devices(); |
@@ -664,11 +663,6 @@ static void __init snowball_init_machine(void) | |||
664 | mop500_spi_init(parent); | 663 | mop500_spi_init(parent); |
665 | mop500_uart_init(parent); | 664 | mop500_uart_init(parent); |
666 | 665 | ||
667 | i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); | ||
668 | i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); | ||
669 | i2c_register_board_info(2, mop500_i2c2_devices, | ||
670 | ARRAY_SIZE(mop500_i2c2_devices)); | ||
671 | |||
672 | /* This board has full regulator constraints */ | 666 | /* This board has full regulator constraints */ |
673 | regulator_has_full_constraints(); | 667 | regulator_has_full_constraints(); |
674 | } | 668 | } |
@@ -767,7 +761,6 @@ static void __init u8500_init_machine(void) | |||
767 | int i; | 761 | int i; |
768 | 762 | ||
769 | parent = u8500_init_devices(); | 763 | parent = u8500_init_devices(); |
770 | i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); | ||
771 | 764 | ||
772 | for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++) | 765 | for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++) |
773 | mop500_platform_devs[i]->dev.parent = parent; | 766 | mop500_platform_devs[i]->dev.parent = parent; |
@@ -785,6 +778,12 @@ static void __init u8500_init_machine(void) | |||
785 | ARRAY_SIZE(mop500_platform_devs)); | 778 | ARRAY_SIZE(mop500_platform_devs)); |
786 | 779 | ||
787 | mop500_sdi_init(parent); | 780 | mop500_sdi_init(parent); |
781 | |||
782 | i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); | ||
783 | i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); | ||
784 | i2c_register_board_info(2, mop500_i2c2_devices, | ||
785 | ARRAY_SIZE(mop500_i2c2_devices)); | ||
786 | |||
788 | } else if (of_machine_is_compatible("calaosystems,snowball-a9500")) { | 787 | } else if (of_machine_is_compatible("calaosystems,snowball-a9500")) { |
789 | snowball_pins_init(); | 788 | snowball_pins_init(); |
790 | platform_add_devices(snowball_platform_devs, | 789 | platform_add_devices(snowball_platform_devs, |
@@ -798,19 +797,21 @@ static void __init u8500_init_machine(void) | |||
798 | * instead. | 797 | * instead. |
799 | */ | 798 | */ |
800 | mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO; | 799 | mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO; |
801 | i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES; | ||
802 | hrefv60_pins_init(); | 800 | hrefv60_pins_init(); |
803 | platform_add_devices(mop500_platform_devs, | 801 | platform_add_devices(mop500_platform_devs, |
804 | ARRAY_SIZE(mop500_platform_devs)); | 802 | ARRAY_SIZE(mop500_platform_devs)); |
805 | 803 | ||
806 | hrefv60_sdi_init(parent); | 804 | hrefv60_sdi_init(parent); |
805 | |||
806 | i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); | ||
807 | i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES; | ||
808 | |||
809 | i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); | ||
810 | i2c_register_board_info(2, mop500_i2c2_devices, | ||
811 | ARRAY_SIZE(mop500_i2c2_devices)); | ||
807 | } | 812 | } |
808 | mop500_i2c_init(parent); | 813 | mop500_i2c_init(parent); |
809 | 814 | ||
810 | i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); | ||
811 | i2c_register_board_info(2, mop500_i2c2_devices, | ||
812 | ARRAY_SIZE(mop500_i2c2_devices)); | ||
813 | |||
814 | /* This board has full regulator constraints */ | 815 | /* This board has full regulator constraints */ |
815 | regulator_has_full_constraints(); | 816 | regulator_has_full_constraints(); |
816 | } | 817 | } |