All of lore.kernel.org
 help / color / mirror / Atom feed
* ad7793 adc rcv userspace test - details attached
@ 2011-08-24  8:26 malas
  2011-08-24  8:44 ` Jonathan Cameron
  0 siblings, 1 reply; 7+ messages in thread
From: malas @ 2011-08-24  8:26 UTC (permalink / raw)
  To: Jonathan Cameron, Michael Hennerich; +Cc: linux-iio@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 366 bytes --]


Dear Michael Hennerich,

I have attached the details of my testing with the ad7793 driver both as when installed
as module and otherwise.

I have not been to resolve the issue even after having created a device node under /dev
as device0:buffer0.

Requesting your further assistance for the same.

Thanks
Mala



--
Open WebMail Project (http://openwebmail.org)




[-- Attachment #2: ad7793USTst.odt --]
[-- Type: application/vnd.oasis.opendocument.text, Size: 25307 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ad7793 adc rcv userspace test - details attached
  2011-08-24  8:26 ad7793 adc rcv userspace test - details attached malas
@ 2011-08-24  8:44 ` Jonathan Cameron
  2011-08-24  8:53   ` malas
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Cameron @ 2011-08-24  8:44 UTC (permalink / raw)
  To: malas; +Cc: Michael Hennerich, linux-iio@vger.kernel.org

On 08/24/11 09:26, malas wrote:
> 
> Dear Michael Hennerich,
> 
> I have attached the details of my testing with the ad7793 driver both as when installed
> as module and otherwise.
> 
> I have not been to resolve the issue even after having created a device node under /dev
> as device0:buffer0.
> 
> Requesting your further assistance for the same.
> 
> Thanks
> Mala
> 
> 
> 
> --
> Open WebMail Project (http://openwebmail.org)
> 
> 
> 

> Testing results of ADC ad7793 driver with generic_buffer.c
> 
> 
> Results of installing ad7793 adc driver as module:
> 
> root:/> cd lib/modules/3.1.0-rc1-dirty/kernel/drivers/staging/iio/adc/ 
> root:/lib/modules/3.1.0-rc1-dirty/kernel/drivers/staging/iio/adc> ls ad7793.ko 
> root:/lib/modules/3.1.0-rc1-dirty/kernel/drivers/staging/iio/adc> insmod ad7793. ko 
> ad7793: module is from the staging directory, the quality is unknown, you have been warned. 
> root:/lib/modules/3.1.0-rc1-dirty/kernel/drivers/staging/iio/adc> lsmod 
> Module                  Size  Used by 
> ad7793                  7998  0 
> root:/lib/modules/3.1.0-rc1-dirty/kernel/drivers/staging/iio/adc> cd 
> root:/> ls -l /dev/device0\:buffer0 
> crw-r--r--    1 root     root        0,   0 Jan  1 00:00 /dev/device0:buffer0 
> root:/> ls /sys/bus/iio/devices/ 
> iio_sysfs_trigger 
> root:/> 
> 
> I observed driver probe() doesn't get called when inserted as module. Also the device0\buffer0 nodes dont get created on installation.

If probe isn't getting called then something has gone wrong in device matching.
What is the board file you are using? (guessing blackfin hasn't gone all device tree
yet?)

> Results of installing ad7793 adc driver built into kernel:
> 
> I added following line in .rc under dist/vendor/AnalogDevices/common/. 
> 
> mknod /dev/device0:buffer0 c 0 0
> 
> Please confirm this property of node is correct?

No it isn't. 
http://www.kernel.org/pub/linux/docs/device-list/devices-2.6+.txt
tells us that 0 0 is reserved for null devices.

What does the following contain?

/sys/bus/iio/devices/device0:/buffer0/dev



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ad7793 adc rcv userspace test - details attached
  2011-08-24  8:44 ` Jonathan Cameron
@ 2011-08-24  8:53   ` malas
  2011-08-24 15:51     ` Jonathan Cameron
  0 siblings, 1 reply; 7+ messages in thread
From: malas @ 2011-08-24  8:53 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Michael Hennerich, linux-iio@vger.kernel.org

On Wed, 24 Aug 2011 09:44:00 +0100, Jonathan Cameron wrote
> On 08/24/11 09:26, malas wrote:
> > 
> > Dear Michael Hennerich,
> > 
> > I have attached the details of my testing with the ad7793 driver both as when installed
> > as module and otherwise.
> > 
> > I have not been to resolve the issue even after having created a device node under /dev
> > as device0:buffer0.
> > 
> > Requesting your further assistance for the same.
> > 
> > Thanks
> > Mala
> > 
> > 
> > 
> > --
> > Open WebMail Project (http://openwebmail.org)
> > 
> > 
> >
> 
> > Testing results of ADC ad7793 driver with generic_buffer.c
> > 
> > 
> > Results of installing ad7793 adc driver as module:
> > 
> > root:/> cd lib/modules/3.1.0-rc1-dirty/kernel/drivers/staging/iio/adc/ 
> > root:/lib/modules/3.1.0-rc1-dirty/kernel/drivers/staging/iio/adc> ls ad7793.ko 
> > root:/lib/modules/3.1.0-rc1-dirty/kernel/drivers/staging/iio/adc> insmod ad7793. ko 
> > ad7793: module is from the staging directory, the quality is unknown, you have been
warned. 
> > root:/lib/modules/3.1.0-rc1-dirty/kernel/drivers/staging/iio/adc> lsmod 
> > Module                  Size  Used by 
> > ad7793                  7998  0 
> > root:/lib/modules/3.1.0-rc1-dirty/kernel/drivers/staging/iio/adc> cd 
> > root:/> ls -l /dev/device0\:buffer0 
> > crw-r--r--    1 root     root        0,   0 Jan  1 00:00 /dev/device0:buffer0 
> > root:/> ls /sys/bus/iio/devices/ 
> > iio_sysfs_trigger 
> > root:/> 
> > 
> > I observed driver probe() doesn't get called when inserted as module. Also the
device0\buffer0 nodes dont get created on installation.
> 
> If probe isn't getting called then something has gone wrong in device matching.
> What is the board file you are using? (guessing blackfin hasn't gone all 
> device tree yet?)

  board file and driver has name and modalias as ad7793 (small case)


> 
> > Results of installing ad7793 adc driver built into kernel:
> > 
> > I added following line in .rc under dist/vendor/AnalogDevices/common/. 
> > 
> > mknod /dev/device0:buffer0 c 0 0
> > 
> > Please confirm this property of node is correct?
> 
> No it isn't. 
> http://www.kernel.org/pub/linux/docs/device-list/devices-2.6+.txt
> tells us that 0 0 is reserved for null devices.

iio major number listed under/proc/devices for iio was 254  
What major and minor number should I initialize for the /dev/devicw0buffer0 device node. 


> What does the following contain?
> 
> /sys/bus/iio/devices/device0:/buffer0/dev

It has ad7793-dev
--
Open WebMail Project (http://openwebmail.org)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ad7793 adc rcv userspace test - details attached
  2011-08-24  8:53   ` malas
@ 2011-08-24 15:51     ` Jonathan Cameron
  2011-08-25  6:58       ` malas
  2011-08-29  5:39       ` ad7793 adc rcv userspace test - passed succesfully malas
  0 siblings, 2 replies; 7+ messages in thread
From: Jonathan Cameron @ 2011-08-24 15:51 UTC (permalink / raw)
  To: malas; +Cc: Michael Hennerich, linux-iio@vger.kernel.org

On 08/24/11 09:53, malas wrote:
> On Wed, 24 Aug 2011 09:44:00 +0100, Jonathan Cameron wrote
>> On 08/24/11 09:26, malas wrote:
>>>
>>> Dear Michael Hennerich,
>>>
>>> I have attached the details of my testing with the ad7793 driver both as when installed
>>> as module and otherwise.
>>>
>>> I have not been to resolve the issue even after having created a device node under /dev
>>> as device0:buffer0.
>>>
>>> Requesting your further assistance for the same.
>>>
>>> Thanks
>>> Mala
>>>
>>>
>>>
>>> --
>>> Open WebMail Project (http://openwebmail.org)
>>>
>>>
>>>
>>
>>> Testing results of ADC ad7793 driver with generic_buffer.c
>>>
>>>
>>> Results of installing ad7793 adc driver as module:
>>>
>>> root:/> cd lib/modules/3.1.0-rc1-dirty/kernel/drivers/staging/iio/adc/ 
>>> root:/lib/modules/3.1.0-rc1-dirty/kernel/drivers/staging/iio/adc> ls ad7793.ko 
>>> root:/lib/modules/3.1.0-rc1-dirty/kernel/drivers/staging/iio/adc> insmod ad7793. ko 
>>> ad7793: module is from the staging directory, the quality is unknown, you have been
> warned. 
>>> root:/lib/modules/3.1.0-rc1-dirty/kernel/drivers/staging/iio/adc> lsmod 
>>> Module                  Size  Used by 
>>> ad7793                  7998  0 
>>> root:/lib/modules/3.1.0-rc1-dirty/kernel/drivers/staging/iio/adc> cd 
>>> root:/> ls -l /dev/device0\:buffer0 
>>> crw-r--r--    1 root     root        0,   0 Jan  1 00:00 /dev/device0:buffer0 
>>> root:/> ls /sys/bus/iio/devices/ 
>>> iio_sysfs_trigger 
>>> root:/> 
>>>
>>> I observed driver probe() doesn't get called when inserted as module. Also the
> device0\buffer0 nodes dont get created on installation.
>>
>> If probe isn't getting called then something has gone wrong in device matching.
>> What is the board file you are using? (guessing blackfin hasn't gone all 
>> device tree yet?)
> 
>   board file and driver has name and modalias as ad7793 (small case)
> 
> 
>>
>>> Results of installing ad7793 adc driver built into kernel:
>>>
>>> I added following line in .rc under dist/vendor/AnalogDevices/common/. 
>>>
>>> mknod /dev/device0:buffer0 c 0 0
>>>
>>> Please confirm this property of node is correct?
>>
>> No it isn't. 
>> http://www.kernel.org/pub/linux/docs/device-list/devices-2.6+.txt
>> tells us that 0 0 is reserved for null devices.
> 
> iio major number listed under/proc/devices for iio was 254  
> What major and minor number should I initialize for the /dev/devicw0buffer0 device node. 
Major as you've noted is 255
> 
> 
>> What does the following contain?
>>
>> /sys/bus/iio/devices/device0:/buffer0/dev
> 
> It has ad7793-dev
really?  Should be a major:minor number pair.
> --
> Open WebMail Project (http://openwebmail.org)
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ad7793 adc rcv userspace test - details attached
  2011-08-24 15:51     ` Jonathan Cameron
@ 2011-08-25  6:58       ` malas
  2011-08-29  5:39       ` ad7793 adc rcv userspace test - passed succesfully malas
  1 sibling, 0 replies; 7+ messages in thread
From: malas @ 2011-08-25  6:58 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Michael Hennerich, linux-iio@vger.kernel.org

On Wed, 24 Aug 2011 16:51:11 +0100, Jonathan Cameron wrote
> On 08/24/11 09:53, malas wrote:
> > On Wed, 24 Aug 2011 09:44:00 +0100, Jonathan Cameron wrote
> >> On 08/24/11 09:26, malas wrote:
> >>>
> >>> Dear Michael Hennerich,
> >>>
> >>> I have attached the details of my testing with the ad7793 driver both as when
installed
> >>> as module and otherwise.
> >>>
> >>> I have not been to resolve the issue even after having created a device node under
/dev
> >>> as device0:buffer0.
> >>>
> >>> Requesting your further assistance for the same.
> >>>
> >>> Thanks
> >>> Mala
> >>>
> >>>
> >>>
> >>> --
> >>> Open WebMail Project (http://openwebmail.org)
> >>>
> >>>
> >>>
> >>
> >>> Testing results of ADC ad7793 driver with generic_buffer.c
> >>>
> >>>
> >>> Results of installing ad7793 adc driver as module:
> >>>
> >>> root:/> cd lib/modules/3.1.0-rc1-dirty/kernel/drivers/staging/iio/adc/ 
> >>> root:/lib/modules/3.1.0-rc1-dirty/kernel/drivers/staging/iio/adc> ls ad7793.ko 
> >>> root:/lib/modules/3.1.0-rc1-dirty/kernel/drivers/staging/iio/adc> insmod ad7793. ko 
> >>> ad7793: module is from the staging directory, the quality is unknown, you have been
> > warned. 
> >>> root:/lib/modules/3.1.0-rc1-dirty/kernel/drivers/staging/iio/adc> lsmod 
> >>> Module                  Size  Used by 
> >>> ad7793                  7998  0 
> >>> root:/lib/modules/3.1.0-rc1-dirty/kernel/drivers/staging/iio/adc> cd 
> >>> root:/> ls -l /dev/device0\:buffer0 
> >>> crw-r--r--    1 root     root        0,   0 Jan  1 00:00 /dev/device0:buffer0 
> >>> root:/> ls /sys/bus/iio/devices/ 
> >>> iio_sysfs_trigger 
> >>> root:/> 
> >>>
> >>> I observed driver probe() doesn't get called when inserted as module. Also the
> > device0\buffer0 nodes dont get created on installation.
> >>
> >> If probe isn't getting called then something has gone wrong in device matching.
> >> What is the board file you are using? (guessing blackfin hasn't gone all 
> >> device tree yet?)
> > 
> >   board file and driver has name and modalias as ad7793 (small case)
> > 
> > 
> >>
> >>> Results of installing ad7793 adc driver built into kernel:
> >>>
> >>> I added following line in .rc under dist/vendor/AnalogDevices/common/. 
> >>>
> >>> mknod /dev/device0:buffer0 c 0 0
> >>>
> >>> Please confirm this property of node is correct?
> >>
> >> No it isn't. 
> >> http://www.kernel.org/pub/linux/docs/device-list/devices-2.6+.txt
> >> tells us that 0 0 is reserved for null devices.
> > 
> > iio major number listed under/proc/devices for iio was 254  
> > What major and minor number should I initialize for the /dev/devicw0buffer0 device
node. 
> Major as you've noted is 255
> > 
> > 
> >> What does the following contain?
> >>
> >> /sys/bus/iio/devices/device0:/buffer0/dev
> > 
> > It has ad7793-dev
> really?  Should be a major:minor number pair.
Sorry, that was trigger name. Under /dev, as you say,

Yes Jonanthan. /dev has  major:minor = 254:0.

Open() call now succeeds. Poll waits indefinitely. I have to check out if "data ready"
signalling GPIO interrupt gets enabled and ring buffer getting filled or not.I shall
test further and get back.

Thanks Jonanthan.



> > --
> > Open WebMail Project (http://openwebmail.org)
> > 
> > 
> > 
> >


--
Open WebMail Project (http://openwebmail.org)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* ad7793 adc rcv userspace test - passed succesfully
  2011-08-24 15:51     ` Jonathan Cameron
  2011-08-25  6:58       ` malas
@ 2011-08-29  5:39       ` malas
  2011-08-30 10:02         ` Jonathan Cameron
  1 sibling, 1 reply; 7+ messages in thread
From: malas @ 2011-08-29  5:39 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Michael Hennerich, linux-iio@vger.kernel.org


Dear Jonathan Cameron,

I last reported that after creating device node and opening it, read() call was failing.
I got to fix this.

The reason was this:
4 functions are exported from ad7793 module to iio-ring module as ring setup ops:
namely: 
        .preenable = &ad7793_ring_preenable,
	.postenable = &iio_triggered_ring_postenable,
	.predisable = &iio_triggered_ring_predisable,
	.postdisable = &ad7793_ring_postdisable,

In the iio-ring modules "iio_store_ring_enable" function is invoked from user app,which
inturn invokes the func "ad7793_ring_preenable" and subsequently driver's postenable
function.

The "iio_triggered_ring_postenable" function then attaches the poll function to the ring
trigger soft interrupt.

Since continuous mode was set and enabled the configured GPIO interrupt for capturing
data ready signal (in ad7793_ring_preenable) as interrupt, iio_trigger_poll() invoked on
interrupt (from drivers data rdy interrupt handler) failed to raise soft interrupt and
as a consequence driver's ad7793_trigger_handler() was not invoked when data ready.

I patched as follows in ad7793.c:

1. Moved irq enabling from ad7793_ring_preenable to ad7793_ring_postenable
2. Defined ad7793_ring_setup_ops ".postenable" as  ad7793_ring_postenable
3. In ad7793_ring_postenable, invoked &iio_triggered_ring_postenable and then enabled
the data ready signalling GPIO interrupt.

Then, from user app after opening the device, Poll() for rcv data presence was
successful and  read() call returned non-zero size . Could print the data from ring buffer.

Sincere thanks to you and Michael for guiding me through.

Take care.

regards
Mala

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ad7793 adc rcv userspace test - passed succesfully
  2011-08-29  5:39       ` ad7793 adc rcv userspace test - passed succesfully malas
@ 2011-08-30 10:02         ` Jonathan Cameron
  0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2011-08-30 10:02 UTC (permalink / raw)
  To: malas; +Cc: Michael Hennerich, linux-iio@vger.kernel.org

On 08/29/11 06:39, malas wrote:
> 
> Dear Jonathan Cameron,
> 
> I last reported that after creating device node and opening it, read() call was failing.
> I got to fix this.
> 
> The reason was this:
> 4 functions are exported from ad7793 module to iio-ring module as ring setup ops:
> namely: 
>         .preenable = &ad7793_ring_preenable,
> 	.postenable = &iio_triggered_ring_postenable,
> 	.predisable = &iio_triggered_ring_predisable,
> 	.postdisable = &ad7793_ring_postdisable,
> 
> In the iio-ring modules "iio_store_ring_enable" function is invoked from user app,which
> inturn invokes the func "ad7793_ring_preenable" and subsequently driver's postenable
> function.
> 
> The "iio_triggered_ring_postenable" function then attaches the poll function to the ring
> trigger soft interrupt.
> 
> Since continuous mode was set and enabled the configured GPIO interrupt for capturing
> data ready signal (in ad7793_ring_preenable) as interrupt, iio_trigger_poll() invoked on
> interrupt (from drivers data rdy interrupt handler) failed to raise soft interrupt and
> as a consequence driver's ad7793_trigger_handler() was not invoked when data ready.
> 
> I patched as follows in ad7793.c:
> 
> 1. Moved irq enabling from ad7793_ring_preenable to ad7793_ring_postenable
> 2. Defined ad7793_ring_setup_ops ".postenable" as  ad7793_ring_postenable
> 3. In ad7793_ring_postenable, invoked &iio_triggered_ring_postenable and then enabled
> the data ready signalling GPIO interrupt.
Hmm.. That will fix the issue. Normally I'd expect to see the enable actually
happening in the trigger_set_state callback rather than there, but this device
shares the interrupt line with on of the spi signal lines so is messing with irq's
a lot more than normal so I guess that doesn't work?
> 
> Then, from user app after opening the device, Poll() for rcv data presence was
> successful and  read() call returned non-zero size . Could print the data from ring buffer.
> 
> Sincere thanks to you and Michael for guiding me through.
> 
> Take care.
> 
> regards
> Mala
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-08-30  9:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-24  8:26 ad7793 adc rcv userspace test - details attached malas
2011-08-24  8:44 ` Jonathan Cameron
2011-08-24  8:53   ` malas
2011-08-24 15:51     ` Jonathan Cameron
2011-08-25  6:58       ` malas
2011-08-29  5:39       ` ad7793 adc rcv userspace test - passed succesfully malas
2011-08-30 10:02         ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.