Re: [RFC v2 PATCH 7/7] dmaengine: xilinx_dma: Program interrupt delay timeout

2021-04-15 Thread Lars-Peter Clausen
On 4/9/21 7:56 PM, Radhey Shyam Pandey wrote: Program IRQDelay for AXI DMA. The interrupt timeout mechanism causes the DMA engine to generate an interrupt after the delay time period has expired. It enables dmaengine to respond in real-time even though interrupt coalescing is configured. It also

Re: [RFC v2 PATCH 5/7] dmaengine: xilinx_dma: Freeup active list based on descriptor completion bit

2021-04-15 Thread Lars-Peter Clausen
On 4/9/21 7:56 PM, Radhey Shyam Pandey wrote: AXIDMA IP in SG mode sets completion bit to 1 when the transfer is completed. Read this bit to move descriptor from active list to the done list. This feature is needed when interrupt delay timeout and IRQThreshold is enabled i.e Dly_IrqEn is

Re: [RFC v2 PATCH 6/7] dmaengine: xilinx_dma: Use tasklet_hi_schedule for timing critical usecase

2021-04-15 Thread Lars-Peter Clausen
On 4/9/21 7:56 PM, Radhey Shyam Pandey wrote: Schedule tasklet with high priority to ensure that callback processing is prioritized. It improves throughput for netdev dma clients. Do you have specific numbers on the throughput improvement?

Re: [RFC v2 PATCH 5/7] dmaengine: xilinx_dma: Freeup active list based on descriptor completion bit

2021-04-15 Thread Lars-Peter Clausen
On 4/9/21 7:56 PM, Radhey Shyam Pandey wrote: AXIDMA IP in SG mode sets completion bit to 1 when the transfer is completed. Read this bit to move descriptor from active list to the done list. This feature is needed when interrupt delay timeout and IRQThreshold is enabled i.e Dly_IrqEn is

Re: [RFC v2 PATCH 0/7] Xilinx DMA enhancements and optimization

2021-04-15 Thread Lars-Peter Clausen
On 4/9/21 7:55 PM, Radhey Shyam Pandey wrote: Some background about the patch series: Xilinx Axi Ethernet device driver (xilinx_axienet_main.c) currently has axi-dma code inside it. The goal is to refactor axiethernet driver and use existing AXI DMA driver using DMAEngine API. This is pretty

Re: [PATCH v4 2/2] iio: temperature: add driver support for ti tmp117

2021-04-09 Thread Lars-Peter Clausen
, thanks. Reviewed-by: Lars-Peter Clausen

Re: [PATCH v3 2/2] iio: temperature: add driver support for ti tmp117

2021-04-06 Thread Lars-Peter Clausen
On 4/6/21 8:28 PM, Puranjay Mohan wrote: + +static int tmp117_write_raw(struct iio_dev *indio_dev, + struct iio_chan_spec const *channel, int val, + int val2, long mask) +{ + struct tmp117_data *data = iio_priv(indio_dev); + s16 off; + + switch

Re: [PATCH v2 2/2] iio: temperature: add driver support for ti tmp117

2021-04-03 Thread Lars-Peter Clausen
On 4/3/21 4:58 PM, Puranjay Mohan wrote: On Fri, Apr 2, 2021 at 1:43 PM Lars-Peter Clausen wrote: On 4/1/21 11:16 AM, Puranjay Mohan wrote: TMP117 is a Digital temperature sensor with integrated NV memory. Add support for tmp117 driver in iio subsystem. Datasheet:-https://www.ti.com/lit/gpn

Re: [PATCH v2 2/2] iio: temperature: add driver support for ti tmp117

2021-04-02 Thread Lars-Peter Clausen
On 4/1/21 11:36 AM, Andy Shevchenko wrote: [...] + case IIO_CHAN_INFO_SCALE: + /* Conversion from 10s of uC to mC +* as IIO reports temperature in mC +*/ + *val = TMP117_RESOLUTION_10UC / 1; + *val2 =

Re: [PATCH v2 2/2] iio: temperature: add driver support for ti tmp117

2021-04-02 Thread Lars-Peter Clausen
On 4/1/21 11:16 AM, Puranjay Mohan wrote: TMP117 is a Digital temperature sensor with integrated NV memory. Add support for tmp117 driver in iio subsystem. Datasheet:-https://www.ti.com/lit/gpn/tmp117 Signed-off-by: Puranjay Mohan Nice and clean driver. Just some comments about the

Re: [PATCH 3/3] iio: adc: ad7923: register device with devm_iio_device_register

2021-03-29 Thread Lars-Peter Clausen
On 3/28/21 11:46 PM, Lucas Stankus wrote: Registers the device using the devm variant. This is the final step of converting the ad7923 to only use devm routines, meaning that the ad7923_remove() function is no longer needed to release resources on device detach. Signed-off-by: Lucas Stankus

Re: [PATCH v6 20/24] iio: buffer: add ioctl() to support opening extra buffers for IIO device

2021-03-27 Thread Lars-Peter Clausen
On 3/24/21 10:10 AM, Alexandru Ardelean wrote: On Tue, Mar 23, 2021 at 1:35 PM Jonathan Cameron wrote: [..] Continuing a bit with the original IIO buffer ioctl(), I talked to Lars a bit over IRC. And there was an idea/suggestion to maybe use a struct to pass more information to the buffer

Re: [PATCH 2/2] iio: adc: Add support for TI INA260 power monitors

2021-03-22 Thread Lars-Peter Clausen
On 3/22/21 1:11 PM, Raviteja Narayanam wrote: -Original Message- From: Lars-Peter Clausen Sent: Monday, March 22, 2021 5:22 PM To: Raviteja Narayanam ; robh...@kernel.org; ji...@kernel.org Cc: Michal Simek ; pme...@pmeerw.net; linux- i...@vger.kernel.org; devicet...@vger.kernel.org

Re: [PATCH 2/2] iio: adc: Add support for TI INA260 power monitors

2021-03-22 Thread Lars-Peter Clausen
On 3/22/21 12:43 PM, Lars-Peter Clausen wrote: On 3/22/21 11:50 AM, Raviteja Narayanam wrote: This driver supports software buffer mode and raw reads of ina260 iio channels. In software buffer mode, a kthread will capture the active scan_elements periodically using a delay. This can produce

Re: [PATCH 2/2] iio: adc: Add support for TI INA260 power monitors

2021-03-22 Thread Lars-Peter Clausen
On 3/22/21 11:50 AM, Raviteja Narayanam wrote: This driver supports software buffer mode and raw reads of ina260 iio channels. In software buffer mode, a kthread will capture the active scan_elements periodically using a delay. This can produce a stream of up to 3 channels plus a 64 bits

Re: [PATCH v1 2/2] iio: temperature: add driver support for ti tmp117

2021-03-20 Thread Lars-Peter Clausen
On 3/21/21 6:07 AM, Lars-Peter Clausen wrote: On 3/20/21 7:45 AM, Puranjay Mohan wrote: TMP117 is a Digital temperature sensor with integrated NV memory. Add support for tmp117 driver in iio subsystem. Datasheet:-https://www.ti.com/lit/gpn/tmp117 Signed-off-by: Puranjay Mohan This looks

Re: [PATCH v1 2/2] iio: temperature: add driver support for ti tmp117

2021-03-20 Thread Lars-Peter Clausen
On 3/20/21 7:45 AM, Puranjay Mohan wrote: TMP117 is a Digital temperature sensor with integrated NV memory. Add support for tmp117 driver in iio subsystem. Datasheet:-https://www.ti.com/lit/gpn/tmp117 Signed-off-by: Puranjay Mohan This looks good to me. Just two small bits I overlooked

Re: [PATCH 2/2] iio: temperature: add driver support for ti tmp117

2021-03-19 Thread Lars-Peter Clausen
On 3/19/21 9:30 PM, Puranjay Mohan wrote: TMP117 is a Digital temperature sensor with integrated NV memory. Add support for tmp117 driver in iio subsystem. Datasheet:-https://www.ti.com/lit/gpn/tmp117 Signed-off-by: Puranjay Mohan Hi, Thanks for the patch, this looks really good. I have a

Re: A potential data race in drivers/iio/adc/berlin2-adc.ko

2021-03-18 Thread Lars-Peter Clausen
On 3/18/21 9:27 AM, Lars-Peter Clausen wrote: On 3/18/21 9:07 AM, Pavel Andrianov wrote: Hi, berlin2_adc_probe [1] registers two interrupt handlers: berlin2_adc_irq [2] and berlin2_adc_tsen_irq [3]. The interrupt handlers operate with the same data, for example, modify priv->d

Re: A potential data race in drivers/iio/adc/berlin2-adc.ko

2021-03-18 Thread Lars-Peter Clausen
On 3/18/21 9:07 AM, Pavel Andrianov wrote: Hi, berlin2_adc_probe [1] registers two interrupt handlers: berlin2_adc_irq [2] and berlin2_adc_tsen_irq [3]. The interrupt handlers operate with the same data, for example, modify priv->data with different masks: priv->data &= BERLIN2_SM_ADC_MASK;

Re: [PATCH v2] iio:dac:max517.c: Use devm_iio_device_register()

2021-03-14 Thread Lars-Peter Clausen
red data will be never used. Hi, This looks good! Reviewed-by: Lars-Peter Clausen One thing process wise. I know it is tempting to send version 2 as a reply to version 1, but this way it is also easy for the messages to get lost in longer threads. At least for the IIO mailinglist we h

Re: [PATCH 02/23] ASoC: ad1836: remove useless return

2021-03-12 Thread Lars-Peter Clausen
On 3/12/21 7:22 PM, Pierre-Louis Bossart wrote: Cppcheck warning: sound/soc/codecs/ad1836.c:311:9: warning: Identical condition and return expression 'ret', return value is always 0 [identicalConditionAfterEarlyExit] return ret; ^ sound/soc/codecs/ad1836.c:308:6: note: If condition

Re: [PATCH 01/10] spi: spi-axi-spi-engine: remove usage of delay_usecs

2021-03-09 Thread Lars-Peter Clausen
On 3/10/21 8:16 AM, Alexandru Ardelean wrote: On Mon, 8 Mar 2021 at 18:42, Lars-Peter Clausen wrote: On 3/8/21 3:54 PM, Alexandru Ardelean wrote: The 'delay_usecs' field was handled for backwards compatibility in case there were some users that still configured SPI delay transfers

Re: [PATCH 01/10] spi: spi-axi-spi-engine: remove usage of delay_usecs

2021-03-08 Thread Lars-Peter Clausen
On 3/8/21 3:54 PM, Alexandru Ardelean wrote: The 'delay_usecs' field was handled for backwards compatibility in case there were some users that still configured SPI delay transfers with this field. They should all be removed by now. Signed-off-by: Alexandru Ardelean ---

Re: [PATCH] iio: buffer: fix use-after-free for attached_buffers array

2021-03-07 Thread Lars-Peter Clausen
On 3/7/21 1:36 PM, Jonathan Cameron wrote: On Sat, 6 Mar 2021 18:47:10 +0200 Alexandru Ardelean wrote: Thanks to Lars for finding this. The free of the 'attached_buffers' array should be done as late as possible. This change moves it to iio_buffers_put(), which looks like the best place for

Re: [PATCH v6 20/24] iio: buffer: add ioctl() to support opening extra buffers for IIO device

2021-02-28 Thread Lars-Peter Clausen
On 2/28/21 3:34 PM, Jonathan Cameron wrote: On Sun, 28 Feb 2021 09:51:38 +0100 Lars-Peter Clausen wrote: On 2/15/21 11:40 AM, Alexandru Ardelean wrote: With this change, an ioctl() call is added to open a character device for a buffer. The ioctl() number is 'i' 0x91, which follows

Re: [PATCH v6 20/24] iio: buffer: add ioctl() to support opening extra buffers for IIO device

2021-02-28 Thread Lars-Peter Clausen
On 2/15/21 11:40 AM, Alexandru Ardelean wrote: With this change, an ioctl() call is added to open a character device for a buffer. The ioctl() number is 'i' 0x91, which follows the IIO_GET_EVENT_FD_IOCTL ioctl. The ioctl() will return an FD for the requested buffer index. The indexes are the

Re: [PATCH v6 19/24] iio: buffer: introduce support for attaching more IIO buffers

2021-02-28 Thread Lars-Peter Clausen
On 2/15/21 11:40 AM, Alexandru Ardelean wrote: static ssize_t iio_show_scan_index(struct device *dev, struct device_attribute *attr, char *buf) @@ -1451,11 +1465,13 @@ static void __iio_buffer_free_sysfs_and_mask(struct

Re: [PATCH v6 02/24] iio: kfifo: add devm_iio_kfifo_buffer_setup() helper

2021-02-28 Thread Lars-Peter Clausen
On 2/15/21 11:40 AM, Alexandru Ardelean wrote: +int devm_iio_kfifo_buffer_setup(struct device *dev, + struct iio_dev *indio_dev, + int mode_flags, + const struct iio_buffer_setup_ops *setup_ops) +{ +

Re: [PATCH v6 20/24] iio: buffer: add ioctl() to support opening extra buffers for IIO device

2021-02-28 Thread Lars-Peter Clausen
On 2/15/21 11:40 AM, Alexandru Ardelean wrote: [...] /** * iio_buffer_wakeup_poll - Wakes up the buffer waitqueue * @indio_dev: The IIO device @@ -1343,6 +1371,96 @@ static void iio_buffer_unregister_legacy_sysfs_groups(struct iio_dev *indio_dev)

Re: [PATCH v2 5/5] iio: dac: ad5686: Add PWM as a trigger source

2021-02-23 Thread Lars-Peter Clausen
On 2/18/21 3:05 PM, Jonathan Cameron wrote: On Wed, 17 Feb 2021 10:34:38 +0200 Alexandru Ardelean wrote: From: Mircea Caprioru A PWM signal will be used as a trigger source to have a deterministic sampling frequency since this family of DAC has no hardware interrupt source. This feature is

Re: Adding custom functional callbacks to IIO driver

2021-02-12 Thread Lars-Peter Clausen
On 2/12/21 12:07 PM, Anand Ashok Dumbre wrote: Hello, I have an IIO adc driver that measures temperatures and voltages on the SOC. There are other kernel modules interested in the temperature and voltage event information. Would using a custom callback registration mechanism be advisable? Is

Re: [PATCH v2] dt-bindings: iio: dac: Fix AD5686 references

2021-02-02 Thread Lars-Peter Clausen
Clausen Cc: Michael Hennerich Cc: Jonathan Cameron Cc: Peter Meerwald-Stadler Cc: Michael Auchter Cc: linux-...@vger.kernel.org Signed-off-by: Rob Herring Acked-by: Lars-Peter Clausen Thanks Rob. --- v2: - Rename instead of adding AD5686 .../iio/dac/{adi,ad5686.yaml => adi,ad5696.y

Re: [PATCH] dt-bindings: iio: dac: Add missing ad5686 compatible strings

2021-02-02 Thread Lars-Peter Clausen
and one with a I2C interface. This binding document only describes the I2C variants. But the ad5686 is a SPI variant. I think this is a typo and we should replace ad5686 with ad5696, including the document name. Cc: Lars-Peter Clausen Cc: Michael Hennerich Cc: Jonathan Cameron Cc: Peter

Re: dmaengine : xilinx_dma two issues

2021-01-11 Thread Lars-Peter Clausen
On 1/11/21 10:32 AM, Michal Simek wrote: Hi Lars, On 10. 01. 21 16:43, Lars-Peter Clausen wrote: On 1/10/21 4:16 PM, Paul Thomas wrote: On Fri, Jan 8, 2021 at 1:36 PM Radhey Shyam Pandey wrote: -Original Message- From: Paul Thomas Sent: Friday, January 8, 2021 9:27 PM To: Radhey

Re: dmaengine : xilinx_dma two issues

2021-01-10 Thread Lars-Peter Clausen
On 1/10/21 4:16 PM, Paul Thomas wrote: On Fri, Jan 8, 2021 at 1:36 PM Radhey Shyam Pandey wrote: -Original Message- From: Paul Thomas Sent: Friday, January 8, 2021 9:27 PM To: Radhey Shyam Pandey Cc: Dan Williams ; Vinod Koul ; Michal Simek ; Matthew Murrian ; Romain Perier ;

Re: Haswell audio no longer working with new Catpt driver (was: sound)

2020-12-31 Thread Lars-Peter Clausen
On 12/31/20 9:33 AM, Greg Kroah-Hartman wrote: On Wed, Dec 30, 2020 at 07:10:16PM +0100, Christian Labisch wrote: Update : I've just tested the kernel 5.10.4 from ELRepo. Unfortunately nothing changed - still no sound. Ah, sad. Can you run 'git bisect' between 5.9 and 5.10 to determine the

Re: [RFC PATCH v2 1/1] iio/scmi: Adding support for IIO SCMI Based Sensors

2020-12-30 Thread Lars-Peter Clausen
On 12/30/20 2:41 PM, Jonathan Cameron wrote: On Thu, 24 Dec 2020 03:19:21 + Jyoti Bhayana wrote: + /* +* The seconds field in the sensor interval in SCMI is 16 bits long +* Therefore seconds = 1/Hz <= 0x. As floating point calculations are +*

Re: [PATCH v1 ] ALSA: core: memalloc: add page alignment for iram

2020-12-17 Thread Lars-Peter Clausen
On 12/17/20 4:18 PM, Takashi Iwai wrote: On Thu, 17 Dec 2020 15:57:02 +0100, Lars-Peter Clausen wrote: On 12/17/20 3:24 PM, Takashi Iwai wrote: On Thu, 17 Dec 2020 14:16:48 +0100, Lars-Peter Clausen wrote: On 12/17/20 12:06 PM, Takashi Iwai wrote: On Thu, 17 Dec 2020 11:59:23 +0100, Lars

Re: [PATCH v1 ] ALSA: core: memalloc: add page alignment for iram

2020-12-17 Thread Lars-Peter Clausen
On 12/17/20 3:24 PM, Takashi Iwai wrote: On Thu, 17 Dec 2020 14:16:48 +0100, Lars-Peter Clausen wrote: On 12/17/20 12:06 PM, Takashi Iwai wrote: On Thu, 17 Dec 2020 11:59:23 +0100, Lars-Peter Clausen wrote: On 12/17/20 10:55 AM, Takashi Iwai wrote: On Thu, 17 Dec 2020 10:43:45 +0100, Lars

Re: [PATCH v1 ] ALSA: core: memalloc: add page alignment for iram

2020-12-17 Thread Lars-Peter Clausen
On 12/17/20 12:06 PM, Takashi Iwai wrote: On Thu, 17 Dec 2020 11:59:23 +0100, Lars-Peter Clausen wrote: On 12/17/20 10:55 AM, Takashi Iwai wrote: On Thu, 17 Dec 2020 10:43:45 +0100, Lars-Peter Clausen wrote: On 12/17/20 5:15 PM, Robin Gong wrote: Since mmap for userspace is based on page

Re: [PATCH v1 ] ALSA: core: memalloc: add page alignment for iram

2020-12-17 Thread Lars-Peter Clausen
On 12/17/20 10:55 AM, Takashi Iwai wrote: On Thu, 17 Dec 2020 10:43:45 +0100, Lars-Peter Clausen wrote: On 12/17/20 5:15 PM, Robin Gong wrote: Since mmap for userspace is based on page alignment, add page alignment for iram alloc from pool, otherwise, some good data located in the same page

Re: [PATCH v1 ] ALSA: core: memalloc: add page alignment for iram

2020-12-17 Thread Lars-Peter Clausen
On 12/17/20 11:14 AM, Takashi Iwai wrote: On Thu, 17 Dec 2020 10:55:42 +0100, Takashi Iwai wrote: On Thu, 17 Dec 2020 10:43:45 +0100, Lars-Peter Clausen wrote: On 12/17/20 5:15 PM, Robin Gong wrote: Since mmap for userspace is based on page alignment, add page alignment for iram alloc from

Re: [PATCH v1 ] ALSA: core: memalloc: add page alignment for iram

2020-12-17 Thread Lars-Peter Clausen
On 12/17/20 5:15 PM, Robin Gong wrote: Since mmap for userspace is based on page alignment, add page alignment for iram alloc from pool, otherwise, some good data located in the same page of dmab->area maybe touched wrongly by userspace like pulseaudio. I wonder, do we also have to align size

Re: [PATCH V2] iio: adc: ad7476: Add LTC2314-14 support

2020-12-16 Thread Lars-Peter Clausen
On 12/16/20 9:23 AM, Mircea Caprioru wrote: [...] Changelog v2 - fix conflict with ADS7868 device in chip_info_tbl [...] [ID_ADS7868] = { .channel[0] = ADS786X_CHAN(8), .channel[1] = IIO_CHAN_SOFT_TIMESTAMP(1), Hi Mircea, I think this is still missing a

Re: [PATCH v2 3/3] Input: adp5589-keys - add basic devicetree support

2020-11-24 Thread Lars-Peter Clausen
On 11/24/20 9:22 AM, Alexandru Ardelean wrote: error = devm_add_action_or_reset(>dev, adp5589_clear_config, @@ -1078,6 +1098,13 @@ static int __maybe_unused adp5589_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(adp5589_dev_pm_ops, adp5589_suspend, adp5589_resume); +static

Re: [Cocci] Proposal for a new checkpatch check; matching _set_drvdata() & _get_drvdata()

2020-11-20 Thread Lars-Peter Clausen
On 11/20/20 12:54 PM, Alexandru Ardelean wrote: On Fri, Nov 20, 2020 at 12:47 PM Julia Lawall wrote: On Thu, 19 Nov 2020, Joe Perches wrote: On Thu, 2020-11-19 at 17:16 +0200, Andy Shevchenko wrote: On Thu, Nov 19, 2020 at 4:09 PM Alexandru Ardelean wrote: Hey, So, I stumbled on a new

Re: [PATCH] iio: ad_sigma_delta: Don't put SPI transfer buffer on the stack

2020-11-12 Thread Lars-Peter Clausen
On 11/12/20 11:14 AM, Alexandru Ardelean wrote: On Thu, Nov 12, 2020 at 11:55 AM Lars-Peter Clausen wrote: On 11/12/20 10:10 AM, Alexandru Ardelean wrote: From: Lars-Peter Clausen Use a heap allocated memory for the SPI transfer buffer. Using stack memory can corrupt stack memory when using

Re: [PATCH] iio: ad_sigma_delta: Don't put SPI transfer buffer on the stack

2020-11-12 Thread Lars-Peter Clausen
On 11/12/20 10:10 AM, Alexandru Ardelean wrote: From: Lars-Peter Clausen Use a heap allocated memory for the SPI transfer buffer. Using stack memory can corrupt stack memory when using DMA on some systems. This change adds 4 bytes at the end of the current DMA buffer, which will be used

Re: [PATCH] dt-bindings: clock: adi,axi-clkgen: convert old binding to yaml format

2020-10-11 Thread Lars-Peter Clausen
. As maintainers, added: - Lars-Peter Clausen - as original author of driver & binding Do you have permission for relicensing? The default was GPL-2.0. I talked to Michael Hennerich [he's cc-ed], and we have permission from his side. I think Lars would need to provide permission as

Re: [PATCH v3 1/2] MAINTAINERS: Consolidate Analog Devices IIO entries and remove Beniamin Bia

2020-09-06 Thread Lars-Peter Clausen
and Michael responsibility for a few things they didn't previously cover. If the two of them are fine with it, than that's good, but I'd ideally like an Ack from Lars. Acked-by: Lars-Peter Clausen I think I left a ticket with ADI when I left to update the maintainers entries and replace me

Re: [PATCH] drivers/dma/dma-jz4780: Fix race condition between probe and irq handler

2020-08-20 Thread Lars-Peter Clausen
On 8/20/20 1:59 PM, Paul Cercueil wrote: Hi, Le dim. 16 août 2020 à 12:52, madhuparnabhowmi...@gmail.com a écrit : From: Madhuparna Bhowmik In probe IRQ is requested before zchan->id is initialized which can be read in the irq handler. Hence, shift request irq and enable clock after other

Re: pcm|dmaengine|imx-sdma race condition on i.MX6

2020-08-19 Thread Lars-Peter Clausen
On 8/19/20 1:08 PM, Lars-Peter Clausen wrote: On 8/17/20 9:28 AM, Benjamin Bara - SKIDATA wrote: We think this is not an i.MX6-specific problem, but a problem of the DMAengine usage from the PCM. In case of a XRUN, the DMA channel is never closed but first a SNDRV_PCM_TRIGGER_STOP next

Re: pcm|dmaengine|imx-sdma race condition on i.MX6

2020-08-19 Thread Lars-Peter Clausen
On 8/17/20 9:28 AM, Benjamin Bara - SKIDATA wrote: We think this is not an i.MX6-specific problem, but a problem of the DMAengine usage from the PCM. In case of a XRUN, the DMA channel is never closed but first a SNDRV_PCM_TRIGGER_STOP next a SNDRV_PCM_TRIGGER_START is triggered. The

Re: [PATCH] iio: trigger: sysfs: Disable irqs before calling iio_trigger_poll()

2020-08-13 Thread Lars-Peter Clausen
On 8/12/20 1:01 PM, Christian Eggers wrote: Hi Lars On Monday, 3 August 2020, 08:52:54 CEST, Lars-Peter Clausen wrote: On 8/3/20 8:44 AM, Christian Eggers wrote: ... is my patch sufficient, or would you prefer a different solution? The code in normal upstream is correct, there is no need

Re: [PATCH v5 2/2] iio: light: as73211: New driver

2020-08-04 Thread Lars-Peter Clausen
On 8/4/20 9:40 AM, Christian Eggers wrote: On Sunday, 2 August 2020, 20:02:35 CEST, Andy Shevchenko wrote: Thanks for an update, my comments below. Thanks for the review. Please see below for my questions. Best regards Christian On Sun, Aug 2, 2020 at 7:40 PM Christian Eggers wrote:

Re: [PATCH] iio: trigger: sysfs: Disable irqs before calling iio_trigger_poll()

2020-08-03 Thread Lars-Peter Clausen
On 8/3/20 8:44 AM, Christian Eggers wrote: Hi Lars, On Monday, 3 August 2020, 08:37:43 CEST, Lars-Peter Clausen wrote: The sysfs IIO trigger uses irq_work to schedule the iio_trigger_poll() and the promise of irq_work is that the callback will run in hard IRQ context. That's the whole point

Re: [PATCH] iio: trigger: sysfs: Disable irqs before calling iio_trigger_poll()

2020-08-03 Thread Lars-Peter Clausen
On 8/3/20 7:16 AM, Christian Eggers wrote: On Saturday, 1 August 2020, 18:02:34 CEST, Jonathan Cameron wrote: On Mon, 27 Jul 2020 16:57:13 +0200 Christian Eggers wrote: iio_trigger_poll() calls generic_handle_irq(). This function expects to be run with local IRQs disabled. Was there an

Re: [PATCH] iio: trigger: sysfs: Disable irqs before calling iio_trigger_poll()

2020-08-02 Thread Lars-Peter Clausen
On 8/1/20 6:02 PM, Jonathan Cameron wrote: On Mon, 27 Jul 2020 16:57:13 +0200 Christian Eggers wrote: iio_trigger_poll() calls generic_handle_irq(). This function expects to be run with local IRQs disabled. Was there an error or warning that lead to this patch? Or can you point to what call

Re: [PATCH] iio: trigger: Staticise stub functions

2020-07-18 Thread Lars-Peter Clausen
On 7/18/20 6:25 PM, Jonathan Cameron wrote: On Tue, 14 Jul 2020 17:24:56 +0300 Alexandru Ardelean wrote: From: Lars-Peter Clausen Make sure that the trigger function stubs are all static inline. Otherwise we'll get linker errors due to multiple definitions of the same function. Fixes

Re: [RFC PATCH] one-bit-adc-dac: Add initial version of one bit ADC, DAC

2020-07-16 Thread Lars-Peter Clausen
On 7/16/20 9:27 AM, Cristian Pop wrote: Implementation for 1-bit ADC (comparator) and a 1-bit DAC (switch) Very sneaky way of introducing a iio-gpio-proxy driver to be able to access GPIOs through libiio ;). I'm not really a fan of the whole idea. But either way I think this needs a better

Re: [PATCH v3 06/13] iio: imu: inv_icm42600: add temperature sensor support

2020-06-14 Thread Lars-Peter Clausen
On 6/8/20 10:42 PM, Jean-Baptiste Maneyrol wrote: + case IIO_CHAN_INFO_PROCESSED: + ret = iio_device_claim_direct_mode(indio_dev); + if (ret) + return ret; + ret = inv_icm42600_temp_read(st, ); +

Re: [PATCH 0/2] iio: adc: Add a current from voltage driver

2020-05-16 Thread Lars-Peter Clausen
On 5/16/20 4:26 AM, Jonathan Bakker wrote: In the discussion around adding the GP2A002 light driver, there came up the question of what to do when a system emulates a current ADC by using a voltage ADC and a resistor. Rather than adding it on a per-driver basis, it was suggested(1) to add a

Re: [RFC PATCH 00/14] iio: buffer: add support for multiple buffers

2020-05-11 Thread Lars-Peter Clausen
On 5/11/20 4:56 PM, Ardelean, Alexandru wrote: On Mon, 2020-05-11 at 15:58 +0200, Lars-Peter Clausen wrote: [External] On 5/11/20 3:24 PM, Ardelean, Alexandru wrote: On Mon, 2020-05-11 at 13:03 +, Ardelean, Alexandru wrote: [External] On Mon, 2020-05-11 at 12:37 +0200, Lars-Peter

Re: [RFC PATCH 00/14] iio: buffer: add support for multiple buffers

2020-05-11 Thread Lars-Peter Clausen
On 5/11/20 3:24 PM, Ardelean, Alexandru wrote: On Mon, 2020-05-11 at 13:03 +, Ardelean, Alexandru wrote: [External] On Mon, 2020-05-11 at 12:37 +0200, Lars-Peter Clausen wrote: [External] On 5/11/20 12:33 PM, Ardelean, Alexandru wrote: On Sun, 2020-05-10 at 11:09 +0100, Jonathan Cameron

Re: [RFC PATCH 00/14] iio: buffer: add support for multiple buffers

2020-05-11 Thread Lars-Peter Clausen
On 5/11/20 12:33 PM, Ardelean, Alexandru wrote: On Sun, 2020-05-10 at 11:09 +0100, Jonathan Cameron wrote: [External] On Sat, 9 May 2020 10:52:14 +0200 Lars-Peter Clausen wrote: On 5/8/20 3:53 PM, Alexandru Ardelean wrote: [...] What I don't like, is that iio:device3 has iio:buffer3:0

Re: [RFC PATCH 00/14] iio: buffer: add support for multiple buffers

2020-05-09 Thread Lars-Peter Clausen
On 5/8/20 3:53 PM, Alexandru Ardelean wrote: [...] What I don't like, is that iio:device3 has iio:buffer3:0 (to 3). This is because the 'buffer->dev.parent = _dev->dev'. But I do feel this is correct. So, now I don't know whether to leave it like that or symlink to shorter versions like

Re: [PATCH][RFC] iio: core: add a class hierarchy on iio device lock

2019-10-15 Thread Lars-Peter Clausen
On 10/14/19 5:59 PM, Olivier MOYSAN wrote: > Hello Jonathan, > > Thanks for your comment. > > On 10/12/19 10:57 AM, Jonathan Cameron wrote: >> On Fri, 11 Oct 2019 17:13:14 +0200 >> Olivier Moysan wrote: >> >>> The aim of this patch is to correct a recursive locking warning, >>> detected when

Re: [PATCH] dmaengine: axi-dmac: simple device_config operation implemented

2019-10-15 Thread Lars-Peter Clausen
On 10/15/19 12:43 PM, Vinod Koul wrote: > On 15-10-19, 07:05, Ardelean, Alexandru wrote: >> On Mon, 2019-10-14 at 12:31 +0530, Vinod Koul wrote: >>> [External] >>> >> >> Hey, >> >>> On 13-09-19, 17:54, Alexandru Ardelean wrote: From: Rodrigo Alencar dmaengine_slave_config is called

Re: [PATCH 1/1] iio: core: Fix fractional format generation

2019-08-21 Thread Lars-Peter Clausen
On 8/21/19 5:50 PM, Alexander Stein wrote: > In case the result is -0.3252 tmp0 is 0 after the div_s64_rem, so tmp0 is > non-negative which results in an output of 0.3252. > Fix this by explicitly handling the negative sign ourselves. Hi, Thanks for you patch. Some comments inline. > >

Re: static analysis bug report in drivers/staging/iio/dac/ad5380.c

2019-08-15 Thread Lars-Peter Clausen
On 8/15/19 12:21 PM, Colin Ian King wrote: > Hi, > > Static analysis with Coverity Scan has detected a potential assignment > bug in ad5380.c: > > 217case IIO_CHAN_INFO_CALIBBIAS: > 218ret = regmap_read(st->regmap, > AD5380_REG_OFFSET(chan->address), > 219

Re: [PATCH] staging: iio: ad7780: update voltage on read

2018-10-25 Thread Lars-Peter Clausen
On 10/25/2018 04:55 PM, Himanshu Jha wrote: > On Thu, Oct 25, 2018 at 11:26:36AM -0300, Renato Lui Geh wrote: >> Hi, >> >> Thanks for the quick review. :) >> >>> But please create one patch per issue and do not put unrelated changes into >>> the same patch. >> >> Should I resend this patch as a

Re: [PATCH] staging: iio: ad7780: update voltage on read

2018-10-25 Thread Lars-Peter Clausen
On 10/25/2018 04:55 PM, Himanshu Jha wrote: > On Thu, Oct 25, 2018 at 11:26:36AM -0300, Renato Lui Geh wrote: >> Hi, >> >> Thanks for the quick review. :) >> >>> But please create one patch per issue and do not put unrelated changes into >>> the same patch. >> >> Should I resend this patch as a

Re: [PATCH] staging: iio: ad7780: update voltage on read

2018-10-25 Thread Lars-Peter Clausen
On 10/25/2018 03:32 PM, Renato Lui Geh wrote: > The ad7780 driver previously did not read the correct device output. > This patch fixes two issues. > > - The driver read an outdated value set at initialization. It now > updates its voltage on read. > - Variable val subtracted an uninitialized

Re: [PATCH] staging: iio: ad7780: update voltage on read

2018-10-25 Thread Lars-Peter Clausen
On 10/25/2018 03:32 PM, Renato Lui Geh wrote: > The ad7780 driver previously did not read the correct device output. > This patch fixes two issues. > > - The driver read an outdated value set at initialization. It now > updates its voltage on read. > - Variable val subtracted an uninitialized

Re: [PATCH 1/2] staging: iio: ad7606: Move out of staging

2018-10-18 Thread Lars-Peter Clausen
On 10/18/2018 02:55 PM, Dan Carpenter wrote: > On Thu, Oct 18, 2018 at 12:10:32PM +0300, Stefan Popa wrote: >> +static int ad7606_read_samples(struct ad7606_state *st) >> +{ >> +unsigned int num = st->chip_info->num_channels; >> +u16 *data = st->data; >> +int ret; >> + >> +/* >> +

Re: [PATCH 1/2] staging: iio: ad7606: Move out of staging

2018-10-18 Thread Lars-Peter Clausen
On 10/18/2018 02:55 PM, Dan Carpenter wrote: > On Thu, Oct 18, 2018 at 12:10:32PM +0300, Stefan Popa wrote: >> +static int ad7606_read_samples(struct ad7606_state *st) >> +{ >> +unsigned int num = st->chip_info->num_channels; >> +u16 *data = st->data; >> +int ret; >> + >> +/* >> +

Re: [PATCH v2] staging: iio: ad7816: Switch to the gpio descriptor interface

2018-10-18 Thread Lars-Peter Clausen
On 10/18/2018 09:28 AM, Phil Reid wrote: [...] >> +    chip->rdwr_pin = devm_gpiod_get(_dev->dev, "rdwr", GPIOD_IN); >> +    if (IS_ERR(chip->rdwr_pin)) { >> +    ret = PTR_ERR(chip->rdwr_pin); >> +    dev_err(_dev->dev, "Failed to request rdwr GPIO: %d\n", >> +    ret); >>

Re: [PATCH v2] staging: iio: ad7816: Switch to the gpio descriptor interface

2018-10-18 Thread Lars-Peter Clausen
On 10/18/2018 09:28 AM, Phil Reid wrote: [...] >> +    chip->rdwr_pin = devm_gpiod_get(_dev->dev, "rdwr", GPIOD_IN); >> +    if (IS_ERR(chip->rdwr_pin)) { >> +    ret = PTR_ERR(chip->rdwr_pin); >> +    dev_err(_dev->dev, "Failed to request rdwr GPIO: %d\n", >> +    ret); >>

Re: [PATCH v2] staging: iio: ad7816: Switch to the gpio descriptor interface

2018-10-17 Thread Lars-Peter Clausen
On 10/17/2018 04:47 PM, Nishad Kamdar wrote: > Use the gpiod interface for rdwr_pin, convert_pin and busy_pin > instead of the deprecated old non-descriptor interface. > > Signed-off-by: Nishad Kamdar Acked-by: Lars-Peter Clausen Thanks. > --- > Changes in v2: > - Corre

Re: [PATCH v2] staging: iio: ad7816: Switch to the gpio descriptor interface

2018-10-17 Thread Lars-Peter Clausen
On 10/17/2018 04:47 PM, Nishad Kamdar wrote: > Use the gpiod interface for rdwr_pin, convert_pin and busy_pin > instead of the deprecated old non-descriptor interface. > > Signed-off-by: Nishad Kamdar Acked-by: Lars-Peter Clausen Thanks. > --- > Changes in v2: > - Corre

Re: [PATCH] staging: iio: ad7816: Switch to the gpio descriptor interface

2018-10-16 Thread Lars-Peter Clausen
On 10/16/2018 04:46 PM, Nishad Kamdar wrote: > Use the gpiod interface for rdwr_pin, convert_pin and busy_pin > instead of the deprecated old non-descriptor interface. > > Signed-off-by: Nishad Kamdar Hi, Thanks for the patch, this looks good. One thing about the error messages though. > +

Re: [PATCH] staging: iio: ad7816: Switch to the gpio descriptor interface

2018-10-16 Thread Lars-Peter Clausen
On 10/16/2018 04:46 PM, Nishad Kamdar wrote: > Use the gpiod interface for rdwr_pin, convert_pin and busy_pin > instead of the deprecated old non-descriptor interface. > > Signed-off-by: Nishad Kamdar Hi, Thanks for the patch, this looks good. One thing about the error messages though. > +

Re: [PATCH] iio: adc: Fix potential integer overflow

2018-09-24 Thread Lars-Peter Clausen
On 09/24/2018 07:18 PM, Lars-Peter Clausen wrote: > On 09/22/2018 03:42 PM, Jonathan Cameron wrote: >> On Tue, 18 Sep 2018 07:53:14 -0500 >> "Gustavo A. R. Silva" wrote: >> >>> Cast factor to s64 in order to give the compiler complete information >>

Re: [PATCH] iio: adc: Fix potential integer overflow

2018-09-24 Thread Lars-Peter Clausen
On 09/24/2018 07:18 PM, Lars-Peter Clausen wrote: > On 09/22/2018 03:42 PM, Jonathan Cameron wrote: >> On Tue, 18 Sep 2018 07:53:14 -0500 >> "Gustavo A. R. Silva" wrote: >> >>> Cast factor to s64 in order to give the compiler complete information >>

Re: [PATCH] iio: adc: Fix potential integer overflow

2018-09-24 Thread Lars-Peter Clausen
On 09/22/2018 03:42 PM, Jonathan Cameron wrote: > On Tue, 18 Sep 2018 07:53:14 -0500 > "Gustavo A. R. Silva" wrote: > >> Cast factor to s64 in order to give the compiler complete information >> about the proper arithmetic to use and avoid a potential integer >> overflow. Notice that such

Re: [PATCH] iio: adc: Fix potential integer overflow

2018-09-24 Thread Lars-Peter Clausen
On 09/22/2018 03:42 PM, Jonathan Cameron wrote: > On Tue, 18 Sep 2018 07:53:14 -0500 > "Gustavo A. R. Silva" wrote: > >> Cast factor to s64 in order to give the compiler complete information >> about the proper arithmetic to use and avoid a potential integer >> overflow. Notice that such

Re: [PATCH 1/1] axi-i2s: set period size register

2018-08-27 Thread Lars-Peter Clausen
On 08/27/2018 06:22 PM, Luca Ceresoli wrote: > Hi, > > thanks for your feedback. > > [Adding Michal Simek (Xilinx maintainer) in Cc] > > On 27/08/2018 14:27, Lars-Peter Clausen wrote: >> On 08/24/2018 06:04 PM, Luca Ceresoli wrote: >>> The default v

Re: [PATCH 1/1] axi-i2s: set period size register

2018-08-27 Thread Lars-Peter Clausen
On 08/27/2018 06:22 PM, Luca Ceresoli wrote: > Hi, > > thanks for your feedback. > > [Adding Michal Simek (Xilinx maintainer) in Cc] > > On 27/08/2018 14:27, Lars-Peter Clausen wrote: >> On 08/24/2018 06:04 PM, Luca Ceresoli wrote: >>> The default v

Re: [PATCH 1/1] axi-i2s: set period size register

2018-08-27 Thread Lars-Peter Clausen
On 08/24/2018 06:04 PM, Luca Ceresoli wrote: > The default value of the PERIOD_LEN register is 0 and results in > axi-i2s keeping TLAST always asserted in its AXI Stream output. > > When the AXI Stream is sent to a Xilinx AXI-DMA, this results in the > DMA generating an interrupt flood and ALSA

Re: [PATCH 1/1] axi-i2s: set period size register

2018-08-27 Thread Lars-Peter Clausen
On 08/24/2018 06:04 PM, Luca Ceresoli wrote: > The default value of the PERIOD_LEN register is 0 and results in > axi-i2s keeping TLAST always asserted in its AXI Stream output. > > When the AXI Stream is sent to a Xilinx AXI-DMA, this results in the > DMA generating an interrupt flood and ALSA

Re: [PATCH 1/3] iio: adxl372: Provide validate_trigger and validate_device callbacks

2018-08-20 Thread Lars-Peter Clausen
On 08/20/2018 04:53 PM, Stefan Popa wrote: > This patch provides a validate_device callback for the trigger which makes > sure that other devices are rejected. > > Signed-off-by: Stefan Popa --- > drivers/iio/accel/adxl372.c | 13 + > 1 file changed, 13 insertions(+) > > diff --git

Re: [PATCH 1/3] iio: adxl372: Provide validate_trigger and validate_device callbacks

2018-08-20 Thread Lars-Peter Clausen
On 08/20/2018 04:53 PM, Stefan Popa wrote: > This patch provides a validate_device callback for the trigger which makes > sure that other devices are rejected. > > Signed-off-by: Stefan Popa --- > drivers/iio/accel/adxl372.c | 13 + > 1 file changed, 13 insertions(+) > > diff --git

Re: [alsa-devel] [PATCH] ASoC: adav80x: mark expected switch fall-through

2018-08-09 Thread Lars-Peter Clausen
order the code to look like case 5400: if (source != ADAV80X_PLL_SRC_XIN) return -EINVAL; pll_ctrl1 |= ADAV80X_PLL_CTRL1_PLLDIV; break; It is just as many lines added when adding the /* fall through */, but it makes it more obvious what is going on. Either way: Acked-by: Lars-Peter Clausen

Re: [alsa-devel] [PATCH] ASoC: adav80x: mark expected switch fall-through

2018-08-09 Thread Lars-Peter Clausen
order the code to look like case 5400: if (source != ADAV80X_PLL_SRC_XIN) return -EINVAL; pll_ctrl1 |= ADAV80X_PLL_CTRL1_PLLDIV; break; It is just as many lines added when adding the /* fall through */, but it makes it more obvious what is going on. Either way: Acked-by: Lars-Peter Clausen

Re: [alsa-devel] [PATCH] ASoC: adau1761: Mark expected switch fall-though

2018-08-09 Thread Lars-Peter Clausen
ret = snd_soc_dapm_add_routes(dapm, adau1761_no_dmic_routes, >> ARRAY_SIZE(adau1761_no_dmic_routes)); >> if (ret) > > Again, are you *sure* here? Well, it says so in the comment next to it :) Acked-by: Lars-Peter Clausen

Re: [alsa-devel] [PATCH] ASoC: adau1761: Mark expected switch fall-though

2018-08-09 Thread Lars-Peter Clausen
ret = snd_soc_dapm_add_routes(dapm, adau1761_no_dmic_routes, >> ARRAY_SIZE(adau1761_no_dmic_routes)); >> if (ret) > > Again, are you *sure* here? Well, it says so in the comment next to it :) Acked-by: Lars-Peter Clausen

Re: [PATCH 00/46] Use dmaenginem_async_device_register to simplify code

2018-08-03 Thread Lars-Peter Clausen
On 08/03/2018 09:19 AM, Huang Shijie wrote: > All the patches are using dmaenginem_async_device_register to simplify code > except the last one: > dmaengine: add COMPILE_TEST for the drivers > > I use the last one to do the compiler test. > There are still 20 drivers which do not use the >

Re: [PATCH 00/46] Use dmaenginem_async_device_register to simplify code

2018-08-03 Thread Lars-Peter Clausen
On 08/03/2018 09:19 AM, Huang Shijie wrote: > All the patches are using dmaenginem_async_device_register to simplify code > except the last one: > dmaengine: add COMPILE_TEST for the drivers > > I use the last one to do the compiler test. > There are still 20 drivers which do not use the >

Re: [PATCH 3/4] iio: adc: xilinx: Check for return values in clk related functions

2018-07-19 Thread Lars-Peter Clausen
On 07/18/2018 01:12 PM, Manish Narani wrote: > This patch adds check for return values from clock related functions. > This was reported by static code analysis tool. This patch seems to do something else. > > Signed-off-by: Manish Narani > --- > drivers/iio/adc/xilinx-xadc-core.c | 24

  1   2   3   4   5   6   7   8   9   10   >