- 17 Oct, 2021 9 commits
-
-
Cai Huoqing authored
Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately Signed-off-by: Cai Huoqing <caihuoqing@baidu.com> Link: https://lore.kernel.org/r/20210908105638.1525-1-caihuoqing@baidu.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Daniel Palmer authored
When building kernels without ACPI support the table is declared but is not used because ACPI_PTR() turns it into a NULL. Add the __maybe_unused attribute to stop the compiler whining. Signed-off-by: Daniel Palmer <daniel@0x0f.com> Link: https://lore.kernel.org/r/20210919072616.3849723-1-daniel@0x0f.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Alexandru Ardelean authored
This is a simple conversion. Both iio_device_register() and iio_triggered_buffer_setup() functions have device-managed variants. Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210913120002.306280-1-aardelean@deviqon.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Alexandru Ardelean authored
There is nothing else that needs to be done for this driver. The remove hook calls only the iio_device_unregister() hook. So this driver can use devm_iio_device_register() directly. Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210913115308.301877-1-aardelean@deviqon.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Alexandru Ardelean authored
This change converts the probe of the AD5064 driver to use only device-managed functions. The regulator_bulk_disable() is passed on a devm_add_action_or_reset() hook and the devm_iio_device_register() can be used to register the IIO device. The driver has both I2C and SPI hooks inside, so all these can be removed. Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210913115237.301310-1-aardelean@deviqon.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Alexandru Ardelean authored
This change does a conversion of the driver to use device-managed init functions. The 2 regulators and the clock inits are converted to use devm_add_action_or_reset() callbacks for de-initializing them when the driver unloads. And finally the devm_iio_device_register() function can be use to register the device. The remove hook can finally be removed and the spi_set_drvdata() call can also be removed as the private data is no longer used. Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210913115209.300665-1-aardelean@deviqon.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Alexandru Ardelean authored
For this conversion, the regulators need to have some cleanup hooks registered with devm_add_action_or_reset() and then the devm_io_device_register() call can be used. Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210913115121.300082-1-aardelean@deviqon.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Daniel Palmer authored
When building kernels without ACPI support the table is declared but is not used because ACPI_PTR() turns it into a NULL. Add the __maybe_unused attribute to stop the compiler whining. Signed-off-by: Daniel Palmer <daniel@0x0f.com> Acked-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Link: https://lore.kernel.org/r/20210913112913.2148026-1-daniel@0x0f.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Cai Huoqing authored
Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately Signed-off-by: Cai Huoqing <caihuoqing@baidu.com> Link: https://lore.kernel.org/r/20210908105646.1576-1-caihuoqing@baidu.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
- 14 Sep, 2021 31 commits
-
-
Puranjay Mohan authored
Provide a way for continuous data capture by setting up buffer support. The data ready signal exposed at the DRDY pin of the ADXL355 is exploited as a hardware interrupt which triggers to fill the buffer. Signed-off-by: Puranjay Mohan <puranjay12@gmail.com> Link: https://lore.kernel.org/r/20210903184312.21009-3-puranjay12@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Puranjay Mohan authored
Replace if(ret < 0) with if(ret) for consistency. Signed-off-by: Puranjay Mohan <puranjay12@gmail.com> Link: https://lore.kernel.org/r/20210903184312.21009-2-puranjay12@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Lucas Stankus authored
ADXL313 is a small, thin, low power, 3-axis accelerometer with high resolution measurement up to +/-4g. It includes an integrated 32-level FIFO and has activity and inactivity sensing capabilities. Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ADXL313.pdfSigned-off-by: Lucas Stankus <lucas.p.stankus@gmail.com> Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/d16e2d1967e46bb2b1024b6d23bc4889da77dc6b.1630523106.git.lucas.p.stankus@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Lucas Stankus authored
Add device tree binding documentation for ADXL313 3-axis accelerometer. Signed-off-by: Lucas Stankus <lucas.p.stankus@gmail.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/2eff22d1d22f7e72efdabdc681d02e922682c434.1630523106.git.lucas.p.stankus@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Billy Tsai authored
This patch completes the declare of ADC register bitfields and uses the same prefix ASPEED_ADC_* for these bitfields. In addition, tidy up space alignment of the codes. Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com> Link: https://lore.kernel.org/r/20210831071458.2334-4-billy_tsai@aspeedtech.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Billy Tsai authored
Add device tree bindings document for the aspeed ast2600 adc device driver. Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210831071458.2334-3-billy_tsai@aspeedtech.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Alexandru Ardelean authored
This change converts the driver to register via devm_iio_device_register(). The regulator disable is moved on a devm_add_action_or_reset() hook. And the spi_set_drvdata() isn't required anymore. And finally, the ads8344_remove() can be removed as well. Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210903073707.46892-1-aardelean@deviqon.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Eugen Hristev authored
Update copyright and authors information (corrected e-mail address), and add myself as one of the authors. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Link: https://lore.kernel.org/r/20210901123013.329792-9-eugen.hristev@microchip.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Eugen Hristev authored
Add support to sama7g5 ADC which is similar with sama5d2/sam9x60 device. Differences are highlighted by compatible. Main differences include 16 channels instead of 12 and missing resistive touchscreen. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Link: https://lore.kernel.org/r/20210901123013.329792-8-eugen.hristev@microchip.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Eugen Hristev authored
Add helper for the COR register. This helper allows to modify the COR register, removes duplicate code and improves readability. The COR offset is now part of the register layout. This will allow different platform with a different offset to use the same helper. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Link: https://lore.kernel.org/r/20210901123013.329792-7-eugen.hristev@microchip.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Eugen Hristev authored
Some platforms have separated the end-of-conversion information from the usual ISR/IMR/IER/IDR registers, into EOC_ISR/EOC_IMR/EOC_IER/EOC_IDR. To cope with both variants, helpers are being added, that will make code more clear and more easy to read. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Link: https://lore.kernel.org/r/20210901123013.329792-6-eugen.hristev@microchip.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Eugen Hristev authored
Convert the driver to platform specific structures. This means: - create a register layout struct that will hold offsets for registers - create a platform struct that will hold platform information (number of channels, indexes for different channels and pointer to layout struct) - convert specific macros that are platform dependent into platform variables This step is in fact a no-op, but allows the driver to be more flexible and for future enhancement including adding new platforms that are partly compatible with the current driver and differ slightly in register layout or capabilities for example. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Link: https://lore.kernel.org/r/20210901123013.329792-5-eugen.hristev@microchip.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Eugen Hristev authored
Remove unused register definition Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Link: https://lore.kernel.org/r/20210901123013.329792-4-eugen.hristev@microchip.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Eugen Hristev authored
The hw_init hardware init call must happen after the clock is prepared and enabled. Otherwise, writing to the registers might lead to a block or external abort. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Link: https://lore.kernel.org/r/20210901123013.329792-3-eugen.hristev@microchip.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Eugen Hristev authored
Add compatible for microchip,sama7g5-adc device. Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Link: https://lore.kernel.org/r/20210901123013.329792-2-eugen.hristev@microchip.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Matt Ranostay authored
Add additional AK09116 to the magnetometer driver which has the same register mapping and scaling as the AK09112 device. Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com> Link: https://lore.kernel.org/r/20210825020738.35877-1-matt.ranostay@konsulko.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Navin Sankar Velliangiri authored
Add DT bindings for MAXIM max31865 RTD sensor. Signed-off-by: Navin Sankar Velliangiri <navin@linumiz.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210824050650.72619-1-navin@linumiz.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Navin Sankar Velliangiri authored
This patch adds support for Maxim MAX31865 RTD temperature sensor support. More information can be found in: https://datasheets.maximintegrated.com/en/ds/MAX31865.pdfSigned-off-by: Navin Sankar Velliangiri <navin@linumiz.com> Link: https://lore.kernel.org/r/20210824050123.71289-1-navin@linumiz.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Tang Bin authored
Use the defined variable "dev" to make the code cleaner. Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com> Link: https://lore.kernel.org/r/20210823095921.16828-1-tangbin@cmss.chinamobile.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Alexander Vorwerk authored
Remove braces from single line if blocks to clear checkpatch warnings. WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Alexander Vorwerk <alec@vc-celle.de> Link: https://lore.kernel.org/r/20210820224914.1260-1-alec@vc-celle.deSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Nuno Sá authored
If there are no channels defined in the devicetree, there's no point in probing the device. We were actually requesting a zero sized 'kmalloc' array but since we were not touching the ZERO_SIZE_PTR afterwards, nothing bad was actually happening. Hence this is not really a fix but rather an improvement. Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com> Signed-off-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20210825084149.11587-2-nuno.sa@analog.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Nuno Sá authored
Check if an optional reset gpio is present and if so, make sure to reset the device. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20210825084149.11587-1-nuno.sa@analog.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Nuno Sá authored
The bindings file for this driver is defining the property as 'reg' but the driver was reading it with the 'num' name. The bindings actually had the 'num' property when added in commit ea52c212 ("dt-bindings: iio: dac: Add docs for AD5770R DAC") and then changed it to 'reg' in commit 2cf3818f ("dt-bindings: iio: dac: AD5570R fix bindings errors"). However, both these commits landed in v5.7 so the assumption is that either 'num' is not being used or if it is, the validations were not done. Anyways, if someone comes back yelling about this, we might just support both of the properties in the future. Not ideal, but that's life... Fixes: 2cf3818f ("dt-bindings: iio: dac: AD5570R fix bindings errors") Signed-off-by: Nuno Sá <nuno.sa@analog.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210818080525.62790-1-nuno.sa@analog.com Cc: Stable@vger.kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Lukas Bulwahn authored
Commit b1fe0cf0 ("Input: delete MPU3050 driver") deletes the superseded MPU3050 driver and its corresponding config INPUT_MPU3050. The dependencies on the superseding driver in ./drivers/iio/gyro/Kconfig to ensure that the two drivers are not built into the same kernel is a dead dependency and not required anymore. So, remove those config dependencies on INPUT_MPU3050 for MPU3050_I2C. This issue was detected with ./scripts/checkkconfigsymbols.py. Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210817081330.9645-1-lukas.bulwahn@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Alexandru Ardelean authored
The idea behind it, is that all devm_ calls in ST sensors are bound to the parent device object. However, the reference to that object is kept on both the st_sensor_data struct and the IIO object parent (indio_dev->dev.parent). This change only adds a bit consistency and uses the reference stored on indio_dev->dev.parent, to enforce the assumption that all ST sensors' devm_ calls are bound to the same reference as the one store on st_sensor_data. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210823112204.243255-6-aardelean@deviqon.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Alexandru Ardelean authored
At this point all ST driver remove functions do iio_device_unregister(). This change removes them from them and replaces all iio_device_register() with devm_iio_device_register(). This can be done in a single change relatively easy, since all these remove functions are define in st_sensors.h. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210823112204.243255-5-aardelean@deviqon.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Alexandru Ardelean authored
This change converts the st_sensors_power_enable() function to use devm_add_action_or_reset() handlers to register regulator_disable hooks for when the drivers get unloaded. The parent device of the IIO device object is used. This is based on the assumption that all other devm_ calls in the ST sensors use this reference. This makes the st_sensors_power_disable() un-needed. Removing this also changes unload order a bit, as all ST drivers would call st_sensors_power_disable() first and iio_device_unregister() after that. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210823112204.243255-4-aardelean@deviqon.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Alexandru Ardelean authored
This change converts the st_sensors_allocate_trigger() to use device-managed functions. The parent device of the IIO device object is used. This is based on the assumption that all other devm_ calls in the ST sensors use this reference. That makes the st_sensors_deallocate_trigger() function un-needed, so it can be removed. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210823112204.243255-3-aardelean@deviqon.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Alexandru Ardelean authored
Up until commit ea7e586b ("iio: st_sensors: move regulator retrieveal to core") only the ST pressure driver seems to have had any regulator disable. After that commit, the regulator handling was moved into the common st_sensors logic. In all instances of this regulator handling, the regulators were disabled before unregistering the IIO device. This can cause issues where the device would be powered down and still be available to userspace, allowing it to send invalid/garbage data. This change moves the st_sensors_power_disable() after the common probe functions. These common probe functions also handle unregistering the IIO device. Fixes: 77448761 ("iio: pressure-core: st: Provide support for the Vdd power supply") Fixes: ea7e586b ("iio: st_sensors: move regulator retrieveal to core") Cc: Lee Jones <lee.jones@linaro.org> Cc: Denis CIOCCA <denis.ciocca@st.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210823112204.243255-2-aardelean@deviqon.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Liam Beguin authored
Switch to devm_iio_device_register to finalize devm migration. This removes the use for iio_device_unregister() and since mutex_destroy() is not necessary here, remove it altogether. Signed-off-by: Liam Beguin <lvb@xiphos.com> Link: https://lore.kernel.org/r/20210815213309.2847711-6-liambeguin@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Liam Beguin authored
Update bindings to describe support for buffered and unbuffered external voltage references selection, and add adi,internal-ref-microvolt for internal voltage reference selection. Signed-off-by: Liam Beguin <lvb@xiphos.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210815213309.2847711-5-liambeguin@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-