History

Merge tag 'iio-for-5.4a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes: First set of new device support, features and cleanups for IIO in the 5.4 cycle Note includes a merge from i3c tree to get support needed for stm_lsm6dsx driver support for l3c devices. Done from immutable branch. A counter subsystem patche in here as well. Alongside the new device support (which is always good), Chuhong's work on using devres managed APIs has cleaned up a number of drivers. New device support * adis16460 - New driver based on ADIS framework which needed addition of support for cs_change_delay. Includes device tree binding. * cros_ec - Support fo the veyron-minnie which uses an older interface. * lsm6dsx - Support for LSM6DSTR-C gyro + magnetometer sensor (new IDs mainly) - Support for ISM330DHCX acc + gyro sensor (extensive rework needed!) * Maxim 5432 - New driver support MAX5432-MAX5435 family of potentiometers. * noa1305 - New driver for this ON Semiconductor Ambient light sensor. Features and cleanups * tree wide - Drop error prints after platform_get_irq as already prints errors internally if any occur. * docs - Document mounting matrix. - Fix a missing newline at end of file. * ad2s1210 - Switch to device managed APIs for all of probe and drop explicit remove. * ad7192 - Add of_device_id array to explicity handling DT bindings. * ad7606 - Lots of rework leading to support for software configure modes in ad7616 parts. - Debugfs register access support. * am2315 - Switch to device managed APIs for all of probe and drop explicit remove. * apds9960 - Typo in module description. * cm36651 - Convert to i2c_new_dummy_device. - Swithc to device managed APIs for all of probe adn drop explicit remove. * cros_ec - Calibscale support for accel, gyro and magnetometer. - Tidy up some error codes to return the error from the stack rather than -EIO. - Determine protocol version. - Add a sign vector to the core to fix sensor rotation if necessary. Cannot just be done with mount matrix as already in use in many devices. - Tidy up INFO_SCALE being in both the separate and shared lists. - Drop a lot of dplicate code from the cros-ec-accel-legacy driver and use the core provided code instead. - Make frequency range available to userspace. * counter / ftm-quaddec - Switch to device managed APIs for all of probe adn drop explicit remove. * hdc100x - Switch to device managed APIs for all of probe and drop explicit remove. * hi8435 - Use gpiod_set_value_cansleep as we don't care here and there is a board out there where it needs to sleep. - Switch to device managed APIs for all of probe and drop explict remove. * hp03 - Convert to i2c_new_dummy_device. * maxim thermocouple - Switch to device managed APIs for all of probe and drop explicit remove. * mmc35240 - Fix typo in constant naming. * mpu6050 - Use devm_add_action_or_reset in place of explicit error handling. - Make text in Kconfig more explicit about which parts are supported. * mxc4005 - Switch to device managed APIs for all of probe and drop explicit remove. * pms7003 - Convert device tree bindings to yaml. - Add a MAINTAINERS entry * sc27xx - Introduce a local struct device *dev pointer to avoid lots of deref. - Use devm_add_action_or_reset in place of explicit error handling. * sca3000 - Typo fix in naming. * si1145 - Switch to device managed APIs for all of probe and drop explicit remove. * st_sensors - Lots of rework to enable switch to regmap. - Regmap conversion at the end. - Tidy up some inconsistencies in buffer setup ops. - Tidy up an oddity by dropping get_irq_data_ready function in favour of direct access. - Stop allocating buffer in buffer enable in favour of just embedding a large enough constant size buffer in the iio_priv accessed structure. * st_lsm6dsx - l3c device support (LSM6DSO and LSM6DSR) - tidy up irq return logic which was strangely written. - fix up an ABI quirk where this driver used separate scale attributes, even though they were always shared by type. * stk33xx - Device tree bindings include manufacturer ID. * stm32-adc - Add control for supply to analog switches including DT bindings. * stm32 timer - Drop the quadrature mode support. Believed there were no users so take this opportunity to drop this unwanted ABI. * tsl2772 - Switch to device mangage APIs for all of probe and drop explicit remove. - Use regulator_bulk_* APIs to reduce repitition. * veml6070 - Convert to i2c_new_dummy_device. * tag 'iio-for-5.4a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (84 commits) iio: hi8435: Drop hi8435_remove() by using devres for remaining elements iio: hi8435: Use gpiod_set_value_cansleep() iio:st_sensors: remove buffer allocation at each buffer enable iio: imu: inv_mpu6050: be more explicit on supported chips iio: light: noa1305: Add support for NOA1305 dt-bindings: Add binding document for NOA1305 iio: remove get_irq_data_ready() function pointer and use IRQ number directly iio: imu: st_lsm6dsx: make IIO_CHAN_INFO_SCALE shared by type iio: tsl2772: Use regulator_bulk_() APIs iio: tsl2772: Use devm_iio_device_register iio: tsl2772: Use devm_add_action_or_reset for tsl2772_chip_off iio: tsl2772: Use devm_add_action_or_reset iio: Remove dev_err() usage after platform_get_irq() iio: light: si1145: Use device-managed APIs iio:pressure: preenable/postenable/predisable fixup for ST press buffer iio:magn: preenable/postenable/predisable fixup for ST magn buffer iio:gyro: preenable/postenable/predisable fixup for ST gyro buffer iio:accel: preenable/postenable/predisable fixup for ST accel buffer dt-bindings: iio: imu: st_lsm6dsx: add ism330dhcx device bindings iio: imu: st_lsm6dsx: add support to ISM330DHCX ...

Greg Kroah-Hartman committed 7 years ago

Commit 6aed51d2 parents 1aee09b ef19ee6114 files · +3455 −1517Browse files

Showing the changes to include/linux (6 of 114 files). Show all

Unified · Split

6 files
  1. include/linux/i3c/device.h +4 −0
  2. include/linux/iio/common/cros_ec_sensors_core.h +26 −2
  3. include/linux/iio/common/st_sensors.h +19 −47
  4. include/linux/iio/common/st_sensors_i2c.h +2 −2
  5. include/linux/iio/common/st_sensors_spi.h +2 −2
  6. include/linux/iio/imu/adis.h +2 −0
include/linux/i3c/device.h+4−0
@@ -188,6 +188,10 @@ static inline struct i3c_driver *drv_to_i3cdrv(struct device_driver *drv) · 187 unmodified lines
188188 struct device *i3cdev_to_dev(struct i3c_device *i3cdev);
189189 struct i3c_device *dev_to_i3cdev(struct device *dev);
190190
191+const struct i3c_device_id *
192+i3c_device_match_id(struct i3c_device *i3cdev,
193+ const struct i3c_device_id *id_table);
194+
191195 static inline void i3cdev_set_drvdata(struct i3c_device *i3cdev,
192196 void *data)
193197 {
include/linux/iio/common/cros_ec_sensors_core.h+26−2
@@ -62,14 +62,20 @@ struct cros_ec_sensors_core_state { · 61 unmodified lines
6262 enum motionsensor_type type;
6363 enum motionsensor_location loc;
6464
65− s16 calib[CROS_EC_SENSOR_MAX_AXIS];
66−
65+ struct calib_data {
66+ s16 offset;
67+ u16 scale;
68+ } calib[CROS_EC_SENSOR_MAX_AXIS];
69+ s8 sign[CROS_EC_SENSOR_MAX_AXIS];
6770 u8 samples[CROS_EC_SAMPLE_SIZE];
6871
6972 int (*read_ec_sensors_data)(struct iio_dev *indio_dev,
7073 unsigned long scan_mask, s16 *data);
7174
7275 int curr_sampl_freq;
76+
77+ /* Table of known available frequencies : 0, Min and Max in mHz */
78+ int frequencies[3];
7379 };
7480
7581 /**
@@ -150,6 +156,24 @@ int cros_ec_sensors_core_read(struct cros_ec_sensors_core_state *st, · 74 unmodified lines
150156 struct iio_chan_spec const *chan,
151157 int *val, int *val2, long mask);
152158
159+/**
160+ * cros_ec_sensors_core_read_avail() - get available values
161+ * @indio_dev: pointer to state information for device
162+ * @chan: channel specification structure table
163+ * @vals: list of available values
164+ * @type: type of data returned
165+ * @length: number of data returned in the array
166+ * @mask: specifies which values to be requested
167+ *
168+ * Return: an error code, IIO_AVAIL_RANGE or IIO_AVAIL_LIST
169+ */
170+int cros_ec_sensors_core_read_avail(struct iio_dev *indio_dev,
171+ struct iio_chan_spec const *chan,
172+ const int **vals,
173+ int *type,
174+ int *length,
175+ long mask);
176+
153177 /**
154178 * cros_ec_sensors_core_write() - function to write a value to the sensor
155179 * @st: pointer to state information for device
include/linux/iio/common/st_sensors.h+19−47
@@ -16,11 +16,16 @@ · 15 unmodified lines
1616 #include <linux/iio/trigger.h>
1717 #include <linux/bitops.h>
1818 #include <linux/regulator/consumer.h>
19+#include <linux/regmap.h>
1920
2021 #include <linux/platform_data/st_sensors_pdata.h>
2122
22−#define ST_SENSORS_TX_MAX_LENGTH 2
23−#define ST_SENSORS_RX_MAX_LENGTH 6
23+/*
24+ * Buffer size max case: 2bytes per channel, 3 channels in total +
25+ * 8bytes timestamp channel (s64)
26+ */
27+#define ST_SENSORS_MAX_BUFFER_SIZE (ALIGN(2 * 3, sizeof(s64)) + \
28+ sizeof(s64))
2429
2530 #define ST_SENSORS_ODR_LIST_MAX 10
2631 #define ST_SENSORS_FULLSCALE_AVL_MAX 10
@@ -169,36 +174,6 @@ struct st_sensor_data_ready_irq { · 142 unmodified lines
169174 } ig1;
170175 };
171176
172−/**
173− * struct st_sensor_transfer_buffer - ST sensor device I/O buffer
174− * @buf_lock: Mutex to protect rx and tx buffers.
175− * @tx_buf: Buffer used by SPI transfer function to send data to the sensors.
176− * This buffer is used to avoid DMA not-aligned issue.
177− * @rx_buf: Buffer used by SPI transfer to receive data from sensors.
178− * This buffer is used to avoid DMA not-aligned issue.
179− */
180−struct st_sensor_transfer_buffer {
181− struct mutex buf_lock;
182− u8 rx_buf[ST_SENSORS_RX_MAX_LENGTH];
183− u8 tx_buf[ST_SENSORS_TX_MAX_LENGTH] ____cacheline_aligned;
184−};
185−
186−/**
187− * struct st_sensor_transfer_function - ST sensor device I/O function
188− * @read_byte: Function used to read one byte.
189− * @write_byte: Function used to write one byte.
190− * @read_multiple_byte: Function used to read multiple byte.
191− */
192−struct st_sensor_transfer_function {
193− int (*read_byte) (struct st_sensor_transfer_buffer *tb,
194− struct device *dev, u8 reg_addr, u8 *res_byte);
195− int (*write_byte) (struct st_sensor_transfer_buffer *tb,
196− struct device *dev, u8 reg_addr, u8 data);
197− int (*read_multiple_byte) (struct st_sensor_transfer_buffer *tb,
198− struct device *dev, u8 reg_addr, int len, u8 *data,
199− bool multiread_bit);
200−};
201−
202177 /**
203178 * struct st_sensor_settings - ST specific sensor settings
204179 * @wai: Contents of WhoAmI register.
@@ -242,19 +217,17 @@ struct st_sensor_settings { · 37 unmodified lines
242217 * @current_fullscale: Maximum range of measure by the sensor.
243218 * @vdd: Pointer to sensor's Vdd power supply
244219 * @vdd_io: Pointer to sensor's Vdd-IO power supply
220+ * @regmap: Pointer to specific sensor regmap configuration.
245221 * @enabled: Status of the sensor (false->off, true->on).
246− * @multiread_bit: Use or not particular bit for [I2C/SPI] multiread.
247− * @buffer_data: Data used by buffer part.
248222 * @odr: Output data rate of the sensor [Hz].
249223 * num_data_channels: Number of data channels used in buffer.
250224 * @drdy_int_pin: Redirect DRDY on pin 1 (1) or pin 2 (2).
251225 * @int_pin_open_drain: Set the interrupt/DRDY to open drain.
252− * @get_irq_data_ready: Function to get the IRQ used for data ready signal.
253− * @tf: Transfer function structure used by I/O operations.
254− * @tb: Transfer buffers and mutex used by I/O operations.
226+ * @irq: the IRQ number.
255227 * @edge_irq: the IRQ triggers on edges and need special handling.
256228 * @hw_irq_trigger: if we're using the hardware interrupt on the sensor.
257229 * @hw_timestamp: Latest timestamp from the interrupt handler, when in use.
230+ * @buffer_data: Data used by buffer part.
258231 */
259232 struct st_sensor_data {
260233 struct device *dev;
@@ -264,26 +237,22 @@ struct st_sensor_data { · 3 unmodified lines
264237 struct st_sensor_fullscale_avl *current_fullscale;
265238 struct regulator *vdd;
266239 struct regulator *vdd_io;
240+ struct regmap *regmap;
267241
268242 bool enabled;
269− bool multiread_bit;
270−
271− char *buffer_data;
272243
273244 unsigned int odr;
274245 unsigned int num_data_channels;
275246
276247 u8 drdy_int_pin;
277248 bool int_pin_open_drain;
278−
279− unsigned int (*get_irq_data_ready) (struct iio_dev *indio_dev);
280−
281− const struct st_sensor_transfer_function *tf;
282− struct st_sensor_transfer_buffer tb;
249+ int irq;
283250
284251 bool edge_irq;
285252 bool hw_irq_trigger;
286253 s64 hw_timestamp;
254+
255+ char buffer_data[ST_SENSORS_MAX_BUFFER_SIZE] ____cacheline_aligned;
287256 };
288257
289258 #ifdef CONFIG_IIO_BUFFER
@@ -334,8 +303,11 @@ int st_sensors_set_fullscale_by_gain(struct iio_dev *indio_dev, int scale); · 44 unmodified lines
334303 int st_sensors_read_info_raw(struct iio_dev *indio_dev,
335304 struct iio_chan_spec const *ch, int *val);
336305
337−int st_sensors_check_device_support(struct iio_dev *indio_dev,
338− int num_sensors_list, const struct st_sensor_settings *sensor_settings);
306+int st_sensors_get_settings_index(const char *name,
307+ const struct st_sensor_settings *list,
308+ const int list_length);
309+
310+int st_sensors_verify_id(struct iio_dev *indio_dev);
339311
340312 ssize_t st_sensors_sysfs_sampling_frequency_avail(struct device *dev,
341313 struct device_attribute *attr, char *buf);
include/linux/iio/common/st_sensors_i2c.h+2−2
@@ -14,8 +14,8 @@ · 13 unmodified lines
1414 #include <linux/iio/common/st_sensors.h>
1515 #include <linux/of.h>
1616
17−void st_sensors_i2c_configure(struct iio_dev *indio_dev,
18− struct i2c_client *client, struct st_sensor_data *sdata);
17+int st_sensors_i2c_configure(struct iio_dev *indio_dev,
18+ struct i2c_client *client);
1919
2020 #ifdef CONFIG_ACPI
2121 int st_sensors_match_acpi_device(struct device *dev);
include/linux/iio/common/st_sensors_spi.h+2−2
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 #include <linux/spi/spi.h>
1414 #include <linux/iio/common/st_sensors.h>
1515
16−void st_sensors_spi_configure(struct iio_dev *indio_dev,
17− struct spi_device *spi, struct st_sensor_data *sdata);
16+int st_sensors_spi_configure(struct iio_dev *indio_dev,
17+ struct spi_device *spi);
1818
1919 #endif /* ST_SENSORS_SPI_H */
include/linux/iio/imu/adis.h+2−0
@@ -26,6 +26,7 @@ struct adis_burst; · 25 unmodified lines
2626 * struct adis_data - ADIS chip variant specific data
2727 * @read_delay: SPI delay for read operations in us
2828 * @write_delay: SPI delay for write operations in us
29+ * @cs_change_delay: SPI delay between CS changes in us
2930 * @glob_cmd_reg: Register address of the GLOB_CMD register
3031 * @msc_ctrl_reg: Register address of the MSC_CTRL register
3132 * @diag_stat_reg: Register address of the DIAG_STAT register
@@ -35,6 +36,7 @@ struct adis_burst; · 3 unmodified lines
3536 struct adis_data {
3637 unsigned int read_delay;
3738 unsigned int write_delay;
39+ unsigned int cs_change_delay;
3840
3941 unsigned int glob_cmd_reg;
4042 unsigned int msc_ctrl_reg;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t