All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 06/10] ARM: shmobile: r8a7790: add I2C clock
@ 2013-08-30 12:37 Ulrich Hecht
  2013-08-30 17:31 ` Sergei Shtylyov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ulrich Hecht @ 2013-08-30 12:37 UTC (permalink / raw)
  To: linux-sh

From: Nguyen Viet Dung <nv-dung@jinso.co.jp>

This patch add clock for I2C bus.

Signed-off-by: Nguyen Viet Dung <nv-dung@jinso.co.jp>
---
 arch/arm/mach-shmobile/clock-r8a7790.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
index d99b87b..05cd34b 100644
--- a/arch/arm/mach-shmobile/clock-r8a7790.c
+++ b/arch/arm/mach-shmobile/clock-r8a7790.c
@@ -52,6 +52,7 @@
 #define SMSTPCR5 0xe6150144
 #define SMSTPCR7 0xe615014c
 #define SMSTPCR8 0xe6150990
+#define SMSTPCR9 0xe6150994
 
 #define SDCKCR		0xE6150074
 #define SD2CKCR		0xE6150078
@@ -181,6 +182,7 @@ static struct clk div6_clks[DIV6_NR] = {
 
 /* MSTP */
 enum {
+	MSTP931, MSTP930, MSTP929, MSTP928,
 	MSTP813,
 	MSTP726, MSTP725, MSTP724, MSTP723, MSTP722, MSTP721, MSTP720,
 	MSTP717, MSTP716,
@@ -192,6 +194,10 @@ enum {
 };
 
 static struct clk mstp_clks[MSTP_NR] = {
+	[MSTP931] = SH_CLK_MSTP32(&hp_clk, SMSTPCR9, 31, 0), /* I2C0 */
+	[MSTP930] = SH_CLK_MSTP32(&hp_clk, SMSTPCR9, 30, 0), /* I2C1 */
+	[MSTP929] = SH_CLK_MSTP32(&hp_clk, SMSTPCR9, 29, 0), /* I2C2 */
+	[MSTP928] = SH_CLK_MSTP32(&hp_clk, SMSTPCR9, 28, 0), /* I2C3 */
 	[MSTP813] = SH_CLK_MSTP32(&p_clk, SMSTPCR8, 13, 0), /* Ether */
 	[MSTP726] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 26, 0), /* LVDS0 */
 	[MSTP725] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 25, 0), /* LVDS1 */
@@ -247,6 +253,7 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_CON_ID("mp",		&mp_clk),
 	CLKDEV_CON_ID("qspi",		&qspi_clk),
 	CLKDEV_CON_ID("cp",		&cp_clk),
+	CLKDEV_CON_ID("peripheral_clk",	&hp_clk),
 
 	/* DIV4 */
 	CLKDEV_CON_ID("sdh",		&div4_clks[DIV4_SDH]),
@@ -286,6 +293,10 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_DEV_ID("ee220000.mmcif", &mstp_clks[MSTP305]),
 	CLKDEV_DEV_ID("sh_mmcif.1", &mstp_clks[MSTP305]),
 	CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]),
+	CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP931]),
+	CLKDEV_DEV_ID("i2c-rcar.1", &mstp_clks[MSTP930]),
+	CLKDEV_DEV_ID("i2c-rcar.2", &mstp_clks[MSTP929]),
+	CLKDEV_DEV_ID("i2c-rcar.3", &mstp_clks[MSTP928]),
 };
 
 #define R8A7790_CLOCK_ROOT(e, m, p0, p1, p30, p31)		\
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RFC 06/10] ARM: shmobile: r8a7790: add I2C clock
  2013-08-30 12:37 [RFC 06/10] ARM: shmobile: r8a7790: add I2C clock Ulrich Hecht
@ 2013-08-30 17:31 ` Sergei Shtylyov
  2013-09-03  7:21 ` Ulrich Hecht
  2013-09-03 12:21 ` Sergei Shtylyov
  2 siblings, 0 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2013-08-30 17:31 UTC (permalink / raw)
  To: linux-sh

Hello.

On 08/30/2013 04:37 PM, Ulrich Hecht wrote:

> From: Nguyen Viet Dung <nv-dung@jinso.co.jp>

> This patch add clock for I2C bus.

> Signed-off-by: Nguyen Viet Dung <nv-dung@jinso.co.jp>
> ---
>   arch/arm/mach-shmobile/clock-r8a7790.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)

> diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
> index d99b87b..05cd34b 100644
> --- a/arch/arm/mach-shmobile/clock-r8a7790.c
> +++ b/arch/arm/mach-shmobile/clock-r8a7790.c
[...]
> @@ -181,6 +182,7 @@ static struct clk div6_clks[DIV6_NR] = {
>
>   /* MSTP */
>   enum {
> +	MSTP931, MSTP930, MSTP929, MSTP928,

    Please break the line after "MSTP930,".

[...]
> @@ -286,6 +293,10 @@ static struct clk_lookup lookups[] = {
>   	CLKDEV_DEV_ID("ee220000.mmcif", &mstp_clks[MSTP305]),
>   	CLKDEV_DEV_ID("sh_mmcif.1", &mstp_clks[MSTP305]),
>   	CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]),
> +	CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP931]),
> +	CLKDEV_DEV_ID("i2c-rcar.1", &mstp_clks[MSTP930]),
> +	CLKDEV_DEV_ID("i2c-rcar.2", &mstp_clks[MSTP929]),
> +	CLKDEV_DEV_ID("i2c-rcar.3", &mstp_clks[MSTP928]),

    These should be sorted downwards by MSTPxxx index, no?

WBR, Sergei


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC 06/10] ARM: shmobile: r8a7790: add I2C clock
  2013-08-30 12:37 [RFC 06/10] ARM: shmobile: r8a7790: add I2C clock Ulrich Hecht
  2013-08-30 17:31 ` Sergei Shtylyov
@ 2013-09-03  7:21 ` Ulrich Hecht
  2013-09-03 12:21 ` Sergei Shtylyov
  2 siblings, 0 replies; 4+ messages in thread
From: Ulrich Hecht @ 2013-09-03  7:21 UTC (permalink / raw)
  To: linux-sh

Thanks for the review.

On Fri, Aug 30, 2013 at 7:31 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> On 08/30/2013 04:37 PM, Ulrich Hecht wrote:
>> --- a/arch/arm/mach-shmobile/clock-r8a7790.c
>> +++ b/arch/arm/mach-shmobile/clock-r8a7790.c
>> @@ -181,6 +182,7 @@ static struct clk div6_clks[DIV6_NR] = {
>>
>>   /* MSTP */
>>   enum {
>> +       MSTP931, MSTP930, MSTP929, MSTP928,
>
>    Please break the line after "MSTP930,".

Could you explain what the system behind this is?

>> @@ -286,6 +293,10 @@ static struct clk_lookup lookups[] = {
>>         CLKDEV_DEV_ID("ee220000.mmcif", &mstp_clks[MSTP305]),
>>         CLKDEV_DEV_ID("sh_mmcif.1", &mstp_clks[MSTP305]),
>>         CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]),
>> +       CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP931]),
>> +       CLKDEV_DEV_ID("i2c-rcar.1", &mstp_clks[MSTP930]),
>> +       CLKDEV_DEV_ID("i2c-rcar.2", &mstp_clks[MSTP929]),
>> +       CLKDEV_DEV_ID("i2c-rcar.3", &mstp_clks[MSTP928]),
>
>    These should be sorted downwards by MSTPxxx index, no?

OK.

CU
Uli

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC 06/10] ARM: shmobile: r8a7790: add I2C clock
  2013-08-30 12:37 [RFC 06/10] ARM: shmobile: r8a7790: add I2C clock Ulrich Hecht
  2013-08-30 17:31 ` Sergei Shtylyov
  2013-09-03  7:21 ` Ulrich Hecht
@ 2013-09-03 12:21 ` Sergei Shtylyov
  2 siblings, 0 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2013-09-03 12:21 UTC (permalink / raw)
  To: linux-sh

Hello.

On 03-09-2013 11:21, Ulrich Hecht wrote:

> <sergei.shtylyov@cogentembedded.com> wrote:
>> On 08/30/2013 04:37 PM, Ulrich Hecht wrote:
>>> --- a/arch/arm/mach-shmobile/clock-r8a7790.c
>>> +++ b/arch/arm/mach-shmobile/clock-r8a7790.c
>>> @@ -181,6 +182,7 @@ static struct clk div6_clks[DIV6_NR] = {
>>>
>>>    /* MSTP */
>>>    enum {
>>> +       MSTP931, MSTP930, MSTP929, MSTP928,

>>     Please break the line after "MSTP930,".

> Could you explain what the system behind this is?

    Every line should start with MSTPxx0 and end with MSTPxx9, ideally.
Although, I see this file doesn't always follow this rule, so you can ignore 
me. :-)

> CU
> Uli

WBR, Sergei


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-09-03 12:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-30 12:37 [RFC 06/10] ARM: shmobile: r8a7790: add I2C clock Ulrich Hecht
2013-08-30 17:31 ` Sergei Shtylyov
2013-09-03  7:21 ` Ulrich Hecht
2013-09-03 12:21 ` Sergei Shtylyov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.