- 03 Jun, 2021 30 commits
-
-
Stephan Gerhold authored
According to the BMA253 datasheet [1] and BMA250 datasheet [2] BMA25x also supports a bandwidth of 500 Hz and 1000 Hz but this was not listed in the driver for some reason. Add it to the bw_table to make the driver match the datasheet. [1]: https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bma253-ds000.pdf [2]: https://datasheet.octopart.com/BMA250-Bosch-datasheet-15540103.pdf Cc: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210526094408.34298-3-stephan@gerhold.netSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jarkko Nikula authored
Add support for Intel Quadrature Encoder Peripheral found on Intel Elkhart Lake platform. Initial implementation was done by Felipe Balbi while he was working at Intel with later changes from Raymond Tan and me. Co-developed-by: Felipe Balbi (Intel) <balbi@kernel.org> Signed-off-by: Felipe Balbi (Intel) <balbi@kernel.org> Co-developed-by: Raymond Tan <raymond.tan@intel.com> Signed-off-by: Raymond Tan <raymond.tan@intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com> Link: https://lore.kernel.org/r/20210602113259.158674-1-jarkko.nikula@linux.intel.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Lucas Stankus authored
Refactor the capdac register write logic to own function. Also fixes the following checkpatch warning: CHECK: Alignment should match open parenthesis Signed-off-by: Lucas Stankus <lucas.p.stankus@gmail.com> Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com> Link: https://lore.kernel.org/r/b637a5ecde4e5f9f927a5b104332378d4721c91d.1621786036.git.lucas.p.stankus@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Lucas Stankus authored
Slight simplication of the probe return on device register. Signed-off-by: Lucas Stankus <lucas.p.stankus@gmail.com> Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com> Link: https://lore.kernel.org/r/45443b8306893576824effaff57d40231de8e813.1621786036.git.lucas.p.stankus@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Lucas Stankus authored
Remove ordinary comments about typical driver structure. Also align one comment with wrong indentation. Signed-off-by: Lucas Stankus <lucas.p.stankus@gmail.com> Link: https://lore.kernel.org/r/e93e5efb19cee53546a339c1caf1ab344e9ff282.1621786036.git.lucas.p.stankus@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jonathan Cameron authored
Simplifies error handling and allows us to drop remove entirely. The regulator handling in this driver was unusual as it would try to acquire the regulator, but if that failed with an error would continue. We should get a stub regulator if one isn't provided in DT and an error could indicate an actual problem preventing the device being powered (perhaps a need to defer). So this handling is cleaned up (arguably that might be a fix but given no one has run into it, I haven't broken it out separately. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Matt Ranostay <matt.ranostay@konsulko.com> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Reviewed-by: Alexandru Ardelean <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210516172520.1398835-9-jic23@kernel.org
-
Jonathan Cameron authored
Simplifies error handling and lets us drop remove() entirely. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Bogdan Pricop <bogdan.pricop@emutex.com> Reviewed-by: Alexandru Ardelean <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210516172520.1398835-8-jic23@kernel.org
-
Jonathan Cameron authored
Simplifies error handling, plus allows us to drop the remove() function entirely. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Akinobu Mita <akinobu.mita@gmail.com> Reviewed-by: Alexandru Ardelean <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210516172520.1398835-7-jic23@kernel.org
-
Jonathan Cameron authored
Simplifies error handling and allows us to drop remove() entirely. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210516172520.1398835-6-jic23@kernel.org
-
Jonathan Cameron authored
Changing from passing the spi structure into various functions to passing struct iio_dev avoids use of spi_get_drvdata and lets us stop setting that at all. Previous code was unnecessarily complex. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210516172520.1398835-5-jic23@kernel.org
-
Jonathan Cameron authored
This simplifies error handling and allows us to drop the remove function entirely. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Akinobu Mita <akinobu.mita@gmail.com> Reviewed-by: Alexandru Ardelean <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210516172520.1398835-4-jic23@kernel.org
-
Jonathan Cameron authored
By using devm_add_action_or_reset() to manage the regulator disable, it becomes simple to use managed functions for all of remove. This simplifies error handling and allows us to drop the remove() function entirely. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Alexandru Ardelean <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210516172520.1398835-3-jic23@kernel.org
-
Jonathan Cameron authored
The function is more explicit in showing the intent + quicker on some platforms. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Alexandru Ardelean <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210516172520.1398835-2-jic23@kernel.org
-
Jonathan Cameron authored
Since: commit cbacb5ab ("docs: printk-formats: Stop encouraging use of unnecessary %h[xudi] and %hh[xudi]") use of these format strings has been discouraged. As there are only a few such uses in IIO, lets clear them all out and avoid chance of them getting copied into new drivers. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Nathan Chancellor <nathan@kernel.org> Cc: Andreas Brauchli <andreas.brauchli@sensirion.com> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Link: https://lore.kernel.org/r/20210517125554.1463156-5-jic23@kernel.org
-
Linus Walleij authored
Add support to read and present the mounting matrix on ST gyroscopes. Cc: Denis Ciocca <denis.ciocca@st.com> Cc: Daniel Drake <drake@endlessm.com> Cc: Stephan Gerhold <stephan@gerhold.net> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210518230722.522446-5-linus.walleij@linaro.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Linus Walleij authored
Add support to read and present the mounting matrix on ST magnetometers. Cc: Denis Ciocca <denis.ciocca@st.com> Cc: Daniel Drake <drake@endlessm.com> Cc: Stephan Gerhold <stephan@gerhold.net> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210518230722.522446-4-linus.walleij@linaro.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Linus Walleij authored
The channels were copied only so that the .ext_info member should become assignable. We now have compile-time static assignment so drop this code. Cc: Hans de Goede <hdegoede@redhat.com> Cc: Denis Ciocca <denis.ciocca@st.com> Cc: Daniel Drake <drake@endlessm.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210518230722.522446-3-linus.walleij@linaro.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Linus Walleij authored
The ST accelerators support a special type of quirky mounting matrix found in ACPI systems, but not a generic mounting matrix such as from the device tree. Augment the ACPI hack to be a bit more generic and accept a mounting matrix from device properties. This makes it possible to fix orientation on the Ux500 HREF device. Cc: Hans de Goede <hdegoede@redhat.com> Cc: Denis Ciocca <denis.ciocca@st.com> Cc: Daniel Drake <drake@endlessm.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210518230722.522446-2-linus.walleij@linaro.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Linus Walleij authored
Extend ST_SENSORS_LSM_CHANNELS() to a version that will accept extended attributes named ST_SENSORS_LSM_CHANNELS_EXT() and wrap the former as a specialized version of the former. Cc: Hans de Goede <hdegoede@redhat.com> Cc: Denis Ciocca <denis.ciocca@st.com> Cc: Daniel Drake <drake@endlessm.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210518230722.522446-1-linus.walleij@linaro.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Nuno Sá authored
Use the adis lib lock helpers to lock the device. This makes things consistent with other users of the library. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20210520115909.466275-3-nuno.sa@analog.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Nuno Sá authored
Use the adis lib lock helpers to lock the device. This makes things consistent with other users of the library. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20210520115909.466275-2-nuno.sa@analog.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Lucas Stankus authored
Ditch platform_data fields in favor of device tree properties for configuring EXCA and EXCB output pins and setting the capacitive channel excitation level. As this covers all current use cases for the platform_data struct, remove ad7746.h header file since it's no longer needed. Signed-off-by: Lucas Stankus <lucas.p.stankus@gmail.com> Link: https://lore.kernel.org/r/3e7f2a0a8960cece185f518ff2b7ceb87891edcd.1619841953.git.lucas.p.stankus@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Lucas Stankus authored
Add device tree binding documentation for AD7746 cdc in YAML format. Signed-off-by: Lucas Stankus <lucas.p.stankus@gmail.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/2c2f4d486a94e0740e112bfac0d9306bdb7ea69c.1619841953.git.lucas.p.stankus@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Linus Walleij authored
It happens that an ADC will only provide raw or processed voltage conversion channels. (adc/ab8500-gpadc.c). On the Samsung GT-I9070 this is used for a light sensor and current sense amplifier so we need to think of something. The idea is to allow processed channels and scale them with 1/1 and then the rescaler can modify the result on top. Link: https://lore.kernel.org/linux-iio/20201101232211.1194304-1-linus.walleij@linaro.org/ Cc: Peter Rosin <peda@axentia.se> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Peter Rosin <peda@axentia.se> Link: https://lore.kernel.org/r/20210518092741.403080-1-linus.walleij@linaro.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Tang Bin authored
In the function ad7746_probe(), the initialized value of 'ret' is unused, because it will be assigned by the function i2c_smbus_write_byte_data(), thus remove it. Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20210518095647.3008-1-tangbin@cmss.chinamobile.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Andy Shevchenko authored
All of the users of iio_read_mount_matrix() are using the very same property name. Moreover, the property name is hard coded in the API documentation. Make this clear and avoid duplication now and in the future. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Sean Nyekjaer <sean@geanix.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210518112546.44592-1-andriy.shevchenko@linux.intel.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Nuno Sa authored
Some supported devices support burst read function. This provides a method for reading a batch of data (status, temperature, gyroscopes, accelerometers, time stamp/data counter, and CRC code), which does not require a stall time between each 16-bit segment and only requires one command on the DIN line to initiate. Devices supporting this mode are: * adis16495-1 * adis16495-2 * adis16495-3 * adis16497-1 * adis16497-2 * adis16497-3 Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20210422103735.136367-1-nuno.sa@analog.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jiapeng Chong authored
Variable in_loc is being assigned a value from a calculation however the assignment is never read, so this redundant assignment can be removed. Clean up the following clang-analyzer warning: drivers/iio/industrialio-buffer.c:929:3: warning: Value stored to 'in_loc' is never read [clang-analyzer-deadcode.DeadStores]. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Link: https://lore.kernel.org/r/1621246317-62725-1-git-send-email-jiapeng.chong@linux.alibaba.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jonathan Cameron authored
The call to pm_runtime_put_noidle() in remove() callback is not balanced by any gets Note this doesn't cause any problems beyond reader confusion as the runtime pm core protects against the reference counter going negative. Whilst here, use pm_runtiem_resume_and_get() to simplify code a little. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Link: https://lore.kernel.org/r/20210509113354.660190-9-jic23@kernel.org
-
Dan Carpenter authored
These variables are unsigned so the condition can't be less than zero and the warning message will never be printed. Fixes: 9374e8f5 ("iio: adc: add ADC driver for the TI TSC2046 controller") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/YJ+ZuO43TnguY5vq@mwandaSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
- 17 May, 2021 10 commits
-
-
Dan Carpenter authored
This return statement is indented one more tab than it should be. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/YJ523y0dhc1IwCOB@mwandaSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Dan Carpenter authored
These variables need to be int for the error handling to work. Fixes: 2335f0d7 ("iio: light: Added AMS tsl2591 driver implementation") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/YJ52r1XZ44myD9Xx@mwandaSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Tang Bin authored
In the function ad7766_probe(), the return value of devm_iio_device_register() can be zero or ret, Thus it is unnecessary to repeated check here. Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com> Co-developed-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com> Link: https://lore.kernel.org/r/20210511134739.948-1-tangbin@cmss.chinamobile.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Dan Carpenter authored
The devm_iio_device_alloc() function is supposed to return NULL and not error pointers. Returning an error pointer will lead to a crash in the callers. Fixes: cf5724e9 ("iio: core: simplify some devm functions") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com> Link: https://lore.kernel.org/r/YJ+a1yaMu2QNATgt@mwandaSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jonathan Cameron authored
Found using coccicheck script under review at: https://lore.kernel.org/lkml/20210427141946.2478411-1-Julia.Lawall@inria.fr/ This is a prequel to taking a closer look at the runtime pm in IIO drivers in general. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Link: https://lore.kernel.org/r/20210509113354.660190-20-jic23@kernel.org
-
Jonathan Cameron authored
Add __aligned(8) to ensure the buffer passed to iio_push_to_buffers_with_timestamp() is suitable for the naturally aligned timestamp that will be inserted. Here structure is not used, because this buffer is also used elsewhere in the driver. Fixes: 67e17300 ("iio: potentiostat: add LMP91000 support") Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Matt Ranostay <matt.ranostay@konsulko.com> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Link: https://lore.kernel.org/r/20210501171352.512953-8-jic23@kernel.org
-
Jonathan Cameron authored
The samples buffer is passed to iio_push_to_buffers_with_timestamp() which requires a buffer aligned to 8 bytes as it is assumed that the timestamp will be naturally aligned if present. Fixes tag is inaccurate but prior to that likely manual backporting needed (for anything before 4.18) Earlier than that the include file to fix is drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.h: commit 974e6f02 ("iio: cros_ec_sensors_core: Add common functions for the ChromeOS EC Sensor Hub.") present since kernel stable 4.10. (Thanks to Gwendal for tracking this down) Fixes: 5a0b8cb4 ("iio: cros_ec: Move cros_ec_sensors_core.h in /include") Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Gwendal Grignou <gwendal@chromium.org Link: https://lore.kernel.org/r/20210501171352.512953-7-jic23@kernel.org
-
Jonathan Cameron authored
Variable location for the timestamp, so just use __aligned(8) to ensure it is always possible to naturally align it. Found during an audit of all calls of uses of iio_push_to_buffers_with_timestamp() Fixes tag is not accurate, but it will need manual backporting beyond that point if anyone cares. Fixes: 0d15190f ("iio: chemical: atlas-ph-sensor: rename atlas-ph-sensor to atlas-sensor") Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Matt Ranostay <matt.ranostay@konsulko.com> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Link: https://lore.kernel.org/r/20210501171352.512953-6-jic23@kernel.org
-
Jonathan Cameron authored
To make code more readable, use a structure to express the channel layout and ensure the timestamp is 8 byte aligned. Found during an audit of all calls of uses of iio_push_to_buffers_with_timestamp(). Fixes tag is not strictly accurate as prior to that patch there was potentially an unaligned write. However, any backport past there will need to be done manually. Fixes: 0624bf84 ("iio:tcs3472: Use iio_push_to_buffers_with_timestamp()") Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210501170121.512209-20-jic23@kernel.org
-
Jonathan Cameron authored
To make code more readable, use a structure to express the channel layout and ensure the timestamp is 8 byte aligned. Found during an audit of all calls of uses of iio_push_to_buffers_with_timestamp() Fixes: a244e7b5 ("iio: Add driver for AMS/TAOS tcs3414 digital color sensor") Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210501170121.512209-19-jic23@kernel.org
-