linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] Add cros_ec changes for newer boards
@ 2014-04-17 17:59 Doug Anderson
  2014-04-17 17:59 ` [PATCH 7/7] ARM: tegra: Add the EC i2c tunnel to tegra124-venice2 Doug Anderson
  2014-04-17 18:23 ` [PATCH 0/7] Add cros_ec changes for newer boards Andrew Bresticker
  0 siblings, 2 replies; 10+ messages in thread
From: Doug Anderson @ 2014-04-17 17:59 UTC (permalink / raw)
  To: linux-arm-kernel

This series adds the most critical cros_ec changes for newer boards
using cros_ec.  Specifically:
* Fixes timing/locking issues with the previously upstreamed (but
  never used upstream) cros_ec_spi driver.
* Updates the cros_ec header file to the latest version which allows
  us to use newer EC features like i2c tunneling.
* Adds an i2c tunnel driver to allow communication to the EC's i2c
  devices.

This _doesn't_ get the EC driver fully up to speed with what's in the
current Chromium OS trees.  There are a whole slew of cleanup patches
there, an addition of an LPC transport mode, and exports of functions
to userspace.  Once these patches land and we have functionality we
can continue to pick more cleanup patches.


Bill Richardson (1):
  mfd: cros_ec: Sync to the latest cros_ec_commands.h from EC sources

David Hendricks (1):
  mfd: cros_ec: spi: calculate delay between transfers correctly

Doug Anderson (5):
  mfd: cros_ec: spi: Add mutex to cros_ec_spi
  mfd: cros_ec: spi: Make the cros_ec_spi timeout more reliable
  mfd: cros_ec: spi: Increase cros_ec_spi deadline from 5ms to 100ms
  i2c: ChromeOS EC tunnel driver
  ARM: tegra: Add the EC i2c tunnel to tegra124-venice2

 .../devicetree/bindings/i2c/i2c-cros-ec-tunnel.txt |   36 +
 arch/arm/boot/dts/tegra124-venice2.dts             |   27 +
 drivers/i2c/busses/Kconfig                         |    9 +
 drivers/i2c/busses/Makefile                        |    1 +
 drivers/i2c/busses/i2c-cros-ec-tunnel.c            |  304 ++++++
 drivers/mfd/cros_ec.c                              |    7 +-
 drivers/mfd/cros_ec_spi.c                          |   67 +-
 include/linux/mfd/cros_ec.h                        |    4 +-
 include/linux/mfd/cros_ec_commands.h               | 1128 ++++++++++++++++++--
 9 files changed, 1491 insertions(+), 92 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-cros-ec-tunnel.txt
 create mode 100644 drivers/i2c/busses/i2c-cros-ec-tunnel.c

-- 
1.9.1.423.g4596e3a

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

* [PATCH 7/7] ARM: tegra: Add the EC i2c tunnel to tegra124-venice2
  2014-04-17 17:59 [PATCH 0/7] Add cros_ec changes for newer boards Doug Anderson
@ 2014-04-17 17:59 ` Doug Anderson
  2014-04-21 18:18   ` Stephen Warren
  2014-05-15 18:42   ` Stephen Warren
  2014-04-17 18:23 ` [PATCH 0/7] Add cros_ec changes for newer boards Andrew Bresticker
  1 sibling, 2 replies; 10+ messages in thread
From: Doug Anderson @ 2014-04-17 17:59 UTC (permalink / raw)
  To: linux-arm-kernel

This adds the EC i2c tunnel (and devices under it) to the
tegra124-venice2 device tree.

Signed-off-by: Doug Anderson <dianders@chromium.org>
---
 arch/arm/boot/dts/tegra124-venice2.dts | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/arch/arm/boot/dts/tegra124-venice2.dts b/arch/arm/boot/dts/tegra124-venice2.dts
index c17283c..df97d15 100644
--- a/arch/arm/boot/dts/tegra124-venice2.dts
+++ b/arch/arm/boot/dts/tegra124-venice2.dts
@@ -8,6 +8,7 @@
 	compatible = "nvidia,venice2", "nvidia,tegra124";
 
 	aliases {
+		i2c20 = "/spi at 0,7000d400/cros-ec at 0/i2c-tunnel";
 		rtc0 = "/i2c at 0,7000d000/pmic at 40";
 		rtc1 = "/rtc at 0,7000e000";
 	};
@@ -813,6 +814,32 @@
 
 			google,cros-ec-spi-msg-delay = <2000>;
 
+			i2c-tunnel {
+				compatible = "google,cros-ec-i2c-tunnel";
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				google,remote-bus = <0>;
+
+				charger: bq24735 at 9 {
+					compatible = "ti,bq24735";
+					reg = <0x9>;
+					interrupt-parent = <&gpio>;
+					interrupts = <TEGRA_GPIO(J, 0)
+							GPIO_ACTIVE_HIGH>;
+					ti,ac-detect-gpios = <&gpio
+							TEGRA_GPIO(J, 0)
+							GPIO_ACTIVE_HIGH>;
+				};
+
+				battery: sbs-battery at b {
+					compatible = "sbs,sbs-battery";
+					reg = <0xb>;
+					sbs,i2c-retry-count = <2>;
+					sbs,poll-retry-count = <1>;
+				};
+			};
+
 			cros-ec-keyb {
 				compatible = "google,cros-ec-keyb";
 				keypad,num-rows = <8>;
-- 
1.9.1.423.g4596e3a

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

* [PATCH 0/7] Add cros_ec changes for newer boards
  2014-04-17 17:59 [PATCH 0/7] Add cros_ec changes for newer boards Doug Anderson
  2014-04-17 17:59 ` [PATCH 7/7] ARM: tegra: Add the EC i2c tunnel to tegra124-venice2 Doug Anderson
@ 2014-04-17 18:23 ` Andrew Bresticker
  1 sibling, 0 replies; 10+ messages in thread
From: Andrew Bresticker @ 2014-04-17 18:23 UTC (permalink / raw)
  To: linux-arm-kernel

Doug,

> This series adds the most critical cros_ec changes for newer boards
> using cros_ec.  Specifically:
> * Fixes timing/locking issues with the previously upstreamed (but
>   never used upstream) cros_ec_spi driver.
> * Updates the cros_ec header file to the latest version which allows
>   us to use newer EC features like i2c tunneling.
> * Adds an i2c tunnel driver to allow communication to the EC's i2c
>   devices.
>
> This _doesn't_ get the EC driver fully up to speed with what's in the
> current Chromium OS trees.  There are a whole slew of cleanup patches
> there, an addition of an LPC transport mode, and exports of functions
> to userspace.  Once these patches land and we have functionality we
> can continue to pick more cleanup patches.

I can now talk to the charger and battery over the tunnel on my
Venice2 and other communication with the EC still works, so:

Tested-by: Andrew Bresticker <abrestic@chromium.org>

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

* [PATCH 7/7] ARM: tegra: Add the EC i2c tunnel to tegra124-venice2
  2014-04-17 17:59 ` [PATCH 7/7] ARM: tegra: Add the EC i2c tunnel to tegra124-venice2 Doug Anderson
@ 2014-04-21 18:18   ` Stephen Warren
  2014-04-21 19:35     ` Doug Anderson
  2014-05-15 18:42   ` Stephen Warren
  1 sibling, 1 reply; 10+ messages in thread
From: Stephen Warren @ 2014-04-21 18:18 UTC (permalink / raw)
  To: linux-arm-kernel

On 04/17/2014 11:59 AM, Doug Anderson wrote:
> This adds the EC i2c tunnel (and devices under it) to the
> tegra124-venice2 device tree.

The series,
Tested-by: Stephen Warren <swarren@nvidia.com>

I can apply this one patch once the other patches in the series are
acked or applied (in order to make sure the DT binding is acceptable to
others).

I guess I'll send separate patches for tegra_defconfig and
multi_v7_defconfig to add the required options once I've applied this,
unless you beat me to it.

> diff --git a/arch/arm/boot/dts/tegra124-venice2.dts b/arch/arm/boot/dts/tegra124-venice2.dts

>  	aliases {
> +		i2c20 = "/spi at 0,7000d400/cros-ec at 0/i2c-tunnel";

Is that needed? I'd prefer not to add it unless there's a specific
reason. I don't think I2C buses need specific names, do they?

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

* [PATCH 7/7] ARM: tegra: Add the EC i2c tunnel to tegra124-venice2
  2014-04-21 18:18   ` Stephen Warren
@ 2014-04-21 19:35     ` Doug Anderson
  2014-04-21 20:03       ` Stephen Warren
  0 siblings, 1 reply; 10+ messages in thread
From: Doug Anderson @ 2014-04-21 19:35 UTC (permalink / raw)
  To: linux-arm-kernel

Stephen,

On Mon, Apr 21, 2014 at 11:18 AM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 04/17/2014 11:59 AM, Doug Anderson wrote:
>> This adds the EC i2c tunnel (and devices under it) to the
>> tegra124-venice2 device tree.
>
> The series,
> Tested-by: Stephen Warren <swarren@nvidia.com>
>
> I can apply this one patch once the other patches in the series are
> acked or applied (in order to make sure the DT binding is acceptable to
> others).

Sounds good.  If I don't get any feedback (positive or negative) in
the next few days I'll resend with your Tested-by.


> I guess I'll send separate patches for tegra_defconfig and
> multi_v7_defconfig to add the required options once I've applied this,
> unless you beat me to it.
>
>> diff --git a/arch/arm/boot/dts/tegra124-venice2.dts b/arch/arm/boot/dts/tegra124-venice2.dts
>
>>       aliases {
>> +             i2c20 = "/spi at 0,7000d400/cros-ec at 0/i2c-tunnel";
>
> Is that needed? I'd prefer not to add it unless there's a specific
> reason. I don't think I2C buses need specific names, do they?

It is not strictly needed, but from a usability standpoint it is
terribly helpful.  It serves to make it obvious to someone looking at
the device that it's _not_ an i2c bus associated with the main SoC.
If you don't include a number I believe that the i2c core will pick
the first available number.

It seems worth it to save a few people a few hours of head scratching.

...but this is your dts and if you think it's a terrible idea then
I'll remove it.  It looks to be less critical on tegra than it is on
exynos (which has ~9 i2c busses, they are numbered in the user manual,
and if you have one set to "disable" in the dts then the tunnel will
end up getting a very confusing number).

-Doug

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

* [PATCH 7/7] ARM: tegra: Add the EC i2c tunnel to tegra124-venice2
  2014-04-21 19:35     ` Doug Anderson
@ 2014-04-21 20:03       ` Stephen Warren
  0 siblings, 0 replies; 10+ messages in thread
From: Stephen Warren @ 2014-04-21 20:03 UTC (permalink / raw)
  To: linux-arm-kernel

On 04/21/2014 01:35 PM, Doug Anderson wrote:
> Stephen,
> 
> On Mon, Apr 21, 2014 at 11:18 AM, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> On 04/17/2014 11:59 AM, Doug Anderson wrote:
>>> This adds the EC i2c tunnel (and devices under it) to the
>>> tegra124-venice2 device tree.

>>> diff --git a/arch/arm/boot/dts/tegra124-venice2.dts b/arch/arm/boot/dts/tegra124-venice2.dts
>>
>>>       aliases {
>>> +             i2c20 = "/spi at 0,7000d400/cros-ec at 0/i2c-tunnel";
>>
>> Is that needed? I'd prefer not to add it unless there's a specific
>> reason. I don't think I2C buses need specific names, do they?
> 
> It is not strictly needed, but from a usability standpoint it is
> terribly helpful.  It serves to make it obvious to someone looking at
> the device that it's _not_ an i2c bus associated with the main SoC.
> If you don't include a number I believe that the i2c core will pick
> the first available number.
> 
> It seems worth it to save a few people a few hours of head scratching.
> 
> ...but this is your dts and if you think it's a terrible idea then
> I'll remove it.  It looks to be less critical on tegra than it is on
> exynos (which has ~9 i2c busses, they are numbered in the user manual,
> and if you have one set to "disable" in the dts then the tunnel will
> end up getting a very confusing number).

My opinion is that the in-kernel I2C bus numbering is an entirely
unrelated numbering space to the HW controller numbering space precisely
because of issues like that. DT aliases are more useful for user-visible
port numbering (e.g. HDMI 0, 1 connectors on a case) than purely
internal details like this. So, I would leave it out.

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

* [PATCH 7/7] ARM: tegra: Add the EC i2c tunnel to tegra124-venice2
  2014-04-17 17:59 ` [PATCH 7/7] ARM: tegra: Add the EC i2c tunnel to tegra124-venice2 Doug Anderson
  2014-04-21 18:18   ` Stephen Warren
@ 2014-05-15 18:42   ` Stephen Warren
  2014-05-15 18:55     ` Doug Anderson
  1 sibling, 1 reply; 10+ messages in thread
From: Stephen Warren @ 2014-05-15 18:42 UTC (permalink / raw)
  To: linux-arm-kernel

On 04/17/2014 11:59 AM, Doug Anderson wrote:
> This adds the EC i2c tunnel (and devices under it) to the
> tegra124-venice2 device tree.

Did the MFD patches at the start of this series get applied yet? I was
hoping to apply this one patch to the Tegra tree for 3.16, and that
needs to happen by tomorrow morning at the latest since -rc6 is looming
fast. However, I'm holding off until the rest of the series is applied
to the MFD tree so I can be sure the DT binding is accepted first...

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

* [PATCH 7/7] ARM: tegra: Add the EC i2c tunnel to tegra124-venice2
  2014-05-15 18:42   ` Stephen Warren
@ 2014-05-15 18:55     ` Doug Anderson
  2014-05-15 20:12       ` Olof Johansson
  0 siblings, 1 reply; 10+ messages in thread
From: Doug Anderson @ 2014-05-15 18:55 UTC (permalink / raw)
  To: linux-arm-kernel

Stephen,

On Thu, May 15, 2014 at 11:42 AM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 04/17/2014 11:59 AM, Doug Anderson wrote:
>> This adds the EC i2c tunnel (and devices under it) to the
>> tegra124-venice2 device tree.
>
> Did the MFD patches at the start of this series get applied yet? I was
> hoping to apply this one patch to the Tegra tree for 3.16, and that
> needs to happen by tomorrow morning at the latest since -rc6 is looming
> fast. However, I'm holding off until the rest of the series is applied
> to the MFD tree so I can be sure the DT binding is accepted first...

As far as I know, they didn't.  Lee was waiting on Wolfram's ack to
the i2c tunnel before landing them.  ...and I'm still eagerly awaiting
Wolfram's next i2c tunnel review.

-Doug

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

* [PATCH 7/7] ARM: tegra: Add the EC i2c tunnel to tegra124-venice2
  2014-05-15 18:55     ` Doug Anderson
@ 2014-05-15 20:12       ` Olof Johansson
  2014-05-19  9:18         ` Lee Jones
  0 siblings, 1 reply; 10+ messages in thread
From: Olof Johansson @ 2014-05-15 20:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, May 15, 2014 at 11:55 AM, Doug Anderson <dianders@chromium.org> wrote:
> Stephen,
>
> On Thu, May 15, 2014 at 11:42 AM, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> On 04/17/2014 11:59 AM, Doug Anderson wrote:
>>> This adds the EC i2c tunnel (and devices under it) to the
>>> tegra124-venice2 device tree.
>>
>> Did the MFD patches at the start of this series get applied yet? I was
>> hoping to apply this one patch to the Tegra tree for 3.16, and that
>> needs to happen by tomorrow morning at the latest since -rc6 is looming
>> fast. However, I'm holding off until the rest of the series is applied
>> to the MFD tree so I can be sure the DT binding is accepted first...
>
> As far as I know, they didn't.  Lee was waiting on Wolfram's ack to
> the i2c tunnel before landing them.  ...and I'm still eagerly awaiting
> Wolfram's next i2c tunnel review.

The i2c portion can be revisited if needed, the MFD piece should be
possible to land sooner than that... Lee?


-Olof

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

* [PATCH 7/7] ARM: tegra: Add the EC i2c tunnel to tegra124-venice2
  2014-05-15 20:12       ` Olof Johansson
@ 2014-05-19  9:18         ` Lee Jones
  0 siblings, 0 replies; 10+ messages in thread
From: Lee Jones @ 2014-05-19  9:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 15 May 2014, Olof Johansson wrote:

> On Thu, May 15, 2014 at 11:55 AM, Doug Anderson <dianders@chromium.org> wrote:
> > Stephen,
> >
> > On Thu, May 15, 2014 at 11:42 AM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> >> On 04/17/2014 11:59 AM, Doug Anderson wrote:
> >>> This adds the EC i2c tunnel (and devices under it) to the
> >>> tegra124-venice2 device tree.
> >>
> >> Did the MFD patches at the start of this series get applied yet? I was
> >> hoping to apply this one patch to the Tegra tree for 3.16, and that
> >> needs to happen by tomorrow morning at the latest since -rc6 is looming
> >> fast. However, I'm holding off until the rest of the series is applied
> >> to the MFD tree so I can be sure the DT binding is accepted first...
> >
> > As far as I know, they didn't.  Lee was waiting on Wolfram's ack to
> > the i2c tunnel before landing them.  ...and I'm still eagerly awaiting
> > Wolfram's next i2c tunnel review.
> 
> The i2c portion can be revisited if needed, the MFD piece should be
> possible to land sooner than that... Lee?

The set 'will' make it in during this cycle.  The trouble is, once
it's applied, the I2C portion will have to wait until the next cycle.
By applying late, I'm giving this set every chance to go in as a
whole.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2014-05-19  9:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-17 17:59 [PATCH 0/7] Add cros_ec changes for newer boards Doug Anderson
2014-04-17 17:59 ` [PATCH 7/7] ARM: tegra: Add the EC i2c tunnel to tegra124-venice2 Doug Anderson
2014-04-21 18:18   ` Stephen Warren
2014-04-21 19:35     ` Doug Anderson
2014-04-21 20:03       ` Stephen Warren
2014-05-15 18:42   ` Stephen Warren
2014-05-15 18:55     ` Doug Anderson
2014-05-15 20:12       ` Olof Johansson
2014-05-19  9:18         ` Lee Jones
2014-04-17 18:23 ` [PATCH 0/7] Add cros_ec changes for newer boards Andrew Bresticker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).