Re: [PATCH 17/22] mfd: sun6i-prcm: Add support for Allwinner A23 PRCM

2014-05-29 Thread Maxime Ripard
On Thu, May 29, 2014 at 12:23:58PM +0800, Chen-Yu Tsai wrote:
> On Tue, May 27, 2014 at 4:30 PM, Maxime Ripard
>  wrote:
> > On Mon, May 26, 2014 at 12:36:38PM +0800, Chen-Yu Tsai wrote:
> >> On Mon, May 26, 2014 at 3:14 AM, Maxime Ripard
> >>  wrote:
> >> > On Fri, May 23, 2014 at 03:51:20PM +0800, Chen-Yu Tsai wrote:
> >> >> The Allwinner A23 SoC has a PRCM unit like the previous A31 SoC.
> >> >> The differences are the AR100 clock can no longer be modified,
> >> >> and the APB0 clock has different divisors.
> >> >>
> >> >> This patch adds a compatible with a modified subdevice list for
> >> >> the A23.
> >> >>
> >> >> Signed-off-by: Chen-Yu Tsai 
> >> >> ---
> >> >>  .../devicetree/bindings/mfd/sun6i-prcm.txt |  2 +-
> >> >>  drivers/mfd/sun6i-prcm.c   | 30 
> >> >> ++
> >> >>  2 files changed, 31 insertions(+), 1 deletion(-)
> >> >>
> >> >> diff --git a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt 
> >> >> b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
> >> >> index 1f5a31f..03c5a55 100644
> >> >> --- a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
> >> >> +++ b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
> >> >> @@ -4,7 +4,7 @@ PRCM is an MFD device exposing several Power Management 
> >> >> related devices
> >> >>  (like clks and reset controllers).
> >> >>
> >> >>  Required properties:
> >> >> - - compatible: "allwinner,sun6i-a31-prcm"
> >> >> + - compatible: "allwinner,sun6i-a31-prcm" or "allwinner,sun8i-a23-prcm"
> >> >>   - reg: The PRCM registers range
> >> >>
> >> >>  The prcm node may contain several subdevices definitions:
> >> >> diff --git a/drivers/mfd/sun6i-prcm.c b/drivers/mfd/sun6i-prcm.c
> >> >> index 718fc4d..c96bb6c 100644
> >> >> --- a/drivers/mfd/sun6i-prcm.c
> >> >> +++ b/drivers/mfd/sun6i-prcm.c
> >> >> @@ -76,16 +76,46 @@ static const struct mfd_cell 
> >> >> sun6i_a31_prcm_subdevs[] = {
> >> >>   },
> >> >>  };
> >> >>
> >> >> +static const struct mfd_cell sun8i_a23_prcm_subdevs[] = {
> >> >> + {
> >> >> + .name = "sun6i-a31-apb0-clk",
> >> >> + .of_compatible = "allwinner,sun8i-a23-apb0-clk",
> >> >> + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_clk_res),
> >> >> + .resources = sun6i_a31_apb0_clk_res,
> >> >> + },
> >> >> + {
> >> >> + .name = "sun6i-a31-apb0-gates-clk",
> >> >> + .of_compatible = "allwinner,sun6i-a31-apb0-gates-clk",
> >> >> + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_gates_clk_res),
> >> >> + .resources = sun6i_a31_apb0_gates_clk_res,
> >> >> + },
> >> >
> >> > Did I just have a brainfart, or didn't you just introduced an
> >> > sun8i-a23-apb0-gates-clk driver?
> >>
> >> My bad, I missed this one. The one in the DT is correct.
> >> It actually works, so I'm a bit confused here.
> >> Which one does the driver core actually use?
> >
> > Actually, it will use both, and will match the of_compatible string
> > try to match it against the mfd-sub-nodes compatibles. If nothing
> > matches, it won't fill the dev.of_node field.
> 
> So actually it was supposed to use "allwinner,sun6i-a31-apb0-gates-clk",
> as that clk driver takes clock-indices, so no need to define gate masks
> and tie them to some new compatible.
> 
> There was no sun8i-a23-apb0-gates-clk driver.
> 
> I must not be getting enough sleep.

I'd still prefer it to have a different compatible though, at least to
be consistent.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


signature.asc
Description: Digital signature


Re: [PATCH 17/22] mfd: sun6i-prcm: Add support for Allwinner A23 PRCM

2014-05-29 Thread Maxime Ripard
On Thu, May 29, 2014 at 12:23:58PM +0800, Chen-Yu Tsai wrote:
 On Tue, May 27, 2014 at 4:30 PM, Maxime Ripard
 maxime.rip...@free-electrons.com wrote:
  On Mon, May 26, 2014 at 12:36:38PM +0800, Chen-Yu Tsai wrote:
  On Mon, May 26, 2014 at 3:14 AM, Maxime Ripard
  maxime.rip...@free-electrons.com wrote:
   On Fri, May 23, 2014 at 03:51:20PM +0800, Chen-Yu Tsai wrote:
   The Allwinner A23 SoC has a PRCM unit like the previous A31 SoC.
   The differences are the AR100 clock can no longer be modified,
   and the APB0 clock has different divisors.
  
   This patch adds a compatible with a modified subdevice list for
   the A23.
  
   Signed-off-by: Chen-Yu Tsai w...@csie.org
   ---
.../devicetree/bindings/mfd/sun6i-prcm.txt |  2 +-
drivers/mfd/sun6i-prcm.c   | 30 
   ++
2 files changed, 31 insertions(+), 1 deletion(-)
  
   diff --git a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt 
   b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
   index 1f5a31f..03c5a55 100644
   --- a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
   +++ b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
   @@ -4,7 +4,7 @@ PRCM is an MFD device exposing several Power Management 
   related devices
(like clks and reset controllers).
  
Required properties:
   - - compatible: allwinner,sun6i-a31-prcm
   + - compatible: allwinner,sun6i-a31-prcm or allwinner,sun8i-a23-prcm
 - reg: The PRCM registers range
  
The prcm node may contain several subdevices definitions:
   diff --git a/drivers/mfd/sun6i-prcm.c b/drivers/mfd/sun6i-prcm.c
   index 718fc4d..c96bb6c 100644
   --- a/drivers/mfd/sun6i-prcm.c
   +++ b/drivers/mfd/sun6i-prcm.c
   @@ -76,16 +76,46 @@ static const struct mfd_cell 
   sun6i_a31_prcm_subdevs[] = {
 },
};
  
   +static const struct mfd_cell sun8i_a23_prcm_subdevs[] = {
   + {
   + .name = sun6i-a31-apb0-clk,
   + .of_compatible = allwinner,sun8i-a23-apb0-clk,
   + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_clk_res),
   + .resources = sun6i_a31_apb0_clk_res,
   + },
   + {
   + .name = sun6i-a31-apb0-gates-clk,
   + .of_compatible = allwinner,sun6i-a31-apb0-gates-clk,
   + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_gates_clk_res),
   + .resources = sun6i_a31_apb0_gates_clk_res,
   + },
  
   Did I just have a brainfart, or didn't you just introduced an
   sun8i-a23-apb0-gates-clk driver?
 
  My bad, I missed this one. The one in the DT is correct.
  It actually works, so I'm a bit confused here.
  Which one does the driver core actually use?
 
  Actually, it will use both, and will match the of_compatible string
  try to match it against the mfd-sub-nodes compatibles. If nothing
  matches, it won't fill the dev.of_node field.
 
 So actually it was supposed to use allwinner,sun6i-a31-apb0-gates-clk,
 as that clk driver takes clock-indices, so no need to define gate masks
 and tie them to some new compatible.
 
 There was no sun8i-a23-apb0-gates-clk driver.
 
 I must not be getting enough sleep.

I'd still prefer it to have a different compatible though, at least to
be consistent.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


signature.asc
Description: Digital signature


Re: [PATCH 17/22] mfd: sun6i-prcm: Add support for Allwinner A23 PRCM

2014-05-28 Thread Chen-Yu Tsai
On Tue, May 27, 2014 at 4:30 PM, Maxime Ripard
 wrote:
> On Mon, May 26, 2014 at 12:36:38PM +0800, Chen-Yu Tsai wrote:
>> On Mon, May 26, 2014 at 3:14 AM, Maxime Ripard
>>  wrote:
>> > On Fri, May 23, 2014 at 03:51:20PM +0800, Chen-Yu Tsai wrote:
>> >> The Allwinner A23 SoC has a PRCM unit like the previous A31 SoC.
>> >> The differences are the AR100 clock can no longer be modified,
>> >> and the APB0 clock has different divisors.
>> >>
>> >> This patch adds a compatible with a modified subdevice list for
>> >> the A23.
>> >>
>> >> Signed-off-by: Chen-Yu Tsai 
>> >> ---
>> >>  .../devicetree/bindings/mfd/sun6i-prcm.txt |  2 +-
>> >>  drivers/mfd/sun6i-prcm.c   | 30 
>> >> ++
>> >>  2 files changed, 31 insertions(+), 1 deletion(-)
>> >>
>> >> diff --git a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt 
>> >> b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
>> >> index 1f5a31f..03c5a55 100644
>> >> --- a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
>> >> +++ b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
>> >> @@ -4,7 +4,7 @@ PRCM is an MFD device exposing several Power Management 
>> >> related devices
>> >>  (like clks and reset controllers).
>> >>
>> >>  Required properties:
>> >> - - compatible: "allwinner,sun6i-a31-prcm"
>> >> + - compatible: "allwinner,sun6i-a31-prcm" or "allwinner,sun8i-a23-prcm"
>> >>   - reg: The PRCM registers range
>> >>
>> >>  The prcm node may contain several subdevices definitions:
>> >> diff --git a/drivers/mfd/sun6i-prcm.c b/drivers/mfd/sun6i-prcm.c
>> >> index 718fc4d..c96bb6c 100644
>> >> --- a/drivers/mfd/sun6i-prcm.c
>> >> +++ b/drivers/mfd/sun6i-prcm.c
>> >> @@ -76,16 +76,46 @@ static const struct mfd_cell sun6i_a31_prcm_subdevs[] 
>> >> = {
>> >>   },
>> >>  };
>> >>
>> >> +static const struct mfd_cell sun8i_a23_prcm_subdevs[] = {
>> >> + {
>> >> + .name = "sun6i-a31-apb0-clk",
>> >> + .of_compatible = "allwinner,sun8i-a23-apb0-clk",
>> >> + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_clk_res),
>> >> + .resources = sun6i_a31_apb0_clk_res,
>> >> + },
>> >> + {
>> >> + .name = "sun6i-a31-apb0-gates-clk",
>> >> + .of_compatible = "allwinner,sun6i-a31-apb0-gates-clk",
>> >> + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_gates_clk_res),
>> >> + .resources = sun6i_a31_apb0_gates_clk_res,
>> >> + },
>> >
>> > Did I just have a brainfart, or didn't you just introduced an
>> > sun8i-a23-apb0-gates-clk driver?
>>
>> My bad, I missed this one. The one in the DT is correct.
>> It actually works, so I'm a bit confused here.
>> Which one does the driver core actually use?
>
> Actually, it will use both, and will match the of_compatible string
> try to match it against the mfd-sub-nodes compatibles. If nothing
> matches, it won't fill the dev.of_node field.

So actually it was supposed to use "allwinner,sun6i-a31-apb0-gates-clk",
as that clk driver takes clock-indices, so no need to define gate masks
and tie them to some new compatible.

There was no sun8i-a23-apb0-gates-clk driver.

I must not be getting enough sleep.

>> > And there's no ar100 and ahb0 clocks ?
>>
>> The ahb0 is a fixed-factor (1:1) clock. There are no controls for it.
>> The ar100 clock on the A23 has no controls either, so fixed-factor
>> clock again.
>
> Ack.
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 17/22] mfd: sun6i-prcm: Add support for Allwinner A23 PRCM

2014-05-28 Thread Chen-Yu Tsai
On Tue, May 27, 2014 at 4:30 PM, Maxime Ripard
maxime.rip...@free-electrons.com wrote:
 On Mon, May 26, 2014 at 12:36:38PM +0800, Chen-Yu Tsai wrote:
 On Mon, May 26, 2014 at 3:14 AM, Maxime Ripard
 maxime.rip...@free-electrons.com wrote:
  On Fri, May 23, 2014 at 03:51:20PM +0800, Chen-Yu Tsai wrote:
  The Allwinner A23 SoC has a PRCM unit like the previous A31 SoC.
  The differences are the AR100 clock can no longer be modified,
  and the APB0 clock has different divisors.
 
  This patch adds a compatible with a modified subdevice list for
  the A23.
 
  Signed-off-by: Chen-Yu Tsai w...@csie.org
  ---
   .../devicetree/bindings/mfd/sun6i-prcm.txt |  2 +-
   drivers/mfd/sun6i-prcm.c   | 30 
  ++
   2 files changed, 31 insertions(+), 1 deletion(-)
 
  diff --git a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt 
  b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
  index 1f5a31f..03c5a55 100644
  --- a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
  +++ b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
  @@ -4,7 +4,7 @@ PRCM is an MFD device exposing several Power Management 
  related devices
   (like clks and reset controllers).
 
   Required properties:
  - - compatible: allwinner,sun6i-a31-prcm
  + - compatible: allwinner,sun6i-a31-prcm or allwinner,sun8i-a23-prcm
- reg: The PRCM registers range
 
   The prcm node may contain several subdevices definitions:
  diff --git a/drivers/mfd/sun6i-prcm.c b/drivers/mfd/sun6i-prcm.c
  index 718fc4d..c96bb6c 100644
  --- a/drivers/mfd/sun6i-prcm.c
  +++ b/drivers/mfd/sun6i-prcm.c
  @@ -76,16 +76,46 @@ static const struct mfd_cell sun6i_a31_prcm_subdevs[] 
  = {
},
   };
 
  +static const struct mfd_cell sun8i_a23_prcm_subdevs[] = {
  + {
  + .name = sun6i-a31-apb0-clk,
  + .of_compatible = allwinner,sun8i-a23-apb0-clk,
  + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_clk_res),
  + .resources = sun6i_a31_apb0_clk_res,
  + },
  + {
  + .name = sun6i-a31-apb0-gates-clk,
  + .of_compatible = allwinner,sun6i-a31-apb0-gates-clk,
  + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_gates_clk_res),
  + .resources = sun6i_a31_apb0_gates_clk_res,
  + },
 
  Did I just have a brainfart, or didn't you just introduced an
  sun8i-a23-apb0-gates-clk driver?

 My bad, I missed this one. The one in the DT is correct.
 It actually works, so I'm a bit confused here.
 Which one does the driver core actually use?

 Actually, it will use both, and will match the of_compatible string
 try to match it against the mfd-sub-nodes compatibles. If nothing
 matches, it won't fill the dev.of_node field.

So actually it was supposed to use allwinner,sun6i-a31-apb0-gates-clk,
as that clk driver takes clock-indices, so no need to define gate masks
and tie them to some new compatible.

There was no sun8i-a23-apb0-gates-clk driver.

I must not be getting enough sleep.

  And there's no ar100 and ahb0 clocks ?

 The ahb0 is a fixed-factor (1:1) clock. There are no controls for it.
 The ar100 clock on the A23 has no controls either, so fixed-factor
 clock again.

 Ack.

 --
 Maxime Ripard, Free Electrons
 Embedded Linux, Kernel and Android engineering
 http://free-electrons.com
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 17/22] mfd: sun6i-prcm: Add support for Allwinner A23 PRCM

2014-05-27 Thread Maxime Ripard
On Mon, May 26, 2014 at 12:36:38PM +0800, Chen-Yu Tsai wrote:
> On Mon, May 26, 2014 at 3:14 AM, Maxime Ripard
>  wrote:
> > On Fri, May 23, 2014 at 03:51:20PM +0800, Chen-Yu Tsai wrote:
> >> The Allwinner A23 SoC has a PRCM unit like the previous A31 SoC.
> >> The differences are the AR100 clock can no longer be modified,
> >> and the APB0 clock has different divisors.
> >>
> >> This patch adds a compatible with a modified subdevice list for
> >> the A23.
> >>
> >> Signed-off-by: Chen-Yu Tsai 
> >> ---
> >>  .../devicetree/bindings/mfd/sun6i-prcm.txt |  2 +-
> >>  drivers/mfd/sun6i-prcm.c   | 30 
> >> ++
> >>  2 files changed, 31 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt 
> >> b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
> >> index 1f5a31f..03c5a55 100644
> >> --- a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
> >> +++ b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
> >> @@ -4,7 +4,7 @@ PRCM is an MFD device exposing several Power Management 
> >> related devices
> >>  (like clks and reset controllers).
> >>
> >>  Required properties:
> >> - - compatible: "allwinner,sun6i-a31-prcm"
> >> + - compatible: "allwinner,sun6i-a31-prcm" or "allwinner,sun8i-a23-prcm"
> >>   - reg: The PRCM registers range
> >>
> >>  The prcm node may contain several subdevices definitions:
> >> diff --git a/drivers/mfd/sun6i-prcm.c b/drivers/mfd/sun6i-prcm.c
> >> index 718fc4d..c96bb6c 100644
> >> --- a/drivers/mfd/sun6i-prcm.c
> >> +++ b/drivers/mfd/sun6i-prcm.c
> >> @@ -76,16 +76,46 @@ static const struct mfd_cell sun6i_a31_prcm_subdevs[] 
> >> = {
> >>   },
> >>  };
> >>
> >> +static const struct mfd_cell sun8i_a23_prcm_subdevs[] = {
> >> + {
> >> + .name = "sun6i-a31-apb0-clk",
> >> + .of_compatible = "allwinner,sun8i-a23-apb0-clk",
> >> + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_clk_res),
> >> + .resources = sun6i_a31_apb0_clk_res,
> >> + },
> >> + {
> >> + .name = "sun6i-a31-apb0-gates-clk",
> >> + .of_compatible = "allwinner,sun6i-a31-apb0-gates-clk",
> >> + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_gates_clk_res),
> >> + .resources = sun6i_a31_apb0_gates_clk_res,
> >> + },
> >
> > Did I just have a brainfart, or didn't you just introduced an
> > sun8i-a23-apb0-gates-clk driver?
> 
> My bad, I missed this one. The one in the DT is correct.
> It actually works, so I'm a bit confused here.
> Which one does the driver core actually use?

Actually, it will use both, and will match the of_compatible string
try to match it against the mfd-sub-nodes compatibles. If nothing
matches, it won't fill the dev.of_node field.

> 
> > And there's no ar100 and ahb0 clocks ?
> 
> The ahb0 is a fixed-factor (1:1) clock. There are no controls for it.
> The ar100 clock on the A23 has no controls either, so fixed-factor
> clock again.

Ack.

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


signature.asc
Description: Digital signature


Re: [PATCH 17/22] mfd: sun6i-prcm: Add support for Allwinner A23 PRCM

2014-05-27 Thread Maxime Ripard
On Mon, May 26, 2014 at 12:36:38PM +0800, Chen-Yu Tsai wrote:
 On Mon, May 26, 2014 at 3:14 AM, Maxime Ripard
 maxime.rip...@free-electrons.com wrote:
  On Fri, May 23, 2014 at 03:51:20PM +0800, Chen-Yu Tsai wrote:
  The Allwinner A23 SoC has a PRCM unit like the previous A31 SoC.
  The differences are the AR100 clock can no longer be modified,
  and the APB0 clock has different divisors.
 
  This patch adds a compatible with a modified subdevice list for
  the A23.
 
  Signed-off-by: Chen-Yu Tsai w...@csie.org
  ---
   .../devicetree/bindings/mfd/sun6i-prcm.txt |  2 +-
   drivers/mfd/sun6i-prcm.c   | 30 
  ++
   2 files changed, 31 insertions(+), 1 deletion(-)
 
  diff --git a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt 
  b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
  index 1f5a31f..03c5a55 100644
  --- a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
  +++ b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
  @@ -4,7 +4,7 @@ PRCM is an MFD device exposing several Power Management 
  related devices
   (like clks and reset controllers).
 
   Required properties:
  - - compatible: allwinner,sun6i-a31-prcm
  + - compatible: allwinner,sun6i-a31-prcm or allwinner,sun8i-a23-prcm
- reg: The PRCM registers range
 
   The prcm node may contain several subdevices definitions:
  diff --git a/drivers/mfd/sun6i-prcm.c b/drivers/mfd/sun6i-prcm.c
  index 718fc4d..c96bb6c 100644
  --- a/drivers/mfd/sun6i-prcm.c
  +++ b/drivers/mfd/sun6i-prcm.c
  @@ -76,16 +76,46 @@ static const struct mfd_cell sun6i_a31_prcm_subdevs[] 
  = {
},
   };
 
  +static const struct mfd_cell sun8i_a23_prcm_subdevs[] = {
  + {
  + .name = sun6i-a31-apb0-clk,
  + .of_compatible = allwinner,sun8i-a23-apb0-clk,
  + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_clk_res),
  + .resources = sun6i_a31_apb0_clk_res,
  + },
  + {
  + .name = sun6i-a31-apb0-gates-clk,
  + .of_compatible = allwinner,sun6i-a31-apb0-gates-clk,
  + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_gates_clk_res),
  + .resources = sun6i_a31_apb0_gates_clk_res,
  + },
 
  Did I just have a brainfart, or didn't you just introduced an
  sun8i-a23-apb0-gates-clk driver?
 
 My bad, I missed this one. The one in the DT is correct.
 It actually works, so I'm a bit confused here.
 Which one does the driver core actually use?

Actually, it will use both, and will match the of_compatible string
try to match it against the mfd-sub-nodes compatibles. If nothing
matches, it won't fill the dev.of_node field.

 
  And there's no ar100 and ahb0 clocks ?
 
 The ahb0 is a fixed-factor (1:1) clock. There are no controls for it.
 The ar100 clock on the A23 has no controls either, so fixed-factor
 clock again.

Ack.

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


signature.asc
Description: Digital signature


Re: [PATCH 17/22] mfd: sun6i-prcm: Add support for Allwinner A23 PRCM

2014-05-25 Thread Chen-Yu Tsai
On Mon, May 26, 2014 at 3:14 AM, Maxime Ripard
 wrote:
> On Fri, May 23, 2014 at 03:51:20PM +0800, Chen-Yu Tsai wrote:
>> The Allwinner A23 SoC has a PRCM unit like the previous A31 SoC.
>> The differences are the AR100 clock can no longer be modified,
>> and the APB0 clock has different divisors.
>>
>> This patch adds a compatible with a modified subdevice list for
>> the A23.
>>
>> Signed-off-by: Chen-Yu Tsai 
>> ---
>>  .../devicetree/bindings/mfd/sun6i-prcm.txt |  2 +-
>>  drivers/mfd/sun6i-prcm.c   | 30 
>> ++
>>  2 files changed, 31 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt 
>> b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
>> index 1f5a31f..03c5a55 100644
>> --- a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
>> +++ b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
>> @@ -4,7 +4,7 @@ PRCM is an MFD device exposing several Power Management 
>> related devices
>>  (like clks and reset controllers).
>>
>>  Required properties:
>> - - compatible: "allwinner,sun6i-a31-prcm"
>> + - compatible: "allwinner,sun6i-a31-prcm" or "allwinner,sun8i-a23-prcm"
>>   - reg: The PRCM registers range
>>
>>  The prcm node may contain several subdevices definitions:
>> diff --git a/drivers/mfd/sun6i-prcm.c b/drivers/mfd/sun6i-prcm.c
>> index 718fc4d..c96bb6c 100644
>> --- a/drivers/mfd/sun6i-prcm.c
>> +++ b/drivers/mfd/sun6i-prcm.c
>> @@ -76,16 +76,46 @@ static const struct mfd_cell sun6i_a31_prcm_subdevs[] = {
>>   },
>>  };
>>
>> +static const struct mfd_cell sun8i_a23_prcm_subdevs[] = {
>> + {
>> + .name = "sun6i-a31-apb0-clk",
>> + .of_compatible = "allwinner,sun8i-a23-apb0-clk",
>> + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_clk_res),
>> + .resources = sun6i_a31_apb0_clk_res,
>> + },
>> + {
>> + .name = "sun6i-a31-apb0-gates-clk",
>> + .of_compatible = "allwinner,sun6i-a31-apb0-gates-clk",
>> + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_gates_clk_res),
>> + .resources = sun6i_a31_apb0_gates_clk_res,
>> + },
>
> Did I just have a brainfart, or didn't you just introduced an
> sun8i-a23-apb0-gates-clk driver?

My bad, I missed this one. The one in the DT is correct.
It actually works, so I'm a bit confused here.
Which one does the driver core actually use?

> And there's no ar100 and ahb0 clocks ?

The ahb0 is a fixed-factor (1:1) clock. There are no controls for it.
The ar100 clock on the A23 has no controls either, so fixed-factor
clock again.


Thanks,
ChenYu
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 17/22] mfd: sun6i-prcm: Add support for Allwinner A23 PRCM

2014-05-25 Thread Maxime Ripard
On Fri, May 23, 2014 at 03:51:20PM +0800, Chen-Yu Tsai wrote:
> The Allwinner A23 SoC has a PRCM unit like the previous A31 SoC.
> The differences are the AR100 clock can no longer be modified,
> and the APB0 clock has different divisors.
> 
> This patch adds a compatible with a modified subdevice list for
> the A23.
> 
> Signed-off-by: Chen-Yu Tsai 
> ---
>  .../devicetree/bindings/mfd/sun6i-prcm.txt |  2 +-
>  drivers/mfd/sun6i-prcm.c   | 30 
> ++
>  2 files changed, 31 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt 
> b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
> index 1f5a31f..03c5a55 100644
> --- a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
> +++ b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
> @@ -4,7 +4,7 @@ PRCM is an MFD device exposing several Power Management 
> related devices
>  (like clks and reset controllers).
>  
>  Required properties:
> - - compatible: "allwinner,sun6i-a31-prcm"
> + - compatible: "allwinner,sun6i-a31-prcm" or "allwinner,sun8i-a23-prcm"
>   - reg: The PRCM registers range
>  
>  The prcm node may contain several subdevices definitions:
> diff --git a/drivers/mfd/sun6i-prcm.c b/drivers/mfd/sun6i-prcm.c
> index 718fc4d..c96bb6c 100644
> --- a/drivers/mfd/sun6i-prcm.c
> +++ b/drivers/mfd/sun6i-prcm.c
> @@ -76,16 +76,46 @@ static const struct mfd_cell sun6i_a31_prcm_subdevs[] = {
>   },
>  };
>  
> +static const struct mfd_cell sun8i_a23_prcm_subdevs[] = {
> + {
> + .name = "sun6i-a31-apb0-clk",
> + .of_compatible = "allwinner,sun8i-a23-apb0-clk",
> + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_clk_res),
> + .resources = sun6i_a31_apb0_clk_res,
> + },
> + {
> + .name = "sun6i-a31-apb0-gates-clk",
> + .of_compatible = "allwinner,sun6i-a31-apb0-gates-clk",
> + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_gates_clk_res),
> + .resources = sun6i_a31_apb0_gates_clk_res,
> + },

Did I just have a brainfart, or didn't you just introduced an
sun8i-a23-apb0-gates-clk driver?

And there's no ar100 and ahb0 clocks ?

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


signature.asc
Description: Digital signature


Re: [PATCH 17/22] mfd: sun6i-prcm: Add support for Allwinner A23 PRCM

2014-05-25 Thread Maxime Ripard
On Fri, May 23, 2014 at 03:51:20PM +0800, Chen-Yu Tsai wrote:
 The Allwinner A23 SoC has a PRCM unit like the previous A31 SoC.
 The differences are the AR100 clock can no longer be modified,
 and the APB0 clock has different divisors.
 
 This patch adds a compatible with a modified subdevice list for
 the A23.
 
 Signed-off-by: Chen-Yu Tsai w...@csie.org
 ---
  .../devicetree/bindings/mfd/sun6i-prcm.txt |  2 +-
  drivers/mfd/sun6i-prcm.c   | 30 
 ++
  2 files changed, 31 insertions(+), 1 deletion(-)
 
 diff --git a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt 
 b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
 index 1f5a31f..03c5a55 100644
 --- a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
 +++ b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
 @@ -4,7 +4,7 @@ PRCM is an MFD device exposing several Power Management 
 related devices
  (like clks and reset controllers).
  
  Required properties:
 - - compatible: allwinner,sun6i-a31-prcm
 + - compatible: allwinner,sun6i-a31-prcm or allwinner,sun8i-a23-prcm
   - reg: The PRCM registers range
  
  The prcm node may contain several subdevices definitions:
 diff --git a/drivers/mfd/sun6i-prcm.c b/drivers/mfd/sun6i-prcm.c
 index 718fc4d..c96bb6c 100644
 --- a/drivers/mfd/sun6i-prcm.c
 +++ b/drivers/mfd/sun6i-prcm.c
 @@ -76,16 +76,46 @@ static const struct mfd_cell sun6i_a31_prcm_subdevs[] = {
   },
  };
  
 +static const struct mfd_cell sun8i_a23_prcm_subdevs[] = {
 + {
 + .name = sun6i-a31-apb0-clk,
 + .of_compatible = allwinner,sun8i-a23-apb0-clk,
 + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_clk_res),
 + .resources = sun6i_a31_apb0_clk_res,
 + },
 + {
 + .name = sun6i-a31-apb0-gates-clk,
 + .of_compatible = allwinner,sun6i-a31-apb0-gates-clk,
 + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_gates_clk_res),
 + .resources = sun6i_a31_apb0_gates_clk_res,
 + },

Did I just have a brainfart, or didn't you just introduced an
sun8i-a23-apb0-gates-clk driver?

And there's no ar100 and ahb0 clocks ?

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


signature.asc
Description: Digital signature


Re: [PATCH 17/22] mfd: sun6i-prcm: Add support for Allwinner A23 PRCM

2014-05-25 Thread Chen-Yu Tsai
On Mon, May 26, 2014 at 3:14 AM, Maxime Ripard
maxime.rip...@free-electrons.com wrote:
 On Fri, May 23, 2014 at 03:51:20PM +0800, Chen-Yu Tsai wrote:
 The Allwinner A23 SoC has a PRCM unit like the previous A31 SoC.
 The differences are the AR100 clock can no longer be modified,
 and the APB0 clock has different divisors.

 This patch adds a compatible with a modified subdevice list for
 the A23.

 Signed-off-by: Chen-Yu Tsai w...@csie.org
 ---
  .../devicetree/bindings/mfd/sun6i-prcm.txt |  2 +-
  drivers/mfd/sun6i-prcm.c   | 30 
 ++
  2 files changed, 31 insertions(+), 1 deletion(-)

 diff --git a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt 
 b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
 index 1f5a31f..03c5a55 100644
 --- a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
 +++ b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
 @@ -4,7 +4,7 @@ PRCM is an MFD device exposing several Power Management 
 related devices
  (like clks and reset controllers).

  Required properties:
 - - compatible: allwinner,sun6i-a31-prcm
 + - compatible: allwinner,sun6i-a31-prcm or allwinner,sun8i-a23-prcm
   - reg: The PRCM registers range

  The prcm node may contain several subdevices definitions:
 diff --git a/drivers/mfd/sun6i-prcm.c b/drivers/mfd/sun6i-prcm.c
 index 718fc4d..c96bb6c 100644
 --- a/drivers/mfd/sun6i-prcm.c
 +++ b/drivers/mfd/sun6i-prcm.c
 @@ -76,16 +76,46 @@ static const struct mfd_cell sun6i_a31_prcm_subdevs[] = {
   },
  };

 +static const struct mfd_cell sun8i_a23_prcm_subdevs[] = {
 + {
 + .name = sun6i-a31-apb0-clk,
 + .of_compatible = allwinner,sun8i-a23-apb0-clk,
 + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_clk_res),
 + .resources = sun6i_a31_apb0_clk_res,
 + },
 + {
 + .name = sun6i-a31-apb0-gates-clk,
 + .of_compatible = allwinner,sun6i-a31-apb0-gates-clk,
 + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_gates_clk_res),
 + .resources = sun6i_a31_apb0_gates_clk_res,
 + },

 Did I just have a brainfart, or didn't you just introduced an
 sun8i-a23-apb0-gates-clk driver?

My bad, I missed this one. The one in the DT is correct.
It actually works, so I'm a bit confused here.
Which one does the driver core actually use?

 And there's no ar100 and ahb0 clocks ?

The ahb0 is a fixed-factor (1:1) clock. There are no controls for it.
The ar100 clock on the A23 has no controls either, so fixed-factor
clock again.


Thanks,
ChenYu
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 17/22] mfd: sun6i-prcm: Add support for Allwinner A23 PRCM

2014-05-23 Thread Chen-Yu Tsai
The Allwinner A23 SoC has a PRCM unit like the previous A31 SoC.
The differences are the AR100 clock can no longer be modified,
and the APB0 clock has different divisors.

This patch adds a compatible with a modified subdevice list for
the A23.

Signed-off-by: Chen-Yu Tsai 
---
 .../devicetree/bindings/mfd/sun6i-prcm.txt |  2 +-
 drivers/mfd/sun6i-prcm.c   | 30 ++
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt 
b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
index 1f5a31f..03c5a55 100644
--- a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
+++ b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
@@ -4,7 +4,7 @@ PRCM is an MFD device exposing several Power Management related 
devices
 (like clks and reset controllers).
 
 Required properties:
- - compatible: "allwinner,sun6i-a31-prcm"
+ - compatible: "allwinner,sun6i-a31-prcm" or "allwinner,sun8i-a23-prcm"
  - reg: The PRCM registers range
 
 The prcm node may contain several subdevices definitions:
diff --git a/drivers/mfd/sun6i-prcm.c b/drivers/mfd/sun6i-prcm.c
index 718fc4d..c96bb6c 100644
--- a/drivers/mfd/sun6i-prcm.c
+++ b/drivers/mfd/sun6i-prcm.c
@@ -76,16 +76,46 @@ static const struct mfd_cell sun6i_a31_prcm_subdevs[] = {
},
 };
 
+static const struct mfd_cell sun8i_a23_prcm_subdevs[] = {
+   {
+   .name = "sun6i-a31-apb0-clk",
+   .of_compatible = "allwinner,sun8i-a23-apb0-clk",
+   .num_resources = ARRAY_SIZE(sun6i_a31_apb0_clk_res),
+   .resources = sun6i_a31_apb0_clk_res,
+   },
+   {
+   .name = "sun6i-a31-apb0-gates-clk",
+   .of_compatible = "allwinner,sun6i-a31-apb0-gates-clk",
+   .num_resources = ARRAY_SIZE(sun6i_a31_apb0_gates_clk_res),
+   .resources = sun6i_a31_apb0_gates_clk_res,
+   },
+   {
+   .name = "sun6i-a31-apb0-clock-reset",
+   .of_compatible = "allwinner,sun6i-a31-clock-reset",
+   .num_resources = ARRAY_SIZE(sun6i_a31_apb0_rstc_res),
+   .resources = sun6i_a31_apb0_rstc_res,
+   },
+};
+
 static const struct prcm_data sun6i_a31_prcm_data = {
.nsubdevs = ARRAY_SIZE(sun6i_a31_prcm_subdevs),
.subdevs = sun6i_a31_prcm_subdevs,
 };
 
+static const struct prcm_data sun8i_a23_prcm_data = {
+   .nsubdevs = ARRAY_SIZE(sun8i_a23_prcm_subdevs),
+   .subdevs = sun8i_a23_prcm_subdevs,
+};
+
 static const struct of_device_id sun6i_prcm_dt_ids[] = {
{
.compatible = "allwinner,sun6i-a31-prcm",
.data = _a31_prcm_data,
},
+   {
+   .compatible = "allwinner,sun8i-a23-prcm",
+   .data = _a23_prcm_data,
+   },
{ /* sentinel */ },
 };
 
-- 
2.0.0.rc2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 17/22] mfd: sun6i-prcm: Add support for Allwinner A23 PRCM

2014-05-23 Thread Chen-Yu Tsai
The Allwinner A23 SoC has a PRCM unit like the previous A31 SoC.
The differences are the AR100 clock can no longer be modified,
and the APB0 clock has different divisors.

This patch adds a compatible with a modified subdevice list for
the A23.

Signed-off-by: Chen-Yu Tsai w...@csie.org
---
 .../devicetree/bindings/mfd/sun6i-prcm.txt |  2 +-
 drivers/mfd/sun6i-prcm.c   | 30 ++
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt 
b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
index 1f5a31f..03c5a55 100644
--- a/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
+++ b/Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
@@ -4,7 +4,7 @@ PRCM is an MFD device exposing several Power Management related 
devices
 (like clks and reset controllers).
 
 Required properties:
- - compatible: allwinner,sun6i-a31-prcm
+ - compatible: allwinner,sun6i-a31-prcm or allwinner,sun8i-a23-prcm
  - reg: The PRCM registers range
 
 The prcm node may contain several subdevices definitions:
diff --git a/drivers/mfd/sun6i-prcm.c b/drivers/mfd/sun6i-prcm.c
index 718fc4d..c96bb6c 100644
--- a/drivers/mfd/sun6i-prcm.c
+++ b/drivers/mfd/sun6i-prcm.c
@@ -76,16 +76,46 @@ static const struct mfd_cell sun6i_a31_prcm_subdevs[] = {
},
 };
 
+static const struct mfd_cell sun8i_a23_prcm_subdevs[] = {
+   {
+   .name = sun6i-a31-apb0-clk,
+   .of_compatible = allwinner,sun8i-a23-apb0-clk,
+   .num_resources = ARRAY_SIZE(sun6i_a31_apb0_clk_res),
+   .resources = sun6i_a31_apb0_clk_res,
+   },
+   {
+   .name = sun6i-a31-apb0-gates-clk,
+   .of_compatible = allwinner,sun6i-a31-apb0-gates-clk,
+   .num_resources = ARRAY_SIZE(sun6i_a31_apb0_gates_clk_res),
+   .resources = sun6i_a31_apb0_gates_clk_res,
+   },
+   {
+   .name = sun6i-a31-apb0-clock-reset,
+   .of_compatible = allwinner,sun6i-a31-clock-reset,
+   .num_resources = ARRAY_SIZE(sun6i_a31_apb0_rstc_res),
+   .resources = sun6i_a31_apb0_rstc_res,
+   },
+};
+
 static const struct prcm_data sun6i_a31_prcm_data = {
.nsubdevs = ARRAY_SIZE(sun6i_a31_prcm_subdevs),
.subdevs = sun6i_a31_prcm_subdevs,
 };
 
+static const struct prcm_data sun8i_a23_prcm_data = {
+   .nsubdevs = ARRAY_SIZE(sun8i_a23_prcm_subdevs),
+   .subdevs = sun8i_a23_prcm_subdevs,
+};
+
 static const struct of_device_id sun6i_prcm_dt_ids[] = {
{
.compatible = allwinner,sun6i-a31-prcm,
.data = sun6i_a31_prcm_data,
},
+   {
+   .compatible = allwinner,sun8i-a23-prcm,
+   .data = sun8i_a23_prcm_data,
+   },
{ /* sentinel */ },
 };
 
-- 
2.0.0.rc2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/