<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/platform/chrome/cros_ec_sysfs.c, branch linux-7.1.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.1.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.1.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-02-05T04:03:31+00:00</updated>
<entry>
<title>platform/chrome: cros_ec_sysfs: Expose AP_MODE_ENTRY feature state</title>
<updated>2025-02-05T04:03:31+00:00</updated>
<author>
<name>Andrei Kuchynski</name>
<email>akuchynski@chromium.org</email>
</author>
<published>2025-02-03T12:59:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=435a3d78b87a93c52a4f84e36ba4a0857554c958'/>
<id>urn:sha1:435a3d78b87a93c52a4f84e36ba4a0857554c958</id>
<content type='text'>
This adds sysfs attribute /sys/class/chromeos/cros_ec/ap_mode_entry
to expose the status of the AP_MODE_ENTRY feature. This attribute
indicate whether the EC requires direction from the Application
Processor (AP) before entering Type-C alternate modes or USB4 mode.
This allows user-space applications to easily determine if the AP needs
to be involved in mode entry.

Signed-off-by: Andrei Kuchynski &lt;akuchynski@chromium.org&gt;
Link: https://lore.kernel.org/r/20250203125947.2701106-3-akuchynski@chromium.org
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_sysfs: Expose PD mux status</title>
<updated>2025-02-05T04:02:27+00:00</updated>
<author>
<name>Andrei Kuchynski</name>
<email>akuchynski@chromium.org</email>
</author>
<published>2025-02-03T12:59:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e6a3215f78716d25ad60b002fd0585c04ffd5d01'/>
<id>urn:sha1:e6a3215f78716d25ad60b002fd0585c04ffd5d01</id>
<content type='text'>
This adds sysfs attribute /sys/class/chromeos/cros_ec/usbpdmuxinfo
to expose the PD mux status for each Type-C port.
This allows user-space applications to easily determine
the current mux state without using ioctls.

Signed-off-by: Andrei Kuchynski &lt;akuchynski@chromium.org&gt;
Link: https://lore.kernel.org/r/20250203125947.2701106-2-akuchynski@chromium.org
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: Switch back to struct platform_driver::remove()</title>
<updated>2024-10-28T08:48:34+00:00</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@baylibre.com</email>
</author>
<published>2024-10-28T08:26:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ea45f3f46734a47bdbcfb31f41748484219d2ea6'/>
<id>urn:sha1:ea45f3f46734a47bdbcfb31f41748484219d2ea6</id>
<content type='text'>
After commit 0edb555a65d1 ("platform: Make platform_driver::remove()
return void") .remove() is (again) the right callback to implement for
platform drivers.

Convert all platform drivers below drivers/platform/chrome to use
.remove(), with the eventual goal to drop struct
platform_driver::remove_new(). As .remove() and .remove_new() have the
same prototypes, conversion is done by just changing the structure
member name in the driver initializer.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@baylibre.com&gt;
Link: https://lore.kernel.org/r/20241028082611.431723-2-u.kleine-koenig@baylibre.com
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_sysfs: provide ID table for avoiding fallback match</title>
<updated>2024-04-24T08:45:57+00:00</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2024-03-29T07:56:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=82efd459b9f52af30e14bdf640e3961ac1156762'/>
<id>urn:sha1:82efd459b9f52af30e14bdf640e3961ac1156762</id>
<content type='text'>
Instead of using fallback driver name match, provide ID table[1] for the
primary match.

[1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353

Reviewed-by: Benson Leung &lt;bleung@chromium.org&gt;
Reviewed-by: Krzysztof Kozlowski &lt;krzk@kernel.org&gt;
Link: https://lore.kernel.org/r/20240329075630.2069474-11-tzungbi@kernel.org
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_sysfs: Convert to platform remove callback returning void</title>
<updated>2023-09-28T05:18:06+00:00</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2023-09-27T08:10:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6478e302409a0377cd6382c05b0ece22fc05c308'/>
<id>urn:sha1:6478e302409a0377cd6382c05b0ece22fc05c308</id>
<content type='text'>
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Link: https://lore.kernel.org/r/20230927081040.2198742-6-u.kleine-koenig@pengutronix.de
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: use sysfs_emit_at() instead of scnprintf()</title>
<updated>2022-12-26T08:14:53+00:00</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2022-12-05T06:10:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b251c0e7ea5ddfab21495c36cd3c3fa90c36f104'/>
<id>urn:sha1:b251c0e7ea5ddfab21495c36cd3c3fa90c36f104</id>
<content type='text'>
Follow the advice in Documentation/filesystems/sysfs.rst:
show() should only use sysfs_emit() or sysfs_emit_at() when formatting
the value to be returned to user space.

Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Reviewed-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Link: https://lore.kernel.org/r/20221205061042.1774769-1-tzungbi@kernel.org
</content>
</entry>
<entry>
<title>platform/chrome: use sysfs_emit() instead of scnprintf()</title>
<updated>2022-12-26T03:14:34+00:00</updated>
<author>
<name>ye xingchen</name>
<email>ye.xingchen@zte.com.cn</email>
</author>
<published>2022-12-02T08:56:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=256b734efc7494eb3c45f3ff5abd632ff0afde03'/>
<id>urn:sha1:256b734efc7494eb3c45f3ff5abd632ff0afde03</id>
<content type='text'>
Follow the advice in Documentation/filesystems/sysfs.rst:
show() should only use sysfs_emit() or sysfs_emit_at() when formatting
the value to be returned to user space.

Signed-off-by: ye xingchen &lt;ye.xingchen@zte.com.cn&gt;
Link: https://lore.kernel.org/r/202212021656040995199@zte.com.cn
[tzungbi: fixed the commit message.]
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_sysfs: Add cold-ap-off to sysfs reboot.</title>
<updated>2021-01-20T15:19:17+00:00</updated>
<author>
<name>Pi-Hsun Shih</name>
<email>pihsun@chromium.org</email>
</author>
<published>2020-12-21T04:12:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4c2e9b3e18962862281d2b2b82e5ef8aaba0442f'/>
<id>urn:sha1:4c2e9b3e18962862281d2b2b82e5ef8aaba0442f</id>
<content type='text'>
Add cold-ap-off to ChromeOS EC sysfs reboot file option, corresponds to
the EC_REBOOT_COLD_AP_OFF flag, that will reset EC and keep AP off.

Signed-off-by: Pi-Hsun Shih &lt;pihsun@chromium.org&gt;
Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
Link: https://lore.kernel.org/r/20201221041231.14516-2-pihsun@chromium.org
</content>
</entry>
<entry>
<title>platform/chrome: Constify static attribute_group structs</title>
<updated>2021-01-20T15:19:17+00:00</updated>
<author>
<name>Rikard Falkeborn</name>
<email>rikard.falkeborn@gmail.com</email>
</author>
<published>2021-01-09T00:17:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d7c1fef7fdc769ee45771059da823c8840590472'/>
<id>urn:sha1:d7c1fef7fdc769ee45771059da823c8840590472</id>
<content type='text'>
The only usage of these is to print their name in a dev_err-message, and
to pass their address to sysfs_create_group() and sysfs_remove_group(),
both which takes pointers to const. Make them const to allow the compiler
to put them in read-only memory.

Signed-off-by: Rikard Falkeborn &lt;rikard.falkeborn@gmail.com&gt;
Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
Link: https://lore.kernel.org/r/20210109001748.58036-1-rikard.falkeborn@gmail.com
</content>
</entry>
<entry>
<title>platform/chrome: Use kobj_to_dev() instead of container_of()</title>
<updated>2020-09-29T08:08:44+00:00</updated>
<author>
<name>Wang Qing</name>
<email>wangqing@vivo.com</email>
</author>
<published>2020-09-26T07:03:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9aa7bd452af17a3966e3583d959dcacab030bb8e'/>
<id>urn:sha1:9aa7bd452af17a3966e3583d959dcacab030bb8e</id>
<content type='text'>
Use kobj_to_dev() instead of container_of().

Signed-off-by: Wang Qing &lt;wangqing@vivo.com&gt;
Reviewed-by: Guenter Roeck &lt;groeck@chromium.org&gt;
Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
</content>
</entry>
</feed>
