Merge tag 'tag-chrome-platform-for-v5.4' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / include / linux / iio / common / cros_ec_sensors_core.h
index 77a7d65..bb331e6 100644 (file)
@@ -63,14 +63,20 @@ struct cros_ec_sensors_core_state {
        enum motionsensor_type type;
        enum motionsensor_location loc;
 
-       s16 calib[CROS_EC_SENSOR_MAX_AXIS];
-
+       struct calib_data {
+               s16 offset;
+               u16 scale;
+       } calib[CROS_EC_SENSOR_MAX_AXIS];
+       s8 sign[CROS_EC_SENSOR_MAX_AXIS];
        u8 samples[CROS_EC_SAMPLE_SIZE];
 
        int (*read_ec_sensors_data)(struct iio_dev *indio_dev,
                                    unsigned long scan_mask, s16 *data);
 
        int curr_sampl_freq;
+
+       /* Table of known available frequencies : 0, Min and Max in mHz */
+       int frequencies[3];
 };
 
 /**
@@ -151,6 +157,24 @@ int cros_ec_sensors_core_read(struct cros_ec_sensors_core_state *st,
                              struct iio_chan_spec const *chan,
                              int *val, int *val2, long mask);
 
+/**
+ * cros_ec_sensors_core_read_avail() - get available values
+ * @indio_dev:         pointer to state information for device
+ * @chan:      channel specification structure table
+ * @vals:      list of available values
+ * @type:      type of data returned
+ * @length:    number of data returned in the array
+ * @mask:      specifies which values to be requested
+ *
+ * Return:     an error code, IIO_AVAIL_RANGE or IIO_AVAIL_LIST
+ */
+int cros_ec_sensors_core_read_avail(struct iio_dev *indio_dev,
+                                   struct iio_chan_spec const *chan,
+                                   const int **vals,
+                                   int *type,
+                                   int *length,
+                                   long mask);
+
 /**
  * cros_ec_sensors_core_write() - function to write a value to the sensor
  * @st:                pointer to state information for device