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

ARM: 6337/2: AB8500 I2C platform configuration and irq

This patch adds the platform part of the AB8500 PRCMU I2C
access driver. The old irq name AB4500 is changed to AB8500.

Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Linus Walleij and committed by
Russell King
29aeb3cf fd0d67d6

+28 -5
+27 -4
arch/arm/mach-ux500/board-mop500.c
··· 28 28 #include <mach/hardware.h> 29 29 #include <mach/setup.h> 30 30 #include <mach/devices.h> 31 + #include <mach/irqs.h> 31 32 32 33 #include "pins-db8500.h" 33 34 #include "board-mop500.h" ··· 77 76 .irq_base = MOP500_AB8500_IRQ_BASE, 78 77 }; 79 78 80 - static struct spi_board_info u8500_spi_devices[] = { 79 + static struct resource ab8500_resources[] = { 80 + [0] = { 81 + .start = IRQ_AB8500, 82 + .end = IRQ_AB8500, 83 + .flags = IORESOURCE_IRQ 84 + } 85 + }; 86 + 87 + struct platform_device ab8500_device = { 88 + .name = "ab8500-i2c", 89 + .id = 0, 90 + .dev = { 91 + .platform_data = &ab8500_platdata, 92 + }, 93 + .num_resources = 1, 94 + .resource = ab8500_resources, 95 + }; 96 + 97 + static struct spi_board_info ab8500_spi_devices[] = { 81 98 { 82 - .modalias = "ab8500", 99 + .modalias = "ab8500-spi", 83 100 .controller_data = &ab4500_chip_info, 84 101 .platform_data = &ab8500_platdata, 85 102 .max_speed_hz = 12000000, ··· 185 166 186 167 mop500_sdi_init(); 187 168 188 - spi_register_board_info(u8500_spi_devices, 189 - ARRAY_SIZE(u8500_spi_devices)); 169 + /* If HW is early drop (ED) or V1.0 then use SPI to access AB8500 */ 170 + if (cpu_is_u8500ed() || cpu_is_u8500v10()) 171 + spi_register_board_info(ab8500_spi_devices, 172 + ARRAY_SIZE(ab8500_spi_devices)); 173 + else /* If HW is v.1.1 or later use I2C to access AB8500 */ 174 + platform_device_register(&ab8500_device); 190 175 } 191 176 192 177 MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
+1 -1
arch/arm/mach-ux500/include/mach/irqs.h
··· 40 40 #define IRQ_HSIR_CH1_OVRRUN (IRQ_SHPI_START + 33) 41 41 #define IRQ_HSIR_CH2_OVRRUN (IRQ_SHPI_START + 34) 42 42 #define IRQ_HSIR_CH3_OVRRUN (IRQ_SHPI_START + 35) 43 - #define IRQ_AB4500 (IRQ_SHPI_START + 40) 43 + #define IRQ_AB8500 (IRQ_SHPI_START + 40) 44 44 #define IRQ_PRCMU (IRQ_SHPI_START + 47) 45 45 #define IRQ_DISP (IRQ_SHPI_START + 48) 46 46 #define IRQ_SiPI3 (IRQ_SHPI_START + 49)