Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm: omap2: n8x0: move i2c devices to DT

By moving i2c devices to DT we can clean up
i2c_board_info and fix a problem with moving
INTC to irq domain where IRQs can be renumbered
on each boot.

Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>

authored by

Felipe Balbi and committed by
Tony Lindgren
e92ce89c 55601c9f

+23 -23
+7
arch/arm/boot/dts/omap2420-n810.dts
··· 6 6 model = "Nokia N810"; 7 7 compatible = "nokia,n810", "nokia,n8x0", "ti,omap2420", "ti,omap2"; 8 8 }; 9 + 10 + &i2c2 { 11 + aic3x@18 { 12 + compatible = "tlv320aic3x"; 13 + reg = <0x18>; 14 + }; 15 + };
+6
arch/arm/boot/dts/omap2420-n8x0-common.dtsi
··· 27 27 28 28 &i2c1 { 29 29 clock-frequency = <400000>; 30 + 31 + pmic@72 { 32 + compatible = "menelaus"; 33 + reg = <0x72>; 34 + interrupts = <7 IRQ_TYPE_EDGE_RISING>; 35 + }; 30 36 }; 31 37 32 38 &i2c2 {
+3 -23
arch/arm/mach-omap2/board-n8x0.c
··· 33 33 #include "mmc.h" 34 34 #include "soc.h" 35 35 #include "gpmc-onenand.h" 36 + #include "common-board-devices.h" 36 37 37 38 #define TUSB6010_ASYNC_CS 1 38 39 #define TUSB6010_SYNC_CS 4 ··· 569 568 } 570 569 #endif 571 570 572 - static struct menelaus_platform_data n8x0_menelaus_platform_data __initdata = { 571 + struct menelaus_platform_data n8x0_menelaus_platform_data __initdata = { 573 572 .late_init = n8x0_menelaus_late_init, 574 573 }; 575 574 576 - static struct i2c_board_info __initdata n8x0_i2c_board_info_1[] __initdata = { 577 - { 578 - I2C_BOARD_INFO("menelaus", 0x72), 579 - .irq = 7 + OMAP_INTC_START, 580 - .platform_data = &n8x0_menelaus_platform_data, 581 - }, 582 - }; 583 - 584 - static struct aic3x_pdata n810_aic33_data __initdata = { 575 + struct aic3x_pdata n810_aic33_data __initdata = { 585 576 .gpio_reset = 118, 586 - }; 587 - 588 - static struct i2c_board_info n810_i2c_board_info_2[] __initdata = { 589 - { 590 - I2C_BOARD_INFO("tlv320aic3x", 0x18), 591 - .platform_data = &n810_aic33_data, 592 - }, 593 577 }; 594 578 595 579 static int __init n8x0_late_initcall(void) ··· 598 612 board_check_revision(); 599 613 spi_register_board_info(n800_spi_board_info, 600 614 ARRAY_SIZE(n800_spi_board_info)); 601 - i2c_register_board_info(0, n8x0_i2c_board_info_1, 602 - ARRAY_SIZE(n8x0_i2c_board_info_1)); 603 - if (board_is_n810()) 604 - i2c_register_board_info(1, n810_i2c_board_info_2, 605 - ARRAY_SIZE(n810_i2c_board_info_2)); 606 - 607 615 return &mmc1_data; 608 616 }
+5
arch/arm/mach-omap2/common-board-devices.h
··· 1 1 #ifndef __OMAP_COMMON_BOARD_DEVICES__ 2 2 #define __OMAP_COMMON_BOARD_DEVICES__ 3 3 4 + #include <sound/tlv320aic3x.h> 5 + #include <linux/mfd/menelaus.h> 4 6 #include "twl-common.h" 5 7 6 8 #define NAND_BLOCK_SIZE SZ_128K ··· 13 11 void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce, 14 12 struct ads7846_platform_data *board_pdata); 15 13 void *n8x0_legacy_init(void); 14 + 15 + extern struct menelaus_platform_data n8x0_menelaus_platform_data; 16 + extern struct aic3x_pdata n810_aic33_data; 16 17 17 18 #endif /* __OMAP_COMMON_BOARD_DEVICES__ */
+2
arch/arm/mach-omap2/pdata-quirks.c
··· 336 336 struct of_dev_auxdata omap_auxdata_lookup[] __initdata = { 337 337 #ifdef CONFIG_MACH_NOKIA_N8X0 338 338 OF_DEV_AUXDATA("ti,omap2420-mmc", 0x4809c000, "mmci-omap.0", NULL), 339 + OF_DEV_AUXDATA("menelaus", 0x72, "1-0072", &n8x0_menelaus_platform_data), 340 + OF_DEV_AUXDATA("tlv320aic3x", 0x18, "2-0018", &n810_aic33_data), 339 341 #endif 340 342 #ifdef CONFIG_ARCH_OMAP3 341 343 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata),