<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/mfd/cros_ec.c, branch linux-4.0.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.0.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.0.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2014-10-06T20:30:16Z</updated>
<entry>
<title>mfd: cros_ec: wait for completion of commands that return IN_PROGRESS</title>
<updated>2014-10-06T20:30:16Z</updated>
<author>
<name>Andrew Bresticker</name>
</author>
<published>2014-09-18T15:18:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d86c21fd31114e3ef9fae64be335c76aa22859dc'/>
<id>urn:sha1:d86c21fd31114e3ef9fae64be335c76aa22859dc</id>
<content type='text'>
When an EC command returns EC_RES_IN_PROGRESS, we need to query
the state of the EC until it indicates that it is no longer busy.
Do this in cros_ec_cmd_xfer() under the EC's mutex so that other
commands (e.g. keyboard, I2C passtru) aren't issued to the EC while
it is working on the in-progress command.

The 10 milliseconds delay and the number of retries are the values
that were used by the flashrom tool when retrying commands.

Signed-off-by: Andrew Bresticker &lt;abrestic@chromium.org&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: Javier Martinez Canillas &lt;javier.martinez@collabora.co.uk&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>mfd: cros_ec: move locking into cros_ec_cmd_xfer</title>
<updated>2014-10-06T20:29:50Z</updated>
<author>
<name>Andrew Bresticker</name>
</author>
<published>2014-09-18T15:18:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=63427530fa7a78b42a19f47fb0c12b303c0666ca'/>
<id>urn:sha1:63427530fa7a78b42a19f47fb0c12b303c0666ca</id>
<content type='text'>
Now that there's a central cros_ec_cmd_xfer(), move the locking
out of the SPI driver.

Signed-off-by: Andrew Bresticker &lt;abrestic@chromium.org&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: Javier Martinez Canillas &lt;javier.martinez@collabora.co.uk&gt;
Reviewed-by: Doug Anderson &lt;dianders@chromium.org&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>mfd: cros_ec: stop calling -&gt;cmd_xfer() directly</title>
<updated>2014-10-06T20:29:07Z</updated>
<author>
<name>Andrew Bresticker</name>
</author>
<published>2014-09-18T15:18:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a6551a76fff15056fde2342d0f7de41ee605264e'/>
<id>urn:sha1:a6551a76fff15056fde2342d0f7de41ee605264e</id>
<content type='text'>
Instead of having users of the ChromeOS EC call the interface-specific
cmd_xfer() callback directly, introduce a central cros_ec_cmd_xfer()
to use instead.  This will allow us to put all the locking and retry
logic in one place instead of duplicating it across the different
drivers.

Signed-off-by: Andrew Bresticker &lt;abrestic@chromium.org&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: Javier Martinez Canillas &lt;javier.martinez@collabora.co.uk&gt;
Reviewed-by: Doug Anderson &lt;dianders@chromium.org&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>mfd: cros_ec: Move EC interrupt to cros_ec_keyb</title>
<updated>2014-07-09T13:58:20Z</updated>
<author>
<name>Andrew Bresticker</name>
</author>
<published>2014-06-18T18:14:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d1fd345e2087f0362c92bd3b0a1cea7fe636ac3a'/>
<id>urn:sha1:d1fd345e2087f0362c92bd3b0a1cea7fe636ac3a</id>
<content type='text'>
If we receive EC interrupts after the cros_ec driver has probed, but
before the cros_ec_keyb driver has probed, the cros_ec IRQ handler
will not run the cros_ec_keyb notifier and the EC will leave the IRQ
line asserted.  The cros_ec IRQ handler then returns IRQ_HANDLED and
the resulting flood of interrupts causes the machine to hang.

Since the EC interrupt is currently only used for the keyboard, move
the setup and handling of the EC interrupt to the cros_ec_keyb driver.

Signed-off-by: Andrew Bresticker &lt;abrestic@chromium.org&gt;
Signed-off-by: Doug Anderson &lt;dianders@chromium.org&gt;
Acked-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>mfd: cros_ec: Check result code from EC messages</title>
<updated>2014-07-09T13:58:19Z</updated>
<author>
<name>Bill Richardson</name>
</author>
<published>2014-06-18T18:14:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6db07b6336589ff480528173e41f8f6af3f0097f'/>
<id>urn:sha1:6db07b6336589ff480528173e41f8f6af3f0097f</id>
<content type='text'>
Just because the host was able to talk to the EC doesn't mean that the EC
was happy with what it was told. Errors in communincation are not the same
as error messages from the EC itself.

This change lets the EC report its errors separately.

[dianders: Added common function to cros_ec.c]

Signed-off-by: Bill Richardson &lt;wfrichar@chromium.org&gt;
Signed-off-by: Doug Anderson &lt;dianders@chromium.org&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>mfd: cros_ec: cleanup: Remove EC wrapper functions</title>
<updated>2014-07-09T13:58:18Z</updated>
<author>
<name>Bill Richardson</name>
</author>
<published>2014-06-18T18:14:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5799f95a373a2752e5c732f531a6f40fe458b818'/>
<id>urn:sha1:5799f95a373a2752e5c732f531a6f40fe458b818</id>
<content type='text'>
Remove the three wrapper functions that talk to the EC without passing all
the desired arguments and just use the underlying communication function
that passes everything in a struct intead.

This is internal code refactoring only. Nothing should change.

Signed-off-by: Bill Richardson &lt;wfrichar@chromium.org&gt;
Signed-off-by: Doug Anderson &lt;dianders@chromium.org&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Acked-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Acked-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>mfd: cros_ec: cleanup: remove unused fields from struct cros_ec_device</title>
<updated>2014-07-09T13:58:18Z</updated>
<author>
<name>Bill Richardson</name>
</author>
<published>2014-06-18T18:14:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=533cec8f34778de10412dfabac991cf458ebf3c9'/>
<id>urn:sha1:533cec8f34778de10412dfabac991cf458ebf3c9</id>
<content type='text'>
struct cros_ec_device has a superfluous "name" field. We can get all the
debugging info we need from the existing ec_name and phys_name fields, so
let's take out the extra field.

The printout also has sufficient info in it without explicitly adding
the transport.  Before this change:
  cros-ec-spi spi2.0: Chrome EC (SPI)

After this change:
  cros-ec-spi spi2.0: Chrome EC device registered

Signed-off-by: Bill Richardson &lt;wfrichar@chromium.org&gt;
Signed-off-by: Doug Anderson &lt;dianders@chromium.org&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>mfd: cros_ec: Use struct cros_ec_command to communicate with the EC</title>
<updated>2014-07-09T13:58:17Z</updated>
<author>
<name>Bill Richardson</name>
</author>
<published>2014-06-18T18:14:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5d4773e27e8ab37491767a6ef99ffd7100fe6341'/>
<id>urn:sha1:5d4773e27e8ab37491767a6ef99ffd7100fe6341</id>
<content type='text'>
This is some internal structure reorganization / renaming to prepare
for future patches that will add a userspace API to cros_ec.  There
should be no visible changes.

Signed-off-by: Bill Richardson &lt;wfrichar@chromium.org&gt;
Signed-off-by: Doug Anderson &lt;dianders@chromium.org&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>mfd: cros_ec: Tweak struct cros_ec_device for clarity</title>
<updated>2014-07-09T13:58:16Z</updated>
<author>
<name>Bill Richardson</name>
</author>
<published>2014-06-18T18:14:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7e6cb5b4dbbc4b1d98289c88d0bc4092cac328be'/>
<id>urn:sha1:7e6cb5b4dbbc4b1d98289c88d0bc4092cac328be</id>
<content type='text'>
The members of struct cros_ec_device were improperly commented, and
intermixed the private and public sections. This is just cleanup to make it
more obvious what goes with what.

[dianders: left lock in the structure but gave it the name that will
eventually be used.]

Signed-off-by: Bill Richardson &lt;wfrichar@chromium.org&gt;
Signed-off-by: Doug Anderson &lt;dianders@chromium.org&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>i2c: ChromeOS EC tunnel driver</title>
<updated>2014-06-03T07:11:49Z</updated>
<author>
<name>Doug Anderson</name>
</author>
<published>2014-04-30T17:44:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9d230c9e4f4e67cb1c1cb9e0f6142da16b0f2796'/>
<id>urn:sha1:9d230c9e4f4e67cb1c1cb9e0f6142da16b0f2796</id>
<content type='text'>
On ARM Chromebooks we have a few devices that are accessed by both the
AP (the main "Application Processor") and the EC (the Embedded
Controller).  These are:
* The battery (sbs-battery).
* The power management unit tps65090.

On the original Samsung ARM Chromebook these devices were on an I2C
bus that was shared between the AP and the EC and arbitrated using
some extranal GPIOs (see i2c-arb-gpio-challenge).

The original arbitration scheme worked well enough but had some
downsides:
* It was nonstandard (not using standard I2C multimaster)
* It only worked if the EC-AP communication was I2C
* It was relatively hard to debug problems (hard to tell if i2c issues
  were caused by the EC, the AP, or some device on the bus).

On the HP Chromebook 11 the design was changed to:
* The AP/EC comms were still i2c, but the battery/tps65090 were no
  longer on the bus used for AP/EC communication.  The battery was
  exposed to the AP through a limited i2c tunnel and tps65090 was
  exposed to the AP through a custom Linux driver.

On the Samsung ARM Chromebook 2 the scheme is changed yet again, now:
* The AP/EC comms are now using SPI for faster speeds.
* The EC's i2c bus is exposed to the AP through a full i2c tunnel.

The upstream "tegra124-venice2" uses the same scheme as the Samsung
ARM Chromebook 2, though it has a different set of components on the
other side of the bus.

This driver supports the scheme used by the Samsung ARM Chromebook 2.
Future patches to this driver could add support for the battery tunnel
on the HP Chromebook 11 (and perhaps could even be used to access
tps65090 on the HP Chromebook 11 instead of using a special driver,
but I haven't researched that enough).

Signed-off-by: Vincent Palatin &lt;vpalatin@chromium.org&gt;
Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: Doug Anderson &lt;dianders@chromium.org&gt;
Reviewed-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
</feed>
