Re: [PATCH v2 0/9] i2c: add generic support for timing parameters in DT

2015-12-14 Thread Simon Horman
On Mon, Dec 14, 2015 at 11:00:26AM +0100, Wolfram Sang wrote:
> On Tue, Dec 08, 2015 at 10:37:44AM +0100, Wolfram Sang wrote:
> > Here is a patch series adding better DT support for timing parameters like 
> > the
> > raise time or the fall time which are generic for the I2C subsystem. There 
> > is a
> > core function for parsing and an implementation for the RCar driver how to 
> > use
> > it.
> > 
> > I added people of the designware and rk3x driver to CC because they might be
> > interested in this new function. They provided the basis for this series, 
> > so it
> > should be easy to convert them.
> > 
> > Please have a look, test, comment...
> > 
> > Thanks,
> > 
> > Wolfram
> 
> Applied patches 1-5 to for-next with the change Andy suggested, thanks!
> 
> Simon, you can pick up patches 6-9 now, I'd think.

Thanks for letting me know, I have done so.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 0/9] i2c: add generic support for timing parameters in DT

2015-12-09 Thread Simon Horman
On Tue, Dec 08, 2015 at 10:37:44AM +0100, Wolfram Sang wrote:
> Here is a patch series adding better DT support for timing parameters like the
> raise time or the fall time which are generic for the I2C subsystem. There is 
> a
> core function for parsing and an implementation for the RCar driver how to use
> it.
> 
> I added people of the designware and rk3x driver to CC because they might be
> interested in this new function. They provided the basis for this series, so 
> it
> should be easy to convert them.
> 
> Please have a look, test, comment...
> 
> Thanks,
> 
> Wolfram
> 
> Changes since V1:
> * switched from DT properties to device properties
> * that means no dependency on OF and rename of the parsing function
> * removed a superfluous comment
> * adapted the RCar driver to the changes
> * added Rob's ack
> 
> Changes since RFC:
> * better tested
> * added documentation for the new function and the new struct
> * reworded some commit messages slightly
> * moved the new property in the dtsi above the "status" property
> 
> Wolfram Sang (9):
>   i2c: document generic DT bindings for timing parameters
>   i2c: add generic routine to parse DT for timing information
>   i2c: rcar: refactor probe function a little
>   i2c: rcar: switch to i2c generic dt parsing
>   i2c: rcar: honor additional i2c timings from DT
>   ARM: shmobile: r8a7790: dtsi: add internal delay for i2c IPs
>   ARM: shmobile: r8a7791: dtsi: add internal delay for i2c IPs
>   ARM: shmobile: r8a7794: dtsi: add internal delay for i2c IPs
>   arm64: renesas: r8a7795: add internal delay for i2c IPs

I have marked the ARM and arm64 patches as deferred pending
acceptance of the driver patches.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/9] i2c: add generic support for timing parameters in DT

2015-12-06 Thread Simon Horman
On Thu, Dec 03, 2015 at 04:51:30PM +0100, Wolfram Sang wrote:
> Here is a patch series adding better DT support for timing parameters like the
> raise time or the fall time which are generic for the I2C subsystem. There is 
> a
> core function for parsing and an implementation for the RCar driver how to use
> it.
> 
> I added people of the designware and rk3x driver to CC because they might be
> interested in this new function. They provided the basis for this series, so 
> it
> should be easy to convert them.
> 
> Please have a look, test, comment...
> 
> Thanks,
> 
> Wolfram
> 
> 
> Changes since RFC:
> * better tested
> * added documentation for the new function and the new struct
> * reworded some commit messages slightly
> * moved the new property in the dtsi above the "status" property
> 
> 
> Wolfram Sang (9):
>   i2c: document generic DT bindings for timing parameters
>   i2c: add generic routine to parse DT for timing information
>   i2c: rcar: refactor probe function a little
>   i2c: rcar: switch to i2c generic dt parsing
>   i2c: rcar: honor additional i2c timings from DT

I have marked the integration patches (below) as deferred pending
acceptance of the driver changes (above). Please repost the former
once the latter have been accepted (by you :).

>   ARM: shmobile: r8a7790: dtsi: add internal delay for i2c IPs
>   ARM: shmobile: r8a7791: dtsi: add internal delay for i2c IPs
>   ARM: shmobile: r8a7794: dtsi: add internal delay for i2c IPs
>   arm64: renesas: r8a7795: add internal delay for i2c IPs
> 
>  Documentation/devicetree/bindings/i2c/i2c-rcar.txt |  4 ++
>  Documentation/devicetree/bindings/i2c/i2c.txt  | 31 --
>  arch/arm/boot/dts/r8a7790.dtsi |  4 ++
>  arch/arm/boot/dts/r8a7791.dtsi |  6 ++
>  arch/arm/boot/dts/r8a7794.dtsi |  6 ++
>  arch/arm64/boot/dts/renesas/r8a7795.dtsi   |  7 +++
>  drivers/i2c/busses/i2c-rcar.c  | 67 
> +++---
>  drivers/i2c/i2c-core.c | 50 
>  include/linux/i2c.h| 22 +++
>  9 files changed, 158 insertions(+), 39 deletions(-)
> 
> -- 
> 2.1.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFT 1/2] i2c: rcar: add support for r8a7795 (R-Car H3)

2015-08-05 Thread Simon Horman
On Wed, Aug 05, 2015 at 03:18:25PM +0200, Wolfram Sang wrote:
> From: Wolfram Sang 
> 
> Enable the I2C core for this SoC. I add a new type because this version
> has new features (e.g. DMA) which will be added somewhen later.

Minor nit: s/somewhen/sometime/
or: s/somewhen //

> Signed-off-by: Wolfram Sang 
> ---
>  Documentation/devicetree/bindings/i2c/i2c-rcar.txt | 1 +
>  drivers/i2c/busses/i2c-rcar.c  | 3 +++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-rcar.txt 
> b/Documentation/devicetree/bindings/i2c/i2c-rcar.txt
> index 16b3e07aa98fdd..ea406eb20fa5ad 100644
> --- a/Documentation/devicetree/bindings/i2c/i2c-rcar.txt
> +++ b/Documentation/devicetree/bindings/i2c/i2c-rcar.txt
> @@ -10,6 +10,7 @@ Required properties:
>   "renesas,i2c-r8a7792"
>   "renesas,i2c-r8a7793"
>   "renesas,i2c-r8a7794"
> + "renesas,i2c-r8a7795"
>  - reg: physical base address of the controller and length of memory mapped
>region.
>  - interrupts: interrupt specifier.
> diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
> index d8361dada58455..3e125654bb288a 100644
> --- a/drivers/i2c/busses/i2c-rcar.c
> +++ b/drivers/i2c/busses/i2c-rcar.c
> @@ -103,6 +103,7 @@
>  enum rcar_i2c_type {
>   I2C_RCAR_GEN1,
>   I2C_RCAR_GEN2,
> + I2C_RCAR_GEN3,
>  };
>  
>  struct rcar_i2c_priv {
> @@ -178,6 +179,7 @@ static int rcar_i2c_clock_calculate(struct rcar_i2c_priv 
> *priv,
>   cdf_width = 2;
>   break;
>   case I2C_RCAR_GEN2:
> + case I2C_RCAR_GEN3:
>   cdf_width = 3;
>   break;
>   default:
> @@ -625,6 +627,7 @@ static const struct of_device_id rcar_i2c_dt_ids[] = {
>   { .compatible = "renesas,i2c-r8a7792", .data = (void *)I2C_RCAR_GEN2 },
>   { .compatible = "renesas,i2c-r8a7793", .data = (void *)I2C_RCAR_GEN2 },
>   { .compatible = "renesas,i2c-r8a7794", .data = (void *)I2C_RCAR_GEN2 },
> + { .compatible = "renesas,i2c-r8a7795", .data = (void *)I2C_RCAR_GEN3 },
>   {},
>  };
>  MODULE_DEVICE_TABLE(of, rcar_i2c_dt_ids);
> -- 
> 2.1.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 0/5] enable I2C on Renesas EMEV2 and KZM9D board

2015-07-14 Thread Simon Horman
On Tue, Jul 14, 2015 at 01:18:58PM +0200, Wolfram Sang wrote:
> On Sat, Jul 11, 2015 at 09:46:21AM +0200, Wolfram Sang wrote:
> > So, I picked up the old series from Ian and reworked it significantly. While
> > his series was already an improvement from the driver found in the BSP, it 
> > was
> > still not ready for upstream. It should be now :) My idea was to start 
> > simple
> > and improve incrementally, so e.g. clock handling was broken, so clocks are
> > always on for starters. Major changes include:
> > 
> > * clock handling simplified and adapted to current EMEV clock handling
> > * switch from wait_event to completion mechanism. The old one was basically
> >   some kind of completion with custom code around wait_events
> > * dropped using signals; they always cause trouble with I2C
> > * simplified the bus free logic. If it turns out to be too simple, we'd need
> >   to switch to the bus_recovery infrastructure probably. But we'd need a 
> > test
> >   case for that
> > * error handling improved to match subsystem standards
> > * removed some BSP angst code
> > * lots of refactoring to make code simpler, more readable...
> > * bugfixes
> > 
> > I also added all the glue code to add clocks, disable reset etc which was
> > missing before. I'd prefer to take the first three patches via i2c myself,
> > and the latter two via Simon's tree.
> > 
> > Since V1, there are minor updates fixing issues found in reviews. Thanks!
> > 
> > A branch for testing can be found here:
> > 
> > git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/emma-i2c
> > 
> > Please test, comment...
> > 
> > Thanks!
> > 
> >Wolfram
> > 
> > Wolfram Sang (5):
> >   clk: shmobile: emev2: deassert reset for IIC0/1
> >   i2c: emev2: add binding documentation
> >   i2c: emev2: add driver
> 
> Those patches applied to for-next...
> 
> 
> >   ARM: shmobile: emev2: add IIC cores to dtsi
> >   ARM: shmobile: emev2: kzm9d: enable IIC busses
> 
> ... so Simon, you can pick up these, I'd say.

Thanks for the reminder; done.

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


Re: [PATCH 0/2] ARM: shmobile: r8a7740: move I2C errata handling into the driver

2015-06-10 Thread Simon Horman
On Tue, Jun 09, 2015 at 04:14:38PM +0900, Wolfram Sang wrote:
> This series moves the errata handling from the setup function into the driver.
> It has been tested that this changeset does not cause a regression on the
> armadillo board we had access to. Unfortunately, this board did not need the
> workaround at all, only some revisions of the r8a7740 are affected.
> 
> After a short discussion with Simon, we agreed this should go via I2C.

Acked-by: Simon Horman 

> 
> Wolfram Sang (2):
>   i2c: sh_mobile: add errata workaround
>   ARM: shmobile: r8a7740: remove I2C errata handling
> 
>  arch/arm/mach-shmobile/setup-r8a7740.c | 55 
> --
>  drivers/i2c/busses/i2c-sh_mobile.c | 40 +
>  2 files changed, 40 insertions(+), 55 deletions(-)
> 
> -- 
> 2.1.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/2] DT: i2c: Deprecate adi,adxl34x compatible string

2015-05-21 Thread Simon Horman
On Thu, May 21, 2015 at 01:42:25PM +0200, Geert Uytterhoeven wrote:
> From: Laurent Pinchart 
> 
> DT nodes should use the more specific adi,adxl345 and adi,adxl346
> compatible values instead. As the ADXL346 is backward-compatible with
> the ADXL345, ADXL346 nodes must list both adi,adxl346 and adi,adxl345,
> in that order.
> 
> Signed-off-by: Laurent Pinchart 
> Acked-by: Wolfram Sang 
> Signed-off-by: Geert Uytterhoeven 
> ---
> v2:
>   - Add Acked-by.

Reviewed-by: Simon Horman 

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


Re: [PATCH v2 2/2] input: adxl34x: Add OF match support

2015-05-21 Thread Simon Horman
On Thu, May 21, 2015 at 01:42:26PM +0200, Geert Uytterhoeven wrote:
> From: Laurent Pinchart 
> 
> The I2C subsystem can match devices without explicit OF support based on
> the part of their compatible property after the comma. However, this
> mechanism uses the first compatible value only. For adxl34x OF device
> nodes the compatible property will contain the more specific
> "adi,adxl345" or "adi,adxl346" value first. This prevents the device
> node from being matched with the adxl34x driver.
> 
> Fix this by adding an OF match table with an "adi,adxl345" compatible
> entry. There's no need to add the "adi,adxl346" entry as the ADXL346 is
> backward-compatible with the ADXL345 with differences handled by runtime
> detection of the device model.
> 
> Signed-off-by: Laurent Pinchart 
> Reviewed-by: Wolfram Sang 
> Signed-off-by: Geert Uytterhoeven 
> ---
> v2:
>   - Add Reviewed-by.

Reviewed-by: Simon Horman 

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


Re: [PATCH/RFC] i2c: rcar: Fix order of restart and clear status

2015-03-29 Thread Simon Horman
On Fri, Mar 27, 2015 at 02:10:45PM +0100, Wolfram Sang wrote:
> On Sat, Mar 07, 2015 at 11:33:49AM +0100, Wolfram Sang wrote:
> > On Fri, Mar 06, 2015 at 11:05:31PM +0100, Wolfram Sang wrote:
> > > 
> > > > I asked Kataoka-san about this and his response was as follows:
> > > 
> > > Thanks, Simon!
> > > 
> > > > If system(CPU) is busy, the driver can't clear the status register soon
> > > > after kicking start.
> > > > 
> > > > If sequence of first start is as follows, there is a problem.
> > > > Because H/W starts by 1.
> > > > But sequence of re-start is as follows, there is no problem.
> > > > Because H/W starts by 2.
> > > > 
> > > >   1. Issue START condition by ESG bit of ICMCR register.
> > > >   <--- If there is too much time, H/W finish 
> > > > transmitting
> > > >and set status in status register.
> > > >   2. Clear interrupt status (ICMSR).
> > > >   3. Open interrupt mask.
> > > >   4. Wait interrupt.
> > > >   <--- If status is cleared, interrupt does not occur.
> > > 
> > > I understand. I'll add this explanation to the patch and apply it soon.
> > 
> > Sorry, another question came up while applying:
> > 
> > How can this interruption happen? The function is called in a
> > spin_lock_irqsave protected area. Is this an RT_PREEMPT related issue?
> > Am I missing something?
> 
> Hi,
> 
> any news on this one?

Sorry, I seem to have dropped the ball here. I've (finally) forwarded
your question on to the BSP team.

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


Re: [PATCH/RFC] i2c: rcar: Support ACK by HW auto restart after NACK

2015-03-27 Thread Simon Horman
Hi Wolfram,

On Fri, Mar 27, 2015 at 02:11:04PM +0100, Wolfram Sang wrote:
> On Fri, Mar 06, 2015 at 11:18:09PM +0100, Wolfram Sang wrote:
> > 
> > > > >Even if R-Car I2C received NACK, after that it might receive ACK
> > > > >by HW auto restart. In case of that, driver would continue process.
> > > > >If R-Car I2C didn't receive ACK, the driver would detect timeout
> > > > >and would report NACK as -ENXIO.
> > > > >
> > > > >Signed-off-by: Ryo Kataoka 
> > > > >Signed-off-by: Yoshihiro Kaneko 
> > > > 
> > > > Excuse me, but what exactly is HW auto restart in this case? Is it a 
> > > > feature
> > > > of the I2C slave?
> > > 
> > > I asked Kataoka-san about this and his response was as follows:
> > > 
> > > It is a feature of the i2c-rcar(H/W) master.
> > > 
> > > If system(CPU) is busy, NACK procedure may have interrupt latency.
> > > Since the clear of ICMCR.ESG bit is delayed, i2c-rcar(H/W) may 
> > > auto-restart
> > > after NACK. Please refer to ESG bit of H/W UM section 55.3.5.
> > > 
> > > For example, this is I2C write transmitting.
> > > 1.Start / 2.SlaveAddr,ACK / 3.RegAddr,ACK / 4.RegData,ACK / 5.Stop
> > > 
> > > If No.2 has NACK and interruption has delay, this transmitting is as 
> > > follows.
> > > 1.Start / 2.SlaveAddr,NACK/ 1x.auto-restart / 2x.SlaveAddr,ACK
> > > / 3.RegAddr,ACK / 4.RegData,ACK / 
> > > 5.Stop
> > > 
> > > NACK of No.2 is invalidated by ACK of No.2x. It means recover.
> > 
> > Does this make some I2C device work which did not work before?
> > 
> > Most I2C devices always ack their address, so NACK very often means
> > "nothing is there". I think it makes sense that the rcar driver returns
> > ENXIO in this case which is documented to be used for NACK after address
> > phase. Then, the i2c client driver should know if this means "not there"
> > or "currently busy". And it should know when is a good time for another
> > try. As I read the patch, the driver would use the auto-restart feature
> > until the timeout is reached. That would make bus scanning pretty slow,
> > too.
> 
> Hi,
> 
> any news on this one?

Sorry for not responding earlier. I have the following information from
Kataoka-san.

* There are now several patches in the BSP that address this issue;
  this patch and two follow up fix patches. Its probably best if these
  patches were all squashed into a single patch for your consideration.

  For reference I am referring to the following patches in the BSP:

  i2c: rcar: Support ACK by HW auto restart after NACK
  i2c: rcar: Fix status clear after NACK
  i2c: rcar: Fix flag clear for recovering by HW auto restart

* In answer to your questions above:

  "When NACK interruption occurs, the i2c rcar driver sets ICMCR register
   from (MDBS|MIE|ESG) to (MDBS|MIE|FSB) in rcar_i2c_bus_phase().  It means
   clearing of ESG bit. If this procedure is late, H/W auto-restarts.  After
   that, if NACK occurs again, H/W doesn't auto-restart because ESG bit was
   already cleared.

   S/W doesn't know whether H/W did auto-restart or did not auto-restart.
   So, S/W needs to wait. The return of ENXIO is pretty slow.

   It takes long time but I think it's ok because NACK is unjust case."
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH/RFC] i2c: rcar: Fix order of restart and clear status

2015-03-03 Thread Simon Horman
Hi Wolfram,

On Mon, Feb 23, 2015 at 02:07:18PM +0100, Wolfram Sang wrote:
> Hi,
> 
> On 2015-02-15 15:43, Yoshihiro Kaneko wrote:
> >From: Ryo Kataoka 
> >
> >In case of repeated START condition, the restart has to be kicked
> >before clear status (MSR register). If it is kicked after clear status,
> >R-Car I2C may transfer data (TXD register) or receive data (RXD register)
> >instead of transferring slave address (MAR register).
> >
> >Signed-off-by: Ryo Kataoka 
> >Signed-off-by: Yoshihiro Kaneko 
> 
> Thanks for the patch!
> 
> I wondered if we couldn't always kick the start/restart before clearing
> the status register?

I asked Kataoka-san about this and his response was as follows:

If system(CPU) is busy, the driver can't clear the status register soon
after kicking start.

If sequence of first start is as follows, there is a problem.
Because H/W starts by 1.
But sequence of re-start is as follows, there is no problem.
Because H/W starts by 2.

  1. Issue START condition by ESG bit of ICMCR register.
  <--- If there is too much time, H/W finish transmitting
   and set status in status register.
  2. Clear interrupt status (ICMSR).
  3. Open interrupt mask.
  4. Wait interrupt.
  <--- If status is cleared, interrupt does not occur.

> I am not sure if this simulates the flaw accurately, but I inserted a
> udelay(500) in the original code after clearing the status register.
> Then, I couldn't access the audio codec on my Lager board anymore. By
> always first "kicking" and then clearing, access was possible again. But
> as said, I am not sure if my scenario matches yours. Have you considered
> to treat start and repeated start the same and always kick the condition
> before clearing the status?
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH/RFC] i2c: rcar: Support ACK by HW auto restart after NACK

2015-03-03 Thread Simon Horman
Hi Wolfram,

On Mon, Feb 23, 2015 at 02:08:42PM +0100, Wolfram Sang wrote:
> Hi,
> 
> On 2015-02-15 15:44, Yoshihiro Kaneko wrote:
> >From: Ryo Kataoka 
> >
> >Even if R-Car I2C received NACK, after that it might receive ACK
> >by HW auto restart. In case of that, driver would continue process.
> >If R-Car I2C didn't receive ACK, the driver would detect timeout
> >and would report NACK as -ENXIO.
> >
> >Signed-off-by: Ryo Kataoka 
> >Signed-off-by: Yoshihiro Kaneko 
> 
> Excuse me, but what exactly is HW auto restart in this case? Is it a feature
> of the I2C slave?

I asked Kataoka-san about this and his response was as follows:

It is a feature of the i2c-rcar(H/W) master.

If system(CPU) is busy, NACK procedure may have interrupt latency.
Since the clear of ICMCR.ESG bit is delayed, i2c-rcar(H/W) may auto-restart
after NACK. Please refer to ESG bit of H/W UM section 55.3.5.

For example, this is I2C write transmitting.
1.Start / 2.SlaveAddr,ACK / 3.RegAddr,ACK / 4.RegData,ACK / 5.Stop

If No.2 has NACK and interruption has delay, this transmitting is as 
follows.
1.Start / 2.SlaveAddr,NACK/ 1x.auto-restart / 2x.SlaveAddr,ACK
/ 3.RegAddr,ACK / 4.RegData,ACK / 5.Stop

NACK of No.2 is invalidated by ACK of No.2x. It means recover.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/4] ARM: shmobile: koelsch: Add DA9063 PMIC device node for system restart

2014-12-21 Thread Simon Horman
On Tue, Dec 09, 2014 at 12:22:48PM +0100, Geert Uytterhoeven wrote:
> Add a minimal device node for the DA9063 PMIC, which is connected to i2c6.
> This allows the system to be restarted when the watchdog timer times
> out, or when a system restart is requested.
> 
> Regulator support is not yet included, as no DT support code nor DT
> binding documentation exists for the regulator functionality.
> 
> Signed-off-by: Geert Uytterhoeven 
> Cc: devicet...@vger.kernel.org

Hi,

I had this queued up for v3.20, however, when rebasing on top
of v3.19-rca (previous base was v3.18) I noticed that this patch
appears to cause booting koelsch with shmobile_defconfig to
stop at:

rcar_sound ec50.rcar_sound: can't get dma channel
rcar_sound ec50.rcar_sound: src[3] (Gen2) failed
rcar_sound ec50.rcar_sound: ssi[1] fallback to PIO mode
rcar_sound ec50.rcar_sound: probed
TCP: cubic registered
NET: Registered protocol family 10
da9063 6-0058: Failed to read IRQ status: -6
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
Key type dns_resolver registered
random: nonblocking pool is initialized

I have (hopefully temporarily) dropped this patch accordingly.

> ---
> Restart by watchdog timeout is working now.
> Manual system restart depends on "[PATCH 1/4] watchdog: da9063: Add restart
> handler support".
> ---
>  arch/arm/boot/dts/r8a7791-koelsch.dts | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts 
> b/arch/arm/boot/dts/r8a7791-koelsch.dts
> index 6938377d3798644b..a400c27a813f1a8b 100644
> --- a/arch/arm/boot/dts/r8a7791-koelsch.dts
> +++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
> @@ -524,6 +524,13 @@
>   regulator-boot-on;
>   regulator-always-on;
>   };
> +
> + pmic@58 {
> + compatible = "dlg,da9063";
> + reg = <0x58>;
> + interrupt-parent = <&irqc0>;
> + interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
> + };
>  };
>  
>  &pci0 {
> -- 
> 1.9.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/4] ARM: shmobile: koelsch: Add DA9063 watchdog restart support

2014-12-10 Thread Simon Horman
On Wed, Dec 10, 2014 at 11:06:25AM +0100, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Wed, Dec 10, 2014 at 1:33 AM, Simon Horman  wrote:
> > On Tue, Dec 09, 2014 at 12:22:45PM +0100, Geert Uytterhoeven wrote:
> >> This patch series add restart support for r8a7791/koelsch through the 
> >> watchdog
> >> in the DA9063 PMIC. Restart can be triggered in two ways:
> >>   1. Timeout of the watchdog timer,
> >>   2. Manual system restart, shutting down the DA9063.
> >>
> >> Dependencies:
> >>   - There are no strict merge order dependencies,
> >>   - While manual restart depends on patch 1, patches 3 and 4 can be merged
> >> now, as restart on watchdog timeout works without patch 1.
> >>
> >> Patches:
> >>   - Patch 1 is intended for the watchdog tree (based on watchdog/next),
> >>   - Patch 2 is intended for the i2c tree (based on i2c/next),
> >>   - Patches 3 and 4 are intended for the shmobile tree (based on
> >> renesas-devel-20141209-v3.18).
> >
> > Patches 3 and 4 look like they could be queued up for v3.20 now.
> > Shall I do so?
> 
> Please do so.
> 
> You can easily test restart on watchdog timeout using:
> 
> $ cat > /dev/watchdog0
> 
> Koelsch should restart 8 seconds after you stop typing.

Thanks, I have queued them up.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/4] ARM: shmobile: koelsch: Add DA9063 watchdog restart support

2014-12-09 Thread Simon Horman
On Tue, Dec 09, 2014 at 12:22:45PM +0100, Geert Uytterhoeven wrote:
>   Hi Wim, Wolfram, Simon, Magnus,
> 
> This patch series add restart support for r8a7791/koelsch through the watchdog
> in the DA9063 PMIC. Restart can be triggered in two ways:
>   1. Timeout of the watchdog timer,
>   2. Manual system restart, shutting down the DA9063.
> 
> Dependencies:
>   - There are no strict merge order dependencies,
>   - While manual restart depends on patch 1, patches 3 and 4 can be merged
> now, as restart on watchdog timeout works without patch 1.
> 
> Patches:
>   - Patch 1 is intended for the watchdog tree (based on watchdog/next),
>   - Patch 2 is intended for the i2c tree (based on i2c/next),
>   - Patches 3 and 4 are intended for the shmobile tree (based on
> renesas-devel-20141209-v3.18).

Patches 3 and 4 look like they could be queued up for v3.20 now.
Shall I do so?

> This was tested on r8a7791/koelsch.
> I expect this restart method to be usable on r8a7791/lager and r8a7794/alt,
> too.
> 
> Thanks!
> 
> Geert Uytterhoeven (4):
>   watchdog: da9063: Add restart handler support
>   DT: i2c: Add devices handled by the da9063 MFD driver
>   ARM: shmobile: koelsch: Add DA9063 PMIC device node for system restart
>   ARM: shmobile: Enable DA9063 watchdog in multiplatform defconfig
> 
>  .../devicetree/bindings/i2c/trivial-devices.txt|  1 +
>  arch/arm/boot/dts/r8a7791-koelsch.dts  |  7 +
>  arch/arm/configs/shmobile_defconfig|  3 ++
>  drivers/watchdog/da9063_wdt.c  | 32 
> +-
>  4 files changed, 42 insertions(+), 1 deletion(-)
> 
> -- 
> 1.9.1
> 
> Gr{oetje,eeting}s,
> 
>   Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- 
> ge...@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like 
> that.
>   -- Linus Torvalds
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/5] i2c: sh_mobile: improve success message

2014-11-12 Thread Simon Horman
On Wed, Nov 12, 2014 at 05:12:19PM +0100, Wolfram Sang wrote:
> On Fri, Nov 07, 2014 at 11:11:42AM +0100, Wolfram Sang wrote:
> > From: Wolfram Sang 
> > 
> > No user needs magic hex values, makes this debug output. Add DMA info.
> > 
> > Signed-off-by: Wolfram Sang 
> 
> Applied to for-next, thanks!
> 
> Simon, that means you can queue up patches 4 + 5?

Thanks, I have now done so.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] ARM: shmobile: r8a7791: add DMA nodes for IIC

2014-11-12 Thread Simon Horman
On Fri, Nov 07, 2014 at 11:11:44AM +0100, Wolfram Sang wrote:
> From: Wolfram Sang 
> 
> Signed-off-by: Wolfram Sang 
> Acked-by: Laurent Pinchart 
> Acked-by: Geert Uytterhoeven 

Thanks, I have queued this up.

> ---
>  arch/arm/boot/dts/r8a7791.dtsi | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
> index 9a57215f54f7..213b6bda6201 100644
> --- a/arch/arm/boot/dts/r8a7791.dtsi
> +++ b/arch/arm/boot/dts/r8a7791.dtsi
> @@ -371,6 +371,8 @@
>   reg = <0 0xe60b 0 0x425>;
>   interrupts = <0 173 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = <&mstp9_clks R8A7791_CLK_IICDVFS>;
> + dmas = <&dmac0 0x77>, <&dmac0 0x78>;
> + dma-names = "tx", "rx";
>   status = "disabled";
>   };
>  
> @@ -381,6 +383,8 @@
>   reg = <0 0xe650 0 0x425>;
>   interrupts = <0 174 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = <&mstp3_clks R8A7791_CLK_IIC0>;
> + dmas = <&dmac0 0x61>, <&dmac0 0x62>;
> + dma-names = "tx", "rx";
>   status = "disabled";
>   };
>  
> @@ -391,6 +395,8 @@
>   reg = <0 0xe651 0 0x425>;
>   interrupts = <0 175 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = <&mstp3_clks R8A7791_CLK_IIC1>;
> + dmas = <&dmac0 0x65>, <&dmac0 0x66>;
> + dma-names = "tx", "rx";
>   status = "disabled";
>   };
>  
> -- 
> 2.1.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/5] ARM: shmobile: r8a7790: add DMA nodes for IIC

2014-11-12 Thread Simon Horman
On Fri, Nov 07, 2014 at 11:11:43AM +0100, Wolfram Sang wrote:
> From: Wolfram Sang 
> 
> Signed-off-by: Wolfram Sang 
> Acked-by: Laurent Pinchart 
> Acked-by: Geert Uytterhoeven 

Thanks, I have queued this up.

> ---
>  arch/arm/boot/dts/r8a7790.dtsi | 8 
>  1 file changed, 8 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
> index 69b7cd0e7fb3..7e836cc86098 100644
> --- a/arch/arm/boot/dts/r8a7790.dtsi
> +++ b/arch/arm/boot/dts/r8a7790.dtsi
> @@ -359,6 +359,8 @@
>   reg = <0 0xe650 0 0x425>;
>   interrupts = <0 174 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = <&mstp3_clks R8A7790_CLK_IIC0>;
> + dmas = <&dmac0 0x61>, <&dmac0 0x62>;
> + dma-names = "tx", "rx";
>   status = "disabled";
>   };
>  
> @@ -369,6 +371,8 @@
>   reg = <0 0xe651 0 0x425>;
>   interrupts = <0 175 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = <&mstp3_clks R8A7790_CLK_IIC1>;
> + dmas = <&dmac0 0x65>, <&dmac0 0x66>;
> + dma-names = "tx", "rx";
>   status = "disabled";
>   };
>  
> @@ -379,6 +383,8 @@
>   reg = <0 0xe652 0 0x425>;
>   interrupts = <0 176 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = <&mstp3_clks R8A7790_CLK_IIC2>;
> + dmas = <&dmac0 0x69>, <&dmac0 0x6a>;
> + dma-names = "tx", "rx";
>   status = "disabled";
>   };
>  
> @@ -389,6 +395,8 @@
>   reg = <0 0xe60b 0 0x425>;
>   interrupts = <0 173 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = <&mstp9_clks R8A7790_CLK_IICDVFS>;
> + dmas = <&dmac0 0x77>, <&dmac0 0x78>;
> + dma-names = "tx", "rx";
>   status = "disabled";
>   };
>  
> -- 
> 2.1.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/5] ARM: shmobile: kzm9g legacy: Set i2c clks_per_count to 2

2014-11-12 Thread Simon Horman
On Wed, Nov 12, 2014 at 09:55:58AM +0100, Geert Uytterhoeven wrote:
> On Wed, Nov 12, 2014 at 9:53 AM, Geert Uytterhoeven
>  wrote:
> >>   i2c_shmobile support.") in v2.6.37.
> >>
> >>   Without this fix i2c may not operate correctly on the sh73a0/kzm9g.
> >
> > Thanks, that's correct.
> 
> git tag --contains b028f94b76319e1b8 says v2.6.38.
> 
> Not that you're gonna backport it to ltsi-v2.6.37 ;-)

Hopefully not!

I'll update my description anyway.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/5] ARM: shmobile: kzm9g legacy: Set i2c clks_per_count to 2

2014-11-12 Thread Simon Horman
On Wed, Nov 12, 2014 at 09:53:27AM +0100, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Wed, Nov 12, 2014 at 2:44 AM, Simon Horman  wrote:
> > On Fri, Nov 07, 2014 at 06:24:21AM +0100, Wolfram Sang wrote:
> >> On Thu, Nov 06, 2014 at 12:52:06PM +0100, Geert Uytterhoeven wrote:
> >> > On sh73a0/kzm9g-legacy, probing of the i2c masters fails with:
> >> >
> >> > i2c-sh_mobile i2c-sh_mobile.0: timing values out of range: 
> >> > L/H=0x208/0x1bf
> >> > sh_mobile: probe of i2c-sh_mobile.0 failed with error -22
> >>
> >> Yay, so the warning I added found another bug \o/
> >>
> >> >
> >> > According to the datasheet, the transfer rate is derived from the HP
> >> > clock (which runs at 104 MHz) divided by two. Hence
> >> > i2c_sh_mobile_platform_data.clks_per_count should be set to two.
> >> >
> >> > Now probing succeeds, and i2c works:
> >> >
> >> > i2c-sh_mobile i2c-sh_mobile.0: I2C adapter 0 with bus speed 10 
> >> > Hz (L/H=0x104/0xe0)
> >> >
> >> > Signed-off-by: Geert Uytterhoeven 
> >>
> >> Reviewed-by: Wolfram Sang 
> 
> > As this appears to be a bug fix I would like to accompany this patch with
> > some text describing when the problem was introduced and what its effects
> > are. In short a rough guide to if it should be applied to -stable. To that
> > end I prepared the following which I would appreciate your feedback on.
> >
> > * ARM: shmobile: kzm9g legacy: Set i2c clks_per_count
> >
> >   This problem appears to have been introduced when i2c shmobile support was
> >   added to the sh73a9 by b028f94b76319e1b8 ("ARM: mach-shmobile: sh73a0
> 
> sh73a0

Thanks.

> >   i2c_shmobile support.") in v2.6.37.
> >
> >   Without this fix i2c may not operate correctly on the sh73a0/kzm9g.
> 
> Thanks, that's correct.
> 
> BTW, I guess Kuribayashi-san was aware of the problem:
> 
> commit ebd5ac165f2aaefb767c53112c2010b0ff3df688
> Author: Shinya Kuribayashi 
> Date:   Wed Oct 24 19:58:10 2012 +0900
> 
> i2c: i2c-sh_mobile: support I2C hardware block with a faster operating 
> clock
> 
> On newer SH-/R-Mobile SoCs, a clock supply to the I2C hardware block,
> which is used to generate the SCL clock output, is getting faster than
> before, while on the other hand, the SCL clock control registers, ICCH
> and ICCL, stay unchanged in 9-bit-wide (8+1).
> 
> On such silicons, the internal SCL clock counter gets incremented every
> 2 clocks of the operating clock.
> 
> This patch makes it configurable through platform data.
> 
> Signed-off-by: Shinya Kuribayashi 
> Signed-off-by: Wolfram Sang 
> 
> But I couldn't find any patches on a public mailing list using the new
> clks_per_count field...

My understanding is that unfortunately Kuribayashi-san is no longer
working for Renesas. But I can try to raise this with the BSP team
if you like.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/5] ARM: shmobile: kzm9g legacy: Set i2c clks_per_count to 2

2014-11-11 Thread Simon Horman
On Fri, Nov 07, 2014 at 06:24:21AM +0100, Wolfram Sang wrote:
> On Thu, Nov 06, 2014 at 12:52:06PM +0100, Geert Uytterhoeven wrote:
> > On sh73a0/kzm9g-legacy, probing of the i2c masters fails with:
> > 
> > i2c-sh_mobile i2c-sh_mobile.0: timing values out of range: 
> > L/H=0x208/0x1bf
> > sh_mobile: probe of i2c-sh_mobile.0 failed with error -22
> 
> Yay, so the warning I added found another bug \o/
> 
> > 
> > According to the datasheet, the transfer rate is derived from the HP
> > clock (which runs at 104 MHz) divided by two. Hence
> > i2c_sh_mobile_platform_data.clks_per_count should be set to two.
> > 
> > Now probing succeeds, and i2c works:
> > 
> > i2c-sh_mobile i2c-sh_mobile.0: I2C adapter 0 with bus speed 10 Hz 
> > (L/H=0x104/0xe0)
> > 
> > Signed-off-by: Geert Uytterhoeven 
> 
> Reviewed-by: Wolfram Sang 
> 
> > ---
> > Note that the L/H values still differ from the Transfer Rate Settings
> > example in Table 19.3 of the datasheet, which suggests 0x121/0xe7.
> 
> Is the formula different or is it rounding errors?

Hi Geert,

As this appears to be a bug fix I would like to accompany this patch with
some text describing when the problem was introduced and what its effects
are. In short a rough guide to if it should be applied to -stable. To that
end I prepared the following which I would appreciate your feedback on.

* ARM: shmobile: kzm9g legacy: Set i2c clks_per_count

  This problem appears to have been introduced when i2c shmobile support was
  added to the sh73a9 by b028f94b76319e1b8 ("ARM: mach-shmobile: sh73a0
  i2c_shmobile support.") in v2.6.37.

  Without this fix i2c may not operate correctly on the sh73a0/kzm9g.

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


Re: [PATCH 3/5] i2c: sh_mobile: Document SoC-specific bindings

2014-11-09 Thread Simon Horman
On Fri, Nov 07, 2014 at 06:53:48PM +0100, Wolfram Sang wrote:
> On Thu, Nov 06, 2014 at 12:52:08PM +0100, Geert Uytterhoeven wrote:
> > Explicitly list the various SoC-specific compatible properties.
> > This allows checkpatch to validate DTSes.
> > 
> > Signed-off-by: Geert Uytterhoeven 
> 
> Applied to for-next, thanks! I guess the other patches go via Simon.

Thanks, I have picked up patches 1, 4 and 5.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] ARM: shmobile: r8a73a4 dtsi: Add SoC-specific IIC compatible properties

2014-11-09 Thread Simon Horman
On Fri, Nov 07, 2014 at 06:26:16AM +0100, Wolfram Sang wrote:
> On Thu, Nov 06, 2014 at 12:52:10PM +0100, Geert Uytterhoeven wrote:
> > The IIC nodes used the generic compatible properties only.
> > This may cause the driver to fail when using Standard Speed on IIC
> > masters where the operational clock is driven by the 130 MHz HP clock.
> > 
> > Add the SoC-specific compatible property to fix this.
> > 
> > Signed-off-by: Geert Uytterhoeven 
> 
> Reviewed-by: Wolfram Sang 

Thanks, I have queued this up.

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


Re: [PATCH 4/5] ARM: shmobile: sh73a0 dtsi: Add SoC-specific IIC compatible properties

2014-11-09 Thread Simon Horman
On Fri, Nov 07, 2014 at 06:25:33AM +0100, Wolfram Sang wrote:
> On Thu, Nov 06, 2014 at 12:52:09PM +0100, Geert Uytterhoeven wrote:
> > The IIC nodes used the generic compatible properties only.
> > This causes the driver to fail when using Standard Speed, as the
> > operational clock is driven by the 104 MHz HP clock:
> > 
> > i2c-sh_mobile e682.i2c: timing values out of range: L/H=0x208/0x1bf
> > i2c-sh_mobile: probe of e682.i2c failed with error -22
> > 
> > Add the SoC-specific compatible property to fix this.
> > 
> > Signed-off-by: Geert Uytterhoeven 
> 
> Reviewed-by: Wolfram Sang 

Thanks, I have queued this up.

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


Re: [PATCH 1/5] ARM: shmobile: kzm9g legacy: Set i2c clks_per_count to 2

2014-11-09 Thread Simon Horman
On Fri, Nov 07, 2014 at 06:24:21AM +0100, Wolfram Sang wrote:
> On Thu, Nov 06, 2014 at 12:52:06PM +0100, Geert Uytterhoeven wrote:
> > On sh73a0/kzm9g-legacy, probing of the i2c masters fails with:
> > 
> > i2c-sh_mobile i2c-sh_mobile.0: timing values out of range: 
> > L/H=0x208/0x1bf
> > sh_mobile: probe of i2c-sh_mobile.0 failed with error -22
> 
> Yay, so the warning I added found another bug \o/
> 
> > 
> > According to the datasheet, the transfer rate is derived from the HP
> > clock (which runs at 104 MHz) divided by two. Hence
> > i2c_sh_mobile_platform_data.clks_per_count should be set to two.
> > 
> > Now probing succeeds, and i2c works:
> > 
> > i2c-sh_mobile i2c-sh_mobile.0: I2C adapter 0 with bus speed 10 Hz 
> > (L/H=0x104/0xe0)
> > 
> > Signed-off-by: Geert Uytterhoeven 
> 
> Reviewed-by: Wolfram Sang 

Thanks, I have queued this up.

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


Re: [PATCH 3/5] i2c: sh_mobile: Document SoC-specific bindings

2014-11-06 Thread Simon Horman
On Thu, Nov 06, 2014 at 12:52:08PM +0100, Geert Uytterhoeven wrote:
> Explicitly list the various SoC-specific compatible properties.
> This allows checkpatch to validate DTSes.
> 
> Signed-off-by: Geert Uytterhoeven 

Acked-by: Simon Horman 

> ---
>  Documentation/devicetree/bindings/i2c/i2c-sh_mobile.txt | 9 +
>  1 file changed, 9 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-sh_mobile.txt 
> b/Documentation/devicetree/bindings/i2c/i2c-sh_mobile.txt
> index d2153ce36fa81404..c33e9a32d496ef10 100644
> --- a/Documentation/devicetree/bindings/i2c/i2c-sh_mobile.txt
> +++ b/Documentation/devicetree/bindings/i2c/i2c-sh_mobile.txt
> @@ -2,6 +2,15 @@ Device tree configuration for Renesas IIC (sh_mobile) driver
>  
>  Required properties:
>  - compatible  : "renesas,iic-". "renesas,rmobile-iic" as 
> fallback
> +  Examples with soctypes are:
> + - "renesas,iic-r8a73a4" (R-Mobile APE6)
> + - "renesas,iic-r8a7740" (R-Mobile A1)
> + - "renesas,iic-r8a7790" (R-Car H2)
> + - "renesas,iic-r8a7791" (R-Car M2-W)
> + - "renesas,iic-r8a7792" (R-Car V2H)
> + - "renesas,iic-r8a7793" (R-Car M2-N)
> + - "renesas,iic-r8a7794" (R-Car E2)
> + - "renesas,iic-sh73a0" (SH-Mobile AG5)
>  - reg : address start and address range size of device
>  - interrupts  : interrupt of device
>  - clocks  : clock for device
> -- 
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/5] i2c: rcar: add renesas,i2c-rcar-gen1/gen2 in DT compatible

2014-09-21 Thread Simon Horman
On Fri, Sep 19, 2014 at 07:18:51PM +0200, Wolfram Sang wrote:
> 
> > This approach has no effect to current feature,
> > and can keep compatible for current and future,
> > and can reduce / cleanup driver in the future.
> 
> I defer the patch series for now. Maybe we should talk about it at our
> next meeting?

That is fine by me.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] ARM: shmobile: koelsch: Remove non-existent i2c6 pinmux

2014-08-13 Thread Simon Horman
On Tue, Aug 12, 2014 at 03:48:12PM +0200, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Tue, Aug 12, 2014 at 3:36 PM, Simon Horman  wrote:
> > On Tue, Aug 12, 2014 at 03:03:13PM +0200, Geert Uytterhoeven wrote:
> >> On r8a7791, i2c6 (aka iic3) doesn't need pinmux, but the koelsch dts
> >> refers to non-existent pinmux configuration data:
> >>
> >> pinmux core: sh-pfc does not support function i2c6
> >> sh-pfc e606.pfc: invalid function i2c6 in map table
> >>
> >> Remove it to fix this.
> >>
> >> Fixes: commit 1d41f36a68c0f4e9b01d563ce33bab5201858b54 ("ARM: shmobile:
> >>koelsch dts: Add VDD MPU regulator for DVFS")
> >> Signed-off-by: Geert Uytterhoeven 
> >
> > Thanks Geert. Does this manifest as a run-time problem?
> 
> I don't think it causes any harm, despite the error message.
> i2c6 works fine (using a modified version of "ARM: shmobile:
> koelsch-reference: Add restart function" from the BSP).
> 
> > Regardless, it looks like I should queue this up as
> > a fix for v3.17. Is that your thinking too?
> 
> The error message is a regression from v3.16, so v3.17 would be
> appropriate. However, if you have no other DTS fixes for v3.17,
> v3.18 is fine for me, too.

I don't have any other fixes pending at this time.
But sending this one to the arm-soc guys should not
be much of a burden.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] ARM: shmobile: koelsch: Remove non-existent i2c6 pinmux

2014-08-12 Thread Simon Horman
On Tue, Aug 12, 2014 at 03:03:13PM +0200, Geert Uytterhoeven wrote:
> On r8a7791, i2c6 (aka iic3) doesn't need pinmux, but the koelsch dts
> refers to non-existent pinmux configuration data:
> 
> pinmux core: sh-pfc does not support function i2c6
> sh-pfc e606.pfc: invalid function i2c6 in map table
> 
> Remove it to fix this.
> 
> Fixes: commit 1d41f36a68c0f4e9b01d563ce33bab5201858b54 ("ARM: shmobile:
>koelsch dts: Add VDD MPU regulator for DVFS")
> Signed-off-by: Geert Uytterhoeven 

Thanks Geert. Does this manifest as a run-time problem?

Regardless, it looks like I should queue this up as
a fix for v3.17. Is that your thinking too?

> ---
>  arch/arm/boot/dts/r8a7791-koelsch.dts | 7 ---
>  1 file changed, 7 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts 
> b/arch/arm/boot/dts/r8a7791-koelsch.dts
> index 7966dace64ce..951a5c55003e 100644
> --- a/arch/arm/boot/dts/r8a7791-koelsch.dts
> +++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
> @@ -275,11 +275,6 @@
>   renesas,function = "msiof0";
>   };
>  
> - i2c6_pins: i2c6 {
> - renesas,groups = "i2c6";
> - renesas,function = "i2c6";
> - };
> -
>   usb0_pins: usb0 {
>   renesas,groups = "usb0";
>   renesas,function = "usb0";
> @@ -477,8 +472,6 @@
>  };
>  
>  &i2c6 {
> - pinctrl-names = "default";
> - pinctrl-0 = <&i2c6_pins>;
>   status = "okay";
>   clock-frequency = <10>;
>  
> -- 
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/5] i2c: rcar: add renesas,i2c-rcar-gen1/gen2 in DT compatible

2014-08-06 Thread Simon Horman
On Wed, Aug 06, 2014 at 05:36:37PM -0700, Kuninori Morimoto wrote:
> 
> Hi Simon
> 
> > > From: Kuninori Morimoto 
> > > 
> > > This patch adds DT compatible for Renesas R-Car Gen1/Gen2.
> > > Current driver has SoC level .compatible
> > > (r8a7778/r8a7779/r8a7790/r8a7791/r8a7792/r8a7793/r8a7794),
> > > but these can be match as generation level.
> > 
> > Hi Morimoto-san,
> > 
> > is this compatibility explicitly documented somewhere?
> 
> ?
> Do you mean ${LINUX}/Documentation/devicetree/bindings/xxx ?
> [1/5] patch have it, but is it not enough ?

Sorry for not being clearer.

At our face-to-face meeting in Montpellier we discussed the
idea of generation bindings. And my recollection is that Magnus
and I had strong reservations about declaring what generation compatibility
is without it being explicitly stated in hardware documentation.

>From observation we can say that the i2c controllers on r8a7778 and r8a7779
appear to be compatible. But can we say that in fact they are in fact
compatible hardware. That they are different hardware instances of a common
i2c controller whose name may or may not be is known to us? If not
I do not think that using a common binding describes the hardware,
which is the intention of DT bindings.

A second problem is the using the generation as a name.  Assuming the
answer to the above question is yes can we further say with certainty
that all variants of Gen1 SoCs that currently exist or will exist in the
future are compatible?  If not then using Gen1 as the name does not seem
to accurately describe the hardware.

> > > Signed-off-by: Kuninori Morimoto 
> > > ---
> > >  Documentation/devicetree/bindings/i2c/i2c-rcar.txt |4 +++-
> > >  drivers/i2c/busses/i2c-rcar.c  |2 ++
> > >  2 files changed, 5 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/Documentation/devicetree/bindings/i2c/i2c-rcar.txt 
> > > b/Documentation/devicetree/bindings/i2c/i2c-rcar.txt
> > > index 16b3e07..0f9e812 100644
> > > --- a/Documentation/devicetree/bindings/i2c/i2c-rcar.txt
> > > +++ b/Documentation/devicetree/bindings/i2c/i2c-rcar.txt
> > > @@ -3,6 +3,8 @@ I2C for R-Car platforms
> > >  Required properties:
> > >  - compatible: Must be one of
> > >   "renesas,i2c-rcar"
> > > + "renesas,i2c-rcar-gen1"
> > > + "renesas,i2c-rcar-gen2"
> > >   "renesas,i2c-r8a7778"
> > >   "renesas,i2c-r8a7779"
> > >   "renesas,i2c-r8a7790"
> > > @@ -24,7 +26,7 @@ Examples :
> > >  i2c0: i2c@e6508000 {
> > >   #address-cells = <1>;
> > >   #size-cells = <0>;
> > > - compatible = "renesas,i2c-r8a7791";
> > > + compatible = "renesas,i2c-r8a7791", "renesas,i2c-rcar-gen2";
> > >   reg = <0 0xe6508000 0 0x40>;
> > >   interrupts = <0 287 IRQ_TYPE_LEVEL_HIGH>;
> > >   clocks = <&mstp9_clks R8A7791_CLK_I2C0>;
> > > diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
> > > index f3c7139..6f805f8 100644
> > > --- a/drivers/i2c/busses/i2c-rcar.c
> > > +++ b/drivers/i2c/busses/i2c-rcar.c
> > > @@ -487,6 +487,8 @@ static const struct i2c_algorithm rcar_i2c_algo = {
> > >  
> > >  static const struct of_device_id rcar_i2c_dt_ids[] = {
> > >   { .compatible = "renesas,i2c-rcar", .data = (void *)I2C_RCAR_GEN1 },
> > > + { .compatible = "renesas,i2c-rcar-gen1", .data = (void *)I2C_RCAR_GEN1 
> > > },
> > > + { .compatible = "renesas,i2c-rcar-gen2", .data = (void *)I2C_RCAR_GEN2 
> > > },
> > >   { .compatible = "renesas,i2c-r8a7778", .data = (void *)I2C_RCAR_GEN1 },
> > >   { .compatible = "renesas,i2c-r8a7779", .data = (void *)I2C_RCAR_GEN1 },
> > >   { .compatible = "renesas,i2c-r8a7790", .data = (void *)I2C_RCAR_GEN2 },
> > > -- 
> > > 1.7.9.5
> > > 
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> > > the body of a message to majord...@vger.kernel.org
> > > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > > 
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> > the body of a message to majord...@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/5] i2c: rcar: add renesas,i2c-rcar-gen1/gen2 in DT compatible

2014-08-06 Thread Simon Horman
On Tue, Aug 05, 2014 at 09:40:12PM -0700, Kuninori Morimoto wrote:
> From: Kuninori Morimoto 
> 
> This patch adds DT compatible for Renesas R-Car Gen1/Gen2.
> Current driver has SoC level .compatible
> (r8a7778/r8a7779/r8a7790/r8a7791/r8a7792/r8a7793/r8a7794),
> but these can be match as generation level.

Hi Morimoto-san,

is this compatibility explicitly documented somewhere?

> Signed-off-by: Kuninori Morimoto 
> ---
>  Documentation/devicetree/bindings/i2c/i2c-rcar.txt |4 +++-
>  drivers/i2c/busses/i2c-rcar.c  |2 ++
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-rcar.txt 
> b/Documentation/devicetree/bindings/i2c/i2c-rcar.txt
> index 16b3e07..0f9e812 100644
> --- a/Documentation/devicetree/bindings/i2c/i2c-rcar.txt
> +++ b/Documentation/devicetree/bindings/i2c/i2c-rcar.txt
> @@ -3,6 +3,8 @@ I2C for R-Car platforms
>  Required properties:
>  - compatible: Must be one of
>   "renesas,i2c-rcar"
> + "renesas,i2c-rcar-gen1"
> + "renesas,i2c-rcar-gen2"
>   "renesas,i2c-r8a7778"
>   "renesas,i2c-r8a7779"
>   "renesas,i2c-r8a7790"
> @@ -24,7 +26,7 @@ Examples :
>  i2c0: i2c@e6508000 {
>   #address-cells = <1>;
>   #size-cells = <0>;
> - compatible = "renesas,i2c-r8a7791";
> + compatible = "renesas,i2c-r8a7791", "renesas,i2c-rcar-gen2";
>   reg = <0 0xe6508000 0 0x40>;
>   interrupts = <0 287 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = <&mstp9_clks R8A7791_CLK_I2C0>;
> diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
> index f3c7139..6f805f8 100644
> --- a/drivers/i2c/busses/i2c-rcar.c
> +++ b/drivers/i2c/busses/i2c-rcar.c
> @@ -487,6 +487,8 @@ static const struct i2c_algorithm rcar_i2c_algo = {
>  
>  static const struct of_device_id rcar_i2c_dt_ids[] = {
>   { .compatible = "renesas,i2c-rcar", .data = (void *)I2C_RCAR_GEN1 },
> + { .compatible = "renesas,i2c-rcar-gen1", .data = (void *)I2C_RCAR_GEN1 
> },
> + { .compatible = "renesas,i2c-rcar-gen2", .data = (void *)I2C_RCAR_GEN2 
> },
>   { .compatible = "renesas,i2c-r8a7778", .data = (void *)I2C_RCAR_GEN1 },
>   { .compatible = "renesas,i2c-r8a7779", .data = (void *)I2C_RCAR_GEN1 },
>   { .compatible = "renesas,i2c-r8a7790", .data = (void *)I2C_RCAR_GEN2 },
> -- 
> 1.7.9.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 3/5] arm: shmobile: r7s72100: add nodes for i2c controllers to dtsi

2014-01-05 Thread Simon Horman
On Fri, Dec 27, 2013 at 05:27:47AM +0100, Wolfram Sang wrote:
> On Wed, Dec 18, 2013 at 10:31:59PM +0100, Wolfram Sang wrote:
> > From: Wolfram Sang 
> > 
> > I decided to put the pinmuxing into the dtsi file since there is only
> > one pinmux posiibility which one probably wants to have when using the
> > bus.
> > 
> > Signed-off-by: Wolfram Sang 
> > Acked-by: Magnus Damm 
> 
> Simon, I think you could pull in these patches, too. My series does not
> really depend on the pinctrl stuff. I2C pins are function group 1 and
> thus activated by default if the bootloader doesn't do weird things.
> Actually, I coded the PFC stuff after the driver was finished :)

That seems reasonable.

Could you send a series which contains the patches you would like
queued up? Please base it on the latest devel tag, currently
renesas-devel-v3.13-rc5-20131230, without other patches applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 2/5] arm: shmobile: r7s72100: add i2c clocks

2013-12-26 Thread Simon Horman
On Thu, Dec 26, 2013 at 10:51:34PM +0100, Geert Uytterhoeven wrote:
> On Thu, Dec 26, 2013 at 10:34 PM, Geert Uytterhoeven
>  wrote:
> >>> Note that after dropping these lines:
> >>>
> >>>CLKDEV_DEV_ID("fcfee000.i2c", &mstp_clks[MSTP97]),
> >>>CLKDEV_DEV_ID("fcfee400.i2c", &mstp_clks[MSTP96]),
> >>>CLKDEV_DEV_ID("fcfee800.i2c", &mstp_clks[MSTP95]),
> >>>CLKDEV_DEV_ID("fcfeec00.i2c", &mstp_clks[MSTP94]),
> >>>
> >>> i2c stopped working.
> >>
> >> ??? Why do you want to drop these lines?
> >
> > Your v2 dropped them, presumably in response to Sergei's ICKy comments.
> > And that's what Simon committed...
> 
> Upon checking again, your v2 did contain them, but gmail tried to smart
> me out by not showing those few lines.
> So it must have been Simon who dropped them, or lost them during rebase?

Yes, it seems so. Sorry about that!

Wolfram, could you post the these missing clocks as an incremental patch?
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 2/5] arm: shmobile: r7s72100: add i2c clocks

2013-12-23 Thread Simon Horman
On Wed, Dec 18, 2013 at 10:31:58PM +0100, Wolfram Sang wrote:
> From: Wolfram Sang 
> 
> Tested with RIIC2 on a genmai board. Others untested but hopefully
> trivial enough to be added.
> 
> Signed-off-by: Wolfram Sang 
> Acked-by: Magnus Damm 
> ---
> 
> V2: adapt to established sorting

Thanks. This seems safe enough and I will queue it up.

> 
>  arch/arm/mach-shmobile/clock-r7s72100.c | 12 +++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-shmobile/clock-r7s72100.c 
> b/arch/arm/mach-shmobile/clock-r7s72100.c
> index 7b457ae..9cda215 100644
> --- a/arch/arm/mach-shmobile/clock-r7s72100.c
> +++ b/arch/arm/mach-shmobile/clock-r7s72100.c
> @@ -27,6 +27,7 @@
>  #define FRQCR2   0xfcfe0014
>  #define STBCR3   0xfcfe0420
>  #define STBCR4   0xfcfe0424
> +#define STBCR9   0xfcfe0438
>  
>  #define PLL_RATE 30
>  
> @@ -144,10 +145,15 @@ struct clk div4_clks[DIV4_NR] = {
>   | CLK_ENABLE_ON_INIT),
>  };
>  
> -enum { MSTP47, MSTP46, MSTP45, MSTP44, MSTP43, MSTP42, MSTP41, MSTP40,
> +enum {   MSTP97, MSTP96, MSTP95, MSTP94,
> + MSTP47, MSTP46, MSTP45, MSTP44, MSTP43, MSTP42, MSTP41, MSTP40,
>   MSTP33, MSTP_NR };
>  
>  static struct clk mstp_clks[MSTP_NR] = {
> + [MSTP97] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 7, 0), /* RIIC0 */
> + [MSTP96] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 6, 0), /* RIIC1 */
> + [MSTP95] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 5, 0), /* RIIC2 */
> + [MSTP94] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 4, 0), /* RIIC3 */
>   [MSTP47] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 7, 0), /* SCIF0 */
>   [MSTP46] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 6, 0), /* SCIF1 */
>   [MSTP45] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 5, 0), /* SCIF2 */
> @@ -170,6 +176,10 @@ static struct clk_lookup lookups[] = {
>   CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]),
>  
>   /* MSTP clocks */
> + CLKDEV_DEV_ID("fcfee000.i2c", &mstp_clks[MSTP97]),
> + CLKDEV_DEV_ID("fcfee400.i2c", &mstp_clks[MSTP96]),
> + CLKDEV_DEV_ID("fcfee800.i2c", &mstp_clks[MSTP95]),
> + CLKDEV_DEV_ID("fcfeec00.i2c", &mstp_clks[MSTP94]),
>   CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP33]),
>  
>   /* ICK */
> -- 
> 1.8.4.2
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/5] arm: shmobile: r7s72100: add i2c clocks

2013-12-18 Thread Simon Horman
On Wed, Dec 18, 2013 at 01:15:42PM +0100, Wolfram Sang wrote:
> 
> On Wed, Dec 18, 2013 at 03:53:45PM +0400, Sergei Shtylyov wrote:
> > On 18-12-2013 15:43, Wolfram Sang wrote:
> > 
> > >>>@@ -173,6 +179,10 @@ static struct clk_lookup lookups[] = {
> > >>> CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP33]),
> > 
> > >>> /* ICK */
> > >>>+CLKDEV_DEV_ID("fcfee000.i2c", &mstp_clks[MSTP97]),
> > >>>+CLKDEV_DEV_ID("fcfee400.i2c", &mstp_clks[MSTP96]),
> > >>>+CLKDEV_DEV_ID("fcfee800.i2c", &mstp_clks[MSTP95]),
> > >>>+CLKDEV_DEV_ID("fcfeec00.i2c", &mstp_clks[MSTP94]),
> > 
> > >>These belong to some other place, the group marked by /* ICK */
> > >>is only for CLKDEV_ICK_ID().
> > 
> > >So, I'll create a /* DEV */ prefix?
> > 
> >I really don't know. Other places have /* MSTP */ comment in this
> > case despite all clocks, CLKDEV_DEV_ID() and CLKDEV_ICK_ID() are
> > really MSTP clocks. I considered the idea of separating
> > CLKDEV_ICK_ID() under /* ICK */ comment silly from the very start
> > but Simon didn't listen to me.
> 
> I am puzzled, too. ICK is a type of registration and not a clock domain.
> Also, there is 'mtu2_fck' which is under ICK as well as MSTP? Looks
> wrong. From what I understand now, removing the /* ICK */ comment would
> be easiest and proper?

I'm not sure that I really understand what all the fuss is about.

As I understand things the convention that prevails for
MSTP clocks under mach-shmobile is as follows:

1. Clocks not registered by CLKDEV_ICK_ID() are grouped together
   under /* MSTP */ followed by:
2. Clocks registered using CLKDEV_ICK_ID() are grouped together
   under /* ICK */

I am unsure of the historical reason for this but it does
seem to be consistent.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] I2C: EMMA Mobile I2C master driver

2013-12-10 Thread Simon Horman
On Fri, Dec 06, 2013 at 08:52:38PM +, Ian Molton wrote:
> On 25/09/13 05:45, Simon Horman wrote:
> 
> >Hi Ian,
> >
> >I spoke with Magnus and in turn Ben about this at LinuxCon in New Orleans
> >last week.
> >
> >Basically the position of Magnus and I is that any support for this
> >hardware is an incremental improvement on the current situation: no
> >support.
> >
> >With this in mind from an shmobile point of view I am happy for this code.
> >And there is no need to wait for a review from Magnus.
> 
> Has anyone merged this for upstream yet? If not, where should I send it?

I don't believe it has been merged.

My suggestion is to re-post it with my Ack with
Wolfram Sang  CCed.

Also, I think you need to provide documentation for the bindings in
Documentation/devicetree/bindings/i2c.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 01/15] i2c: shmobile/rcar: Restrict non-COMPILE_TEST compilation

2013-11-27 Thread Simon Horman
On Wed, Nov 27, 2013 at 02:18:23AM +0100, Laurent Pinchart wrote:
> Hardware supported by the i2c sh_mobile and rcar drivers is only found
> on SUPERH or ARCH_SHMOBILE platforms. Restrict non-COMPILE_TEST
> compilation to them.
> 
> Cc: Wolfram Sang 
> Cc: linux-i2c@vger.kernel.org
> Signed-off-by: Laurent Pinchart 

Acked-by: Simon Horman 

> ---
>  drivers/i2c/busses/Kconfig | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
> index 3b26129..92bdcf9 100644
> --- a/drivers/i2c/busses/Kconfig
> +++ b/drivers/i2c/busses/Kconfig
> @@ -683,7 +683,7 @@ config I2C_SH7760
>  
>  config I2C_SH_MOBILE
>   tristate "SuperH Mobile I2C Controller"
> - depends on SUPERH || ARM || COMPILE_TEST
> + depends on SUPERH || ARCH_SHMOBILE || COMPILE_TEST
>   help
> If you say yes to this option, support will be included for the
> built-in I2C interface on the Renesas SH-Mobile processor.
> @@ -796,7 +796,7 @@ config I2C_XLR
>  
>  config I2C_RCAR
>   tristate "Renesas R-Car I2C Controller"
> - depends on ARM || COMPILE_TEST
> + depends on ARCH_SHMOBILE || COMPILE_TEST
>   help
> If you say yes to this option, support will be included for the
> R-Car I2C controller.
> -- 
> 1.8.3.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 06/12] i2c: sh_mobile: Convert to clk_prepare/unprepare

2013-10-28 Thread Simon Horman
On Tue, Oct 29, 2013 at 06:02:24AM +0100, Wolfram Sang wrote:
> On Mon, Oct 28, 2013 at 11:49:23PM +0100, Laurent Pinchart wrote:
> > Turn clk_enable() and clk_disable() calls into clk_prepare_enable() and
> > clk_disable_unprepare() to get ready for the migration to the common
> > clock framework.
> > 
> > Cc: Wolfram Sang 
> > Cc: linux-i2c@vger.kernel.org
> > Signed-off-by: Laurent Pinchart 
> 
> Acked-by: Wolfram Sang 

Hi Wolfram, Hi Laurent,

correct me if I am wrong, but I think the plan was
for Wolfram to take this patch.

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


Re: [PATCH resend] i2c: rcar: fixup rcar type naming

2013-10-28 Thread Simon Horman
On Mon, Oct 21, 2013 at 01:04:32AM -0700, Kuninori Morimoto wrote:
> b720423a2627f045133bec39a31fe2bc0dab86f3
> (i2c: rcar: add rcar-H2 support)
> added R-Car H2 support on i2c-rcar.
> 
> The R-Car I2C type is based on SoC generation
> (Gen1 = E1/M1/H1, Gen2 = E2/M2/H2),
> but added naming was H1/H2 instead of Gen1/Gen2.
> Gen1/Gen2 is better naming on this driver.
> 
> Signed-off-by: Kuninori Morimoto 

Thanks Morimoto-san, this looks good to me.

Acked-by: Simon Horman 

Wolfram, please consider applying this change.

> ---
> resend
>  - exchanged Wolfram's email address
> 
>  drivers/i2c/busses/i2c-rcar.c |   22 +++---
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
> index 8603f5e..2c2fd7c 100644
> --- a/drivers/i2c/busses/i2c-rcar.c
> +++ b/drivers/i2c/busses/i2c-rcar.c
> @@ -103,8 +103,8 @@ enum {
>  #define ID_NACK  (1 << 4)
>  
>  enum rcar_i2c_type {
> - I2C_RCAR_H1,
> - I2C_RCAR_H2,
> + I2C_RCAR_GEN1,
> + I2C_RCAR_GEN2,
>  };
>  
>  struct rcar_i2c_priv {
> @@ -240,10 +240,10 @@ static int rcar_i2c_clock_calculate(struct 
> rcar_i2c_priv *priv,
>   }
>  
>   switch (priv->devtype) {
> - case I2C_RCAR_H1:
> + case I2C_RCAR_GEN1:
>   cdf_width = 2;
>   break;
> - case I2C_RCAR_H2:
> + case I2C_RCAR_GEN2:
>   cdf_width = 3;
>   break;
>   default:
> @@ -640,10 +640,10 @@ static const struct i2c_algorithm rcar_i2c_algo = {
>  };
>  
>  static const struct of_device_id rcar_i2c_dt_ids[] = {
> - { .compatible = "renesas,i2c-rcar", .data = (void *)I2C_RCAR_H1 },
> - { .compatible = "renesas,i2c-r8a7778", .data = (void *)I2C_RCAR_H1 },
> - { .compatible = "renesas,i2c-r8a7779", .data = (void *)I2C_RCAR_H1 },
> - { .compatible = "renesas,i2c-r8a7790", .data = (void *)I2C_RCAR_H2 },
> + { .compatible = "renesas,i2c-rcar", .data = (void *)I2C_RCAR_GEN1 },
> + { .compatible = "renesas,i2c-r8a7778", .data = (void *)I2C_RCAR_GEN1 },
> + { .compatible = "renesas,i2c-r8a7779", .data = (void *)I2C_RCAR_GEN1 },
> + { .compatible = "renesas,i2c-r8a7790", .data = (void *)I2C_RCAR_GEN2 },
>   {},
>  };
>  MODULE_DEVICE_TABLE(of, rcar_i2c_dt_ids);
> @@ -731,9 +731,9 @@ static int rcar_i2c_remove(struct platform_device *pdev)
>  }
>  
>  static struct platform_device_id rcar_i2c_id_table[] = {
> - { "i2c-rcar",   I2C_RCAR_H1 },
> - { "i2c-rcar_h1",I2C_RCAR_H1 },
> - { "i2c-rcar_h2",I2C_RCAR_H2 },
> + { "i2c-rcar",   I2C_RCAR_GEN1 },
> + { "i2c-rcar_gen1",  I2C_RCAR_GEN1 },
> + { "i2c-rcar_gen2",  I2C_RCAR_GEN2 },
>   {},
>  };
>  MODULE_DEVICE_TABLE(platform, rcar_i2c_id_table);
> -- 
> 1.7.9.5
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] I2C: EMMA Mobile I2C master driver

2013-09-24 Thread Simon Horman
On Thu, Sep 05, 2013 at 03:04:29PM +0900, Simon Horman wrote:
> On Tue, Sep 03, 2013 at 05:49:29PM +0100, Ian Molton wrote:
> > Add a driver for the EMMA mobile I2C block.
> > 
> > The driver supports low and high-speed interrupt driven PIO transfers.
> > 
> > Signed-off-by: Ian Molton 
> 
> Magnus, could you find some time to review this?

Hi Ian,

I spoke with Magnus and in turn Ben about this at LinuxCon in New Orleans
last week.

Basically the position of Magnus and I is that any support for this
hardware is an incremental improvement on the current situation: no
support.

With this in mind from an shmobile point of view I am happy for this code.
And there is no need to wait for a review from Magnus.

Acked-by: Simon Horman 

> > ---
> >  drivers/i2c/busses/Kconfig  |   10 +
> >  drivers/i2c/busses/Makefile |1 +
> >  drivers/i2c/busses/i2c-em.c |  501 
> > +++
> >  3 files changed, 512 insertions(+)
> >  create mode 100644 drivers/i2c/busses/i2c-em.c
> > 
> > diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
> > index dc6dea6..d66d4b4 100644
> > --- a/drivers/i2c/busses/Kconfig
> > +++ b/drivers/i2c/busses/Kconfig
> > @@ -777,6 +777,16 @@ config I2C_RCAR
> >   This driver can also be built as a module.  If so, the module
> >   will be called i2c-rcar.
> >  
> > +config I2C_EM
> > +   tristate "EMMA Mobile series I2C adapter"
> > +   depends on I2C && HAVE_CLK
> > +   help
> > + If you say yes to this option, support will be included for the
> > + I2C interface on the Renesas Electronics EM/EV family of processors.
> > +
> > + This driver can also be built as a module.  If so, the module
> > + will be called i2c-em
> > +
> >  comment "External I2C/SMBus adapter drivers"
> >  
> >  config I2C_DIOLAN_U2C
> > diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
> > index d00997f..d330706 100644
> > --- a/drivers/i2c/busses/Makefile
> > +++ b/drivers/i2c/busses/Makefile
> > @@ -42,6 +42,7 @@ i2c-designware-platform-objs := i2c-designware-platdrv.o
> >  obj-$(CONFIG_I2C_DESIGNWARE_PCI)   += i2c-designware-pci.o
> >  i2c-designware-pci-objs := i2c-designware-pcidrv.o
> >  obj-$(CONFIG_I2C_EG20T)+= i2c-eg20t.o
> > +obj-$(CONFIG_I2C_EM)+= i2c-em.o
> >  obj-$(CONFIG_I2C_GPIO) += i2c-gpio.o
> >  obj-$(CONFIG_I2C_HIGHLANDER)   += i2c-highlander.o
> >  obj-$(CONFIG_I2C_IBM_IIC)  += i2c-ibm_iic.o
> > diff --git a/drivers/i2c/busses/i2c-em.c b/drivers/i2c/busses/i2c-em.c
> > new file mode 100644
> > index 000..d7e91b4
> > --- /dev/null
> > +++ b/drivers/i2c/busses/i2c-em.c
> > @@ -0,0 +1,501 @@
> > +/*
> > + * Copyright 2013 Codethink Ltd.
> > + * Parts Copyright 2010 Renesas Electronics Corporation
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License version 2
> > + * as published by the Free Software Foundation.
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> > + * GNU General Public License for more details.
> > + *
> > + * You should have received a copy of the GNU General Public License
> > + * along with this program; if not, write to the Free Software Foundation,
> > + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA.
> > + */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +/* I2C Registers */
> > +#define I2C_OFS_IICACT00x00/* start */
> > +#define I2C_OFS_IIC0   0x04/* shift */
> > +#define I2C_OFS_IICC0  0x08/* control */
> > +#define I2C_OFS_SVA0   0x0c/* slave address */
> > +#define I2C_OFS_IICCL0 0x10/* clock select */
> > +#define I2C_OFS_IICX0  0x14/* extention */
> > +#define I2C_OFS_IICS0  0x18/* status */
> > +#define I2C_OFS_IICSE0 0x1c/* status For emulation */
> > +#define I2C_OFS_IICF0  0x20/* IIC flag */
> > +
> > +/* I2C IICACT0 Masks */
> > +#define I2C_BIT_IIC

Re: [PATCH 1/2] I2C: EMMA Mobile I2C master driver

2013-09-04 Thread Simon Horman
On Tue, Sep 03, 2013 at 05:49:29PM +0100, Ian Molton wrote:
> Add a driver for the EMMA mobile I2C block.
> 
> The driver supports low and high-speed interrupt driven PIO transfers.
> 
> Signed-off-by: Ian Molton 

Magnus, could you find some time to review this?

> ---
>  drivers/i2c/busses/Kconfig  |   10 +
>  drivers/i2c/busses/Makefile |1 +
>  drivers/i2c/busses/i2c-em.c |  501 
> +++
>  3 files changed, 512 insertions(+)
>  create mode 100644 drivers/i2c/busses/i2c-em.c
> 
> diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
> index dc6dea6..d66d4b4 100644
> --- a/drivers/i2c/busses/Kconfig
> +++ b/drivers/i2c/busses/Kconfig
> @@ -777,6 +777,16 @@ config I2C_RCAR
> This driver can also be built as a module.  If so, the module
> will be called i2c-rcar.
>  
> +config I2C_EM
> + tristate "EMMA Mobile series I2C adapter"
> + depends on I2C && HAVE_CLK
> + help
> +   If you say yes to this option, support will be included for the
> +   I2C interface on the Renesas Electronics EM/EV family of processors.
> +
> +   This driver can also be built as a module.  If so, the module
> +   will be called i2c-em
> +
>  comment "External I2C/SMBus adapter drivers"
>  
>  config I2C_DIOLAN_U2C
> diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
> index d00997f..d330706 100644
> --- a/drivers/i2c/busses/Makefile
> +++ b/drivers/i2c/busses/Makefile
> @@ -42,6 +42,7 @@ i2c-designware-platform-objs := i2c-designware-platdrv.o
>  obj-$(CONFIG_I2C_DESIGNWARE_PCI) += i2c-designware-pci.o
>  i2c-designware-pci-objs := i2c-designware-pcidrv.o
>  obj-$(CONFIG_I2C_EG20T)  += i2c-eg20t.o
> +obj-$(CONFIG_I2C_EM)+= i2c-em.o
>  obj-$(CONFIG_I2C_GPIO)   += i2c-gpio.o
>  obj-$(CONFIG_I2C_HIGHLANDER) += i2c-highlander.o
>  obj-$(CONFIG_I2C_IBM_IIC)+= i2c-ibm_iic.o
> diff --git a/drivers/i2c/busses/i2c-em.c b/drivers/i2c/busses/i2c-em.c
> new file mode 100644
> index 000..d7e91b4
> --- /dev/null
> +++ b/drivers/i2c/busses/i2c-em.c
> @@ -0,0 +1,501 @@
> +/*
> + * Copyright 2013 Codethink Ltd.
> + * Parts Copyright 2010 Renesas Electronics Corporation
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2
> + * as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software Foundation,
> + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA.
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/* I2C Registers */
> +#define I2C_OFS_IICACT0  0x00/* start */
> +#define I2C_OFS_IIC0 0x04/* shift */
> +#define I2C_OFS_IICC00x08/* control */
> +#define I2C_OFS_SVA0 0x0c/* slave address */
> +#define I2C_OFS_IICCL0   0x10/* clock select */
> +#define I2C_OFS_IICX00x14/* extention */
> +#define I2C_OFS_IICS00x18/* status */
> +#define I2C_OFS_IICSE0   0x1c/* status For emulation */
> +#define I2C_OFS_IICF00x20/* IIC flag */
> +
> +/* I2C IICACT0 Masks */
> +#define I2C_BIT_IICE00x0001
> +
> +/* I2C IICC0 Masks */
> +#define I2C_BIT_LREL00x0040
> +#define I2C_BIT_WREL00x0020
> +#define I2C_BIT_SPIE00x0010
> +#define I2C_BIT_WTIM00x0008
> +#define I2C_BIT_ACKE00x0004
> +#define I2C_BIT_STT0 0x0002
> +#define I2C_BIT_SPT0 0x0001
> +
> +/* I2C IICCL0 Masks */
> +#define I2C_BIT_SMC0 0x0008
> +#define I2C_BIT_DFC0 0x0004
> +
> +/* I2C IICSE0 Masks */
> +#define I2C_BIT_MSTS00x0080
> +#define I2C_BIT_ALD0 0x0040
> +#define I2C_BIT_EXC0 0x0020
> +#define I2C_BIT_COI0 0x0010
> +#define I2C_BIT_TRC0 0x0008
> +#define I2C_BIT_ACKD00x0004
> +#define I2C_BIT_STD0 0x0002
> +#define I2C_BIT_SPD0 0x0001
> +
> +/* I2C IICF0 Masks */
> +#define I2C_BIT_STCF 0x0080
> +#define I2C_BIT_IICBSY   0x0040
> +#define I2C_BIT_STCEN0x0002
> +#define I2C_BIT_IICRSV   0x0001
> +
> +static int em_i2c_xfer(struct i2c_adapter *, struct i2c_msg[], int);
> +
> +struct em_i2c_device {
> + struct i2c_adapter  adap;
> + wait_queue_head_t   i2c_wait;
> + void __iomem

Re: [PATCH] i2c: sh_mobile: Don't start transfers when suspending

2013-02-15 Thread Simon Horman
On Thu, Feb 14, 2013 at 11:17:37AM -0600, Bastian Hecht wrote:
> Currently we provoke i2c timeouts by allowing transfers when
> suspending. This patch adds awareness to suspending and fixes these
> issues.
> The patch follows the style used in i2c-tegra.c - thanks.

Hi,

at this stage I do not expect this code to go through the renesas tree.
However, in order to provide a basis for work on renesas SoCs I have added
this patch to the topic/i2c topic branch in the reneas tree on
kernel.org and merged it into topic/all+next.

In other words, I am not picking this patch up to merge it or add it to
linux-next, rather I am storing it for reference.

> 
> Signed-off-by: Bastian Hecht 
> ---
>  drivers/i2c/busses/i2c-sh_mobile.c |   28 
>  1 file changed, 28 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-sh_mobile.c 
> b/drivers/i2c/busses/i2c-sh_mobile.c
> index b6e7a83..da28164 100644
> --- a/drivers/i2c/busses/i2c-sh_mobile.c
> +++ b/drivers/i2c/busses/i2c-sh_mobile.c
> @@ -132,6 +132,7 @@ struct sh_mobile_i2c_data {
>   struct i2c_msg *msg;
>   int pos;
>   int sr;
> + bool is_suspended;
>  };
>  
>  #define IIC_FLAG_HAS_ICIC67  (1 << 0)
> @@ -511,6 +512,9 @@ static int sh_mobile_i2c_xfer(struct i2c_adapter *adapter,
>   u_int8_t val;
>   int i, k, retry_count;
>  
> + if (pd->is_suspended)
> + return -EBUSY;
> +
>   activate_ch(pd);
>  
>   /* Process all messages */
> @@ -753,9 +757,33 @@ static int sh_mobile_i2c_runtime_nop(struct device *dev)
>   return 0;
>  }
>  
> +static int sh_mobile_i2c_suspend(struct device *dev)
> +{
> + struct sh_mobile_i2c_data *pd = dev_get_drvdata(dev);
> +
> + i2c_lock_adapter(&pd->adap);
> + pd->is_suspended = true;
> + i2c_unlock_adapter(&pd->adap);
> +
> + return 0;
> +}
> +
> +static int sh_mobile_i2c_resume(struct device *dev)
> +{
> + struct sh_mobile_i2c_data *pd = dev_get_drvdata(dev);
> +
> + i2c_lock_adapter(&pd->adap);
> + pd->is_suspended = false;
> + i2c_unlock_adapter(&pd->adap);
> +
> + return 0;
> +}
> +
>  static const struct dev_pm_ops sh_mobile_i2c_dev_pm_ops = {
>   .runtime_suspend = sh_mobile_i2c_runtime_nop,
>   .runtime_resume = sh_mobile_i2c_runtime_nop,
> + .suspend = sh_mobile_i2c_suspend,
> + .resume = sh_mobile_i2c_resume,
>  };
>  
>  static const struct of_device_id sh_mobile_i2c_dt_ids[] = {
> -- 
> 1.7.9.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] i2c: rcar: fixup section mismatch on rcar_i2c_probe/remove()

2012-10-31 Thread Simon Horman
On Tue, Oct 30, 2012 at 11:44:44PM -0700, Kuninori Morimoto wrote:
> This patch fixup below WARNING
> 
> make CONFIG_DEBUG_SECTION_MISMATCH=y
> ...
> WARNING: vmlinux.o(.data+0x11798): Section mismatch in reference from the 
> variable rcar_i2c_drv to the function .devinit.text:rcar_i2c_probe()
> The variable rcar_i2c_drv references
> the function __devinit rcar_i2c_probe()
> If the reference is valid then annotate the
> variable with __init* or __refdata (see linux/init.h) or name the variable:
> *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
> 
> WARNING: vmlinux.o(.data+0x1179c): Section mismatch in reference from the 
> variable rcar_i2c_drv to the function .devexit.text:rcar_i2c_remove()
> The variable rcar_i2c_drv references
> the function __devexit rcar_i2c_remove()
> If the reference is valid then annotate the
> variable with __exit* (see linux/init.h) or name the variable:
> *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
> 
> Reported-by: Simon Horman 
> Signed-off-by: Kuninori Morimoto 
> ---
> Simon
> 
> Is this patch solve your issue ?

Yes, thanks.

Tested-by: Simon Horman 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3] i2c: add Renesas R-Car I2C driver

2012-10-30 Thread Simon Horman
On Thu, Sep 27, 2012 at 11:44:25PM -0700, Kuninori Morimoto wrote:
> R-Car I2C is similar with SH7760 I2C.
> But the SH7760 I2C driver had many workaround operations, since H/W had bugs.
> Thus, it was pointless to keep compatible between SH7760 and R-Car I2C 
> drivers.
> This patch creates new Renesas R-Car I2C driver.

Hi,

I am seeing the current section miss-matches, which appear to relate to
this patch, in linux/master (v3.6-rc3+).

make CONFIG_DEBUG_SECTION_MISMATCH=y
...
WARNING: vmlinux.o(.data+0x11798): Section mismatch in reference from the 
variable rcar_i2c_drv to the function .devinit.text:rcar_i2c_probe()
The variable rcar_i2c_drv references
the function __devinit rcar_i2c_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

WARNING: vmlinux.o(.data+0x1179c): Section mismatch in reference from the 
variable rcar_i2c_drv to the function .devexit.text:rcar_i2c_remove()
The variable rcar_i2c_drv references
the function __devexit rcar_i2c_remove()
If the reference is valid then annotate the
variable with __exit* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console


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


Re: [PATCH v2] i2c: add Renesas R-Car I2C driver

2012-09-27 Thread Simon Horman
Hi Morimoto-san, Hi Wolfram, Hi All,

I'm not aware of any objections to this patch from the shmobile side
of things, so to that end:

Acked-by: Simon Horman 

Wolfram, would you consider merging this change?

On Thu, Sep 27, 2012 at 06:57:47PM -0700, Kuninori Morimoto wrote:
> 
> Please teach me current status of this patch ?
> 
> > R-Car I2C is similar with SH7760 I2C.
> > But the SH7760 I2C driver had many workaround operations, since H/W had 
> > bugs.
> > Thus, it was pointless to keep compatible between SH7760 and R-Car I2C 
> > drivers.
> > This patch creates new Renesas R-Car I2C driver.
> > 
> > Signed-off-by: Kuninori Morimoto 
> > ---
> > v1 -> v2
> > 
> >  - removed #if 0 function
> >  - add explanation on rcar_i2c_bus_barrier()
> >  - removed IGNORE_NAK support
> >  - rename rcar_i2c_soft_reset() -> rcar_i2c_init()
> >  - removed devm_kfree/devm_iounmap
> >  - __raw_writel/readl => writel/readl
> >  - removed un-needed return from rcar_i2c_bus_phase()
> >  - tidyup calculation method on rcar_i2c_clock_calculate()
> >  - tidyup English type
> >  - tidyup comment to "i2c device disabled"
> > 
> >  drivers/i2c/busses/Kconfig|   10 +
> >  drivers/i2c/busses/Makefile   |1 +
> >  drivers/i2c/busses/i2c-rcar.c |  715 
> > +
> >  include/linux/i2c/i2c-rcar.h  |   10 +
> >  4 files changed, 736 insertions(+), 0 deletions(-)
> >  create mode 100644 drivers/i2c/busses/i2c-rcar.c
> >  create mode 100644 include/linux/i2c/i2c-rcar.h
> > 
> > diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
> > index b4aaa1b..51baa08 100644
> > --- a/drivers/i2c/busses/Kconfig
> > +++ b/drivers/i2c/busses/Kconfig
> > @@ -709,6 +709,16 @@ config I2C_XLR
> >   This driver can also be built as a module.  If so, the module
> >   will be called i2c-xlr.
> >  
> > +config I2C_RCAR
> > +   tristate "Renesas R-Car I2C Controller"
> > +   depends on ARCH_SHMOBILE && I2C
> > +   help
> > + If you say yes to this option, support will be included for the
> > + R-Car I2C controller.
> > +
> > + This driver can also be built as a module.  If so, the module
> > + will be called i2c-rcar.
> > +
> >  comment "External I2C/SMBus adapter drivers"
> >  
> >  config I2C_DIOLAN_U2C
> > diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
> > index ce3c2be..e98ff51 100644
> > --- a/drivers/i2c/busses/Makefile
> > +++ b/drivers/i2c/busses/Makefile
> > @@ -70,6 +70,7 @@ obj-$(CONFIG_I2C_VERSATILE)   += i2c-versatile.o
> >  obj-$(CONFIG_I2C_OCTEON)   += i2c-octeon.o
> >  obj-$(CONFIG_I2C_XILINX)   += i2c-xiic.o
> >  obj-$(CONFIG_I2C_XLR)  += i2c-xlr.o
> > +obj-$(CONFIG_I2C_RCAR) += i2c-rcar.o
> >  
> >  # External I2C/SMBus adapter drivers
> >  obj-$(CONFIG_I2C_DIOLAN_U2C)   += i2c-diolan-u2c.o
> > diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
> > new file mode 100644
> > index 000..bd8fcf1
> > --- /dev/null
> > +++ b/drivers/i2c/busses/i2c-rcar.c
> > @@ -0,0 +1,715 @@
> > +/*
> > + *  drivers/i2c/busses/i2c-rcar.c
> > + *
> > + * Copyright (C) 2012 Renesas Solutions Corp.
> > + * Kuninori Morimoto 
> > + *
> > + * This file is based on the drivers/i2c/busses/i2c-sh7760.c
> > + * (c) 2005-2008 MSC Vertriebsges.m.b.H, Manuel Lauss 
> > + *
> > + * This file used out-of-tree driver i2c-rcar.c
> > + * Copyright (C) 2011-2012 Renesas Electronics Corporation
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License as published by
> > + * the Free Software Foundation; either version 2 of the License
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + * GNU General Public License for more details.
> > + *
> > + * You should have received a copy of the GNU General Public License
> > + * along with this program; if not, write to the Free Software
> > + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  
> > USA
> > + */
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#in

Re: [PATCH] i2c: i2c-sh_mobile bus speed platform data V2

2011-04-28 Thread Simon Horman
On Thu, Apr 28, 2011 at 01:25:36PM +0900, Magnus Damm wrote:
> From: Magnus Damm 
> 
> Add support to the i2c-sh_mobile driver for setting
> the I2C bus speed using platform data.
> 
> Signed-off-by: Magnus Damm 

Acked-by: Simon Horman 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] i2c: i2c-sh_mobile bus speed platform data

2011-04-27 Thread Simon Horman
On Thu, Apr 28, 2011 at 12:25:30PM +0900, Magnus Damm wrote:
> On Thu, Apr 28, 2011 at 12:11 PM, Paul Mundt  wrote:
> > On Thu, Apr 28, 2011 at 11:46:37AM +0900, Magnus Damm wrote:
> >> On Thu, Apr 28, 2011 at 11:22 AM, Paul Mundt  wrote:
> >> > On Thu, Apr 28, 2011 at 10:18:01AM +0900, Simon Horman wrote:
> >> >> On Thu, Apr 28, 2011 at 10:06:38AM +0900, Magnus Damm wrote:
> >> >> > On Thu, Apr 28, 2011 at 7:14 AM, Simon Horman  
> >> >> > wrote:
> >> >> > > I believe that on the sh73a0 and so far only the sh73a0
> >> >> > > denom needs to be doubled.
> >> >> >
> >> >> > Uhm, I don't think this patch is specific to any SoC type. It may of
> >> >> > course be used on sh73a0 to adjust the denom value, but setting the
> >> >> > I2C bus speed is something that can be used on any SoC. So I'd say
> >> >> > that this is a fairly generic feature.
> >> >>
> >> >> I'm just saying that that I've observed the value being doubled for 
> >> >> sh73a0.
> >> >>
> >> > The general rule of thumb is that whatever unusual behaviour is observed
> >> > in the latest CPU we will see become the standard for future ones.
> >>
> >> This may also be an attempt to simply double the I2C bus speed on that
> >> particular platform for that particular application. So in the end it
> >> may have nothing to do with sh73a0. Actually, now when I think about
> >> it, I recall hacking up a prototype to control the LCD backlight via
> >> I2C on sh73a0 and AG5EVM, and I did not have to modify any part of the
> >> I2C bus driver to get that going as expected.
> >>
> > Ok, that bit of information was missing from your patch. That's obviously
> > a bit more dodgy. We don't want to have the default behaviour out of spec
> > for some specific application.
> 
> I suspect that I may have chosen my words poorly. By writing "This may
> also be an attempt to simply double the I2C bus speed on that
> particular platform for that particular application." I am not
> referring to this patch. I am commenting on something Simon may see
> when he is going though kernel source that has been mangled by people
> doing integration.
> 
> As for configuring the i2c bus speed, I wouldn't call it dodgy. It is
> something that is fairly common but of course needs to be handled with
> care. Other drivers handle this through module parameters, but since
> we want to configure this with per-device instance granularity
> platform data is a better fit.

To clarify my position on this.

I merely observed a different implementation of essentially the same code
that doubles the value for the sh73a0. I am not entirely sure why it was
doubled. Nor am I sure why it was implemented outside of platform code.

However, I am sure that the exception that I noted is nowhere
in upstream code. So I think it would be fine to merge Magnus's changes.

If there is interest in resolving this sh73a0 anomaly then I guess
enquires will need to be made to the people with the alternate
implementation. That is probably a discussion best had off-list.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] i2c: i2c-sh_mobile bus speed platform data

2011-04-27 Thread Simon Horman
On Thu, Apr 28, 2011 at 10:06:38AM +0900, Magnus Damm wrote:
> On Thu, Apr 28, 2011 at 7:14 AM, Simon Horman  wrote:
> > Hi Magnus,
> >
> > On Thu, Apr 21, 2011 at 10:22:54PM +0900, Magnus Damm wrote:
> >> From: Magnus Damm 
> >>
> >> Add support to the i2c-sh_mobile driver for setting
> >> the I2C bus speed using platform data.
> >>
> >> Signed-off-by: Magnus Damm 
> >> ---
> >>
> >>  drivers/i2c/busses/i2c-sh_mobile.c |   13 +++--
> >>  include/linux/i2c-sh_mobile.h      |   10 ++
> >>  2 files changed, 21 insertions(+), 2 deletions(-)
> >>
> >> --- 0013/drivers/i2c/busses/i2c-sh_mobile.c
> >> +++ work/drivers/i2c/busses/i2c-sh_mobile.c   2011-04-21 
> >> 20:20:23.0 +0900
> >> @@ -32,6 +32,7 @@
> >>  #include 
> >>  #include 
> >>  #include 
> >> +#include 
> >>
> >>  /* Transmit operation:                                                    
> >>   */
> >>  /*                                                                        
> >>   */
> >> @@ -117,7 +118,7 @@ struct sh_mobile_i2c_data {
> >>       struct device *dev;
> >>       void __iomem *reg;
> >>       struct i2c_adapter adap;
> >> -
> >> +     unsigned long bus_speed;
> >>       struct clk *clk;
> >>       u_int8_t icic;
> >>       u_int8_t iccl;
> >> @@ -205,7 +206,7 @@ static void activate_ch(struct sh_mobile
> >>        * We also round off the result.
> >>        */
> >>       num = i2c_clk * 5;
> >> -     denom = NORMAL_SPEED * 9;
> >> +     denom = pd->bus_speed * 9;
> >
> > I believe that on the sh73a0 and so far only the sh73a0
> > denom needs to be doubled.
> 
> Uhm, I don't think this patch is specific to any SoC type. It may of
> course be used on sh73a0 to adjust the denom value, but setting the
> I2C bus speed is something that can be used on any SoC. So I'd say
> that this is a fairly generic feature.

I'm just saying that that I've observed the value being doubled for sh73a0.

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


Re: [PATCH] i2c: i2c-sh_mobile bus speed platform data

2011-04-27 Thread Simon Horman
Hi Magnus,

On Thu, Apr 21, 2011 at 10:22:54PM +0900, Magnus Damm wrote:
> From: Magnus Damm 
> 
> Add support to the i2c-sh_mobile driver for setting
> the I2C bus speed using platform data.
> 
> Signed-off-by: Magnus Damm 
> ---
> 
>  drivers/i2c/busses/i2c-sh_mobile.c |   13 +++--
>  include/linux/i2c-sh_mobile.h  |   10 ++
>  2 files changed, 21 insertions(+), 2 deletions(-)
> 
> --- 0013/drivers/i2c/busses/i2c-sh_mobile.c
> +++ work/drivers/i2c/busses/i2c-sh_mobile.c   2011-04-21 20:20:23.0 
> +0900
> @@ -32,6 +32,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  /* Transmit operation:  
> */
>  /*  
> */
> @@ -117,7 +118,7 @@ struct sh_mobile_i2c_data {
>   struct device *dev;
>   void __iomem *reg;
>   struct i2c_adapter adap;
> -
> + unsigned long bus_speed;
>   struct clk *clk;
>   u_int8_t icic;
>   u_int8_t iccl;
> @@ -205,7 +206,7 @@ static void activate_ch(struct sh_mobile
>* We also round off the result.
>*/
>   num = i2c_clk * 5;
> - denom = NORMAL_SPEED * 9;
> + denom = pd->bus_speed * 9;

I believe that on the sh73a0 and so far only the sh73a0
denom needs to be doubled.

>   tmp = num * 10 / denom;
>   if (tmp % 10 >= 5)
>   pd->iccl = (u_int8_t)((num/denom) + 1);
> @@ -574,6 +575,7 @@ static int sh_mobile_i2c_hook_irqs(struc
>  
>  static int sh_mobile_i2c_probe(struct platform_device *dev)
>  {
> + struct i2c_sh_mobile_platform_data *pdata = dev->dev.platform_data;
>   struct sh_mobile_i2c_data *pd;
>   struct i2c_adapter *adap;
>   struct resource *res;
> @@ -618,6 +620,11 @@ static int sh_mobile_i2c_probe(struct pl
>   goto err_irq;
>   }
>  
> + /* Use platformd data bus speed or NORMAL_SPEED */
> + pd->bus_speed = NORMAL_SPEED;
> + if (pdata && pdata->bus_speed)
> + pd->bus_speed = pdata->bus_speed;
> +
>   /* The IIC blocks on SH-Mobile ARM processors
>* come with two new bits in ICIC.
>*/
> @@ -658,6 +665,8 @@ static int sh_mobile_i2c_probe(struct pl
>   goto err_all;
>   }
>  
> + dev_info(&dev->dev, "I2C adapter %d with bus speed %lu Hz\n",
> +  adap->nr, pd->bus_speed);
>   return 0;
>  
>   err_all:
> --- /dev/null
> +++ work/include/linux/i2c-sh_mobile.h2011-04-21 20:06:59.0 
> +0900
> @@ -0,0 +1,10 @@
> +#ifndef __I2C_SH_MOBILE_H__
> +#define __I2C_SH_MOBILE_H__
> +
> +#include 
> +
> +struct i2c_sh_mobile_platform_data {
> + unsigned long bus_speed;
> +};
> +
> +#endif /* __I2C_SH_MOBILE_H__ */
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] i2c: add a module alias to the sh-mobile driver

2011-04-18 Thread Simon Horman
On Fri, Apr 15, 2011 at 08:18:57PM +0200, Guennadi Liakhovetski wrote:
> This patch enables I2C driver autoloading on sh-mobile systems.
> 
> Signed-off-by: Guennadi Liakhovetski 
> Cc: Simon Horman 
> Cc: Magnus Damm 

This appears correct to me.

Reviewed-by: Simon Horman 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html