/* * cros_ec_lid_angle - Driver for CrOS EC lid angle sensor. * * Copyright 2018 Google, Inc * * This driver uses the cros-ec interface to communicate with the Chrome OS * EC about counter sensors. Counters are presented through * iio sysfs.
*/
st->param.cmd = MOTIONSENSE_CMD_LID_ANGLE;
ret = cros_ec_motion_send_host_cmd(st, sizeof(st->resp->lid_angle)); if (ret) {
dev_warn(&indio_dev->dev, "Unable to read lid angle\n"); return ret;
}
*data = st->resp->lid_angle.value; return 0;
}
staticint cros_ec_lid_angle_read(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, int *val, int *val2, long mask)
{ struct cros_ec_lid_angle_state *st = iio_priv(indio_dev);
s16 data; int ret;
mutex_lock(&st->core.cmd_lock);
ret = cros_ec_sensors_read_lid_angle(indio_dev, 1, &data); if (ret == 0) {
*val = data;
ret = IIO_VAL_INT;
}
mutex_unlock(&st->core.cmd_lock); return ret;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.