<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/platform/chrome/cros_ec_rpmsg.c, branch linux-6.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2022-05-16T02:01:51Z</updated>
<entry>
<title>platform/chrome: correct cros_ec_prepare_tx() usage</title>
<updated>2022-05-16T02:01:51Z</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2022-05-13T04:41:38Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=71d3ae7fb6404c87b498f8b7f86b8271dd74989f'/>
<id>urn:sha1:71d3ae7fb6404c87b498f8b7f86b8271dd74989f</id>
<content type='text'>
cros_ec_prepare_tx() returns either:
- &gt;= 0 for number of prepared bytes.
- &lt; 0 for -errno.

Correct the comment and make sure all callers check the return code.

Reviewed-by: Guenter Roeck &lt;groeck@chromium.org&gt;
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Link: https://lore.kernel.org/r/20220513044143.1045728-3-tzungbi@kernel.org
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: Call interrupt bottom half in ISH or RPMSG mode</title>
<updated>2021-01-22T07:50:27Z</updated>
<author>
<name>Gwendal Grignou</name>
<email>gwendal@chromium.org</email>
</author>
<published>2021-01-22T05:46:36Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=24c69043be1725606e876b47d496a0f9f87d176a'/>
<id>urn:sha1:24c69043be1725606e876b47d496a0f9f87d176a</id>
<content type='text'>
Call the same bottom half for all EC protocols (threaded code).

Signed-off-by: Gwendal Grignou &lt;gwendal@chromium.org&gt;
Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
Link: https://lore.kernel.org/r/20210122054637.1422289-2-gwendal@chromium.org
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_rpmsg: Document missing struct parameters</title>
<updated>2020-06-30T09:41:25Z</updated>
<author>
<name>Enric Balletbo i Serra</name>
<email>enric.balletbo@collabora.com</email>
</author>
<published>2020-06-25T17:03:00Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9a876ba58d1e660e7957dd7afd1129b615eb1e04'/>
<id>urn:sha1:9a876ba58d1e660e7957dd7afd1129b615eb1e04</id>
<content type='text'>
Kerneldoc expects all kernel structure member to be documented.

Fixes the following W=1 level warnings:

  cros_ec_rpmsg.c:49: warning: Function parameter or member 'ept' not described in 'cros_ec_rpmsg'
  cros_ec_rpmsg.c:49: warning: Function parameter or member 'has_pending_host_event' not described in 'cros_ec_rpmsg'
  cros_ec_rpmsg.c:49: warning: Function parameter or member 'probe_done' not described in 'cros_ec_rpmsg'

Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
Reviewed-by: Gwendal Grignou &lt;gwendal@chromium.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_rpmsg: Fix race with host event</title>
<updated>2020-03-02T10:04:04Z</updated>
<author>
<name>Pi-Hsun Shih</name>
<email>pihsun@chromium.org</email>
</author>
<published>2020-02-14T08:26:38Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f775ac78fcfc6bdc96bdda07029d11f2a5e84869'/>
<id>urn:sha1:f775ac78fcfc6bdc96bdda07029d11f2a5e84869</id>
<content type='text'>
Host event can be sent by remoteproc by any time, and
cros_ec_rpmsg_callback would be called after cros_ec_rpmsg_create_ept.
But the cros_ec_device is initialized after that, which cause host event
handler to use cros_ec_device that are not initialized properly yet.

Fix this by don't schedule host event handler before cros_ec_register
returns. Instead, remember that we have a pending host event, and
schedule host event handler after cros_ec_register.

Fixes: 71cddb7097e2 ("platform/chrome: cros_ec_rpmsg: Fix race with host command when probe failed.")
Signed-off-by: Pi-Hsun Shih &lt;pihsun@chromium.org&gt;
Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: Match implementation with headers</title>
<updated>2020-02-03T16:14:50Z</updated>
<author>
<name>Enric Balletbo i Serra</name>
<email>enric.balletbo@collabora.com</email>
</author>
<published>2020-01-22T09:07:01Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=034dbec179e5d2820480f477c43acbc50245e56d'/>
<id>urn:sha1:034dbec179e5d2820480f477c43acbc50245e56d</id>
<content type='text'>
The 'cros_ec' core driver is the common interface for the cros_ec
transport drivers to do the shared operations to register, unregister,
suspend, resume and handle_event. The interface is provided by including
the header 'include/linux/platform_data/cros_ec_proto.h', however, instead
of have the implementation of these functions in cros_ec_proto.c, it is in
'cros_ec.c', which is a different kernel module. Apart from being a bad
practice, this can induce confusions allowing the users of the cros_ec
protocol to call these functions.

The register, unregister, suspend, resume and handle_event functions
*should* only be called by the different transport drivers (i2c, spi, lpc,
etc.), so make this a bit less confusing by moving these functions from
the public in-kernel space to a private include in platform/chrome, and
then, the interface for cros_ec module and for the cros_ec_proto module is
clean.

Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
Signed-off-by: Benson Leung &lt;bleung@chromium.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: handle MKBP more events flag</title>
<updated>2019-11-21T10:23:15Z</updated>
<author>
<name>Enrico Granata</name>
<email>egranata@chromium.org</email>
</author>
<published>2019-11-19T12:45:46Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3300fdd630d4d3d96e3ba9af63a740d3a4e8fc61'/>
<id>urn:sha1:3300fdd630d4d3d96e3ba9af63a740d3a4e8fc61</id>
<content type='text'>
The ChromeOS EC has support for signaling to the host that a single IRQ
can serve multiple MKBP (Matrix KeyBoard Protocol) events.

Doing this serves an optimization purpose, as it minimizes the number of
round-trips into the interrupt handling machinery, and it proves
beneficial to sensor timestamping as it keeps the desired synchronization
of event times between the two processors.

This patch adds kernel support for this EC feature, allowing the ec_irq
to loop until all events have been served.

Signed-off-by: Enrico Granata &lt;egranata@chromium.org&gt;
Signed-off-by: Gwendal Grignou &lt;gwendal@chromium.org&gt;
Reviewed-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Acked-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_rpmsg: Fix race with host command when probe failed</title>
<updated>2019-09-12T14:20:50Z</updated>
<author>
<name>Pi-Hsun Shih</name>
<email>pihsun@chromium.org</email>
</author>
<published>2019-09-04T06:26:13Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=71cddb7097e2b0feb855d7fd7d59afd12cbee4bb'/>
<id>urn:sha1:71cddb7097e2b0feb855d7fd7d59afd12cbee4bb</id>
<content type='text'>
Since the rpmsg_endpoint is created before probe is called, it's
possible that a host event is received during cros_ec_register, and
there would be some pending work in the host_event_work workqueue while
cros_ec_register is called.

If cros_ec_register fails, when the leftover work in host_event_work
run, the ec_dev from the drvdata of the rpdev could be already set to
NULL, causing kernel crash when trying to run cros_ec_get_next_event.

Fix this by creating the rpmsg_endpoint by ourself, and when
cros_ec_register fails (or on remove), destroy the endpoint first (to
make sure there's no more new calls to cros_ec_rpmsg_callback), and then
cancel all works in the host_event_work workqueue.

Cc: stable@vger.kernel.org
Fixes: 2de89fd98958 ("platform/chrome: cros_ec: Add EC host command support using rpmsg")
Signed-off-by: Pi-Hsun Shih &lt;pihsun@chromium.org&gt;
Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'ib-mfd-extcon-hid-i2c-iio-input-media-chrome-power-pwm-rtc-sound-v5.4' into chrome-platform/for-next</title>
<updated>2019-09-02T17:02:02Z</updated>
<author>
<name>Enric Balletbo i Serra</name>
<email>enric.balletbo@collabora.com</email>
</author>
<published>2019-09-02T17:02:02Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7e0bb52d0df9bbe4aa82847c243644848d914872'/>
<id>urn:sha1:7e0bb52d0df9bbe4aa82847c243644848d914872</id>
<content type='text'>
Immutable branch between MFD, Extcon, HID, I2C, IIO, Input, Chrome, Power,
PWM, RTC and Sound to allow picking patches that depends on the series
that moves some code from the MFD subsystem to platform/chrome.

Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
</content>
</entry>
<entry>
<title>mfd / platform: cros_ec: Reorganize platform and mfd includes</title>
<updated>2019-09-02T10:33:42Z</updated>
<author>
<name>Enric Balletbo i Serra</name>
<email>enric.balletbo@collabora.com</email>
</author>
<published>2019-09-02T09:53:05Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=840d9f131f65b021e0a73f3371f3194897dba6ad'/>
<id>urn:sha1:840d9f131f65b021e0a73f3371f3194897dba6ad</id>
<content type='text'>
There is a bit of mess between cros-ec mfd includes and platform
includes. For example, we have a linux/mfd/cros_ec.h include that
exports the interface implemented in platform/chrome/cros_ec_proto.c. Or
we have a linux/mfd/cros_ec_commands.h file that is non related to the
multifunction device (in the sense that is not exporting any function of
the mfd device). This causes crossed includes between mfd and
platform/chrome subsystems and makes the code difficult to read, apart
from creating 'curious' situations where a platform/chrome driver includes
a linux/mfd/cros_ec.h file just to get the exported functions that are
implemented in another platform/chrome driver.

In order to have a better separation on what the cros-ec multifunction
driver does and what the cros-ec core provides move and rework the
affected includes doing:

 - Move cros_ec_commands.h to include/linux/platform_data/cros_ec_commands.h
 - Get rid of the parts that are implemented in the platform/chrome/cros_ec_proto.c
   driver from include/linux/mfd/cros_ec.h to a new file
   include/linux/platform_data/cros_ec_proto.h
 - Update all the drivers with the new includes, so
   - Drivers that only need to know about the protocol include
     - linux/platform_data/cros_ec_proto.h
     - linux/platform_data/cros_ec_commands.h
   - Drivers that need to know about the cros-ec mfd device also include
     - linux/mfd/cros_ec.h

Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
Acked-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Acked-by: Mark Brown &lt;broonie@kernel.org&gt;
Acked-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Acked-by: Neil Armstrong &lt;narmstrong@baylibre.com&gt;
Acked-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Acked-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Acked-by: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Acked-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Acked-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Acked-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Reviewed-by: Gwendal Grignou &lt;gwendal@chromium.org&gt;
Tested-by: Gwendal Grignou &lt;gwendal@chromium.org&gt;
Series changes: 3
- Fix dereferencing pointer to incomplete type 'struct cros_ec_dev' (lkp)
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>mfd / platform: cros_ec: Handle chained ECs as platform devices</title>
<updated>2019-09-02T10:32:57Z</updated>
<author>
<name>Enric Balletbo i Serra</name>
<email>enric.balletbo@collabora.com</email>
</author>
<published>2019-09-02T09:53:00Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7aa703bb8824384baad732043a925b46a4f3efa8'/>
<id>urn:sha1:7aa703bb8824384baad732043a925b46a4f3efa8</id>
<content type='text'>
An MFD is a device that contains several sub-devices (cells). For instance,
the ChromeOS EC fits in this description as usually contains a charger and
can have other devices with different functions like a Real-Time Clock,
an Audio codec, a Real-Time Clock, ...

If you look at the driver, though, we're doing something odd. We have
two MFD cros-ec drivers where one of them (cros-ec-core) instantiates
another MFD driver as sub-driver (cros-ec-dev), and the latest
instantiates the different sub-devices (Real-Time Clock, Audio codec,
etc).

                  MFD
------------------------------------------
   cros-ec-core
       |___ mfd-cellA (cros-ec-dev)
       |       |__ mfd-cell0
       |       |__ mfd-cell1
       |       |__ ...
       |
       |___ mfd-cellB (cros-ec-dev)
               |__ mfd-cell0
               |__ mfd-cell1
               |__ ...

The problem that was trying to solve is to describe some kind of topology for
the case where we have an EC (cros-ec) chained with another EC
(cros-pd). Apart from that this extends the bounds of what MFD was
designed to do we might be interested on have other kinds of topology that
can't be implemented in that way.

Let's prepare the code to move the cros-ec-core part from MFD to
platform/chrome as this is clearly a platform specific thing non-related
to a MFD device.

  platform/chrome  |         MFD
------------------------------------------
                   |
   cros-ec ________|___ cros-ec-dev
                   |       |__ mfd-cell0
                   |       |__ mfd-cell1
                   |       |__ ...
                   |
   cros-pd ________|___ cros-ec-dev
                   |        |__ mfd-cell0
                   |        |__ mfd-cell1
                   |        |__ ...

Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
Acked-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Reviewed-by: Gwendal Grignou &lt;gwendal@chromium.org&gt;
Tested-by: Gwendal Grignou &lt;gwendal@chromium.org&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
</feed>
