platform/chrome: cros_ec_dev - Register cros-ec sensors

Check whether the ChromeOS Embedded Controller is a sensor hub and in
such case issue a command to get the number of sensors and register them
all.

Signed-off-by: Gwendal Grignou <[email protected]>
Signed-off-by: Enric Balletbo i Serra <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Acked-by: Olof Johansson <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
This commit is contained in:
Enric Balletbo i Serra 2016-08-01 11:54:38 +02:00 • committed by Jonathan Cameron
commit 5668bfdd90
2 changed files with 124 additions and 2 deletions

View file

@ -51,7 +51,7 @@ static int cros_ec_sensors_read(struct iio_dev *indio_dev,
s16 data = 0;
s64 val64;
int i;
int ret = IIO_VAL_INT;
int ret;
int idx = chan->scan_index;
mutex_lock(&st->core.cmd_lock);
@ -137,7 +137,7 @@ static int cros_ec_sensors_write(struct iio_dev *indio_dev,
{
struct cros_ec_sensors_state *st = iio_priv(indio_dev);
int i;
int ret = 0;
int ret;
int idx = chan->scan_index;
mutex_lock(&st->core.cmd_lock);