Re: [PATCH v2 0/2] platform/chrome: Update cros_ec sysfs attribute after sensors are found

From: Gwendal Grignou
Date: Thu May 27 2021 - 17:01:50 EST


[+dtor]
Is this change acceptable? I was worried it could break when
asynchronous probing is used [https://lwn.net/Articles/629895/], but
since all probes are deferred in a single thread, it is safe.
Gwendal.


Gwendal.

On Mon, Apr 5, 2021 at 1:29 PM Gwendal Grignou <gwendal@xxxxxxxxxxxx> wrote:
>
> Attribute "kb_wake_angle" in /sys/<cros_ec hw path>/chromeos/cros_ec,
> used to set at which angle the embedded controller must wake up the
> host, is only set when there is at least 2 accelerometers in the
> chromebook.
>
> The detection of these sensors is done in cros_ec_sensorhub, driver that
> can be probed after the cros_ec_sysfs driver that sets the attribute.
> Therefore, we need to upgrade the cros_ec sysfs groups in the sensorhub
> probe routine.
>
> The first patch cleans up cros_ec_sysfs by using .dev_groups driver
> field, the second patch fixes the problem.
>
> Gwendal Grignou (2):
> platform/chrome: Use dev_groups to set device sysfs attributes
> platform/chrome: Update cros_ec sysfs attributes on sensors discovery
>
> drivers/platform/chrome/cros_ec_sensorhub.c | 5 ++++-
> drivers/platform/chrome/cros_ec_sysfs.c | 22 +++++++--------------
> include/linux/platform_data/cros_ec_proto.h | 2 ++
> 3 files changed, 13 insertions(+), 16 deletions(-)
>
> --
> 2.31.0.208.g409f899ff0-goog
>