diff mbox

[3/3,V2] ARM: shmobile: koelsch: Add I2C support

Message ID 1388143659-8739-4-git-send-email-valentine.barshak@cogentembedded.com (mailing list archive)
State Superseded
Commit b503798b1915d22b8d2aafe204e0ba108f998ff7
Headers show

Commit Message

Valentine Barshak Dec. 27, 2013, 11:27 a.m. UTC
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.

Changes in V2:
* Capitalized ARM in the subject.

Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
---
 arch/arm/mach-shmobile/board-koelsch.c | 46 ++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

Comments

Simon Horman Jan. 6, 2014, 5:35 a.m. UTC | #1
On Fri, Dec 27, 2013 at 03:27:39PM +0400, Valentine Barshak wrote:
> 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.
> 
> Changes in V2:
> * Capitalized ARM in the subject.
> 
> Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>

Thanks, I will queue this up.
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Simon Horman Jan. 6, 2014, 6:07 a.m. UTC | #2
On Mon, Jan 06, 2014 at 02:35:23PM +0900, Simon Horman wrote:
> On Fri, Dec 27, 2013 at 03:27:39PM +0400, Valentine Barshak wrote:
> > 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.
> > 
> > Changes in V2:
> > * Capitalized ARM in the subject.
> > 
> > Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
> 
> Thanks, I will queue this up.

Please send an update to the koelsch defconfig to enable I2C.
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Simon Horman Jan. 6, 2014, 6:15 a.m. UTC | #3
On Mon, Jan 06, 2014 at 03:07:36PM +0900, Simon Horman wrote:
> On Mon, Jan 06, 2014 at 02:35:23PM +0900, Simon Horman wrote:
> > On Fri, Dec 27, 2013 at 03:27:39PM +0400, Valentine Barshak wrote:
> > > 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.
> > > 
> > > Changes in V2:
> > > * Capitalized ARM in the subject.
> > > 
> > > Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
> > 
> > Thanks, I will queue this up.

Bother, I was too hasty, it seems that there is a run-time dependency on
patch 1 of the series.

> Please send an update to the koelsch defconfig to enable I2C.

Could you please repost this patch, along with a patch to update
the defconfig once the dependencies are available in an rc release.

I will leave patch 2 of the series queued up as it should be harmless enough.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Valentine Barshak Jan. 6, 2014, 1:51 p.m. UTC | #4
On 01/06/2014 10:15 AM, Simon Horman wrote:
> On Mon, Jan 06, 2014 at 03:07:36PM +0900, Simon Horman wrote:
>> On Mon, Jan 06, 2014 at 02:35:23PM +0900, Simon Horman wrote:
>>> On Fri, Dec 27, 2013 at 03:27:39PM +0400, Valentine Barshak wrote:
>>>> 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.
>>>>
>>>> Changes in V2:
>>>> * Capitalized ARM in the subject.
>>>>
>>>> Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
>>>
>>> Thanks, I will queue this up.
>
> Bother, I was too hasty, it seems that there is a run-time dependency on
> patch 1 of the series.
>
>> Please send an update to the koelsch defconfig to enable I2C.
>
> Could you please repost this patch, along with a patch to update
> the defconfig once the dependencies are available in an rc release.

OK, thanks!

>
> I will leave patch 2 of the series queued up as it should be harmless enough.
>
> Thanks.
>

Thanks,
Val.
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index de7cc64..799825c 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -148,6 +148,38 @@  static const struct gpio_keys_platform_data koelsch_keys_pdata __initconst = {
 	.nbuttons	= ARRAY_SIZE(gpio_buttons),
 };
 
+/* I2C */
+static const struct resource i2c_resources[] __initconst = {
+	/* I2C0 */
+	DEFINE_RES_MEM(0xE6508000, 0x40),
+	DEFINE_RES_IRQ(gic_spi(287)),
+	/* I2C1 */
+	DEFINE_RES_MEM(0xE6518000, 0x40),
+	DEFINE_RES_IRQ(gic_spi(288)),
+	/* I2C2 */
+	DEFINE_RES_MEM(0xE6530000, 0x40),
+	DEFINE_RES_IRQ(gic_spi(286)),
+	/* I2C3 */
+	DEFINE_RES_MEM(0xE6540000, 0x40),
+	DEFINE_RES_IRQ(gic_spi(290)),
+	/* I2C4 */
+	DEFINE_RES_MEM(0xE6520000, 0x40),
+	DEFINE_RES_IRQ(gic_spi(19)),
+	/* I2C5 */
+	DEFINE_RES_MEM(0xE6528000, 0x40),
+	DEFINE_RES_IRQ(gic_spi(20)),
+};
+
+static void __init koelsch_add_i2c(unsigned idx)
+{
+	unsigned res_idx = idx * 2;
+
+	BUG_ON(res_idx >= ARRAY_SIZE(i2c_resources));
+
+	platform_device_register_simple("i2c-rcar_gen2", idx,
+					i2c_resources + res_idx, 2);
+}
+
 static const struct pinctrl_map koelsch_pinctrl_map[] = {
 	/* DU */
 	PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7791", "pfc-r8a7791",
@@ -171,6 +203,15 @@  static const struct pinctrl_map koelsch_pinctrl_map[] = {
 	/* SCIF1 (CN20: DEBUG SERIAL1) */
 	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.7", "pfc-r8a7791",
 				  "scif1_data_d", "scif1"),
+	/* I2C1 */
+	PIN_MAP_MUX_GROUP_DEFAULT("i2c-rcar_gen2.1", "pfc-r8a7791",
+				  "i2c1_e", "i2c1"),
+	/* I2C2 */
+	PIN_MAP_MUX_GROUP_DEFAULT("i2c-rcar_gen2.2", "pfc-r8a7791",
+				  "i2c2", "i2c2"),
+	/* I2C4 */
+	PIN_MAP_MUX_GROUP_DEFAULT("i2c-rcar_gen2.4", "pfc-r8a7791",
+				  "i2c4_c", "i2c4"),
 };
 
 static void __init koelsch_add_standard_devices(void)
@@ -192,6 +233,11 @@  static void __init koelsch_add_standard_devices(void)
 				      sizeof(koelsch_keys_pdata));
 
 	koelsch_add_du_device();
+
+	koelsch_add_i2c(1);
+	koelsch_add_i2c(2);
+	koelsch_add_i2c(4);
+	koelsch_add_i2c(5);
 }
 
 /*