summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* iio: dac: ad3552r: extract common code (no changes in behavior intended)Angelo Dureghello2024-11-014-372/+501
| | | | | | | | | | Extracting common code, to share common code to be used later by the AXI driver version (ad3552r-axi.c). Signed-off-by: Angelo Dureghello <adureghello@baylibre.com> Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20241028-wip-bl-ad3552r-axi-v0-iio-testing-v9-6-f6960b4f9719@kernel-space.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: ad3552r: changes to use FIELD_PREPAngelo Dureghello2024-11-011-117/+50
| | | | | | | | | | | Changes to use FIELD_PREP, so that driver-specific ad3552r_field_prep is removed. Variables (arrays) that was used to call ad3552r_field_prep are removed too. Signed-off-by: Angelo Dureghello <adureghello@baylibre.com> Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20241028-wip-bl-ad3552r-axi-v0-iio-testing-v9-5-f6960b4f9719@kernel-space.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: adi-axi-dac: extend featuresAngelo Dureghello2024-11-011-14/+242
| | | | | | | | | | | | | | | | | Extend AXI-DAC backend with new features required to interface to the ad3552r DAC. Mainly, a new compatible string is added to support the ad3552r-axi DAC IP, very similar to the generic DAC IP but with some customizations to work with the ad3552r. Then, a series of generic functions has been added to match with ad3552r needs. Function names has been kept generic as much as possible, to allow re-utilization from other frontend drivers. Signed-off-by: Angelo Dureghello <adureghello@baylibre.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20241028-wip-bl-ad3552r-axi-v0-iio-testing-v9-4-f6960b4f9719@kernel-space.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: backend: extend featuresAngelo Dureghello2024-11-011-0/+78
| | | | | | | | | | | | | | | | | | | | | | | | | Extend backend features with new calls needed later on this patchset from axi version of ad3552r. The follwoing calls are added: iio_backend_ddr_enable() enable ddr bus transfer iio_backend_ddr_disable() disable ddr bus transfer iio_backend_data_stream_enable() enable data stream over bus interface iio_backend_data_stream_disable() disable data stream over bus interface iio_backend_data_transfer_addr() define the target register address where the DAC sample will be written. Reviewed-by: Nuno Sa <nuno.sa@analog.com> Signed-off-by: Angelo Dureghello <adureghello@baylibre.com> Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20241028-wip-bl-ad3552r-axi-v0-iio-testing-v9-3-f6960b4f9719@kernel-space.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: chemical: bme680: use s16 variable for temp value to avoid castingVasileios Amoiridis2024-11-011-2/+3
| | | | | | | | | | Use local s16 variable for the temperature channel to avoid casting it later before passing it to the bme680_read_temp() function. This way, possible endianness and initialization issues are avoided. Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com> Link: https://patch.msgid.link/20241030235424.214935-2-vassilisamir@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: adc: pac1921: Check for error code from devm_mutex_init() callAndy Shevchenko2024-11-011-1/+3
| | | | | | | | | | | | | Even if it's not critical, the avoidance of checking the error code from devm_mutex_init() call today diminishes the point of using devm variant of it. Tomorrow it may even leak something. Add the missed check. Fixes: 371f778b83cd ("iio: adc: add support for pac1921") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Matteo Martelli <matteomartelli3@gmail.com> Link: https://patch.msgid.link/20241030162013.2100253-3-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: adc: ad4000: Check for error code from devm_mutex_init() callAndy Shevchenko2024-11-011-1/+3
| | | | | | | | | | | | Even if it's not critical, the avoidance of checking the error code from devm_mutex_init() call today diminishes the point of using devm variant of it. Tomorrow it may even leak something. Add the missed check. Fixes: 938fd562b974 ("iio: adc: Add support for AD4000") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20241030162013.2100253-2-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: imu: bmi270: Add support for BMI260Justin Weiss2024-11-014-1/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds support for the Bosch BMI260 6-axis IMU to the Bosch BMI270 driver. Setup and operation is nearly identical to the Bosch BMI270, but has a different chip ID and requires different firmware. Firmware is requested and loaded from userspace. Adds ACPI ID BMI0160, used by several devices including the GPD Win Mini, Aya Neo AIR Pro, and OXP Mini Pro. GPD Win Mini: Device (BMI2) { Name (_ADR, Zero) // _ADR: Address Name (_HID, "BMI0160") // _HID: Hardware ID Name (_CID, "BMI0160") // _CID: Compatible ID Name (_DDN, "Accelerometer") // _DDN: DOS Device Name Name (_UID, One) // _UID: Unique ID Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings { Name (RBUF, ResourceTemplate () { I2cSerialBusV2 (0x0068, ControllerInitiated, 0x00061A80, AddressingMode7Bit, "\\_SB.I2CB", 0x00, ResourceConsumer, , Exclusive, ) GpioInt (Edge, ActiveLow, Exclusive, PullDefault, 0x0000, "\\_SB.GPIO", 0x00, ResourceConsumer, , ) { // Pin list 0x008B } }) Return (RBUF) /* \_SB_.I2CB.BMI2._CRS.RBUF */ } ... } Signed-off-by: Justin Weiss <justin@justinweiss.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20241027172029.160134-5-justin@justinweiss.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: imu: bmi270: Add scale and sampling frequency to BMI270 IMUJustin Weiss2024-11-011-0/+339
| | | | | | | | Add read and write functions and create _available entries. Signed-off-by: Justin Weiss <justin@justinweiss.com> Link: https://patch.msgid.link/20241027172029.160134-3-justin@justinweiss.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: imu: bmi270: Add triggered buffer for Bosch BMI270 IMUJustin Weiss2024-11-013-0/+66
| | | | | | | | Set up a triggered buffer for the accel and angl_vel values. Signed-off-by: Justin Weiss <justin@justinweiss.com> Link: https://patch.msgid.link/20241027172029.160134-2-justin@justinweiss.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: chemical: bme680: generalize read_*() functionsVasileios Amoiridis2024-11-011-28/+40
| | | | | | | | | | Remove the IIO specific scaling measurement units from the read functions and add them inside the ->read_raw() function to keep the read_*() generic. This way they can be used in other parts of the driver. Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com> Link: https://patch.msgid.link/20241021195316.58911-8-vassilisamir@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: chemical: bme680: Fix indentation and unnecessary spacesVasileios Amoiridis2024-11-011-12/+9
| | | | | | | | | | Fix indentation issues, line breaking and unnecessary spaces reported by checkpatch.pl. Reduce type casts by defining constants to be LL. Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com> Link: https://patch.msgid.link/20241021195316.58911-7-vassilisamir@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: chemical: bme680: move to fsleep()Vasileios Amoiridis2024-11-011-2/+2
| | | | | | | | Use the new fsleep() function in the remaining driver instances. Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com> Link: https://patch.msgid.link/20241021195316.58911-6-vassilisamir@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: chemical: bme680: avoid using camel caseVasileios Amoiridis2024-11-011-7/+7
| | | | | | | | | | Rename camel case variable, as checkpatch.pl complains. While at it, fix also the indentation of the array for readability. Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com> Link: https://patch.msgid.link/20241021195316.58911-4-vassilisamir@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: chemical: bme680: optimize startup timeVasileios Amoiridis2024-11-011-1/+2
| | | | | | | | | According to datasheet's Section 1.1, Table 1, the startup time for the device is 2ms and not 5ms. Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com> Link: https://patch.msgid.link/20241021195316.58911-3-vassilisamir@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: chemical: bme680: Add missing regmap.h includeVasileios Amoiridis2024-11-011-0/+2
| | | | | | | | | Add the linux/regmap.h header since the struct regmap_config is used in this file. Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com> Link: https://patch.msgid.link/20241021195316.58911-2-vassilisamir@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: light: add support for veml3235Javier Carrasco2024-11-013-0/+507
| | | | | | | | | | | The Vishay veml3235 is a low-power ambient light sensor with I2C interface. It provides a minimum detectable intensity of 0.0021 lx/cnt, configurable integration time and gain, and an additional white channel to distinguish between different light sources. Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com> Link: https://patch.msgid.link/20241023-veml3235-v3-2-8490f2622f9a@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: ad5770r: use devm_regulator_get_enable_read_voltage()David Lechner2024-11-011-36/+5
| | | | | | | | Simplify the code by using devm_regulator_get_enable_read_voltage(). Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20241023-iio-regulator-refactor-round-5-v1-11-d0bd396b3f50@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: ad5761: drop driver remove callbackDavid Lechner2024-11-011-10/+1
| | | | | | | | | | | Drop use of the driver remove callback in the ad5761 driver. By making use of a a devm_ helper, we can avoid the need for the remove callback entirely. Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20241023-iio-regulator-refactor-round-5-v1-10-d0bd396b3f50@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: ad5761: use devm_regulator_get_enable_read_voltage()David Lechner2024-11-011-77/+23
| | | | | | | | | | Simplify the code by using devm_regulator_get_enable_read_voltage(). Error returns are updated to use dev_err_probe(). Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20241023-iio-regulator-refactor-round-5-v1-9-d0bd396b3f50@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: ad5624r: drop driver remove callbackDavid Lechner2024-11-011-10/+1
| | | | | | | | | | | Drop use of the driver remove callback in the ad5624r_spi driver. By making use of a a devm_ helper, we can avoid the need for the remove callback entirely. Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20241023-iio-regulator-refactor-round-5-v1-8-d0bd396b3f50@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: ad5624r: use devm_regulator_get_enable_read_voltage()David Lechner2024-11-012-50/+13
| | | | | | | | Simplify the code by using devm_regulator_get_enable_read_voltage(). Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20241023-iio-regulator-refactor-round-5-v1-7-d0bd396b3f50@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: ad5504: drop driver remove callbackDavid Lechner2024-11-011-10/+1
| | | | | | | | | | | Drop use of the driver remove callback in the ad5504 driver. By making use of a a devm_ helper, we can avoid the need for the remove callback entirely. Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20241023-iio-regulator-refactor-round-5-v1-6-d0bd396b3f50@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: ad5504: use devm_regulator_get_enable_read_voltage()David Lechner2024-11-011-37/+15
| | | | | | | | Simplify the code by using devm_regulator_get_enable_read_voltage(). Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20241023-iio-regulator-refactor-round-5-v1-5-d0bd396b3f50@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: ad5446: drop driver remove callbacksDavid Lechner2024-11-011-21/+1
| | | | | | | | | | | Drop use of the driver remove callbacks in the ad5446 driver. By making use of a a devm_ helper, we can avoid the need for the remove callbacks entirely. Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20241023-iio-regulator-refactor-round-5-v1-4-d0bd396b3f50@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: ad5446: use devm_regulator_get_enable_read_voltage()David Lechner2024-11-011-41/+16
| | | | | | | | | | Simplify the code by using devm_regulator_get_enable_read_voltage(). Also simplify == NULL check while we are touching that line. Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20241023-iio-regulator-refactor-round-5-v1-3-d0bd396b3f50@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: ad5380: drop driver remove callbacksDavid Lechner2024-11-011-48/+13
| | | | | | | | | | | | | Drop use of the driver remove callbacks in the ad5380 driver. By making use of a few more devm_ helpers, we can avoid the need for remove callbacks entirely. Also make use of dev_err_probe() while at it. Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20241023-iio-regulator-refactor-round-5-v1-2-d0bd396b3f50@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: ad5380: use devm_regulator_get_enable_read_voltage()David Lechner2024-11-011-26/+10
| | | | | | | | Simplify the code by using devm_regulator_get_enable_read_voltage(). Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20241023-iio-regulator-refactor-round-5-v1-1-d0bd396b3f50@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: gyro: bmg160_core: remove trailing tabJulien Stephan2024-11-011-1/+1
| | | | | | | | Remove trailing tab Signed-off-by: Julien Stephan <jstephan@baylibre.com> Link: https://patch.msgid.link/20241023-iio-gyro-bmg160_core-remove-trailing-tab-v1-1-9343c7dc4110@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: light: stk3310: simplify code in write_event_config callbackJulien Stephan2024-11-011-3/+0
| | | | | | | | | | | | iio_ev_state_store is actually using kstrtobool to check user input, then gives the converted boolean value to the write_event_config callback. Remove useless code in write_event_config callback. Signed-off-by: Julien Stephan <jstephan@baylibre.com> Link: https://patch.msgid.link/20241024-iio-fix-write-event-config-signature-v1-6-7d29e5a31b00@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: imu: inv_mpu6050: simplify code in write_event_config callbackJulien Stephan2024-11-012-7/+2
| | | | | | | | | | | | | iio_ev_state_store is actually using kstrtobool to check user input, then gives the converted boolean value to the write_event_config callback. Remove useless code in write_event_config callback. Signed-off-by: Julien Stephan <jstephan@baylibre.com> Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com> Link: https://patch.msgid.link/20241024-iio-fix-write-event-config-signature-v1-5-7d29e5a31b00@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: light: veml6030: simplify code in write_event_config callbackJulien Stephan2024-11-011-3/+0
| | | | | | | | | | | | iio_ev_state_store is actually using kstrtobool to check user input, then gives the converted boolean value to the write_event_config callback. Remove useless code in write_event_config callback. Signed-off-by: Julien Stephan <jstephan@baylibre.com> Link: https://patch.msgid.link/20241024-iio-fix-write-event-config-signature-v1-4-7d29e5a31b00@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: light: ltr501: simplify code in write_event_config callbackJulien Stephan2024-11-011-4/+0
| | | | | | | | | | | | iio_ev_state_store is actually using kstrtobool to check user input, then gives the converted boolean value to the write_event_config callback. Remove useless code in write_event_config callback. Signed-off-by: Julien Stephan <jstephan@baylibre.com> Link: https://patch.msgid.link/20241024-iio-fix-write-event-config-signature-v1-3-7d29e5a31b00@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: light: bh1745: simplify code in write_event_config callbackJulien Stephan2024-11-011-26/+22
| | | | | | | | | | | | iio_ev_state_store is actually using kstrtobool to check user input, then gives the converted boolean value to the write_event_config callback. Remove useless code in write_event_config callback. Signed-off-by: Julien Stephan <jstephan@baylibre.com> Link: https://patch.msgid.link/20241024-iio-fix-write-event-config-signature-v1-1-7d29e5a31b00@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: light: ltr501: Replace a variant of iio_get_acpi_device_name_and_data()Andy Shevchenko2024-11-011-17/+8
| | | | | | | | | | IIO core (ACPI part) provides a generic helper that may be used in the driver. Replace a variant of iio_get_acpi_device_name_and_data(). Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20241024191200.229894-25-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: light: ltr501: Add LTER0303 to the supported devicesAndy Shevchenko2024-11-011-0/+2
| | | | | | | | | | | | | | It has been found that the (non-vendor issued) ACPI ID for Lite-On LTR303 is present in Microsoft catalog. Add it to the list of the supported devices. Link: https://www.catalog.update.microsoft.com/Search.aspx?q=lter0303 Closes: https://lore.kernel.org/r/9cdda3e0-d56e-466f-911f-96ffd6f602c8@redhat.com Reported-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20241024191200.229894-24-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: light: ltr501: Drop most likely fake ACPI IDsAndy Shevchenko2024-11-011-2/+0
| | | | | | | | | | | | | | | | | | The commits in question do not proove that ACPI IDs exist. Quite likely it was a cargo cult addition while doing that for DT-based enumeration. Drop most likely fake ACPI IDs. The to be removed IDs has been checked against the following resources: 1) DuckDuckGo 2) Google 3) MS catalog: https://www.catalog.update.microsoft.com/Search.aspx This gives no useful results in regard to DSDT, moreover, the official vendor ID in the registry for Lite-On is LCI. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20241024191200.229894-23-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: light: isl29018: drop ACPI_PTR() and CONFIG_ACPI guardsAndy Shevchenko2024-11-011-7/+6
| | | | | | | | | | | | | The complexity of config guards needed for ACPI_PTR() is not worthwhile for the small amount of saved data. This example was doing it correctly but I am proposing dropping this so as to reduce chance of cut and paste where it is done wrong. Also drop now unneeded linux/acpi.h include and added linux/mod_devicetable.h for struct acpi_device_id definition. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20241024191200.229894-22-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: light: isl29018: Replace a variant of iio_get_acpi_device_name_and_data()Andy Shevchenko2024-11-011-19/+6
| | | | | | | | | | IIO core (ACPI part) provides a generic helper that may be used in the driver. Replace a variant of iio_get_acpi_device_name_and_data(). Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20241024191200.229894-21-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: gyro: bmg160: Replace custom implementation of iio_get_acpi_device_name()Andy Shevchenko2024-11-012-16/+3
| | | | | | | | | | IIO core (ACPI part) provides a generic helper that may be used in the driver. Replace custom implementation of iio_get_acpi_device_name(). Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20241024191200.229894-20-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: accel: mma9553: Replace custom implementation of iio_get_acpi_device_name()Andy Shevchenko2024-11-011-15/+4
| | | | | | | | | | IIO core (ACPI part) provides a generic helper that may be used in the driver. Replace custom implementation of iio_get_acpi_device_name(). Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20241024191200.229894-19-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: accel: mma9551: Replace custom implementation of iio_get_acpi_device_name()Andy Shevchenko2024-11-011-15/+4
| | | | | | | | | | IIO core (ACPI part) provides a generic helper that may be used in the driver. Replace custom implementation of iio_get_acpi_device_name(). Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20241024191200.229894-18-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: accel: kxcjk-1013: drop ACPI_PTR() and move ID out of CONFIG_ACPI guardsAndy Shevchenko2024-11-011-19/+21
| | | | | | | | | | | | The complexity of config guards needed for ACPI_PTR() is not worthwhile for the small amount of saved data. This example was doing it correctly but I am proposing dropping this so as to reduce chance of cut and paste where it is done wrong. Also added linux/mod_devicetable.h for struct acpi_device_id definition. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20241024191200.229894-17-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: accel: kxcjk-1013: Replace a variant of iio_get_acpi_device_name_and_data()Andy Shevchenko2024-11-011-27/+10
| | | | | | | | | IIO core (ACPI part) provides a generic helper that may be used in the driver. Replace a variant of iio_get_acpi_device_name_and_data(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20241024191200.229894-16-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: accel: kxcjk-1013: Get rid of enum kx_chipsetAndy Shevchenko2024-10-281-23/+5
| | | | | | | | | | Instead of using enum, out of which only a couple of values are being actually used, make a comparisons against pointer to the respective chip_info structures. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20241024191200.229894-15-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: accel: kxcjk-1013: Convert ODR times array to variable in chip_infoAndy Shevchenko2024-10-281-77/+94
| | | | | | | | | Convert odr_start_up_times array to the variable in chip_info. Tweak whitespace for readablity whilst here. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20241024191200.229894-14-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: accel: kxcjk-1013: Move odr_start_up_times up in the codeAndy Shevchenko2024-10-281-77/+77
| | | | | | | | | | | | Move odr_start_up_times up in the code in a preparation of the further cleaning up changes. While at it, make it clear what values from enum are being used for the respective array entries. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20241024191200.229894-13-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: accel: kxcjk-1013: Start using chip_info variables instead of enumAndy Shevchenko2024-10-281-73/+100
| | | | | | | | | Instead of having a enum and keeping IDs as driver data pointers, just have a chip_info struct per supported device. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20241024191200.229894-12-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: accel: kxcjk-1013: Rename kxcjk1013_infoAndy Shevchenko2024-10-281-2/+2
| | | | | | | | | Rename kxcjk1013_info to kxcjk1013_iio_info in preparatory of further cleaning up changes. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20241024191200.229894-11-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: accel: kxcjk-1013: Use local variable for regsAndy Shevchenko2024-10-281-28/+37
| | | | | | | | Use local variable for regs in preparatory of further cleaning up changes. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20241024191200.229894-10-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>