[PATCH v2 2/9] i2c: add generic routine to parse DT for timing information

2015-12-08 Thread Wolfram Sang
From: Wolfram Sang Inspired from the i2c-rk3x driver (thanks guys!) but refactored and extended. See built-in docs for further information. Signed-off-by: Wolfram Sang --- drivers/i2c/i2c-core.c | 47

[PATCH v2 3/9] i2c: rcar: refactor probe function a little

2015-12-08 Thread Wolfram Sang
From: Wolfram Sang The probe function is a little bit messy, something here, something there. Rework it so that there is some order: first init the private structure, then the adapter, then do HW init. This also allows us to remove the device argument of the

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

2015-12-08 Thread Wolfram Sang
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

[PATCH v2 8/9] ARM: shmobile: r8a7794: dtsi: add internal delay for i2c IPs

2015-12-08 Thread Wolfram Sang
From: Wolfram Sang Signed-off-by: Wolfram Sang --- arch/arm/boot/dts/r8a7794.dtsi | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/boot/dts/r8a7794.dtsi b/arch/arm/boot/dts/r8a7794.dtsi index

[PATCH v2 1/9] i2c: document generic DT bindings for timing parameters

2015-12-08 Thread Wolfram Sang
From: Wolfram Sang Also, sort the properties alphabetically and make indentation consistent. Wording largely taken from i2c-rk3x.txt, thanks guys! Only "i2c-scl-internal-delay-ns" is new, the rest is used by two drivers already and was documented in their

[PATCH v2 4/9] i2c: rcar: switch to i2c generic dt parsing

2015-12-08 Thread Wolfram Sang
From: Wolfram Sang Switch to the new generic functions. Plain convert, no functionality added yet. Signed-off-by: Wolfram Sang --- drivers/i2c/busses/i2c-rcar.c | 16 +--- 1 file changed, 9 insertions(+), 7

[PATCH v2 9/9] arm64: renesas: r8a7795: add internal delay for i2c IPs

2015-12-08 Thread Wolfram Sang
From: Wolfram Sang Signed-off-by: Wolfram Sang --- arch/arm64/boot/dts/renesas/r8a7795.dtsi | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r8a7795.dtsi

[PATCH v2 6/9] ARM: shmobile: r8a7790: dtsi: add internal delay for i2c IPs

2015-12-08 Thread Wolfram Sang
From: Wolfram Sang Signed-off-by: Wolfram Sang --- arch/arm/boot/dts/r8a7790.dtsi | 4 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi index

[PATCH v2 7/9] ARM: shmobile: r8a7791: dtsi: add internal delay for i2c IPs

2015-12-08 Thread Wolfram Sang
From: Wolfram Sang Signed-off-by: Wolfram Sang --- 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

[PATCH v2 5/9] i2c: rcar: honor additional i2c timings from DT

2015-12-08 Thread Wolfram Sang
From: Wolfram Sang Signed-off-by: Wolfram Sang --- Documentation/devicetree/bindings/i2c/i2c-rcar.txt | 4 drivers/i2c/busses/i2c-rcar.c | 21 - 2 files changed, 16 insertions(+),

Re: [PATCH v2 2/9] i2c: add generic routine to parse DT for timing information

2015-12-08 Thread Andy Shevchenko
On Tue, 2015-12-08 at 10:37 +0100, Wolfram Sang wrote: > From: Wolfram Sang > > Inspired from the i2c-rk3x driver (thanks guys!) but refactored and > extended. See built-in docs for further information. One style comment. > > Signed-off-by: Wolfram Sang

Re: [PATCH v2 4/9] i2c: rcar: switch to i2c generic dt parsing

2015-12-08 Thread Shevchenko, Andriy
On Tue, 2015-12-08 at 12:59 +0200, Andy Shevchenko wrote: > On Tue, 2015-12-08 at 10:37 +0100, Wolfram Sang wrote: > > From: Wolfram Sang > > > > Switch to the new generic functions. Plain convert, no > > functionality > > added yet. > > One style nitpick. Ah,

Re: [PATCH v2 2/9] i2c: add generic routine to parse DT for timing information

2015-12-08 Thread Wolfram Sang
> I wonder if it makes sense to add "i2c-sda-hold-time-ns" (taken from the > designware driver DT binding) to the timings structure? It is tHD;DAT > parameter in the I2C bus specification. It totally makes sense. I just didn't need it for the RCar driver and didn't want to implement something

Re: [PATCH v2 2/9] i2c: add generic routine to parse DT for timing information

2015-12-08 Thread Mika Westerberg
On Tue, Dec 08, 2015 at 01:53:07PM +0100, Wolfram Sang wrote: > > > I wonder if it makes sense to add "i2c-sda-hold-time-ns" (taken from the > > designware driver DT binding) to the timings structure? It is tHD;DAT > > parameter in the I2C bus specification. > > It totally makes sense. I just

Re: [PATCH 2/2] i2c:dw: Add APM X-Gene ACPI I2C device support

2015-12-08 Thread Mika Westerberg
On Mon, Dec 07, 2015 at 05:16:14PM -0700, Loc Ho wrote: > Enable APM X-Gene ACPI I2C device support by adding the > corresponding ACPI ID. The platform ACPI APD corresponding > change is required to provide the proper clock frequency input. > > Signed-off-by: Loc Ho Acked-by: Mika

Re: [PATCH v2 2/9] i2c: add generic routine to parse DT for timing information

2015-12-08 Thread Wolfram Sang
> Too many && use_defaults. What about > > memset(t, 0, sizeof(*t)); > > device_property_read_u32(dev, "i2c-scl-internal-delay-ns", > >scl_int_delay_ns); > > if (!use_defaults) >  return; I like this! Thanks for the input. signature.asc Description: Digital signature

Re: [PATCH v2 2/9] i2c: add generic routine to parse DT for timing information

2015-12-08 Thread Mika Westerberg
On Tue, Dec 08, 2015 at 10:37:46AM +0100, Wolfram Sang wrote: > From: Wolfram Sang > > Inspired from the i2c-rk3x driver (thanks guys!) but refactored and > extended. See built-in docs for further information. > > Signed-off-by: Wolfram Sang

Re: [PATCH v2 4/9] i2c: rcar: switch to i2c generic dt parsing

2015-12-08 Thread Andy Shevchenko
On Tue, 2015-12-08 at 10:37 +0100, Wolfram Sang wrote: > From: Wolfram Sang > > Switch to the new generic functions. Plain convert, no functionality > added yet. One style nitpick. > > Signed-off-by: Wolfram Sang > --- >  

[Patch V2] i2c: imx: init bus recovery info before adding i2c adapter

2015-12-08 Thread Gao Pan
During driver probe, i2c_imx_init_recovery_info() must come before i2c_add_numbered_adapter(), because the get/set_scl() functions are assigned in i2c_register_adapter() under the conditon that bus recover_info are initialized. Otherwise, get/set_scl() function pointers never get assigned. In

Re: [Patch V2] i2c: imx: init bus recovery info before adding i2c adapter

2015-12-08 Thread Uwe Kleine-König
Hello, On Wed, Dec 09, 2015 at 11:08:22AM +0800, Gao Pan wrote: > During driver probe, i2c_imx_init_recovery_info() must come before > i2c_add_numbered_adapter(), because the get/set_scl() functions > are assigned in i2c_register_adapter() under the conditon that bus > recover_info are

Re: [PATCH v2 2/9] i2c: add generic routine to parse DT for timing information

2015-12-08 Thread Wolfram Sang
On Tue, Dec 08, 2015 at 02:03:23PM +0100, Wolfram Sang wrote: > > > Too many && use_defaults. What about > > > > memset(t, 0, sizeof(*t)); > > > > device_property_read_u32(dev, "i2c-scl-internal-delay-ns", > > >scl_int_delay_ns); > > > > if (!use_defaults) > >  return; > > I like this!