aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorValentine Barshak <valentine.barshak@cogentembedded.com>2014-02-04 13:48:20 -0500
committerSimon Horman <horms+renesas@verge.net.au>2014-02-06 01:51:59 -0500
commit12c1d5a54e874f26d08fa27f13f63ef7ccf38a2a (patch)
treeaf36a45890a6416f287fddb673003176fc375c4c
parent29d9f010d7103f2b83ce1c25999a6f3a1e57f5e2 (diff)
ARM: shmobile: koelsch: Add I2C support
This adds I2C[1245] busses support to Koelsch board. I2C[03] do not have any slave devices connected and are not used because of the following: * I2C0 pins are multiplexed with LBSC pins; * I2C3 pins are multiplexed with EtherMAC and VIN0 pins. Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r--arch/arm/mach-shmobile/board-koelsch.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index 1ec3b91b475c..2741dba74aaa 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -165,6 +165,38 @@ static const struct platform_device_info sata0_info __initconst = {
165 .dma_mask = DMA_BIT_MASK(32), 165 .dma_mask = DMA_BIT_MASK(32),
166}; 166};
167 167
168/* I2C */
169static const struct resource i2c_resources[] __initconst = {
170 /* I2C0 */
171 DEFINE_RES_MEM(0xE6508000, 0x40),
172 DEFINE_RES_IRQ(gic_spi(287)),
173 /* I2C1 */
174 DEFINE_RES_MEM(0xE6518000, 0x40),
175 DEFINE_RES_IRQ(gic_spi(288)),
176 /* I2C2 */
177 DEFINE_RES_MEM(0xE6530000, 0x40),
178 DEFINE_RES_IRQ(gic_spi(286)),
179 /* I2C3 */
180 DEFINE_RES_MEM(0xE6540000, 0x40),
181 DEFINE_RES_IRQ(gic_spi(290)),
182 /* I2C4 */
183 DEFINE_RES_MEM(0xE6520000, 0x40),
184 DEFINE_RES_IRQ(gic_spi(19)),
185 /* I2C5 */
186 DEFINE_RES_MEM(0xE6528000, 0x40),
187 DEFINE_RES_IRQ(gic_spi(20)),
188};
189
190static void __init koelsch_add_i2c(unsigned idx)
191{
192 unsigned res_idx = idx * 2;
193
194 BUG_ON(res_idx >= ARRAY_SIZE(i2c_resources));
195
196 platform_device_register_simple("i2c-rcar_gen2", idx,
197 i2c_resources + res_idx, 2);
198}
199
168static const struct pinctrl_map koelsch_pinctrl_map[] = { 200static const struct pinctrl_map koelsch_pinctrl_map[] = {
169 /* DU */ 201 /* DU */
170 PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7791", "pfc-r8a7791", 202 PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7791", "pfc-r8a7791",
@@ -188,6 +220,15 @@ static const struct pinctrl_map koelsch_pinctrl_map[] = {
188 /* SCIF1 (CN20: DEBUG SERIAL1) */ 220 /* SCIF1 (CN20: DEBUG SERIAL1) */
189 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.7", "pfc-r8a7791", 221 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.7", "pfc-r8a7791",
190 "scif1_data_d", "scif1"), 222 "scif1_data_d", "scif1"),
223 /* I2C1 */
224 PIN_MAP_MUX_GROUP_DEFAULT("i2c-rcar_gen2.1", "pfc-r8a7791",
225 "i2c1_e", "i2c1"),
226 /* I2C2 */
227 PIN_MAP_MUX_GROUP_DEFAULT("i2c-rcar_gen2.2", "pfc-r8a7791",
228 "i2c2", "i2c2"),
229 /* I2C4 */
230 PIN_MAP_MUX_GROUP_DEFAULT("i2c-rcar_gen2.4", "pfc-r8a7791",
231 "i2c4_c", "i2c4"),
191}; 232};
192 233
193static void __init koelsch_add_standard_devices(void) 234static void __init koelsch_add_standard_devices(void)
@@ -211,6 +252,11 @@ static void __init koelsch_add_standard_devices(void)
211 koelsch_add_du_device(); 252 koelsch_add_du_device();
212 253
213 platform_device_register_full(&sata0_info); 254 platform_device_register_full(&sata0_info);
255
256 koelsch_add_i2c(1);
257 koelsch_add_i2c(2);
258 koelsch_add_i2c(4);
259 koelsch_add_i2c(5);
214} 260}
215 261
216/* 262/*