<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/linux/platform_data/cros_ec_proto.h, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-07-01T13:22:19+00:00</updated>
<entry>
<title>platform/chrome: cros_ec_proto: Introduce cros_ec_get_cmd_versions()</title>
<updated>2024-07-01T13:22:19+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2024-06-30T20:54:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=69a13742b7c64ed89894caf7091539e164b3e97c'/>
<id>urn:sha1:69a13742b7c64ed89894caf7091539e164b3e97c</id>
<content type='text'>
Retrieving the supported versions of a command is a fairly common
operation. Provide a helper for it.

If the command is not supported at all the EC returns
-EINVAL/EC_RES_INVALID_PARAMS.

This error is translated into an empty version mask as that is easier to
handle for callers and they don't need to know about the error details.

Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Link: https://lore.kernel.org/r/20240630-cros_ec-charge-control-v5-3-8f649d018c52@weissschuh.net
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_proto: Upgrade get_next_event to v3</title>
<updated>2024-06-05T02:44:48+00:00</updated>
<author>
<name>Daisuke Nojiri</name>
<email>dnojiri@chromium.org</email>
</author>
<published>2024-06-04T23:08:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=106d6739823369c734a8fc3b13634274eee4f60e'/>
<id>urn:sha1:106d6739823369c734a8fc3b13634274eee4f60e</id>
<content type='text'>
Upgrade EC_CMD_GET_NEXT_EVENT to version 3.

The max supported version will be v3. So, we speak v3 even if the EC
says it supports v4+.

Signed-off-by: Daisuke Nojiri &lt;dnojiri@chromium.org&gt;
Link: https://lore.kernel.org/r/20240604230837.2878737-1-dnojiri@chromium.org
[tzungbi: uint32_t -&gt; u32 per suggested by checkpatch.pl]
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_proto: Introduce cros_ec_cmd_readmem()</title>
<updated>2024-06-03T01:14:42+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2024-05-29T06:27:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a14a569a9918a0c7e340257a17dbc088bb27db72'/>
<id>urn:sha1:a14a569a9918a0c7e340257a17dbc088bb27db72</id>
<content type='text'>
To read from the EC memory different mechanism are possible.
ECs connected via LPC expose their memory via a -&gt;cmd_readmem operation.
Other protocols require the usage of EC_CMD_READ_MEMMAP, which on the
other hand is not implemented by LPC ECs.

Provide a helper that automatically selects the correct mechanism.

Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Reviewed-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Link: https://lore.kernel.org/r/20240529-cros_ec-hwmon-v4-1-5cdf0c5db50a@weissschuh.net
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_proto: Mark outdata as const</title>
<updated>2023-10-04T03:40:54+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>swboyd@chromium.org</email>
</author>
<published>2023-10-03T00:34:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2f3dd39e2b492bec366487a2c9bcbdbd7792f77c'/>
<id>urn:sha1:2f3dd39e2b492bec366487a2c9bcbdbd7792f77c</id>
<content type='text'>
The 'outdata' is copied to the data buffer in cros_ec_cmd() before being
sent over to the EC. Mark the argument as const so that callers can pass
const pointers to this function and so that callers know the data won't
be modified.

Cc: Prashant Malani &lt;pmalani@chromium.org&gt;
Signed-off-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Acked-by: Prashant Malani &lt;pmalani@chromium.org&gt;
Link: https://lore.kernel.org/r/20231003003429.1378109-5-swboyd@chromium.org
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: Use per-device lockdep key</title>
<updated>2023-01-13T01:30:50+00:00</updated>
<author>
<name>Chen-Yu Tsai</name>
<email>wenst@chromium.org</email>
</author>
<published>2023-01-11T07:41:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=961a325becd9a142ae5c8b258e5c2f221f8bfac8'/>
<id>urn:sha1:961a325becd9a142ae5c8b258e5c2f221f8bfac8</id>
<content type='text'>
Lockdep reports a bogus possible deadlock on MT8192 Chromebooks due to
the following lock sequences:

1. lock(i2c_register_adapter) [1]; lock(&amp;ec_dev-&gt;lock)
2. lock(&amp;ec_dev-&gt;lock); lock(prepare_lock);

The actual dependency chains are much longer. The shortened version
looks somewhat like:

1. cros-ec-rpmsg on mtk-scp
   ec_dev-&gt;lock -&gt; prepare_lock
2. In rt5682_i2c_probe() on native I2C bus:
   prepare_lock -&gt; regmap-&gt;lock -&gt; (possibly) i2c_adapter-&gt;bus_lock
3. In rt5682_i2c_probe() on native I2C bus:
   regmap-&gt;lock -&gt; i2c_adapter-&gt;bus_lock
4. In sbs_probe() on i2c-cros-ec-tunnel I2C bus attached on cros-ec:
   i2c_adapter-&gt;bus_lock -&gt; ec_dev-&gt;lock

While lockdep is correct that the shared lockdep classes have a circular
dependency, it is bogus because

  a) 2+3 happen on a native I2C bus
  b) 4 happens on the actual EC on ChromeOS devices
  c) 1 happens on the SCP coprocessor on MediaTek Chromebooks that just
     happens to expose a cros-ec interface, but does not have an
     i2c-cros-ec-tunnel I2C bus

In short, the "dependencies" are actually on different devices.

Setup a per-device lockdep key for cros_ec devices so lockdep can tell
the two instances apart. This helps with getting rid of the bogus
lockdep warning. For ChromeOS devices that only have one cros-ec
instance this doesn't change anything.

Also add a missing mutex_destroy, just to make the teardown complete.

[1] This is likely the per I2C bus lock with shared lockdep class

Signed-off-by: Chen-Yu Tsai &lt;wenst@chromium.org&gt;
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Link: https://lore.kernel.org/r/20230111074146.2624496-1-wenst@chromium.org
</content>
</entry>
<entry>
<title>platform/chrome: fix kernel-doc warning for last_resume_result</title>
<updated>2023-01-13T01:30:50+00:00</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2023-01-11T05:57:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=212c9b9c395f72fd83c10cf2692b9562c2110d0f'/>
<id>urn:sha1:212c9b9c395f72fd83c10cf2692b9562c2110d0f</id>
<content type='text'>
Fix the following kernel-doc warning:

$ ./scripts/kernel-doc -none include/linux/platform_data/cros_ec_proto.h
include/linux/platform_data/cros_ec_proto.h:187: warning: Function
parameter or member 'last_resume_result' not described in 'cros_ec_device'

Cc: Evan Green &lt;evgreen@chromium.org&gt;
Fixes: 8c3166e17cf1 ("mfd / platform: cros_ec_debugfs: Expose resume result via debugfs")
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Reviewed-by: Guenter Roeck &lt;groeck@chromium.org&gt;
Link: https://lore.kernel.org/r/20230111055728.708990-4-tzungbi@kernel.org
</content>
</entry>
<entry>
<title>platform/chrome: fix kernel-doc warning for suspend_timeout_ms</title>
<updated>2023-01-13T01:30:49+00:00</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2023-01-11T05:57:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=20eb556dac27427f951ca13e117d32bd1c041b79'/>
<id>urn:sha1:20eb556dac27427f951ca13e117d32bd1c041b79</id>
<content type='text'>
Fix the following kernel-doc warning:

$ ./scripts/kernel-doc -none include/linux/platform_data/cros_ec_proto.h
include/linux/platform_data/cros_ec_proto.h:187: warning: Function
parameter or member 'suspend_timeout_ms' not described in 'cros_ec_device'

Cc: Evan Green &lt;evgreen@chromium.org&gt;
Fixes: e8bf17d58a4d ("platform/chrome: cros_ec: Expose suspend_timeout_ms in debugfs")
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Reviewed-by: Guenter Roeck &lt;groeck@chromium.org&gt;
Link: https://lore.kernel.org/r/20230111055728.708990-3-tzungbi@kernel.org
</content>
</entry>
<entry>
<title>platform/chrome: fix kernel-doc warnings for panic notifier</title>
<updated>2023-01-13T01:30:49+00:00</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2023-01-11T05:57:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=16d73129f1fd8e91eb565482245233809647c649'/>
<id>urn:sha1:16d73129f1fd8e91eb565482245233809647c649</id>
<content type='text'>
Fix the following kernel-doc warnings:

$ ./scripts/kernel-doc -none drivers/platform/chrome/*
drivers/platform/chrome/cros_ec_debugfs.c:54: warning: Function
parameter or member 'notifier_panic' not described in 'cros_ec_debugfs'

$ ./scripts/kernel-doc -none include/linux/platform_data/cros_ec_proto.h
include/linux/platform_data/cros_ec_proto.h:187: warning: Function
parameter or member 'panic_notifier' not described in 'cros_ec_device'

Cc: Rob Barnes &lt;robbarnes@google.com&gt;
Fixes: d90fa2c64d59 ("platform/chrome: cros_ec: Poll EC log on EC panic")
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Reviewed-by: Guenter Roeck &lt;groweck@chromium.org&gt;
Link: https://lore.kernel.org/r/20230111055728.708990-2-tzungbi@kernel.org
</content>
</entry>
<entry>
<title>Revert "mfd: cros_ec: Add SCP Core-1 as a new CrOS EC MCU"</title>
<updated>2023-01-09T20:32:52+00:00</updated>
<author>
<name>Prashant Malani</name>
<email>pmalani@chromium.org</email>
</author>
<published>2022-12-28T00:45:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0ac7200e3317bdde7b96112f24b9253208c0258b'/>
<id>urn:sha1:0ac7200e3317bdde7b96112f24b9253208c0258b</id>
<content type='text'>
This reverts commit 66ee379d743c69c726b61d078119a34d5be96a35.

The feature flag introduced by Commit 66ee379d743c ("mfd: cros_ec: Add
SCP Core-1 as a new CrOS EC MCU") was not first added in the source EC
code base[1]. This can lead to the possible misinterpration of an EC's
supported feature set, as well as causes issues with all future feature
flag updates.

[1] https://source.chromium.org/chromium/chromiumos/platform/ec/+/main:include/ec_commands.h

Signed-off-by: Prashant Malani &lt;pmalani@chromium.org&gt;
Acked-by: Lee Jones &lt;lee@kernel.org&gt;
Reviewed-by: Benson Leung &lt;bleung@chromium.org&gt;
Acked-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20221228004648.793339-2-pmalani@chromium.org
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: Poll EC log on EC panic</title>
<updated>2023-01-06T03:48:06+00:00</updated>
<author>
<name>Rob Barnes</name>
<email>robbarnes@google.com</email>
</author>
<published>2023-01-04T01:15:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d90fa2c64d59f5f151beeef5dbc599784b3391ca'/>
<id>urn:sha1:d90fa2c64d59f5f151beeef5dbc599784b3391ca</id>
<content type='text'>
Add handler for CrOS EC panic events. When a panic is reported,
immediately poll for EC log.

This should result in the log leading to the EC panic being
preserved.

ACPI_NOTIFY_CROS_EC_PANIC is defined in coreboot at
https://review.coreboot.org/plugins/gitiles/coreboot/+/refs/heads/master/src/ec/google/chromeec/acpi/ec.asl

Signed-off-by: Rob Barnes &lt;robbarnes@google.com&gt;
Reviewed-by: Prashant Malani &lt;pmalani@chromium.org&gt;
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Link: https://lore.kernel.org/r/20230104011524.369764-2-robbarnes@google.com
</content>
</entry>
</feed>
