linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: John Syne <john3909@gmail.com>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: Re: iio_simple_dummy_buffer_dma
Date: Mon, 22 Feb 2016 18:31:46 +0100	[thread overview]
Message-ID: <56CB4602.6060809@metafoo.de> (raw)
In-Reply-To: <5343A235-F2C0-46B0-A0E1-853F3BC5F27D@gmail.com>

On 02/22/2016 06:25 PM, John Syne wrote:
> Hi Lars,
> 
> It seems like there are other config selections that are selecting KFIFO so it seems to be enabled always. I can enable DMA buffer, but I will see how to disable KFIFO. When I get this working, should I see a waveform in IIO Oscilloscope?

Hi,

There is one for the dummy buffer.

IIO_SIMPLE_DUMMY_BUFFER_DMA needs to be set and
IIO_SIMPLE_DUMMY_BUFFER_KFIFO needs to be unset.

- Lars


> 
> Regards,
> John
> 
> 
> 
> 
>> On Feb 22, 2016, at 3:44 AM, Lars-Peter Clausen <lars@metafoo.de> wrote:
>>
>> On 02/22/2016 05:51 AM, John Syne wrote:
>>> BTW, I seem to remember that Lars removed iio_simple_dummy_buffer_dma.c in his V3 patch so this won’t be in the IIO repo, but I don’t know how to test the IIO DMA framework without this file.
>>>
>>
>> Hi,
>>
>> The patch was dropped for now to avoid conflicts with other ongoing work on
>> the dummy driver. The patch will come back in a slightly overhauled version
>> soonish.
>>
>> As for your problem, make sure that you have the part of the patch which
>> updates things so you can choose in Kconfig whether you want to use the DMA
>> buffer or the KFIFO buffer. And then select the DMA buffer in your .config.
>>
>> - Lars
>>
>>
>>> Regards,
>>> John
>>>
>>>
>>>
>>>
>>>> On Feb 21, 2016, at 8:41 PM, John Syne <john3909@gmail.com> wrote:
>>>>
>>>> Hi,
>>>>
>>>> I am interested in using the IIO DMA framework and tried to use your dummy driver. 
>>>>
>>>> I attempting to get the iio_dummy working with dma and seem to be having sum difficulty.
>>>>
>>>> Here is what I have done so far:
>>>>
>>>> I’m working on a BeagleBoneBlack running a 4.1 Linux Kernel. I have back ported the latest IIO code from git://git.kernel.org/pub/scm/linux/kernel/git/jic23
>>>>
>>>> As a test I tried ti_am335x_adc.ko and enabled in_voltage0_en and then enabled the buffer. Reading from /dev/iio:device0 provided the waveform of the signal generator I had connected to ADC0 on the board. I was even able to run iiod and then connected IIO Oscilloscope which showed the same waveform. I did get a message WARNING: High-speed mode not enabled, but I guess there is no mmap in the driver and that is probably the issue.
>>>>
>>>> In linux config, I have enabled the following:
>>>> CONFIG_IIO_SIMPLE_DUMMY_EVENTS
>>>> CONFIG_IIO_SIMPLE_DUMMY_BUFFER
>>>> CONFIG_IIO_SIMPLE_DUMMY_BUFFER_DMA
>>>> CONFIG_IIO_BUFFER_CB
>>>> CONFIG_IIO_BUFFER_DMA
>>>> CONFIG_IIO_BUFFER_DMAENGINE
>>>> CONFIG_IIO_KFIFO_BUF
>>>> CONFIG_IIO_TRIGGERED_BUFFER
>>>> CONFIG_IIO_TRIGGER
>>>> CONFIG_IIO_CONSUMERS_PER_TRIGGER 2
>>>>
>>>> When I "modprobe iio_dummy”, the following modules are loaded:
>>>>
>>>> industrialio
>>>> industrialio_buffer_dma
>>>> iio_dummy
>>>> kfifo_buf
>>>> iio_dummy_evgen
>>>>
>>>> I then modprobe iio_trig_sysfs which gives me /sys/bus/iio/device/iio_sysfs_trigger. To create a trigger I did:
>>>>
>>>>> echo 1 > /sys/bus/iio/device/iio_sysfs_trigger/add_trigger
>>>>> cat name /sys/bus/iio/device/trigger0/name
>>>>> sysfstrig1
>>>>> echo sysfstrig1 > /sys/bus/iio/device/iio:device0/trigger/current_trigger
>>>>
>>>> Now to enable a measurement:
>>>>
>>>>> echo 1 > /sys/bus/iio/device/iio:device0/scan_elements/in_voltage0_en
>>>>
>>>> Finally to enable the buffer:
>>>>
>>>>> echo 1 /sys/bus/iio/device/iio:device0/buffer/enable
>>>>
>>>> When I read "/dev/iio:device0" I get nothing. Connecting IIO Oscilloscope I get the following error message:
>>>>
>>>> WARNING: High-speed mode not enabled
>>>> ERROR: Reading from device failed: -110
>>>> Client Exited
>>>>
>>>> In iio_simple_dummy_buffer_dma.c, I see iio_dummy_dma_source which generates a rect, sine, tri and saw waveforms. Not sure what I need to do to get these waveforms to generate. Is this demo functional?
>>>>
>>>>
>>>> Regards,
>>>> John
>>>>
>>>>
>>>>
>>>>
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


  parent reply	other threads:[~2016-02-23 12:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-22  4:41 iio_simple_dummy_buffer_dma John Syne
2016-02-22  4:51 ` iio_simple_dummy_buffer_dma John Syne
2016-02-22  4:57   ` iio_simple_dummy_buffer_dma John Syne
2016-02-22  7:34     ` iio_simple_dummy_buffer_dma John Syne
2016-02-22  7:43       ` iio_simple_dummy_buffer_dma John Syne
2016-02-22  7:52         ` iio_simple_dummy_buffer_dma John Syne
2016-02-22 11:44   ` iio_simple_dummy_buffer_dma Lars-Peter Clausen
     [not found]     ` <5343A235-F2C0-46B0-A0E1-853F3BC5F27D@gmail.com>
2016-02-22 17:31       ` Lars-Peter Clausen [this message]
2016-02-23 12:58         ` iio_simple_dummy_buffer_dma John Syne
2016-02-23 16:19         ` iio_simple_dummy_buffer_dma John Syne
2016-02-23 16:33           ` iio_simple_dummy_buffer_dma Lars-Peter Clausen
2016-03-30  6:08             ` iio_simple_dummy_buffer_dma John Syne
2016-03-30 15:26               ` iio_simple_dummy_buffer_dma Lars-Peter Clausen
2016-02-23  7:24     ` iio_simple_dummy_buffer_dma John Syne
2016-02-22  8:07 ` iio_simple_dummy_buffer_dma Daniel Baluta
2016-02-22  8:14   ` iio_simple_dummy_buffer_dma John Syne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56CB4602.6060809@metafoo.de \
    --to=lars@metafoo.de \
    --cc=john3909@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).