iio: common: cros_ec_sensors: Add label attribute
authorGwendal Grignou <gwendal@chromium.org>
Wed, 27 Apr 2022 19:08:04 +0000 (12:08 -0700)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 11 Jun 2022 13:35:26 +0000 (14:35 +0100)
commit7cbb6681d7e5b88688234ad370e027a9346ff7a9
tree09dddb1df50413005ce43054c96efef798a2b67f
parentcc0bb2f106cb6293997e9114caa7887d91d22b26
iio: common: cros_ec_sensors: Add label attribute

When sensor location is known, populate iio sysfs "label" attribute:

* "accel-base" : the sensor is in the base of the convertible (2-1)
  device.
* "accel-display" : the sensor is in the lid/display plane of the
  device.
* "accel-camera" : the sensor is in the swivel camera subassembly.

The non-standard |location| attribute is removed, the field |loc| in
cros_ec_sensors_core_state is removed.

It apply to standalone accelerometer as well as IMU (accelerometer +
gyroscope) and sensors where the location is known (light).

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Link: https://lore.kernel.org/r/20220427190804.961697-3-gwendal@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/cros_ec_accel_legacy.c
drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
drivers/iio/light/cros_ec_light_prox.c
drivers/iio/pressure/cros_ec_baro.c
include/linux/iio/common/cros_ec_sensors_core.h