- 19 Oct, 2021 38 commits
-
-
Lorenzo Bianconi authored
Move max_fifo_size in st_lsm6dsx_fifo_ops in order to have all FIFO configuration parameters in st_lsm6dsx_fifo_ops structure. This patch does not introduce any logic change, just small code rearrangement. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/3262ad9d9d1497e19ea1bab208c495c2b9a98994.1632664866.git.lorenzo@kernel.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Miquel Raynal authored
External triggers do not necessarily need the EOC interrupt to be populated to work properly. The end of conversion status may either come from an interrupt or from a sufficient enough extra delay. IRQs are not mandatory so move the triggered buffer setup out of the IRQ condition and add the logic to wait enough time for all the requested conversions to be in the device's FIFO. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20210921115408.66711-17-miquel.raynal@bootlin.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Miquel Raynal authored
There is no reason to limit this driver to its internal trigger. The only difference being, when using an external trigger, the sample conversion must be manually started. Drop the ->validate_trigger() hook in order to allow other triggers to be bound. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20210921115408.66711-16-miquel.raynal@bootlin.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Miquel Raynal authored
So far the End-Of-Conversion interrupt was only used in conjunction with the internal trigger to process the data. Let's extend the use of this interrupt handler to support regular single-shot conversions as well. Doing so requires writing our own hard IRQ handler. This handler has to check if buffers are enabled or not: *** Buffers disabled condition *** This means the user requested a single conversion and the sample is ready to be retrieved. -> This implies adding the relevant completion boilerplate. *** Buffers enabled condition *** Triggers are used. So far there is only support for the internal trigger but this trigger might soon be attached to another device as well so it is the core duty to decide which handler to call in order to process the data. The core will decide to either: * Call the internal trigger handler which will extract the data that is already present in the ADC FIFOs or * Call the trigger handler of another driver when using this trigger with another device, even though this call will be slightly delayed by the fact that the max1027 IRQ is a data-ready interrupt rather than a real trigger: -> The new handler will manually inform the core about the trigger having transitioned by directly calling iio_trigger_poll() (which iio_trigger_generic_data_rdy_poll() initially did). In order for the handler to be "source" agnostic, we also need to change the private pointer and provide the IIO device instead of the trigger object. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20210921115408.66711-15-miquel.raynal@bootlin.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Miquel Raynal authored
The threaded handler is not populated, this means there is nothing running in process context so let's switch to the regular devm_request_irq() call instead. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20210921115408.66711-14-miquel.raynal@bootlin.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Miquel Raynal authored
For now this helper only waits for the maximum duration of a single conversion. In practice, a "temperature measurement" will take twice this time because it will also carry another analog conversion but as here we will only care about the temperature conversion which happens first, we can still only wait for a single sample and get the right data. This helper will soon be improved to properly handle the end of conversion interrupt as well as a higher number of samples. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20210921115408.66711-13-miquel.raynal@bootlin.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Miquel Raynal authored
Create a max1027_read_scan() helper which will make clearer the future IRQ handler updates (no functional change). Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20210921115408.66711-12-miquel.raynal@bootlin.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Miquel Raynal authored
When hardware buffers are enabled (the cnvst pin being the trigger), one should not mess with the device state by requesting a single channel read. There is already a iio_buffer_enabled() check in *_read_single_value() to merely prevent this situation but the check is inconsistent since buffers can be enabled after the if clause anyway. Instead, use the core mutex by calling iio_device_claim/release_direct_mode(). Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20210921115408.66711-11-miquel.raynal@bootlin.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Miquel Raynal authored
These bits are meant to be reused for triggered buffers setup. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20210921115408.66711-10-miquel.raynal@bootlin.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Miquel Raynal authored
We don't expect the (hardware) cnvst trigger to be enabled at boot time, this is a user choice made in sysfs and there is a dedicated callback to enable/disable this trigger. Hence, we can just ensure it is disabled in the probe at initialization time and then assume that whenever a ->read_raw() call happens, the trigger has been disabled and conversions will start on register write. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20210921115408.66711-9-miquel.raynal@bootlin.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Miquel Raynal authored
The call to max1027_enable_trigger() is the same in both cases thanks to the 'state' variable, so factorize a little bit to simplify the code and explain why we call this helper. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20210921115408.66711-8-miquel.raynal@bootlin.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Miquel Raynal authored
There are two ways to physically trigger a conversion: - A falling edge on the cnvst pin - A write operation on the conversion register Let's create a helper for this. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20210921115408.66711-7-miquel.raynal@bootlin.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Miquel Raynal authored
Make it clear that the *_set_trigger_state() hook is responsible for cnvst based conversions by renaming the helper. This may avoid confusions with software trigger support that is going to be introduced. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20210921115408.66711-6-miquel.raynal@bootlin.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Miquel Raynal authored
Provide a list of ->available_scan_masks which match the device's capabilities. Basically, these devices are able to scan from 0 to N, N being the highest voltage channel requested by the user. The temperature can be included or not, but cannot be retrieved alone. The consequence is, instead of reading and pushing to the IIO buffers all channels each time, the "minimum" number of channels will be scanned and pushed based on the ->active_scan_mask. For example, if the user wants channels 1, 4 and 5, all channels from 0 to 5 will be scanned and pushed to the IIO buffers. The core will then filter out the unneeded samples based on the ->active_scan_mask that has been selected and only channels 1, 4 and 5 will be available to the user in the shared buffer. Provide a comment in the code explaining this logic. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20210921115408.66711-5-miquel.raynal@bootlin.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Miquel Raynal authored
These two debug messages bring absolutely no value, let's drop them. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20210921115408.66711-4-miquel.raynal@bootlin.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Miquel Raynal authored
Memory allocation errors automatically trigger the right logs, no need to have our own. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20210921115408.66711-3-miquel.raynal@bootlin.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Miquel Raynal authored
Follow checkpatch.pl's main advices before hacking into the driver, mainly: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' WARNING: Prefer 'unsigned int *' to bare use of 'unsigned *' CHECK: Comparison to NULL could be written "!foo" CHECK: Alignment should match open parenthesis Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20210921115408.66711-2-miquel.raynal@bootlin.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Cai Huoqing authored
The NXP i.MX 8QuadXPlus SOC has a new ADC IP. After adding the driver support for it, I add the driver info of the NXP IMX8QXP ADC to MAINTAINERS file. Signed-off-by: Cai Huoqing <caihuoqing@baidu.com> Link: https://lore.kernel.org/r/20210925020555.129-4-caihuoqing@baidu.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Cai Huoqing authored
The NXP i.MX 8QuadXPlus SOC a new ADC IP, so add binding documentation for NXP IMX8QXP ADC. Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com> Link: https://lore.kernel.org/r/20210925020555.129-3-caihuoqing@baidu.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Cai Huoqing authored
The NXP i.MX 8QuadXPlus SOC has a new ADC IP, so add driver support for this ADC. Signed-off-by: Cai Huoqing <caihuoqing@baidu.com> Reviewed-by: Fabio Estevam <festevam@gmail.com> Link: https://lore.kernel.org/r/20210925020555.129-2-caihuoqing@baidu.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Sean Nyekjaer authored
This adds ways for the SoC to wake from accelerometer wake events. In the suspend function we skip disabling the sensor if wakeup-source and events are activated. If buffered reads are enabled they will be deactivated before suspend. As the onboard buffer is only holding up to 32 12-bit X/Y/Z data triplets. Signed-off-by: Sean Nyekjaer <sean@geanix.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210920114221.1595543-2-sean@geanix.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Sean Nyekjaer authored
Add event channels that control the creation of motion events. Signed-off-by: Sean Nyekjaer <sean@geanix.com> Link: https://lore.kernel.org/r/20210920114221.1595543-1-sean@geanix.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Billy Tsai authored
The ADC controller has a trimming register for fine-tune the reference voltage. The trimming value comes from the OTP register which will be written during chip production. This patch will read this OTP value and configure it to the ADC register when the ADC controller probes and using dts property "aspeed,trim-data-valid" to determine whether to execute this flow. Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com> Link: https://lore.kernel.org/r/20210922081520.30580-12-billy_tsai@aspeedtech.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Billy Tsai authored
In ast2600, ADC integrate dividing circuit at last input channel for battery sensing. This patch use the dts property "battery-sensing" to enable this feature makes the last channel of each adc can tolerance higher voltage than reference voltage. The offset interface of ch7 will be separated when enabling the battery sensing mode. Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com> Link: https://lore.kernel.org/r/20210922081520.30580-11-billy_tsai@aspeedtech.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Billy Tsai authored
This patch adds a compensation phase to improve the accuracy of ADC measurement. This is the built-in function through input half of the reference voltage to get the ADC offset. Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com> Link: https://lore.kernel.org/r/20210922081520.30580-10-billy_tsai@aspeedtech.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Billy Tsai authored
Add the function to set the sampling rate and keep the sampling period for a driver used to wait the fresh value. In addition, since the ADC clock is required when initializing the ADC device, move clk_prepare_enable ahead of the initialization phase. Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com> Link: https://lore.kernel.org/r/20210922081520.30580-9-billy_tsai@aspeedtech.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Billy Tsai authored
The ADC clock formula is ast2400/2500: ADC clock period = PCLK * 2 * (ADC0C[31:17] + 1) * (ADC0C[9:0] + 1) ast2600: ADC clock period = PCLK * 2 * (ADC0C[15:0] + 1) They all have one fixed divided 2 and the legacy driver didn't handle it. This patch register the fixed factory clock device as the parent of ADC clock scaler to fix this issue. Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com> Link: https://lore.kernel.org/r/20210922081520.30580-8-billy_tsai@aspeedtech.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Billy Tsai authored
Make driver to support ast2600 adc device. - Use shared reset controller - Complete the vref configure function - Add the model data for ast2600 adc Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com> Link: https://lore.kernel.org/r/20210922081520.30580-7-billy_tsai@aspeedtech.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Billy Tsai authored
This patch use devm_add_action_or_reset to handle the error in probe phase. Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com> Link: https://lore.kernel.org/r/20210922081520.30580-6-billy_tsai@aspeedtech.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Billy Tsai authored
This patch uses need_prescaler and scaler_bit_width to set the ADC clock scaler. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com> Link: https://lore.kernel.org/r/20210922081520.30580-5-billy_tsai@aspeedtech.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Billy Tsai authored
Add the function to check the vref_fixed_mv and set the value to driver data. Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com> Link: https://lore.kernel.org/r/20210922081520.30580-4-billy_tsai@aspeedtech.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Billy Tsai authored
This patch refactors the model data structure to distinguish the function form different versions of aspeed ADC. - Rename the vref_voltage to vref_fixed_mv and add vref_mv driver data When driver probe will check vref_fixed_mv value and store it to vref_mv which isn't const value. - Add num_channels Make num_channles of iio device can be changed by different model_data - Add need_prescaler flag and scaler_bit_width The need_prescaler flag is used to tell the driver the clock divider needs another Prescaler and the scaler_bit_width to set the clock divider bitfield width. Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com> Link: https://lore.kernel.org/r/20210922081520.30580-3-billy_tsai@aspeedtech.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Billy Tsai authored
Keep the model data pointer to driver data for reducing the usage of of_device_get_match_data(). Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com> Link: https://lore.kernel.org/r/20210922081520.30580-2-billy_tsai@aspeedtech.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jacopo Mondi authored
Document the 'in_concentration_co2_scale' standard IIO attribute. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Link: https://lore.kernel.org/r/20210920135413.140310-5-jacopo+renesas@jmondi.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jacopo Mondi authored
Add support for the Senseair Sunrise 006-0-0007 driver through the IIO subsystem. Datasheet: https://rmtplusstoragesenseair.blob.core.windows.net/docs/Dev/publicerat/TDE5531.pdfSigned-off-by: Jacopo Mondi <jacopo@jmondi.org> Link: https://lore.kernel.org/r/20210920135413.140310-4-jacopo+renesas@jmondi.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jacopo Mondi authored
Add documentation for the sysfs attributes of the sunrise_co2 driver. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Link: https://lore.kernel.org/r/20210920135413.140310-3-jacopo+renesas@jmondi.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jacopo Mondi authored
Add documentation for the Senseair Sunrise 006-0-0007 CO2 NDIR sensor. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210920135413.140310-2-jacopo+renesas@jmondi.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
David Heidelberg authored
Driver and device-tree also use vid-supply regulator. Fixes: 7e000fbf ("dt-bindings: iio: magnetometer: ak8975: convert format to yaml, add maintainer") Signed-off-by: David Heidelberg <david@ixit.cz> Acked-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210913181949.83179-1-david@ixit.czSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
- 17 Oct, 2021 2 commits
-
-
David Heidelberg authored
Device has interrupts support, which description was missing in the bindings. Signed-off-by: David Heidelberg <david@ixit.cz> Acked-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210919203656.119742-1-david@ixit.czSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Krzysztof Kozlowski authored
Describe better which driver applies to which SoC, to make configuring kernel for Samsung SoC easier. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Link: https://lore.kernel.org/r/20210924133515.112357-1-krzysztof.kozlowski@canonical.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-