summaryrefslogtreecommitdiff
path: root/drivers/iio/frequency
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-10-19 09:33:36 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-10-19 09:33:36 +0200
commitffb4b4ed3e8f4782072ff03513f3531be6b2d3a7 (patch)
tree13e287835baa5be8052c2561c59f8e9c7795ccf2 /drivers/iio/frequency
parent78fe66360ed64d2164bbbbf47b332d76eb39bf75 (diff)
parent57573ace0c1b142433dfe3d63ebf375269c80fc1 (diff)
Merge tag 'iio-for-6.13a-take2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next
Jonathan writes: IIO: 1st set of new device support, features and cleanup for 6.13 Changes in take2: - Additional patch to drop the accidentally added empty file. - Tidy up of a duplicate include. Two merges of other trees. 6.12-rc2: To pull in the move of unaligned.h from include/asm to include/linux This was to resolve issues in linux-next. pwm/duty_offset-for6.13-rc1@ PWM infrastructure that is use di the AD7625 ADC driver. New device support ================== adi,ad7173 - Add support for the AD4113 8 channel ADC. adi,ad7606 - Add support for the AD7606C-16 and AD7606C-18 which have higher precision and support bipolar and differential channels. A lot of driver rework was needed to add the additional flexibility needed to support these parts. adi,ad7625 - New driver supporting AD7625, AD7626, AD7960 and AD7961 LVDS connected ADCs. Interface uses a combination of a PWM control and an IIO backend (currently a custom FPGA IP). adi,ad8460 - New driver for the ad8460 Waveform DAC. This high speed device is driven by a custom IP via a DMAEngine buffer. bosch,bmi270 - New driver for this 6-axis IMU. A later patch adds SPI support. gehc,pmc-adc - New driver for this GE Healthcare ADC 16-channel 16 bit ADC. invensense,mpu6050 - Add support for IAM-20680HT and IAM-20680HP variants of the IAM-20680 IMU that have better specifications in various ways including larger FIFO sizes. vishay,vl6030 - Support the veml7700, a stripped down veml6030 ambient light sensor. - Support the veml6035 ambient light sensor. Features ======== liteon,ltr390 - Allow configuration of sampling frequency - Support suspend and resume - Add interrupt support including threshold events + control over event reporting persistence. st,vl53l0x - Add support for continuous mode via IIO buffer support and a dataready trigger. ti,tmp0006 - Add triggered buffer support using data ready interrupt. vishay,vl6030 - Add regulator control support. vishay,vl6070 - Add regulator control support. vishay,vl6180 - Allow configuration of waiting between continuous samples. - Use the interrupt, if available, for single shot captures - Support continuous mode via the IIO triggered buffer interfaces. Cleanups and minor fixes ======================== tools/event monitor - Free dev_dir_name. treewide - Introduce aligned_s64 type for timestamps to replace s64 __aligned(8). Initial use in a few drivers - many others to follow. - Use dev_get_platform_data() instead of open-coding the access. - InvenSense email address and maintainer updates to reflect move to the tdk domain after acquisition. - Switch platform drivers from remove_new() back to remove() now all rework this was enabling is done. - More use of device_for_each_child_node_scoped() to remove need for manual caling of fwnode_handle_put() in early exits from the loop. - Use IIO_MAP() macro to replace some open-coded versions. - Constify struct iio_map arrays. - Use irq_get_trigger_type(irq) rather than irqd_get_trigger_type(irq_get_irq_data(irq); core - unsigned to unsigned int. adi,ad3552r - Fix to low a limit on max SPI clock speed. No rush to upstream this one as the binding that uses the higher speed will merge via this tree once ready. adi,ad5770r - Use get_unaligned_le16() instead of open-coding. Note this caused a merge issue in linux-next as unaligned.h has moved. adi,ad7606 - Use read_avail() callback to handle the various _available attributes. - Wrap up all data related to channel scaling into a single structure as the use of this gets more complex for the -16 and -18 parts. adi,adf4371 - Use chip_info structures and spi_get_device_match_data() - Drop spi_set_drvdata() as unused. - Reduce scope of struct clock as only touched in probe(). - Use dev_err_probe() where appropriate. adi,axi-dac - Improve register naming to make field and register association clearer. - Fix a wrong register bit. amlogic,meson8-saradc - Allow the meson8-saradc to have the amlogic,hhi-sysctrl property. bosch,bmp280 - Use u8 for the DMA buffer to avoid implication of other types given it can contain be24 data. - Use unsigned types to store raw values to make it clear they cannot be negative. - Drop unnecessary check for errors after IIR filter update. - Support soft reset to get device to know state on driver load. - Use bulk reads to retrieve the humidity calibration data. dynaimage,al3010 - Make sure to powerdown device in error paths. invensense,icm42600 - Add missing i2c_device-id tables. kionix,kmx61 - Drop ACPI IDs that are not associated with valid ACPI vendor IDs and for which there is no evidence they are in use in real devices. liteon,ltrf261a - Document a bad compatible that we are supporting because it is in the wild in the Valve Steam Deck via ACPI PRP0001. maxim,max1363 - Use get_unaligned_be16() instead of open-coding. Note this caused a merge issue in linux-next as unaligned.h has moved. mediatek,mt6360 - Use get_unaligned_be16() instead of open-coding. Note this caused a merge issue in linux-next as unaligned.h has moved. microchip,pac1921 - Drop various unnecessary type casts that were suggested by Wconversion compiler warnings which we do not use in IIO. Remove them because they hurt readability in cases where it is clear not overflow can occur. rohm,rpr0521 - Use iio_poll_func_store_time() rather than open-coding a similar solution. semtech,sx9324 - Make sx_common_get_raw_register() local to the only code that uses it. - Drop unnecessary acpi.h include. st,vl53l0x - Check the part ID register and print an info message if it is not what is expected. vishay,veml6030 - Fix DT binding file name to include vishay - Use regmap_set_bits() for case where all bits are set. - Use dev_err_probe() where appropriate. - Add missing delay after powering up in resume path. - Drop a processed accessor for the white channel as there is no public information to allow a specific scale to be established. - Use read_avail() to replace explicit custom _available attributes. vishay,veml6070 - Use guard() to allow early returns. - Add a devm callback to unregister the i2c device. - Use devm_iio_device_register() to simplify removal code. Various other minor improvements not called out explicitly. * tag 'iio-for-6.13a-take2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (161 commits) iio: imu: bmi270: Remove duplicated include in bmi270_i2c.c iio: adc: ad7606: Drop spurious empty file. iio: light: rpr0521: Use generic iio_pollfunc_store_time() iio: light: vl6180: Add support for Continuous Mode iio: light: vl6180: Added Interrupt support for single shot access iio: light: vl6180: Add configurable inter-measurement period support MAINTAINERS: add entry for VEML6030 ambient light sensor driver iio: light: veml6030: add support for veml7700 dt-bindings: iio: light: veml6030: add veml7700 iio: light: veml6035: fix read_avail in no_irq case for veml6035 iio: dac: adi-axi-dac: update register names iio: dac: adi-axi-dac: fix wrong register bitfield docs: iio: new docs for ad7625 driver iio: adc: ad7625: add driver dt-bindings: iio: adc: add AD762x/AD796x ADCs iio: Convert unsigned to unsigned int iio: pressure: bmp280: Fix uninitialized variable iio: Switch back to struct platform_driver::remove() iio: imu: bmi323: remove redundant register definition iio: frequency: adf4371: make use of dev_err_probe() ...
Diffstat (limited to 'drivers/iio/frequency')
-rw-r--r--drivers/iio/frequency/ad9523.c2
-rw-r--r--drivers/iio/frequency/adf4350.c2
-rw-r--r--drivers/iio/frequency/adf4371.c63
3 files changed, 34 insertions, 33 deletions
diff --git a/drivers/iio/frequency/ad9523.c b/drivers/iio/frequency/ad9523.c
index b391c6e27ab0..b1554ced7a26 100644
--- a/drivers/iio/frequency/ad9523.c
+++ b/drivers/iio/frequency/ad9523.c
@@ -970,7 +970,7 @@ static int ad9523_setup(struct iio_dev *indio_dev)
static int ad9523_probe(struct spi_device *spi)
{
- struct ad9523_platform_data *pdata = spi->dev.platform_data;
+ struct ad9523_platform_data *pdata = dev_get_platdata(&spi->dev);
struct iio_dev *indio_dev;
struct ad9523_state *st;
int ret;
diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c
index e13e64a5164c..61828e61e275 100644
--- a/drivers/iio/frequency/adf4350.c
+++ b/drivers/iio/frequency/adf4350.c
@@ -603,7 +603,7 @@ static int adf4350_probe(struct spi_device *spi)
if (pdata == NULL)
return -EINVAL;
} else {
- pdata = spi->dev.platform_data;
+ pdata = dev_get_platdata(&spi->dev);
}
if (!pdata) {
diff --git a/drivers/iio/frequency/adf4371.c b/drivers/iio/frequency/adf4371.c
index b27088464826..d752507e0c98 100644
--- a/drivers/iio/frequency/adf4371.c
+++ b/drivers/iio/frequency/adf4371.c
@@ -4,6 +4,7 @@
*
* Copyright 2019 Analog Devices Inc.
*/
+#include "linux/dev_printk.h"
#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/device.h>
@@ -150,6 +151,7 @@ static const struct regmap_config adf4371_regmap_config = {
};
struct adf4371_chip_info {
+ const char *name;
unsigned int num_channels;
const struct iio_chan_spec *channels;
};
@@ -157,7 +159,6 @@ struct adf4371_chip_info {
struct adf4371_state {
struct spi_device *spi;
struct regmap *regmap;
- struct clk *clkin;
/*
* Lock for accessing device registers. Some operations require
* multiple consecutive R/W operations, during which the device
@@ -444,15 +445,16 @@ static const struct iio_chan_spec adf4371_chan[] = {
ADF4371_CHANNEL(ADF4371_CH_RF32),
};
-static const struct adf4371_chip_info adf4371_chip_info[] = {
- [ADF4371] = {
- .channels = adf4371_chan,
- .num_channels = 4,
- },
- [ADF4372] = {
- .channels = adf4371_chan,
- .num_channels = 3,
- }
+static const struct adf4371_chip_info adf4371_chip_info = {
+ .name = "adf4371",
+ .channels = adf4371_chan,
+ .num_channels = 4,
+};
+
+static const struct adf4371_chip_info adf4372_chip_info = {
+ .name = "adf4372",
+ .channels = adf4371_chan,
+ .num_channels = 3,
};
static int adf4371_reg_access(struct iio_dev *indio_dev,
@@ -542,10 +544,10 @@ static int adf4371_setup(struct adf4371_state *st)
static int adf4371_probe(struct spi_device *spi)
{
- const struct spi_device_id *id = spi_get_device_id(spi);
struct iio_dev *indio_dev;
struct adf4371_state *st;
struct regmap *regmap;
+ struct clk *clkin;
int ret;
indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
@@ -553,50 +555,49 @@ static int adf4371_probe(struct spi_device *spi)
return -ENOMEM;
regmap = devm_regmap_init_spi(spi, &adf4371_regmap_config);
- if (IS_ERR(regmap)) {
- dev_err(&spi->dev, "Error initializing spi regmap: %ld\n",
- PTR_ERR(regmap));
- return PTR_ERR(regmap);
- }
+ if (IS_ERR(regmap))
+ return dev_err_probe(&spi->dev, PTR_ERR(regmap),
+ "Error initializing spi regmap\n");
st = iio_priv(indio_dev);
- spi_set_drvdata(spi, indio_dev);
st->spi = spi;
st->regmap = regmap;
mutex_init(&st->lock);
- st->chip_info = &adf4371_chip_info[id->driver_data];
- indio_dev->name = id->name;
+ st->chip_info = spi_get_device_match_data(spi);
+ if (!st->chip_info)
+ return -ENODEV;
+
+ indio_dev->name = st->chip_info->name;
indio_dev->info = &adf4371_info;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->channels = st->chip_info->channels;
indio_dev->num_channels = st->chip_info->num_channels;
- st->clkin = devm_clk_get_enabled(&spi->dev, "clkin");
- if (IS_ERR(st->clkin))
- return PTR_ERR(st->clkin);
+ clkin = devm_clk_get_enabled(&spi->dev, "clkin");
+ if (IS_ERR(clkin))
+ return dev_err_probe(&spi->dev, PTR_ERR(clkin),
+ "Failed to get clkin\n");
- st->clkin_freq = clk_get_rate(st->clkin);
+ st->clkin_freq = clk_get_rate(clkin);
ret = adf4371_setup(st);
- if (ret < 0) {
- dev_err(&spi->dev, "ADF4371 setup failed\n");
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(&spi->dev, ret, "ADF4371 setup failed\n");
return devm_iio_device_register(&spi->dev, indio_dev);
}
static const struct spi_device_id adf4371_id_table[] = {
- { "adf4371", ADF4371 },
- { "adf4372", ADF4372 },
+ { "adf4371", (kernel_ulong_t)&adf4371_chip_info },
+ { "adf4372", (kernel_ulong_t)&adf4372_chip_info },
{}
};
MODULE_DEVICE_TABLE(spi, adf4371_id_table);
static const struct of_device_id adf4371_of_match[] = {
- { .compatible = "adi,adf4371" },
- { .compatible = "adi,adf4372" },
+ { .compatible = "adi,adf4371", .data = &adf4371_chip_info },
+ { .compatible = "adi,adf4372", .data = &adf4372_chip_info},
{ },
};
MODULE_DEVICE_TABLE(of, adf4371_of_match);