* [PATCH 0/2] Add I2C support to R8A7778/BOCK-W
@ 2013-04-17 18:42 Sergei Shtylyov
2013-04-17 18:44 ` [PATCH 1/2] ARM: shmobile: r8a7778: add I2C support Sergei Shtylyov
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Sergei Shtylyov @ 2013-04-17 18:42 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
Here's the set of 2 patches against the Simon Horman's 'renesas.git' repo,
'renesas-next-20130417' tag and my recent yet unapplied patches. Here we
add I2C support to the R8A7778 platform code and enable I2C driver on BOCK-W
board. This will be important in the future for the VIN driver since the video
sensor chip is controller via I2C bus #0 on BOCK-W.
[1/2] ARM: shmobile: r8a7778: add I2C support
[2/2] ARM: shmobile: BOCK-W: enable I2C in defconfig
WBR, Sergei
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] ARM: shmobile: r8a7778: add I2C support
2013-04-17 18:42 [PATCH 0/2] Add I2C support to R8A7778/BOCK-W Sergei Shtylyov
@ 2013-04-17 18:44 ` Sergei Shtylyov
2013-04-17 18:47 ` [PATCH 2/2] ARM: shmobile: BOCK-W: enable I2C in defconfig Sergei Shtylyov
2013-04-18 0:44 ` [PATCH 0/2] Add I2C support to R8A7778/BOCK-W Kuninori Morimoto
2 siblings, 0 replies; 7+ messages in thread
From: Sergei Shtylyov @ 2013-04-17 18:44 UTC (permalink / raw)
To: linux-arm-kernel
From: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Add I2C clocks and platform devices for R8A7778 SoC.
Don't forget to also add the peripheral clock which the I2C driver uses.
Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
[Sergei: changed the registration function to platform_device_register_simple()]
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
arch/arm/mach-shmobile/clock-r8a7778.c | 12 ++++++++++++
arch/arm/mach-shmobile/setup-r8a7778.c | 32 ++++++++++++++++++++++++++++++++
2 files changed, 44 insertions(+)
Index: renesas/arch/arm/mach-shmobile/clock-r8a7778.c
===================================================================
--- renesas.orig/arch/arm/mach-shmobile/clock-r8a7778.c
+++ renesas/arch/arm/mach-shmobile/clock-r8a7778.c
@@ -3,6 +3,7 @@
*
* Copyright (C) 2013 Renesas Solutions Corp.
* Copyright (C) 2013 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+ * Copyright (C) 2013 Cogent Embedded, Inc.
*
* based on r8a7779
*
@@ -105,6 +106,7 @@ static struct clk *main_clks[] = {
enum {
MSTP114,
MSTP100,
+ MSTP030, MSTP029, MSTP028, MSTP027,
MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021,
MSTP016, MSTP015,
MSTP_NR };
@@ -112,6 +114,10 @@ enum {
static struct clk mstp_clks[MSTP_NR] = {
[MSTP114] = SH_CLK_MSTP32(&p_clk, MSTPCR1, 14, 0), /* Ether */
[MSTP100] = SH_CLK_MSTP32(&p_clk, MSTPCR1, 0, 0), /* USB0/1 */
+ [MSTP030] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 30, 0), /* I2C0 */
+ [MSTP029] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 29, 0), /* I2C1 */
+ [MSTP028] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 28, 0), /* I2C2 */
+ [MSTP027] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 27, 0), /* I2C3 */
[MSTP026] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 26, 0), /* SCIF0 */
[MSTP025] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 25, 0), /* SCIF1 */
[MSTP024] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 24, 0), /* SCIF2 */
@@ -123,10 +129,16 @@ static struct clk mstp_clks[MSTP_NR] = {
};
static struct clk_lookup lookups[] = {
+ CLKDEV_CON_ID("peripheral_clk", &p_clk),
+
/* MSTP32 clocks */
CLKDEV_DEV_ID("sh-eth", &mstp_clks[MSTP114]), /* Ether */
CLKDEV_DEV_ID("ehci-platform", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */
CLKDEV_DEV_ID("ohci-platform", &mstp_clks[MSTP100]), /* USB OHCI port0/1 */
+ CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP030]), /* I2C0 */
+ CLKDEV_DEV_ID("i2c-rcar.1", &mstp_clks[MSTP029]), /* I2C1 */
+ CLKDEV_DEV_ID("i2c-rcar.2", &mstp_clks[MSTP028]), /* I2C2 */
+ CLKDEV_DEV_ID("i2c-rcar.3", &mstp_clks[MSTP027]), /* I2C3 */
CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP026]), /* SCIF0 */
CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP025]), /* SCIF1 */
CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP024]), /* SCIF2 */
Index: renesas/arch/arm/mach-shmobile/setup-r8a7778.c
===================================================================
--- renesas.orig/arch/arm/mach-shmobile/setup-r8a7778.c
+++ renesas/arch/arm/mach-shmobile/setup-r8a7778.c
@@ -94,6 +94,33 @@ static struct sh_timer_config sh_tmu1_pl
&sh_tmu##idx##_platform_data, \
sizeof(sh_tmu##idx##_platform_data))
+/* I2C */
+static struct resource i2c0_resources[] = {
+ DEFINE_RES_MEM(0xffc70000, 0x1000),
+ DEFINE_RES_IRQ(gic_iid(0x63)),
+};
+
+static struct resource i2c1_resources[] = {
+ DEFINE_RES_MEM(0xffc71000, 0x1000),
+ DEFINE_RES_IRQ(gic_iid(0x6e)),
+};
+
+static struct resource i2c2_resources[] = {
+ DEFINE_RES_MEM(0xffc72000, 0x1000),
+ DEFINE_RES_IRQ(gic_iid(0x6c)),
+};
+
+static struct resource i2c3_resources[] = {
+ DEFINE_RES_MEM(0xffc73000, 0x1000),
+ DEFINE_RES_IRQ(gic_iid(0x6d)),
+};
+
+#define r8a7778_register_i2c(idx) \
+ platform_device_register_simple( \
+ "i2c-rcar", idx, \
+ i2c##idx##_resources, \
+ ARRAY_SIZE(i2c##idx##_resources))
+
/* USB PHY */
static struct resource usb_phy_resources[] = {
DEFINE_RES_MEM(0xffe70800, 0x100),
@@ -236,6 +263,11 @@ void __init r8a7778_add_standard_devices
r8a7778_register_tmu(0);
r8a7778_register_tmu(1);
+
+ r8a7778_register_i2c(0);
+ r8a7778_register_i2c(1);
+ r8a7778_register_i2c(2);
+ r8a7778_register_i2c(3);
}
void __init r8a7778_init_late(void)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/2] ARM: shmobile: BOCK-W: enable I2C in defconfig
2013-04-17 18:42 [PATCH 0/2] Add I2C support to R8A7778/BOCK-W Sergei Shtylyov
2013-04-17 18:44 ` [PATCH 1/2] ARM: shmobile: r8a7778: add I2C support Sergei Shtylyov
@ 2013-04-17 18:47 ` Sergei Shtylyov
2013-04-18 13:27 ` Simon Horman
2013-04-18 0:44 ` [PATCH 0/2] Add I2C support to R8A7778/BOCK-W Kuninori Morimoto
2 siblings, 1 reply; 7+ messages in thread
From: Sergei Shtylyov @ 2013-04-17 18:47 UTC (permalink / raw)
To: linux-arm-kernel
From: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Enable I2C driver in 'bockw_defconfig'.
Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
arch/arm/configs/bockw_defconfig | 2 ++
1 file changed, 2 insertions(+)
Index: renesas/arch/arm/configs/bockw_defconfig
===================================================================
--- renesas.orig/arch/arm/configs/bockw_defconfig
+++ renesas/arch/arm/configs/bockw_defconfig
@@ -73,6 +73,8 @@ CONFIG_SERIAL_SH_SCI_NR_UARTS=6
CONFIG_SERIAL_SH_SCI_CONSOLE=y
# CONFIG_HW_RANDOM is not set
# CONFIG_HWMON is not set
+CONFIG_I2C=y
+CONFIG_I2C_RCAR=y
CONFIG_USB=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_EHCI_HCD=y
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 0/2] Add I2C support to R8A7778/BOCK-W
2013-04-17 18:42 [PATCH 0/2] Add I2C support to R8A7778/BOCK-W Sergei Shtylyov
2013-04-17 18:44 ` [PATCH 1/2] ARM: shmobile: r8a7778: add I2C support Sergei Shtylyov
2013-04-17 18:47 ` [PATCH 2/2] ARM: shmobile: BOCK-W: enable I2C in defconfig Sergei Shtylyov
@ 2013-04-18 0:44 ` Kuninori Morimoto
2 siblings, 0 replies; 7+ messages in thread
From: Kuninori Morimoto @ 2013-04-18 0:44 UTC (permalink / raw)
To: linux-arm-kernel
Hi
> Here's the set of 2 patches against the Simon Horman's 'renesas.git' repo,
> 'renesas-next-20130417' tag and my recent yet unapplied patches. Here we
> add I2C support to the R8A7778 platform code and enable I2C driver on BOCK-W
> board. This will be important in the future for the VIN driver since the video
> sensor chip is controller via I2C bus #0 on BOCK-W.
>
> [1/2] ARM: shmobile: r8a7778: add I2C support
> [2/2] ARM: shmobile: BOCK-W: enable I2C in defconfig
For all patches
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Best regards
---
Kuninori Morimoto
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/2] ARM: shmobile: BOCK-W: enable I2C in defconfig
2013-04-17 18:47 ` [PATCH 2/2] ARM: shmobile: BOCK-W: enable I2C in defconfig Sergei Shtylyov
@ 2013-04-18 13:27 ` Simon Horman
2013-04-18 13:30 ` Sergei Shtylyov
0 siblings, 1 reply; 7+ messages in thread
From: Simon Horman @ 2013-04-18 13:27 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Apr 17, 2013 at 10:47:27PM +0400, Sergei Shtylyov wrote:
> From: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
>
> Enable I2C driver in 'bockw_defconfig'.
>
> Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>
> ---
> arch/arm/configs/bockw_defconfig | 2 ++
> 1 file changed, 2 insertions(+)
>
> Index: renesas/arch/arm/configs/bockw_defconfig
> ===================================================================
> --- renesas.orig/arch/arm/configs/bockw_defconfig
> +++ renesas/arch/arm/configs/bockw_defconfig
> @@ -73,6 +73,8 @@ CONFIG_SERIAL_SH_SCI_NR_UARTS=6
> CONFIG_SERIAL_SH_SCI_CONSOLE=y
> # CONFIG_HW_RANDOM is not set
> # CONFIG_HWMON is not set
> +CONFIG_I2C=y
> +CONFIG_I2C_RCAR=y
> CONFIG_USB=y
> CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
> CONFIG_USB_EHCI_HCD=y
I have applied the following after resolving conflicts
(I don't see CONFIG_USB=y in my tree). Please let me
know if I made an error.
I have queued-up the change for v3.11 in the defconfig-bockw branch
and will push is shortly.
commit 6a3fbcf1ced08f9f423944fefcbc372ec72fa4e7
Author: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Date: Wed Apr 17 22:47:27 2013 +0400
ARM: shmobile: BOCK-W: enable I2C in defconfig
Enable I2C driver in 'bockw_defconfig'.
Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
[ horms+renesas at verge.net.au: resolved trivial conflicts ]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
diff --git a/arch/arm/configs/bockw_defconfig b/arch/arm/configs/bockw_defconfig
index b74a4d4..2c3f34e 100644
--- a/arch/arm/configs/bockw_defconfig
+++ b/arch/arm/configs/bockw_defconfig
@@ -71,6 +71,8 @@ CONFIG_SERIAL_SH_SCI_NR_UARTS=6
CONFIG_SERIAL_SH_SCI_CONSOLE=y
# CONFIG_HW_RANDOM is not set
# CONFIG_HWMON is not set
+CONFIG_I2C=y
+CONFIG_I2C_RCAR=y
# CONFIG_USB_SUPPORT is not set
CONFIG_MMC=y
CONFIG_MMC_SDHI=y
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] ARM: shmobile: BOCK-W: enable I2C in defconfig
2013-04-18 13:27 ` Simon Horman
@ 2013-04-18 13:30 ` Sergei Shtylyov
2013-04-18 13:45 ` Simon Horman
0 siblings, 1 reply; 7+ messages in thread
From: Sergei Shtylyov @ 2013-04-18 13:30 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
On 18-04-2013 17:27, Simon Horman wrote:
>> From: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
>> Enable I2C driver in 'bockw_defconfig'.
>> Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>> ---
>> arch/arm/configs/bockw_defconfig | 2 ++
>> 1 file changed, 2 insertions(+)
>> Index: renesas/arch/arm/configs/bockw_defconfig
>> ===================================================================
>> --- renesas.orig/arch/arm/configs/bockw_defconfig
>> +++ renesas/arch/arm/configs/bockw_defconfig
>> @@ -73,6 +73,8 @@ CONFIG_SERIAL_SH_SCI_NR_UARTS=6
>> CONFIG_SERIAL_SH_SCI_CONSOLE=y
>> # CONFIG_HW_RANDOM is not set
>> # CONFIG_HWMON is not set
>> +CONFIG_I2C=y
>> +CONFIG_I2C_RCAR=y
>> CONFIG_USB=y
>> CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
>> CONFIG_USB_EHCI_HCD=y
> I have applied the following after resolving conflicts
> (I don't see CONFIG_USB=y in my tree). Please let me
> know if I made an error.
I wrote in [0/2] that the patch is atop of my unaccepted USB patches.
> I have queued-up the change for v3.11 in the defconfig-bockw branch
> and will push is shortly.
Have you also queued patch #1? The patch #2 doesn't make much sense
without it.
WBR, Sergei
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/2] ARM: shmobile: BOCK-W: enable I2C in defconfig
2013-04-18 13:30 ` Sergei Shtylyov
@ 2013-04-18 13:45 ` Simon Horman
0 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2013-04-18 13:45 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Apr 18, 2013 at 05:30:09PM +0400, Sergei Shtylyov wrote:
> Hello.
>
> On 18-04-2013 17:27, Simon Horman wrote:
>
> >>From: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
>
> >>Enable I2C driver in 'bockw_defconfig'.
>
> >>Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
> >>Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>
> >>---
> >> arch/arm/configs/bockw_defconfig | 2 ++
> >> 1 file changed, 2 insertions(+)
>
> >>Index: renesas/arch/arm/configs/bockw_defconfig
> >>===================================================================
> >>--- renesas.orig/arch/arm/configs/bockw_defconfig
> >>+++ renesas/arch/arm/configs/bockw_defconfig
> >>@@ -73,6 +73,8 @@ CONFIG_SERIAL_SH_SCI_NR_UARTS=6
> >> CONFIG_SERIAL_SH_SCI_CONSOLE=y
> >> # CONFIG_HW_RANDOM is not set
> >> # CONFIG_HWMON is not set
> >>+CONFIG_I2C=y
> >>+CONFIG_I2C_RCAR=y
> >> CONFIG_USB=y
> >> CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
> >> CONFIG_USB_EHCI_HCD=y
>
> >I have applied the following after resolving conflicts
> >(I don't see CONFIG_USB=y in my tree). Please let me
> >know if I made an error.
>
> I wrote in [0/2] that the patch is atop of my unaccepted USB patches.
>
> >I have queued-up the change for v3.11 in the defconfig-bockw branch
> >and will push is shortly.
>
> Have you also queued patch #1? The patch #2 doesn't make much
> sense without it.
No, I was going to ask for it to be rebased, but I'm happy for it
to wait until your USB changes go in if you are happy to wait.
As for not making much sense, I'm happy with pre-emptively applying
defconfig changes as they are somewhat orthogonal and live in a different
branch.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-04-18 13:45 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-17 18:42 [PATCH 0/2] Add I2C support to R8A7778/BOCK-W Sergei Shtylyov
2013-04-17 18:44 ` [PATCH 1/2] ARM: shmobile: r8a7778: add I2C support Sergei Shtylyov
2013-04-17 18:47 ` [PATCH 2/2] ARM: shmobile: BOCK-W: enable I2C in defconfig Sergei Shtylyov
2013-04-18 13:27 ` Simon Horman
2013-04-18 13:30 ` Sergei Shtylyov
2013-04-18 13:45 ` Simon Horman
2013-04-18 0:44 ` [PATCH 0/2] Add I2C support to R8A7778/BOCK-W Kuninori Morimoto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).