History

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

Jonathan writes: First set of new IIO device support, features and cleanup for the 5.8 cycle Usual mix of new drivers, new support in old drivers and lots of minor cleanup. Yaml conversions also continue to trickle in (plenty more to go!) New device support * ad7476 - Add ad7091 support (ID only) * ad9467 - New driver for this 200/250 MSPS adi-axi-adc and SPI attached ADC. * adi-axi-adc - New driver to support ADIs generic AXI ADC IP core, used to provide high speed interfaces to ADCs (JESD204B/C or parallel interfaces). Usually paired with a device using a slow configuration interface (spi etc) Includes DT bindings and some fixes for fpga headers. * bmg160 - Add support for BMI088 (ID only) * max1241 - New driver for this ADC. * st_sensors - Add support for LIS2HH12 accelerometer * sx9310 - New driver supporting sx9310 and sx9311 proximity sensors. Yaml DT binding conversions * rockchip-saradc (including adding some missing parts) * stm32-dac * tsl2563 * vcnl4000 Features * st_lsm6dsx - Add LIS3MDL as a possible sensor hub device. * vcnl4000 - Add new concept of near level (from DT) to provide to userspace which often needs to have some calibrated concept of 'near'. Cleanups, minor fixes etc. * core - Use snprintf for functions where strings are built and there is potential for overflow. - Correct docs to indicate mlock should not be used directly by drivers. - Fix up accidental dropping of a patch to use bitmap_zalloc. - Stop allowing enabling of buffers with no channels enabled. - Drop unused 'stufftoread' from iio_buffer. - Drop scan_el_attrs form iio_buffer as unused. - Reorder sanity checks in __iio_device_register to fail earlier. - Drop all the devm_ runregister / free functions from IIO as they were never used and encourage poor design. * dma-buffer - Tidy up includes. * dma-engine-buffer - Provide dev-managed allocator. - Fix an issue with printing a size_t * cross subsystem (kxsd9, bmg160, mpu3050, bmi160, mpu6050, bmc150) - Replace some unnecessary casts of error ptrs and whilst there. use the %pe printf parameter to print them in a more useful fashion. * cross subsystem - Drop casts in calls to regmap_bulk_read as they make no sense. - Use devm_platform_ioremap_resource to reduce boilerplate. - Fix typos in Analog Devices. * counters/104-quad - Add Syed Nayyar Waris as an additional maintainer. * ad7476 - Generate CONVST signal internally rather than requiring external trigger. Add sysfs read back as can now do so. - use devm_add_action_or_reset to tidy up error and remove handling. * ad7793 - Switch to read_avail from explicit attribute. Mostly done to avoid confusing people with a - sign (without surounding spaces) that was correct but checkpatch didn't like. * adis library - Add missing newlines at end of error messages. * adis16400 - Use DEFINE_DEBUGS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTR. * adis16460 - Use DEFINE_DEBUGS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTR. * ad_sigma_delta - Move some channel definitions into individual drivers to avoid having to deal with complex options. * ak8974 - Silence an error on deffered probe. * bmp280 - Harden against IRQ before registration. - Convert to read_avail instead of opencoding the equivalent. - Explicitly mark GPIO as optional. - Cleanup casts. - Remove line breaks from strings. * htts221 - Replace direct access to platform_data with dev_get_platdata(). - Use device properties rather than device tree ones to allow ACPI probing. - Casting cleanups. * intel_mrfld_adc - Don't use unaligned accessor for aligned data. * isl29125 - Reorder buer pre and post hooks to allow for coming core rework. * ltc2983 - Remove comp to bool. * max1363 - Stop using mlock from the iio_dev directly in favour of a local lock with clearly defined scope. * max30100 - Use generic device properties to allow ACPI probe. * mpu6050 - Convert to i2c_new_client_device. - Add debugfs register access. * st_lsm6dsx - Provide means of configuring full scale on slave device if supported. - Drop include of st_sensors header to get one value. Its not otherwise used by this driver. * st-sensors - Replace direct access to platform_data with dev_get_platdata(). - Casting cleanups. - Avoid splitting strings. * st_uvis25 - Casting cleanups. * tsl2563 - Typo fix. * tsl2772 - scnprintf in a non obvious string building usecase. Note also 'fixes' a wrong calculation of remaining space that couldn't actually cause any trouble as there was lots of room. * xilinx-xadc - Fix Lars-Peter spelling his own name wrong :) + additional typos. * tag 'iio-for-5.8a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (101 commits) iio: magnetometer: ak8974: Silence deferred-probe error Documentation: ABI: document IIO in_proximity_nearlevel file iio: vcnl4000: Export near level property for proximity sensor dt-bindings: iio: light: vcnl4000: Add proximity-near-level dt-bindings: iio: Introduce common properties for iio sensors dt-bindings: iio: vcnl4000: convert bindings to YAML format iio: Fix misspellings of "Analog Devices" iio: light: isl29125: fix iio_triggered_buffer_{predisable,postenable} positions iio: adc: fsl-imx25-gcq: Use devm_platform_ioremap_resource iio: adc: at91-adc: Use devm_platform_ioremap_resource iio: adc: sun4i-gpadc-iio: Use devm_platform_ioremap_resource iio:light:ltr501: Drop unnecessary cast of parameter in regmap_bulk_read iio:magn:mmc35240: Drop unnecessary casts of val parameter in regmap_bulk* iio:imu:mpu6050: Tidy up parameters to regmap_bulk functions. iio:chemical:bme680: Tidy up parameters to regmap_bulk_read iio:chemical:atlas-sensor: Drop unnecessary explicit casts in regmap_bulk_read calls iio:accel:mxc4005: Drop unnecessary explicit casts in regmap_bulk_read calls iio: imu: st_lsm6dsx: drop huge include in sensor-hub driver iio: buffer: drop devm_iio_kfifo_free() API call iio: buffer: drop devm_iio_hw_consumer_free() API call ...

Greg Kroah-Hartman committed 6 years ago

Commit 4e1d9632 parents 710c451 2de8c02110 files · +3625 −774Browse files

Showing the changes to include/linux (12 of 110 files). Show all

Unified · Split

12 files
  1. include/linux/fpga/adi-axi-common.h +5 −1
  2. include/linux/iio/adc/ad_sigma_delta.h +0 −58
  3. include/linux/iio/adc/adi-axi-adc.h +64 −0
  4. include/linux/iio/buffer-dma.h +1 −1
  5. include/linux/iio/buffer-dmaengine.h +3 −0
  6. include/linux/iio/buffer_impl.h +0 −9
  7. include/linux/iio/consumer.h +0 −18
  8. include/linux/iio/hw-consumer.h +0 −1
  9. include/linux/iio/iio.h +1 −9
  10. include/linux/iio/kfifo_buf.h +0 −1
  11. include/linux/iio/trigger.h +0 −3
  12. include/linux/iio/triggered_buffer.h +0 −2
include/linux/fpga/adi-axi-common.h+5−1
@@ -11,9 +11,13 @@ · 10 unmodified lines
11#ifndef ADI_AXI_COMMON_H_11#ifndef ADI_AXI_COMMON_H_
12#define ADI_AXI_COMMON_H_12#define ADI_AXI_COMMON_H_
13 13
14#define ADI_AXI_REG_VERSION 0x000014#define ADI_AXI_REG_VERSION 0x0000
15 15
16#define ADI_AXI_PCORE_VER(major, minor, patch) \16#define ADI_AXI_PCORE_VER(major, minor, patch) \
17 (((major) << 16) | ((minor) << 8) | (patch))17 (((major) << 16) | ((minor) << 8) | (patch))
18 18
19#define ADI_AXI_PCORE_VER_MAJOR(version) (((version) >> 16) & 0xff)
20#define ADI_AXI_PCORE_VER_MINOR(version) (((version) >> 8) & 0xff)
21#define ADI_AXI_PCORE_VER_PATCH(version) ((version) & 0xff)
22
19#endif /* ADI_AXI_COMMON_H_ */23#endif /* ADI_AXI_COMMON_H_ */
include/linux/iio/adc/ad_sigma_delta.h+0−58
@@ -133,62 +133,4 @@ void ad_sd_cleanup_buffer_and_trigger(struct iio_dev *indio_dev); · 132 unmodified lines
133 133
134int ad_sd_validate_trigger(struct iio_dev *indio_dev, struct iio_trigger *trig);134int ad_sd_validate_trigger(struct iio_dev *indio_dev, struct iio_trigger *trig);
135 135
136#define __AD_SD_CHANNEL(_si, _channel1, _channel2, _address, _bits, \
137 _storagebits, _shift, _extend_name, _type, _mask_all) \
138 { \
139 .type = (_type), \
140 .differential = (_channel2 == -1 ? 0 : 1), \
141 .indexed = 1, \
142 .channel = (_channel1), \
143 .channel2 = (_channel2), \
144 .address = (_address), \
145 .extend_name = (_extend_name), \
146 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
147 BIT(IIO_CHAN_INFO_OFFSET), \
148 .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
149 .info_mask_shared_by_all = _mask_all, \
150 .scan_index = (_si), \
151 .scan_type = { \
152 .sign = 'u', \
153 .realbits = (_bits), \
154 .storagebits = (_storagebits), \
155 .shift = (_shift), \
156 .endianness = IIO_BE, \
157 }, \
158 }
159
160#define AD_SD_DIFF_CHANNEL(_si, _channel1, _channel2, _address, _bits, \
161 _storagebits, _shift) \
162 __AD_SD_CHANNEL(_si, _channel1, _channel2, _address, _bits, \
163 _storagebits, _shift, NULL, IIO_VOLTAGE, \
164 BIT(IIO_CHAN_INFO_SAMP_FREQ))
165
166#define AD_SD_SHORTED_CHANNEL(_si, _channel, _address, _bits, \
167 _storagebits, _shift) \
168 __AD_SD_CHANNEL(_si, _channel, _channel, _address, _bits, \
169 _storagebits, _shift, "shorted", IIO_VOLTAGE, \
170 BIT(IIO_CHAN_INFO_SAMP_FREQ))
171
172#define AD_SD_CHANNEL(_si, _channel, _address, _bits, \
173 _storagebits, _shift) \
174 __AD_SD_CHANNEL(_si, _channel, -1, _address, _bits, \
175 _storagebits, _shift, NULL, IIO_VOLTAGE, \
176 BIT(IIO_CHAN_INFO_SAMP_FREQ))
177
178#define AD_SD_CHANNEL_NO_SAMP_FREQ(_si, _channel, _address, _bits, \
179 _storagebits, _shift) \
180 __AD_SD_CHANNEL(_si, _channel, -1, _address, _bits, \
181 _storagebits, _shift, NULL, IIO_VOLTAGE, 0)
182
183#define AD_SD_TEMP_CHANNEL(_si, _address, _bits, _storagebits, _shift) \
184 __AD_SD_CHANNEL(_si, 0, -1, _address, _bits, \
185 _storagebits, _shift, NULL, IIO_TEMP, \
186 BIT(IIO_CHAN_INFO_SAMP_FREQ))
187
188#define AD_SD_SUPPLY_CHANNEL(_si, _channel, _address, _bits, _storagebits, \
189 _shift) \
190 __AD_SD_CHANNEL(_si, _channel, -1, _address, _bits, \
191 _storagebits, _shift, "supply", IIO_VOLTAGE, \
192 BIT(IIO_CHAN_INFO_SAMP_FREQ))
193
194#endif136#endif
include/linux/iio/adc/adi-axi-adc.h+64−0
@@ -0,0 +1,64 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Analog Devices Generic AXI ADC IP core driver/library
4 * Link: https://wiki.analog.com/resources/fpga/docs/axi_adc_ip
5 *
6 * Copyright 2012-2020 Analog Devices Inc.
7 */
8#ifndef __ADI_AXI_ADC_H__
9#define __ADI_AXI_ADC_H__
10
11struct device;
12struct iio_chan_spec;
13
14/**
15 * struct adi_axi_adc_chip_info - Chip specific information
16 * @name Chip name
17 * @id Chip ID (usually product ID)
18 * @channels Channel specifications of type @struct axi_adc_chan_spec
19 * @num_channels Number of @channels
20 * @scale_table Supported scales by the chip; tuples of 2 ints
21 * @num_scales Number of scales in the table
22 * @max_rate Maximum sampling rate supported by the device
23 */
24struct adi_axi_adc_chip_info {
25 const char *name;
26 unsigned int id;
27
28 const struct iio_chan_spec *channels;
29 unsigned int num_channels;
30
31 const unsigned int (*scale_table)[2];
32 int num_scales;
33
34 unsigned long max_rate;
35};
36
37/**
38 * struct adi_axi_adc_conv - data of the ADC attached to the AXI ADC
39 * @chip_info chip info details for the client ADC
40 * @preenable_setup op to run in the client before enabling the AXI ADC
41 * @reg_access IIO debugfs_reg_access hook for the client ADC
42 * @read_raw IIO read_raw hook for the client ADC
43 * @write_raw IIO write_raw hook for the client ADC
44 */
45struct adi_axi_adc_conv {
46 const struct adi_axi_adc_chip_info *chip_info;
47
48 int (*preenable_setup)(struct adi_axi_adc_conv *conv);
49 int (*reg_access)(struct adi_axi_adc_conv *conv, unsigned int reg,
50 unsigned int writeval, unsigned int *readval);
51 int (*read_raw)(struct adi_axi_adc_conv *conv,
52 struct iio_chan_spec const *chan,
53 int *val, int *val2, long mask);
54 int (*write_raw)(struct adi_axi_adc_conv *conv,
55 struct iio_chan_spec const *chan,
56 int val, int val2, long mask);
57};
58
59struct adi_axi_adc_conv *devm_adi_axi_adc_conv_register(struct device *dev,
60 size_t sizeof_priv);
61
62void *adi_axi_adc_conv_priv(struct adi_axi_adc_conv *conv);
63
64#endif
include/linux/iio/buffer-dma.h+1−1
@@ -11,7 +11,7 @@ · 10 unmodified lines
11#include <linux/kref.h>11#include <linux/kref.h>
12#include <linux/spinlock.h>12#include <linux/spinlock.h>
13#include <linux/mutex.h>13#include <linux/mutex.h>
14#include <linux/iio/buffer.h>14#include <linux/iio/buffer_impl.h>
15 15
16struct iio_dma_buffer_queue;16struct iio_dma_buffer_queue;
17struct iio_dma_buffer_ops;17struct iio_dma_buffer_ops;
include/linux/iio/buffer-dmaengine.h+3−0
@@ -14,4 +14,7 @@ struct iio_buffer *iio_dmaengine_buffer_alloc(struct device *dev, · 13 unmodified lines
14 const char *channel);14 const char *channel);
15void iio_dmaengine_buffer_free(struct iio_buffer *buffer);15void iio_dmaengine_buffer_free(struct iio_buffer *buffer);
16 16
17struct iio_buffer *devm_iio_dmaengine_buffer_alloc(struct device *dev,
18 const char *channel);
19
17#endif20#endif
include/linux/iio/buffer_impl.h+0−9
@@ -94,12 +94,6 @@ struct iio_buffer { · 93 unmodified lines
94 unsigned int watermark;94 unsigned int watermark;
95 95
96 /* private: */96 /* private: */
97 /*
98 * @scan_el_attrs: Control of scan elements if that scan mode
99 * control method is used.
100 */
101 struct attribute_group *scan_el_attrs;
102
103 /* @scan_timestamp: Does the scan mode include a timestamp. */97 /* @scan_timestamp: Does the scan mode include a timestamp. */
104 bool scan_timestamp;98 bool scan_timestamp;
105 99
@@ -115,9 +109,6 @@ struct iio_buffer { · 9 unmodified lines
115 */109 */
116 struct attribute_group scan_el_group;110 struct attribute_group scan_el_group;
117 111
118 /* @stufftoread: Flag to indicate new data. */
119 bool stufftoread;
120
121 /* @attrs: Standard attributes of the buffer. */112 /* @attrs: Standard attributes of the buffer. */
122 const struct attribute **attrs;113 const struct attribute **attrs;
123 114
include/linux/iio/consumer.h+0−18
@@ -63,15 +63,6 @@ void iio_channel_release(struct iio_channel *chan); · 62 unmodified lines
63 */63 */
64struct iio_channel *devm_iio_channel_get(struct device *dev,64struct iio_channel *devm_iio_channel_get(struct device *dev,
65 const char *consumer_channel);65 const char *consumer_channel);
66/**
67 * devm_iio_channel_release() - Resource managed version of
68 * iio_channel_release().
69 * @dev: Pointer to consumer device for which resource
70 * is allocared.
71 * @chan: The channel to be released.
72 */
73void devm_iio_channel_release(struct device *dev, struct iio_channel *chan);
74
75/**66/**
76 * iio_channel_get_all() - get all channels associated with a client67 * iio_channel_get_all() - get all channels associated with a client
77 * @dev: Pointer to consumer device.68 * @dev: Pointer to consumer device.
@@ -106,15 +97,6 @@ void iio_channel_release_all(struct iio_channel *chan); · 28 unmodified lines
106 */97 */
107struct iio_channel *devm_iio_channel_get_all(struct device *dev);98struct iio_channel *devm_iio_channel_get_all(struct device *dev);
108 99
109/**
110 * devm_iio_channel_release_all() - Resource managed version of
111 * iio_channel_release_all().
112 * @dev: Pointer to consumer device for which resource
113 * is allocared.
114 * @chan: Array channel to be released.
115 */
116void devm_iio_channel_release_all(struct device *dev, struct iio_channel *chan);
117
118struct iio_cb_buffer;100struct iio_cb_buffer;
119/**101/**
120 * iio_channel_get_all_cb() - register callback for triggered capture102 * iio_channel_get_all_cb() - register callback for triggered capture
include/linux/iio/hw-consumer.h+0−1
@@ -14,7 +14,6 @@ struct iio_hw_consumer; · 13 unmodified lines
14struct iio_hw_consumer *iio_hw_consumer_alloc(struct device *dev);14struct iio_hw_consumer *iio_hw_consumer_alloc(struct device *dev);
15void iio_hw_consumer_free(struct iio_hw_consumer *hwc);15void iio_hw_consumer_free(struct iio_hw_consumer *hwc);
16struct iio_hw_consumer *devm_iio_hw_consumer_alloc(struct device *dev);16struct iio_hw_consumer *devm_iio_hw_consumer_alloc(struct device *dev);
17void devm_iio_hw_consumer_free(struct device *dev, struct iio_hw_consumer *hwc);
18int iio_hw_consumer_enable(struct iio_hw_consumer *hwc);17int iio_hw_consumer_enable(struct iio_hw_consumer *hwc);
19void iio_hw_consumer_disable(struct iio_hw_consumer *hwc);18void iio_hw_consumer_disable(struct iio_hw_consumer *hwc);
20 19
include/linux/iio/iio.h+1−9
@@ -492,7 +492,7 @@ struct iio_buffer_setup_ops { · 491 unmodified lines
492 * @buffer: [DRIVER] any buffer present492 * @buffer: [DRIVER] any buffer present
493 * @buffer_list: [INTERN] list of all buffers currently attached493 * @buffer_list: [INTERN] list of all buffers currently attached
494 * @scan_bytes: [INTERN] num bytes captured to be fed to buffer demux494 * @scan_bytes: [INTERN] num bytes captured to be fed to buffer demux
495 * @mlock: [DRIVER] lock used to prevent simultaneous device state495 * @mlock: [INTERN] lock used to prevent simultaneous device state
496 * changes496 * changes
497 * @available_scan_masks: [DRIVER] optional array of allowed bitmasks497 * @available_scan_masks: [DRIVER] optional array of allowed bitmasks
498 * @masklength: [INTERN] the length of the mask established from498 * @masklength: [INTERN] the length of the mask established from
@@ -593,9 +593,6 @@ void iio_device_unregister(struct iio_dev *indio_dev); · 94 unmodified lines
593 * calls iio_device_register() internally. Refer to that function for more593 * calls iio_device_register() internally. Refer to that function for more
594 * information.594 * information.
595 *595 *
596 * If an iio_dev registered with this function needs to be unregistered
597 * separately, devm_iio_device_unregister() must be used.
598 *
599 * RETURNS:596 * RETURNS:
600 * 0 on success, negative error number on failure.597 * 0 on success, negative error number on failure.
601 */598 */
@@ -603,7 +600,6 @@ void iio_device_unregister(struct iio_dev *indio_dev); · 1 unmodified line
603 __devm_iio_device_register((dev), (indio_dev), THIS_MODULE);600 __devm_iio_device_register((dev), (indio_dev), THIS_MODULE);
604int __devm_iio_device_register(struct device *dev, struct iio_dev *indio_dev,601int __devm_iio_device_register(struct device *dev, struct iio_dev *indio_dev,
605 struct module *this_mod);602 struct module *this_mod);
606void devm_iio_device_unregister(struct device *dev, struct iio_dev *indio_dev);
607int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp);603int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp);
608int iio_device_claim_direct_mode(struct iio_dev *indio_dev);604int iio_device_claim_direct_mode(struct iio_dev *indio_dev);
609void iio_device_release_direct_mode(struct iio_dev *indio_dev);605void iio_device_release_direct_mode(struct iio_dev *indio_dev);
@@ -694,13 +690,9 @@ static inline struct iio_dev *iio_priv_to_dev(void *priv) · 84 unmodified lines
694}690}
695 691
696void iio_device_free(struct iio_dev *indio_dev);692void iio_device_free(struct iio_dev *indio_dev);
697int devm_iio_device_match(struct device *dev, void *res, void *data);
698struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv);693struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv);
699void devm_iio_device_free(struct device *dev, struct iio_dev *indio_dev);
700struct iio_trigger *devm_iio_trigger_alloc(struct device *dev,694struct iio_trigger *devm_iio_trigger_alloc(struct device *dev,
701 const char *fmt, ...);695 const char *fmt, ...);
702void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig);
703
704/**696/**
705 * iio_buffer_enabled() - helper function to test if the buffer is enabled697 * iio_buffer_enabled() - helper function to test if the buffer is enabled
706 * @indio_dev: IIO device structure for device698 * @indio_dev: IIO device structure for device
include/linux/iio/kfifo_buf.h+0−1
@@ -9,6 +9,5 @@ struct iio_buffer *iio_kfifo_allocate(void); · 8 unmodified lines
9void iio_kfifo_free(struct iio_buffer *r);9void iio_kfifo_free(struct iio_buffer *r);
10 10
11struct iio_buffer *devm_iio_kfifo_allocate(struct device *dev);11struct iio_buffer *devm_iio_kfifo_allocate(struct device *dev);
12void devm_iio_kfifo_free(struct device *dev, struct iio_buffer *r);
13 12
14#endif13#endif
include/linux/iio/trigger.h+0−3
@@ -141,9 +141,6 @@ int __devm_iio_trigger_register(struct device *dev, · 140 unmodified lines
141 **/141 **/
142void iio_trigger_unregister(struct iio_trigger *trig_info);142void iio_trigger_unregister(struct iio_trigger *trig_info);
143 143
144void devm_iio_trigger_unregister(struct device *dev,
145 struct iio_trigger *trig_info);
146
147/**144/**
148 * iio_trigger_set_immutable() - set an immutable trigger on destination145 * iio_trigger_set_immutable() - set an immutable trigger on destination
149 *146 *
include/linux/iio/triggered_buffer.h+0−2
@@ -18,7 +18,5 @@ int devm_iio_triggered_buffer_setup(struct device *dev, · 17 unmodified lines
18 irqreturn_t (*h)(int irq, void *p),18 irqreturn_t (*h)(int irq, void *p),
19 irqreturn_t (*thread)(int irq, void *p),19 irqreturn_t (*thread)(int irq, void *p),
20 const struct iio_buffer_setup_ops *ops);20 const struct iio_buffer_setup_ops *ops);
21void devm_iio_triggered_buffer_cleanup(struct device *dev,
22 struct iio_dev *indio_dev);
23 21
24#endif22#endif