* ad7793 iio-ring test read issue - Reg
@ 2011-08-23 8:18 malas
2011-08-23 11:21 ` Jonathan Cameron
0 siblings, 1 reply; 17+ messages in thread
From: malas @ 2011-08-23 8:18 UTC (permalink / raw)
To: linux-iio
Dear Michael Hennerich,
I shall post iio quesris in this mail list as per your suggestions.
AD7793 driver is built into kernel. The chip gets configured and am able to read data on
continuous mode via spi interface using ad7793 driver at kernel level.
While testing userspace test iio-ring to read data from ring buffer, generic_buffer code
was executed, it proceeds till opening /sys/bus/iio/devices/device0:buffer0 and
Read call fails.
In fs I can list the iio device ad7793 with following properties get/set.
root:/> ls /sys/bus/iio/devices/device0\:buffer0/
bytes_per_datum enable power subsystem
dev length scan_elements uevent
root:/>
I find access0 and event0 missing in this list. Is that the reason for read() fails.
Please help.
Thanks
Mala
--
Open WebMail Project (http://openwebmail.org)
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: ad7793 iio-ring test read issue - Reg
2011-08-23 8:18 ad7793 iio-ring test read issue - Reg malas
@ 2011-08-23 11:21 ` Jonathan Cameron
2011-08-23 11:25 ` malas
0 siblings, 1 reply; 17+ messages in thread
From: Jonathan Cameron @ 2011-08-23 11:21 UTC (permalink / raw)
To: malas; +Cc: linux-iio
On 08/23/11 09:18, malas wrote:
>
> Dear Michael Hennerich,
>
>
> I shall post iio quesris in this mail list as per your suggestions.
>
> AD7793 driver is built into kernel. The chip gets configured and am able to read data on
> continuous mode via spi interface using ad7793 driver at kernel level.
>
> While testing userspace test iio-ring to read data from ring buffer, generic_buffer code
> was executed, it proceeds till opening /sys/bus/iio/devices/device0:buffer0 and
> Read call fails.
Question 1: What's the kernel and where did you get it from? (Interfaces are moving
fast so it's plausible you've fallen in a hole where userspace wasn't matching kernelspace).
>
> In fs I can list the iio device ad7793 with following properties get/set.
>
> root:/> ls /sys/bus/iio/devices/device0\:buffer0/
> bytes_per_datum enable power subsystem
> dev length scan_elements uevent
> root:/>
>
> I find access0 and event0 missing in this list. Is that the reason for read() fails.
Yes. Question is why and without kernel version I don't know where to look I'm afraid.
>
> Please help.
>
> Thanks
> Mala
> --
> Open WebMail Project (http://openwebmail.org)
>
>
>
> --
> 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
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: ad7793 iio-ring test read issue - Reg
2011-08-23 11:21 ` Jonathan Cameron
@ 2011-08-23 11:25 ` malas
2011-08-23 11:39 ` Hennerich, Michael
0 siblings, 1 reply; 17+ messages in thread
From: malas @ 2011-08-23 11:25 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: linux-iio
Dear Jonathan Cameron,
The kernel version I am using is :
---------------------------------------------------------------------
midas@ubuntu:~/Mala/Telemedicine/uclinux_source/uc2010_source/uclinux/2010R1$ svn info
Path: .
URL: svn://blackfin.uclinux.org/uclinux-dist/branches/2010R1
Repository Root: svn://blackfin.uclinux.org/uclinux-dist
Repository UUID: 3e2a5524-39e8-4cb9-84a9-c49da69cba3a
Revision: 10161
Node Kind: directory
Schedule: normal
Last Changed Author: vapier
Last Changed Rev: 10136
Last Changed Date: 2011-04-02 22:36:15 +0530 (Sat, 02 Apr 2011)
---------------------------------------------------------------------
Regards
Mala
On Tue, 23 Aug 2011 12:21:25 +0100, Jonathan Cameron wrote
> On 08/23/11 09:18, malas wrote:
> >
> > Dear Michael Hennerich,
> >
> >
> > I shall post iio quesris in this mail list as per your suggestions.
> >
> > AD7793 driver is built into kernel. The chip gets configured and am able to read data on
> > continuous mode via spi interface using ad7793 driver at kernel level.
> >
> > While testing userspace test iio-ring to read data from ring buffer, generic_buffer code
> > was executed, it proceeds till opening /sys/bus/iio/devices/device0:buffer0 and
> > Read call fails.
> Question 1: What's the kernel and where did you get it from? (Interfaces are moving
> fast so it's plausible you've fallen in a hole where userspace wasn't matching
> kernelspace).
> >
> > In fs I can list the iio device ad7793 with following properties get/set.
> >
> > root:/> ls /sys/bus/iio/devices/device0\:buffer0/
> > bytes_per_datum enable power subsystem
> > dev length scan_elements uevent
> > root:/>
> >
> > I find access0 and event0 missing in this list. Is that the reason for read() fails.
> Yes. Question is why and without kernel version I don't know where to look
> I'm afraid.
>
> >
> > Please help.
> >
> > Thanks
> > Mala
> > --
> > Open WebMail Project (http://openwebmail.org)
> >
> >
> >
> > --
> > 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
> >
--
Open WebMail Project (http://openwebmail.org)
^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: ad7793 iio-ring test read issue - Reg
2011-08-23 11:25 ` malas
@ 2011-08-23 11:39 ` Hennerich, Michael
2011-08-23 12:17 ` malas
0 siblings, 1 reply; 17+ messages in thread
From: Hennerich, Michael @ 2011-08-23 11:39 UTC (permalink / raw)
To: malas, Jonathan Cameron; +Cc: linux-iio@vger.kernel.org
malas wrote on 2011-08-23:
>
>
> Dear Jonathan Cameron,
>
> The kernel version I am using is :
Didn't you say that you use the staging kernel?
http://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?_forum_action=MessageReply&message_id=102839&action=ForumBrowse
Or copied drivers/staging/iio over to your Blackfin kernel tree?
>
> ---------------------------------------------------------------------
> midas@ubuntu:~/Mala/Telemedicine/uclinux_source/uc2010_source/uclinux/2
> 010R1$ svn info Path: . URL:
> svn://blackfin.uclinux.org/uclinux-dist/branches/2010R1 Repository Root:
> svn://blackfin.uclinux.org/uclinux-dist Repository UUID:
> 3e2a5524-39e8-4cb9-84a9-c49da69cba3a Revision: 10161 Node Kind:
> directory Schedule: normal Last Changed Author: vapier Last Changed Rev:
> 10136 Last Changed Date: 2011-04-02 22:36:15 +0530 (Sat, 02 Apr 2011)
> ---------------------------------------------------------------------
>
> Regards
> Mala
>
> On Tue, 23 Aug 2011 12:21:25 +0100, Jonathan Cameron wrote
>> On 08/23/11 09:18, malas wrote:
>>>
>>> Dear Michael Hennerich,
>>>
>>>
>>> I shall post iio quesris in this mail list as per your suggestions.
>>>
>>> AD7793 driver is built into kernel. The chip gets configured and am
>>> able to read data on continuous mode via spi interface using ad7793
>>> driver at kernel level.
>>>
>>> While testing userspace test iio-ring to read data from ring buffer,
>>> generic_buffer code was executed, it proceeds till opening
>>> /sys/bus/iio/devices/device0:buffer0 and Read call fails.
>> Question 1: What's the kernel and where did you get it from?
>> (Interfaces are moving fast so it's plausible you've fallen in a hole
>> where userspace wasn't matching kernelspace).
>>>
>>> In fs I can list the iio device ad7793 with following properties
>>> get/set.
>>>
>>> root:/> ls /sys/bus/iio/devices/device0\:buffer0/
>>> bytes_per_datum enable power subsystem
>>> dev length scan_elements uevent
>>> root:/>
>>>
>>> I find access0 and event0 missing in this list. Is that the reason
> for read() fails.
>> Yes. Question is why and without kernel version I don't know where to
>> look I'm afraid.
>>
>>>
>>> Please help.
>>>
>>> Thanks
>>> Mala
>>> --
>>> Open WebMail Project (http://openwebmail.org)
>>>
>>>
>>>
>>> -- 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
>>>
>
>
Greetings,
Michael
--
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin, Margaret Seif
^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: ad7793 iio-ring test read issue - Reg
2011-08-23 11:39 ` Hennerich, Michael
@ 2011-08-23 12:17 ` malas
2011-08-23 12:39 ` Jonathan Cameron
0 siblings, 1 reply; 17+ messages in thread
From: malas @ 2011-08-23 12:17 UTC (permalink / raw)
To: Hennerich, Michael, Jonathan Cameron; +Cc: linux-iio@vger.kernel.org
Sorry, I did not explicitly mention that. I did use the new staging kernel referred by
Michael Hennerich and integrated with 2010RC5 uclinux dist .
On Tue, 23 Aug 2011 12:39:53 +0100, Hennerich, Michael wrote
> malas wrote on 2011-08-23:
> >
> >
> > Dear Jonathan Cameron,
> >
> > The kernel version I am using is :
>
> Didn't you say that you use the staging kernel?
>
>
http://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?_forum_action=MessageReply&message_id=102839&action=ForumBrowse
>
> Or copied drivers/staging/iio over to your Blackfin kernel tree?
>
> >
> > ---------------------------------------------------------------------
> > midas@ubuntu:~/Mala/Telemedicine/uclinux_source/uc2010_source/uclinux/2
> > 010R1$ svn info Path: . URL:
> > svn://blackfin.uclinux.org/uclinux-dist/branches/2010R1 Repository Root:
> > svn://blackfin.uclinux.org/uclinux-dist Repository UUID:
> > 3e2a5524-39e8-4cb9-84a9-c49da69cba3a Revision: 10161 Node Kind:
> > directory Schedule: normal Last Changed Author: vapier Last Changed Rev:
> > 10136 Last Changed Date: 2011-04-02 22:36:15 +0530 (Sat, 02 Apr 2011)
> > ---------------------------------------------------------------------
> >
> > Regards
> > Mala
> >
> > On Tue, 23 Aug 2011 12:21:25 +0100, Jonathan Cameron wrote
> >> On 08/23/11 09:18, malas wrote:
> >>>
> >>> Dear Michael Hennerich,
> >>>
> >>>
> >>> I shall post iio quesris in this mail list as per your suggestions.
> >>>
> >>> AD7793 driver is built into kernel. The chip gets configured and am
> >>> able to read data on continuous mode via spi interface using ad7793
> >>> driver at kernel level.
> >>>
> >>> While testing userspace test iio-ring to read data from ring buffer,
> >>> generic_buffer code was executed, it proceeds till opening
> >>> /sys/bus/iio/devices/device0:buffer0 and Read call fails.
> >> Question 1: What's the kernel and where did you get it from?
> >> (Interfaces are moving fast so it's plausible you've fallen in a hole
> >> where userspace wasn't matching kernelspace).
> >>>
> >>> In fs I can list the iio device ad7793 with following properties
> >>> get/set.
> >>>
> >>> root:/> ls /sys/bus/iio/devices/device0\:buffer0/
> >>> bytes_per_datum enable power subsystem
> >>> dev length scan_elements uevent
> >>> root:/>
> >>>
> >>> I find access0 and event0 missing in this list. Is that the reason
> > for read() fails.
> >> Yes. Question is why and without kernel version I don't know where to
> >> look I'm afraid.
> >>
> >>>
> >>> Please help.
> >>>
> >>> Thanks
> >>> Mala
> >>> --
> >>> Open WebMail Project (http://openwebmail.org)
> >>>
> >>>
> >>>
> >>> -- 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
> >>>
> >
> >
>
> Greetings,
> Michael
>
> --
> Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
> Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
> Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
> Margaret Seif
--
Open WebMail Project (http://openwebmail.org)
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: ad7793 iio-ring test read issue - Reg
2011-08-23 12:17 ` malas
@ 2011-08-23 12:39 ` Jonathan Cameron
2011-08-23 12:43 ` malas
0 siblings, 1 reply; 17+ messages in thread
From: Jonathan Cameron @ 2011-08-23 12:39 UTC (permalink / raw)
To: malas; +Cc: Hennerich, Michael, linux-iio@vger.kernel.org
On 08/23/11 13:17, malas wrote:
>
>
> Sorry, I did not explicitly mention that. I did use the new staging kernel referred by
> Michael Hennerich and integrated with 2010RC5 uclinux dist .
Hmm. As in current contents of Greg KH's staging/staging-next?
I'll assume so... See below.
>
> On Tue, 23 Aug 2011 12:39:53 +0100, Hennerich, Michael wrote
>> malas wrote on 2011-08-23:
>>>
>>>
>>> Dear Jonathan Cameron,
>>>
>>> The kernel version I am using is :
>>
>> Didn't you say that you use the staging kernel?
>>
>>
> http://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?_forum_action=MessageReply&message_id=102839&action=ForumBrowse
>>
>> Or copied drivers/staging/iio over to your Blackfin kernel tree?
>>
>>>
>>> ---------------------------------------------------------------------
>>> midas@ubuntu:~/Mala/Telemedicine/uclinux_source/uc2010_source/uclinux/2
>>> 010R1$ svn info Path: . URL:
>>> svn://blackfin.uclinux.org/uclinux-dist/branches/2010R1 Repository Root:
>>> svn://blackfin.uclinux.org/uclinux-dist Repository UUID:
>>> 3e2a5524-39e8-4cb9-84a9-c49da69cba3a Revision: 10161 Node Kind:
>>> directory Schedule: normal Last Changed Author: vapier Last Changed Rev:
>>> 10136 Last Changed Date: 2011-04-02 22:36:15 +0530 (Sat, 02 Apr 2011)
>>> ---------------------------------------------------------------------
>>>
>>> Regards
>>> Mala
>>>
>>> On Tue, 23 Aug 2011 12:21:25 +0100, Jonathan Cameron wrote
>>>> On 08/23/11 09:18, malas wrote:
>>>>>
>>>>> Dear Michael Hennerich,
>>>>>
>>>>>
>>>>> I shall post iio quesris in this mail list as per your suggestions.
>>>>>
>>>>> AD7793 driver is built into kernel. The chip gets configured and am
>>>>> able to read data on continuous mode via spi interface using ad7793
>>>>> driver at kernel level.
>>>>>
>>>>> While testing userspace test iio-ring to read data from ring buffer,
>>>>> generic_buffer code was executed, it proceeds till opening
>>>>> /sys/bus/iio/devices/device0:buffer0 and Read call fails.
>>>> Question 1: What's the kernel and where did you get it from?
>>>> (Interfaces are moving fast so it's plausible you've fallen in a hole
>>>> where userspace wasn't matching kernelspace).
>>>>>
>>>>> In fs I can list the iio device ad7793 with following properties
>>>>> get/set.
>>>>>
>>>>> root:/> ls /sys/bus/iio/devices/device0\:buffer0/
>>>>> bytes_per_datum enable power subsystem
>>>>> dev length scan_elements uevent
>>>>> root:/>
>>>>>
>>>>> I find access0 and event0 missing in this list. Is that the reason
>>> for read() fails.
>>>> Yes. Question is why and without kernel version I don't know where to
>>>> look I'm afraid.
Ah, this does look like a missmatch in interfaces between userspace and kernel.
At this point in time we have scrapped the event0 chrdev (done via polling on
the access one) and the access one has be flattened into device0\:buffer0/
(read dev).
Looks like the generic_buffer.c example does line up though. Where did the
'test iio-ring' come from? Is that one yours Michael?
>>>>
>>>>>
>>>>> Please help.
>>>>>
>>>>> Thanks
>>>>> Mala
>>>>> --
>>>>> Open WebMail Project (http://openwebmail.org)
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: ad7793 iio-ring test read issue - Reg
2011-08-23 12:39 ` Jonathan Cameron
@ 2011-08-23 12:43 ` malas
2011-08-23 12:58 ` Jonathan Cameron
0 siblings, 1 reply; 17+ messages in thread
From: malas @ 2011-08-23 12:43 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: Hennerich, Michael, "linux-iio
YES : Gregs updated kernel taken from link below:
http://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6.git
On Tue, 23 Aug 2011 13:39:12 +0100, Jonathan Cameron wrote
> On 08/23/11 13:17, malas wrote:
> >
> >
> > Sorry, I did not explicitly mention that. I did use the new staging kernel referred by
> > Michael Hennerich and integrated with 2010RC5 uclinux dist .
>
> Hmm. As in current contents of Greg KH's staging/staging-next?
>
> I'll assume so... See below.
>
> >
> > On Tue, 23 Aug 2011 12:39:53 +0100, Hennerich, Michael wrote
> >> malas wrote on 2011-08-23:
> >>>
> >>>
> >>> Dear Jonathan Cameron,
> >>>
> >>> The kernel version I am using is :
> >>
> >> Didn't you say that you use the staging kernel?
> >>
> >>
> >
http://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?_forum_action=MessageReply&message_id=102839&action=ForumBrowse
> >>
> >> Or copied drivers/staging/iio over to your Blackfin kernel tree?
> >>
> >>>
> >>> ---------------------------------------------------------------------
> >>> midas@ubuntu:~/Mala/Telemedicine/uclinux_source/uc2010_source/uclinux/2
> >>> 010R1$ svn info Path: . URL:
> >>> svn://blackfin.uclinux.org/uclinux-dist/branches/2010R1 Repository Root:
> >>> svn://blackfin.uclinux.org/uclinux-dist Repository UUID:
> >>> 3e2a5524-39e8-4cb9-84a9-c49da69cba3a Revision: 10161 Node Kind:
> >>> directory Schedule: normal Last Changed Author: vapier Last Changed Rev:
> >>> 10136 Last Changed Date: 2011-04-02 22:36:15 +0530 (Sat, 02 Apr 2011)
> >>> ---------------------------------------------------------------------
> >>>
> >>> Regards
> >>> Mala
> >>>
> >>> On Tue, 23 Aug 2011 12:21:25 +0100, Jonathan Cameron wrote
> >>>> On 08/23/11 09:18, malas wrote:
> >>>>>
> >>>>> Dear Michael Hennerich,
> >>>>>
> >>>>>
> >>>>> I shall post iio quesris in this mail list as per your suggestions.
> >>>>>
> >>>>> AD7793 driver is built into kernel. The chip gets configured and am
> >>>>> able to read data on continuous mode via spi interface using ad7793
> >>>>> driver at kernel level.
> >>>>>
> >>>>> While testing userspace test iio-ring to read data from ring buffer,
> >>>>> generic_buffer code was executed, it proceeds till opening
> >>>>> /sys/bus/iio/devices/device0:buffer0 and Read call fails.
> >>>> Question 1: What's the kernel and where did you get it from?
> >>>> (Interfaces are moving fast so it's plausible you've fallen in a hole
> >>>> where userspace wasn't matching kernelspace).
> >>>>>
> >>>>> In fs I can list the iio device ad7793 with following properties
> >>>>> get/set.
> >>>>>
> >>>>> root:/> ls /sys/bus/iio/devices/device0\:buffer0/
> >>>>> bytes_per_datum enable power subsystem
> >>>>> dev length scan_elements uevent
> >>>>> root:/>
> >>>>>
> >>>>> I find access0 and event0 missing in this list. Is that the reason
> >>> for read() fails.
> >>>> Yes. Question is why and without kernel version I don't know where to
> >>>> look I'm afraid.
> Ah, this does look like a missmatch in interfaces between userspace and kernel.
>
> At this point in time we have scrapped the event0 chrdev (done via polling on
> the access one) and the access one has be flattened into device0\:buffer0/
> (read dev).
>
> Looks like the generic_buffer.c example does line up though. Where did the
> 'test iio-ring' come from? Is that one yours Michael?
> >>>>
> >>>>>
> >>>>> Please help.
> >>>>>
> >>>>> Thanks
> >>>>> Mala
> >>>>> --
> >>>>> Open WebMail Project (http://openwebmail.org)
> >
--
Open WebMail Project (http://openwebmail.org)
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: ad7793 iio-ring test read issue - Reg
2011-08-23 12:43 ` malas
@ 2011-08-23 12:58 ` Jonathan Cameron
2011-08-23 13:24 ` malas
0 siblings, 1 reply; 17+ messages in thread
From: Jonathan Cameron @ 2011-08-23 12:58 UTC (permalink / raw)
To: malas; +Cc: Hennerich, Michael, linux-iio
On 08/23/11 13:43, malas wrote:
> YES : Gregs updated kernel taken from link below:
>
> http://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6.git
Right now that's pretty much mainline.
See comments below and please reply inline as it makes this sort
of discussion much easier to follow.
>
>
> On Tue, 23 Aug 2011 13:39:12 +0100, Jonathan Cameron wrote
>> On 08/23/11 13:17, malas wrote:
>>>
>>>
>>> Sorry, I did not explicitly mention that. I did use the new staging kernel referred by
>>> Michael Hennerich and integrated with 2010RC5 uclinux dist .
>>
>> Hmm. As in current contents of Greg KH's staging/staging-next?
>>
>> I'll assume so... See below.
>>
>>>
>>> On Tue, 23 Aug 2011 12:39:53 +0100, Hennerich, Michael wrote
>>>> malas wrote on 2011-08-23:
>>>>>
>>>>>
>>>>> Dear Jonathan Cameron,
>>>>>
>>>>> The kernel version I am using is :
>>>>
>>>> Didn't you say that you use the staging kernel?
>>>>
>>>>
>>>
> http://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?_forum_action=MessageReply&message_id=102839&action=ForumBrowse
>>>>
>>>> Or copied drivers/staging/iio over to your Blackfin kernel tree?
>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> midas@ubuntu:~/Mala/Telemedicine/uclinux_source/uc2010_source/uclinux/2
>>>>> 010R1$ svn info Path: . URL:
>>>>> svn://blackfin.uclinux.org/uclinux-dist/branches/2010R1 Repository Root:
>>>>> svn://blackfin.uclinux.org/uclinux-dist Repository UUID:
>>>>> 3e2a5524-39e8-4cb9-84a9-c49da69cba3a Revision: 10161 Node Kind:
>>>>> directory Schedule: normal Last Changed Author: vapier Last Changed Rev:
>>>>> 10136 Last Changed Date: 2011-04-02 22:36:15 +0530 (Sat, 02 Apr 2011)
>>>>> ---------------------------------------------------------------------
>>>>>
>>>>> Regards
>>>>> Mala
>>>>>
>>>>> On Tue, 23 Aug 2011 12:21:25 +0100, Jonathan Cameron wrote
>>>>>> On 08/23/11 09:18, malas wrote:
>>>>>>>
>>>>>>> Dear Michael Hennerich,
>>>>>>>
>>>>>>>
>>>>>>> I shall post iio quesris in this mail list as per your suggestions.
>>>>>>>
>>>>>>> AD7793 driver is built into kernel. The chip gets configured and am
>>>>>>> able to read data on continuous mode via spi interface using ad7793
>>>>>>> driver at kernel level.
>>>>>>>
>>>>>>> While testing userspace test iio-ring to read data from ring buffer,
>>>>>>> generic_buffer code was executed, it proceeds till opening
>>>>>>> /sys/bus/iio/devices/device0:buffer0 and Read call fails.
>>>>>> Question 1: What's the kernel and where did you get it from?
>>>>>> (Interfaces are moving fast so it's plausible you've fallen in a hole
>>>>>> where userspace wasn't matching kernelspace).
>>>>>>>
>>>>>>> In fs I can list the iio device ad7793 with following properties
>>>>>>> get/set.
>>>>>>>
>>>>>>> root:/> ls /sys/bus/iio/devices/device0\:buffer0/
>>>>>>> bytes_per_datum enable power subsystem
>>>>>>> dev length scan_elements uevent
>>>>>>> root:/>
>>>>>>>
>>>>>>> I find access0 and event0 missing in this list. Is that the reason
>>>>> for read() fails.
>>>>>> Yes. Question is why and without kernel version I don't know where to
>>>>>> look I'm afraid.
>> Ah, this does look like a missmatch in interfaces between userspace and kernel.
>>
>> At this point in time we have scrapped the event0 chrdev (done via polling on
>> the access one) and the access one has be flattened into device0\:buffer0/
>> (read dev).
>>
>> Looks like the generic_buffer.c example does line up though. Where did the
>> 'test iio-ring' come from? Is that one yours Michael?
>>>>>>
>>>>>>>
>>>>>>> Please help.
>>>>>>>
>>>>>>> Thanks
>>>>>>> Mala
>>>>>>> --
>>>>>>> Open WebMail Project (http://openwebmail.org)
>>>
>
>
> --
> Open WebMail Project (http://openwebmail.org)
>
>
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: ad7793 iio-ring test read issue - Reg
2011-08-23 12:58 ` Jonathan Cameron
@ 2011-08-23 13:24 ` malas
2011-08-23 13:41 ` Jonathan Cameron
0 siblings, 1 reply; 17+ messages in thread
From: malas @ 2011-08-23 13:24 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: Hennerich, Michael, linux-iio
[-- Attachment #1: Type: text/plain, Size: 4577 bytes --]
On Tue, 23 Aug 2011 13:58:34 +0100, Jonathan Cameron wrote
> On 08/23/11 13:43, malas wrote:
> > YES : Gregs updated kernel taken from link below:
> >
> > http://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6.git
> Right now that's pretty much mainline.
>
> See comments below and please reply inline as it makes this sort
> of discussion much easier to follow.
> >
> >
> > On Tue, 23 Aug 2011 13:39:12 +0100, Jonathan Cameron wrote
> >> On 08/23/11 13:17, malas wrote:
> >>>
> >>>
> >>> Sorry, I did not explicitly mention that. I did use the new staging kernel referred by
> >>> Michael Hennerich and integrated with 2010RC5 uclinux dist .
> >>
> >> Hmm. As in current contents of Greg KH's staging/staging-next?
> >>
> >> I'll assume so... See below.
> >>
> >>>
> >>> On Tue, 23 Aug 2011 12:39:53 +0100, Hennerich, Michael wrote
> >>>> malas wrote on 2011-08-23:
> >>>>>
> >>>>>
> >>>>> Dear Jonathan Cameron,
> >>>>>
> >>>>> The kernel version I am using is :
> >>>>
> >>>> Didn't you say that you use the staging kernel?
> >>>>
> >>>>
> >>>
> >
http://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?_forum_action=MessageReply&message_id=102839&action=ForumBrowse
> >>>>
> >>>> Or copied drivers/staging/iio over to your Blackfin kernel tree?
> >>>>
> >>>>>
> >>>>> ---------------------------------------------------------------------
> >>>>> midas@ubuntu:~/Mala/Telemedicine/uclinux_source/uc2010_source/uclinux/2
> >>>>> 010R1$ svn info Path: . URL:
> >>>>> svn://blackfin.uclinux.org/uclinux-dist/branches/2010R1 Repository Root:
> >>>>> svn://blackfin.uclinux.org/uclinux-dist Repository UUID:
> >>>>> 3e2a5524-39e8-4cb9-84a9-c49da69cba3a Revision: 10161 Node Kind:
> >>>>> directory Schedule: normal Last Changed Author: vapier Last Changed Rev:
> >>>>> 10136 Last Changed Date: 2011-04-02 22:36:15 +0530 (Sat, 02 Apr 2011)
> >>>>> ---------------------------------------------------------------------
> >>>>>
> >>>>> Regards
> >>>>> Mala
> >>>>>
> >>>>> On Tue, 23 Aug 2011 12:21:25 +0100, Jonathan Cameron wrote
> >>>>>> On 08/23/11 09:18, malas wrote:
> >>>>>>>
> >>>>>>> Dear Michael Hennerich,
> >>>>>>>
> >>>>>>>
> >>>>>>> I shall post iio quesris in this mail list as per your suggestions.
> >>>>>>>
> >>>>>>> AD7793 driver is built into kernel. The chip gets configured and am
> >>>>>>> able to read data on continuous mode via spi interface using ad7793
> >>>>>>> driver at kernel level.
> >>>>>>>
> >>>>>>> While testing userspace test iio-ring to read data from ring buffer,
> >>>>>>> generic_buffer code was executed, it proceeds till opening
> >>>>>>> /sys/bus/iio/devices/device0:buffer0 and Read call fails.
> >>>>>> Question 1: What's the kernel and where did you get it from?
> >>>>>> (Interfaces are moving fast so it's plausible you've fallen in a hole
> >>>>>> where userspace wasn't matching kernelspace).
> >>>>>>>
> >>>>>>> In fs I can list the iio device ad7793 with following properties
> >>>>>>> get/set.
> >>>>>>>
> >>>>>>> root:/> ls /sys/bus/iio/devices/device0\:buffer0/
> >>>>>>> bytes_per_datum enable power subsystem
> >>>>>>> dev length scan_elements uevent
> >>>>>>> root:/>
> >>>>>>>
> >>>>>>> I find access0 and event0 missing in this list. Is that the reason
> >>>>> for read() fails.
> >>>>>> Yes. Question is why and without kernel version I don't know where to
> >>>>>> look I'm afraid.
> >> Ah, this does look like a missmatch in interfaces between userspace and kernel.
> >>
> >> At this point in time we have scrapped the event0 chrdev (done via polling on
> >> the access one) and the access one has be flattened into device0\:buffer0/
> >> (read dev).
> >>
> >> Looks like the generic_buffer.c example does line up though. Where did the
> >> 'test iio-ring' come from? Is that one yours Michael?
iio-ring.c under uclinux2010/user/blkfin-test/iio-ring-test. The file is in the
attached. I did not use that since i didn't find access0 or event0 files under
/sys/bus/iio/devices/device0:buffer0.
I have tested with the generic_buffer.c example (under iio/documentaion folder) to get
Ad7793 received samples to user space from ring buffer.
The app opens: /dev/device0:buffer0 for poll and reading samples.
Is the device name for the open() correct.
> >>>>>>
> >>>>>>>
> >>>>>>> Please help.
> >>>>>>>
> >>>>>>> Thanks
> >>>>>>> Mala
> >>>>>>> --
> >>>>>>> Open WebMail Project (http://openwebmail.org)
> >>>
> >
> >
> > --
> > Open WebMail Project (http://openwebmail.org)
> >
> >
> >
> >
--
Open WebMail Project (http://openwebmail.org)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: iio-ring.c --]
[-- Type: text/x-csrc; name="iio-ring.c", Size: 7279 bytes --]
/*
* Analog Devices IIO devices ring test program
*
* Author: Barry Song
* based on:
* Jonathan Cameron's Industrialio ring buffer with a lis3l02dq accelerometer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*
* This program is primarily intended as an example application.
*/
#include <dirent.h>
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/dir.h>
#include <linux/types.h>
#include <unistd.h>
#include "iio_utils.h"
#define IIO_TST_DBG
char device_name[IIO_MAX_NAME_LENGTH];
char trigger_name_base[IIO_MAX_NAME_LENGTH];
int num_vals;
int num_loops;
const int scan_ts = 1;
const int buf_len = 128;
char* argv0;
/*
* Could get this from ring bps, but only after starting the ring
* which is a bit late for it to be useful.
*
* Todo: replace with much more generic version based on scan_elements
* directory.
*/
int size_from_scanmode(int num_vals, int timestamp)
{
if (num_vals && timestamp)
return (((num_vals*sizeof(__s16))+sizeof(__s64)-1) & ~(sizeof(__s64)-1))+sizeof(__s64);
else if (timestamp)
return 8;
else
return num_vals*sizeof(__s16);
}
void usage(void){
fprintf(stderr, "usage:%s -n devicename -c valuenumber -l looptimes\n", argv0);
exit(1);
}
int main(int argc, char **argv)
{
int ret;
int i, j, k, toread;
FILE *fp_ev;
int fp;
char *trigger_name, *dev_dir_name, *buf_dir_name;
char *data;
size_t read_size;
struct iio_event_data dat;
int dev_num, trig_num;
int c;
char *buffer_access, *buffer_event;
const char *iio_dir = "/sys/bus/iio/devices/";
int scan_size;
argv0= argv[0];
while( (c = getopt(argc, argv, "n:c:l:")) != -1 ) {
switch (c) {
case 'n':
strcpy(device_name, optarg);
sprintf(trigger_name_base,"%s-dev", device_name);
break;
case 'c': num_vals = atoi(optarg); break;
case 'l': num_loops = atoi(optarg); break;
default: usage();
}
}
if (!sizeof(device_name) || !num_vals || !num_loops)
usage();
/* Find out which iio device is the accelerometer. */
dev_num = find_type_by_name(device_name, "device");
if (dev_num < 0) {
printf("Failed to find the %s\n", device_name);
ret = -ENODEV;
goto error_ret;
}
printf("iio device number being used is %d\n", dev_num);
asprintf(&dev_dir_name, "%sdevice%d", iio_dir, dev_num);
/*
* Build the trigger name.
* In this case we want the lis3l02dq's data ready trigger
* for this lis3l02dq. The naming is lis3l02dq_dev[n], where
* n matches the device number found above.
*/
ret = asprintf(&trigger_name, "%s%d", trigger_name_base, dev_num);
if (ret < 0) {
ret = -ENOMEM;
goto error_free_dev_dir_name;
}
/*
* Find the trigger by name.
* This is techically unecessary here as we only need to
* refer to the trigger by name and that name is already
* known.
*/
trig_num = find_type_by_name(trigger_name, "trigger");
if (trig_num < 0) {
printf("Failed to find the %s\n", trigger_name);
ret = -ENODEV;
goto error_free_triggername;
}
printf("iio trigger number being used is %d\n", trig_num);
/*
* Construct the directory name for the associated buffer.
* As we know that the lis3l02dq has only one buffer this may
* be built rather than found.
*/
ret = asprintf(&buf_dir_name, "%sdevice%d:buffer0", iio_dir, dev_num);
if (ret < 0) {
ret = -ENOMEM;
goto error_free_triggername;
}
/* Set the device trigger to be the data rdy trigger found above */
ret = write_sysfs_string_and_verify("trigger/current_trigger",
dev_dir_name,
trigger_name);
if (ret < 0) {
printf("Failed to write current_trigger file\n");
goto error_free_buf_dir_name;
}
#ifdef IIO_TST_DBG
printf("Going to setup ring parameters, length\n");
#endif
/* Setup ring buffer parameters */
ret = write_sysfs_int("length", buf_dir_name, buf_len);
if (ret < 0)
goto error_free_buf_dir_name;
#ifdef IIO_TST_DBG
printf("Going to setup ring parameters, ring_enable\n");
#endif
/* Enable the buffer */
// ret = write_sysfs_int("ring_enable", buf_dir_name, 1); // Re: Mala changing to enable
ret = write_sysfs_int("enable", buf_dir_name, 1);
if (ret < 0)
goto error_free_buf_dir_name;
data = malloc(size_from_scanmode(num_vals, scan_ts)*buf_len);
if (!data) {
ret = -ENOMEM;
goto error_free_buf_dir_name;
}
ret = asprintf(&buffer_access,
"/dev/device%d:buffer0:access0",
dev_num);
if (ret < 0) {
ret = -ENOMEM;
goto error_free_data;
}
ret = asprintf(&buffer_event, "/dev/device%d:buffer0:event0", dev_num);
if (ret < 0) {
ret = -ENOMEM;
goto error_free_data;
}
#ifdef IIO_TST_DBG
printf("Going to open buffer_access in nblk \n");
#endif
/* Attempt to open non blocking the access dev */
fp = open(buffer_access, O_RDONLY | O_NONBLOCK);
if (fp == -1) { /*If it isn't there make the node */
printf("Failed to open %s\n", buffer_access);
ret = -errno;
goto error_free_buffer_event;
}
#ifdef IIO_TST_DBG
printf("Going to setup opening buffer-event in blocking mode\n");
#endif
/* Attempt to open the event access dev (blocking this time) */
fp_ev = fopen(buffer_event, "rb");
if (fp_ev == NULL) {
printf("Failed to open %s\n", buffer_event);
ret = -errno;
goto error_close_buffer_access;
}
#ifdef IIO_TST_DBG
printf("Starting to wait for events\n");
#endif
/* Wait for events 10 times */
for (j = 0; j < num_loops; j++) {
read_size = fread(&dat, 1, sizeof(struct iio_event_data),
fp_ev);
switch (dat.id) {
case IIO_EVENT_CODE_RING_100_FULL:
toread = buf_len;
break;
case IIO_EVENT_CODE_RING_75_FULL:
toread = buf_len*3/4;
break;
case IIO_EVENT_CODE_RING_50_FULL:
toread = buf_len/2;
break;
default:
printf("Unexpecteded event code\n");
continue;
}
#ifdef IIO_TST_DBG
printf("Entering blocked read\n");
#endif
read_size = read(fp,
data,
toread*size_from_scanmode(num_vals, scan_ts));
if (read_size == -EAGAIN) {
printf("nothing available\n");
continue;
}
#ifdef IIO_TST_DBG
printf("Read %d samples\n",read_size);
#endif
scan_size = size_from_scanmode(num_vals, scan_ts);
for (i = 0; i < read_size/scan_size; i++) {
for (k = 0; k < num_vals; k++) {
__s16 val = *(__s16 *)(&data[i*scan_size
+ (k)*2]);
printf("%04x ", (unsigned short)val);
}
printf(" %lld\n",
*(__s64 *)(&data[(i + 1)
*size_from_scanmode(num_vals,
scan_ts)
- sizeof(__s64)]));
}
}
#ifdef IIO_TST_DBG
printf("Finished data acquisition, stopping ring buffer\n");
#endif
/* Stop the ring buffer */
ret = write_sysfs_int("ring_enable", buf_dir_name, 0);
if (ret < 0)
goto error_close_buffer_event;
/* Disconnect from the trigger - just write a dummy name.*/
write_sysfs_string("trigger/current_trigger",
dev_dir_name, "NULL");
error_close_buffer_event:
fclose(fp_ev);
error_close_buffer_access:
close(fp);
error_free_data:
free(data);
error_free_buffer_access:
free(buffer_access);
error_free_buffer_event:
free(buffer_event);
error_free_buf_dir_name:
free(buf_dir_name);
error_free_triggername:
free(trigger_name);
error_free_dev_dir_name:
free(dev_dir_name);
error_ret:
return ret;
}
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: ad7793 iio-ring test read issue - Reg
2011-08-23 13:24 ` malas
@ 2011-08-23 13:41 ` Jonathan Cameron
2011-08-23 13:48 ` malas
0 siblings, 1 reply; 17+ messages in thread
From: Jonathan Cameron @ 2011-08-23 13:41 UTC (permalink / raw)
To: malas; +Cc: Hennerich, Michael, linux-iio
On 08/23/11 14:24, malas wrote:
> On Tue, 23 Aug 2011 13:58:34 +0100, Jonathan Cameron wrote
>> On 08/23/11 13:43, malas wrote:
>>> YES : Gregs updated kernel taken from link below:
>>>
>>> http://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6.git
>> Right now that's pretty much mainline.
>>
>> See comments below and please reply inline as it makes this sort
>> of discussion much easier to follow.
>>>
>>>
>>> On Tue, 23 Aug 2011 13:39:12 +0100, Jonathan Cameron wrote
>>>> On 08/23/11 13:17, malas wrote:
>>>>>
>>>>>
>>>>> Sorry, I did not explicitly mention that. I did use the new staging kernel referred by
>>>>> Michael Hennerich and integrated with 2010RC5 uclinux dist .
>>>>
>>>> Hmm. As in current contents of Greg KH's staging/staging-next?
>>>>
>>>> I'll assume so... See below.
>>>>
>>>>>
>>>>> On Tue, 23 Aug 2011 12:39:53 +0100, Hennerich, Michael wrote
>>>>>> malas wrote on 2011-08-23:
>>>>>>>
>>>>>>>
>>>>>>> Dear Jonathan Cameron,
>>>>>>>
>>>>>>> The kernel version I am using is :
>>>>>>
>>>>>> Didn't you say that you use the staging kernel?
>>>>>>
>>>>>>
>>>>>
>>>
> http://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?_forum_action=MessageReply&message_id=102839&action=ForumBrowse
>>>>>>
>>>>>> Or copied drivers/staging/iio over to your Blackfin kernel tree?
>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> midas@ubuntu:~/Mala/Telemedicine/uclinux_source/uc2010_source/uclinux/2
>>>>>>> 010R1$ svn info Path: . URL:
>>>>>>> svn://blackfin.uclinux.org/uclinux-dist/branches/2010R1 Repository Root:
>>>>>>> svn://blackfin.uclinux.org/uclinux-dist Repository UUID:
>>>>>>> 3e2a5524-39e8-4cb9-84a9-c49da69cba3a Revision: 10161 Node Kind:
>>>>>>> directory Schedule: normal Last Changed Author: vapier Last Changed Rev:
>>>>>>> 10136 Last Changed Date: 2011-04-02 22:36:15 +0530 (Sat, 02 Apr 2011)
>>>>>>> ---------------------------------------------------------------------
>>>>>>>
>>>>>>> Regards
>>>>>>> Mala
>>>>>>>
>>>>>>> On Tue, 23 Aug 2011 12:21:25 +0100, Jonathan Cameron wrote
>>>>>>>> On 08/23/11 09:18, malas wrote:
>>>>>>>>>
>>>>>>>>> Dear Michael Hennerich,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I shall post iio quesris in this mail list as per your suggestions.
>>>>>>>>>
>>>>>>>>> AD7793 driver is built into kernel. The chip gets configured and am
>>>>>>>>> able to read data on continuous mode via spi interface using ad7793
>>>>>>>>> driver at kernel level.
>>>>>>>>>
>>>>>>>>> While testing userspace test iio-ring to read data from ring buffer,
>>>>>>>>> generic_buffer code was executed, it proceeds till opening
>>>>>>>>> /sys/bus/iio/devices/device0:buffer0 and Read call fails.
>>>>>>>> Question 1: What's the kernel and where did you get it from?
>>>>>>>> (Interfaces are moving fast so it's plausible you've fallen in a hole
>>>>>>>> where userspace wasn't matching kernelspace).
>>>>>>>>>
>>>>>>>>> In fs I can list the iio device ad7793 with following properties
>>>>>>>>> get/set.
>>>>>>>>>
>>>>>>>>> root:/> ls /sys/bus/iio/devices/device0\:buffer0/
>>>>>>>>> bytes_per_datum enable power subsystem
>>>>>>>>> dev length scan_elements uevent
>>>>>>>>> root:/>
>>>>>>>>>
>>>>>>>>> I find access0 and event0 missing in this list. Is that the reason
>>>>>>> for read() fails.
>>>>>>>> Yes. Question is why and without kernel version I don't know where to
>>>>>>>> look I'm afraid.
>>>> Ah, this does look like a missmatch in interfaces between userspace and kernel.
>>>>
>>>> At this point in time we have scrapped the event0 chrdev (done via polling on
>>>> the access one) and the access one has be flattened into device0\:buffer0/
>>>> (read dev).
>>>>
>>>> Looks like the generic_buffer.c example does line up though. Where did the
>>>> 'test iio-ring' come from? Is that one yours Michael?
>
>
> iio-ring.c under uclinux2010/user/blkfin-test/iio-ring-test. The file is in the
> attached. I did not use that since i didn't find access0 or event0 files under
> /sys/bus/iio/devices/device0:buffer0.
>
> I have tested with the generic_buffer.c example (under iio/documentaion folder) to get
> Ad7793 received samples to user space from ring buffer.
> The app opens: /dev/device0:buffer0 for poll and reading samples.
> Is the device name for the open() correct.
Yes - that should be right.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: ad7793 iio-ring test read issue - Reg
2011-08-23 13:41 ` Jonathan Cameron
@ 2011-08-23 13:48 ` malas
2011-08-23 14:07 ` Jonathan Cameron
0 siblings, 1 reply; 17+ messages in thread
From: malas @ 2011-08-23 13:48 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: Hennerich, Michael, linux-iio
On Tue, 23 Aug 2011 14:41:57 +0100, Jonathan Cameron wrote
> On 08/23/11 14:24, malas wrote:
> > On Tue, 23 Aug 2011 13:58:34 +0100, Jonathan Cameron wrote
> >> On 08/23/11 13:43, malas wrote:
> >>> YES : Gregs updated kernel taken from link below:
> >>>
> >>> http://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6.git
> >> Right now that's pretty much mainline.
> >>
> >> See comments below and please reply inline as it makes this sort
> >> of discussion much easier to follow.
> >>>
> >>>
> >>> On Tue, 23 Aug 2011 13:39:12 +0100, Jonathan Cameron wrote
> >>>> On 08/23/11 13:17, malas wrote:
> >>>>>
> >>>>>
> >>>>> Sorry, I did not explicitly mention that. I did use the new staging kernel
referred by
> >>>>> Michael Hennerich and integrated with 2010RC5 uclinux dist .
> >>>>
> >>>> Hmm. As in current contents of Greg KH's staging/staging-next?
> >>>>
> >>>> I'll assume so... See below.
> >>>>
> >>>>>
> >>>>> On Tue, 23 Aug 2011 12:39:53 +0100, Hennerich, Michael wrote
> >>>>>> malas wrote on 2011-08-23:
> >>>>>>>
> >>>>>>>
> >>>>>>> Dear Jonathan Cameron,
> >>>>>>>
> >>>>>>> The kernel version I am using is :
> >>>>>>
> >>>>>> Didn't you say that you use the staging kernel?
> >>>>>>
> >>>>>>
> >>>>>
> >>>
> >
http://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?_forum_action=MessageReply&message_id=102839&action=ForumBrowse
> >>>>>>
> >>>>>> Or copied drivers/staging/iio over to your Blackfin kernel tree?
> >>>>>>
> >>>>>>>
> >>>>>>> ---------------------------------------------------------------------
> >>>>>>> midas@ubuntu:~/Mala/Telemedicine/uclinux_source/uc2010_source/uclinux/2
> >>>>>>> 010R1$ svn info Path: . URL:
> >>>>>>> svn://blackfin.uclinux.org/uclinux-dist/branches/2010R1 Repository Root:
> >>>>>>> svn://blackfin.uclinux.org/uclinux-dist Repository UUID:
> >>>>>>> 3e2a5524-39e8-4cb9-84a9-c49da69cba3a Revision: 10161 Node Kind:
> >>>>>>> directory Schedule: normal Last Changed Author: vapier Last Changed Rev:
> >>>>>>> 10136 Last Changed Date: 2011-04-02 22:36:15 +0530 (Sat, 02 Apr 2011)
> >>>>>>> ---------------------------------------------------------------------
> >>>>>>>
> >>>>>>> Regards
> >>>>>>> Mala
> >>>>>>>
> >>>>>>> On Tue, 23 Aug 2011 12:21:25 +0100, Jonathan Cameron wrote
> >>>>>>>> On 08/23/11 09:18, malas wrote:
> >>>>>>>>>
> >>>>>>>>> Dear Michael Hennerich,
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> I shall post iio quesris in this mail list as per your suggestions.
> >>>>>>>>>
> >>>>>>>>> AD7793 driver is built into kernel. The chip gets configured and am
> >>>>>>>>> able to read data on continuous mode via spi interface using ad7793
> >>>>>>>>> driver at kernel level.
> >>>>>>>>>
> >>>>>>>>> While testing userspace test iio-ring to read data from ring buffer,
> >>>>>>>>> generic_buffer code was executed, it proceeds till opening
> >>>>>>>>> /sys/bus/iio/devices/device0:buffer0 and Read call fails.
> >>>>>>>> Question 1: What's the kernel and where did you get it from?
> >>>>>>>> (Interfaces are moving fast so it's plausible you've fallen in a hole
> >>>>>>>> where userspace wasn't matching kernelspace).
> >>>>>>>>>
> >>>>>>>>> In fs I can list the iio device ad7793 with following properties
> >>>>>>>>> get/set.
> >>>>>>>>>
> >>>>>>>>> root:/> ls /sys/bus/iio/devices/device0\:buffer0/
> >>>>>>>>> bytes_per_datum enable power subsystem
> >>>>>>>>> dev length scan_elements uevent
> >>>>>>>>> root:/>
> >>>>>>>>>
> >>>>>>>>> I find access0 and event0 missing in this list. Is that the reason
> >>>>>>> for read() fails.
> >>>>>>>> Yes. Question is why and without kernel version I don't know where to
> >>>>>>>> look I'm afraid.
> >>>> Ah, this does look like a missmatch in interfaces between userspace and kernel.
> >>>>
> >>>> At this point in time we have scrapped the event0 chrdev (done via polling on
> >>>> the access one) and the access one has be flattened into device0\:buffer0/
> >>>> (read dev).
> >>>>
> >>>> Looks like the generic_buffer.c example does line up though. Where did the
> >>>> 'test iio-ring' come from? Is that one yours Michael?
> >
> >
> > iio-ring.c under uclinux2010/user/blkfin-test/iio-ring-test. The file is in the
> > attached. I did not use that since i didn't find access0 or event0 files under
> > /sys/bus/iio/devices/device0:buffer0.
> >
> > I have tested with the generic_buffer.c example (under iio/documentaion folder) to get
> > Ad7793 received samples to user space from ring buffer.
> > The app opens: /dev/device0:buffer0 for poll and reading samples.
> > Is the device name for the open() correct.
> Yes - that should be right.
*************************
Open fails for "/dev/device0:buffer0" device name
I tried changing to "/sys/bus/iio/devices/device0:buffer0"- open() succeeded then but
then read fails.
-mala
*************************
--
Open WebMail Project (http://openwebmail.org)
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: ad7793 iio-ring test read issue - Reg
2011-08-23 13:48 ` malas
@ 2011-08-23 14:07 ` Jonathan Cameron
2011-08-23 14:14 ` malas
0 siblings, 1 reply; 17+ messages in thread
From: Jonathan Cameron @ 2011-08-23 14:07 UTC (permalink / raw)
To: malas; +Cc: Hennerich, Michael, linux-iio
On 08/23/11 14:48, malas wrote:
> On Tue, 23 Aug 2011 14:41:57 +0100, Jonathan Cameron wrote
>> On 08/23/11 14:24, malas wrote:
>>> On Tue, 23 Aug 2011 13:58:34 +0100, Jonathan Cameron wrote
>>>> On 08/23/11 13:43, malas wrote:
>>>>> YES : Gregs updated kernel taken from link below:
>>>>>
>>>>> http://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6.git
>>>> Right now that's pretty much mainline.
>>>>
>>>> See comments below and please reply inline as it makes this sort
>>>> of discussion much easier to follow.
>>>>>
>>>>>
>>>>> On Tue, 23 Aug 2011 13:39:12 +0100, Jonathan Cameron wrote
>>>>>> On 08/23/11 13:17, malas wrote:
>>>>>>>
>>>>>>>
>>>>>>> Sorry, I did not explicitly mention that. I did use the new staging kernel
> referred by
>>>>>>> Michael Hennerich and integrated with 2010RC5 uclinux dist .
>>>>>>
>>>>>> Hmm. As in current contents of Greg KH's staging/staging-next?
>>>>>>
>>>>>> I'll assume so... See below.
>>>>>>
>>>>>>>
>>>>>>> On Tue, 23 Aug 2011 12:39:53 +0100, Hennerich, Michael wrote
>>>>>>>> malas wrote on 2011-08-23:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Dear Jonathan Cameron,
>>>>>>>>>
>>>>>>>>> The kernel version I am using is :
>>>>>>>>
>>>>>>>> Didn't you say that you use the staging kernel?
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>
>>>
> http://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?_forum_action=MessageReply&message_id=102839&action=ForumBrowse
>>>>>>>>
>>>>>>>> Or copied drivers/staging/iio over to your Blackfin kernel tree?
>>>>>>>>
>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> midas@ubuntu:~/Mala/Telemedicine/uclinux_source/uc2010_source/uclinux/2
>>>>>>>>> 010R1$ svn info Path: . URL:
>>>>>>>>> svn://blackfin.uclinux.org/uclinux-dist/branches/2010R1 Repository Root:
>>>>>>>>> svn://blackfin.uclinux.org/uclinux-dist Repository UUID:
>>>>>>>>> 3e2a5524-39e8-4cb9-84a9-c49da69cba3a Revision: 10161 Node Kind:
>>>>>>>>> directory Schedule: normal Last Changed Author: vapier Last Changed Rev:
>>>>>>>>> 10136 Last Changed Date: 2011-04-02 22:36:15 +0530 (Sat, 02 Apr 2011)
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>
>>>>>>>>> Regards
>>>>>>>>> Mala
>>>>>>>>>
>>>>>>>>> On Tue, 23 Aug 2011 12:21:25 +0100, Jonathan Cameron wrote
>>>>>>>>>> On 08/23/11 09:18, malas wrote:
>>>>>>>>>>>
>>>>>>>>>>> Dear Michael Hennerich,
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> I shall post iio quesris in this mail list as per your suggestions.
>>>>>>>>>>>
>>>>>>>>>>> AD7793 driver is built into kernel. The chip gets configured and am
>>>>>>>>>>> able to read data on continuous mode via spi interface using ad7793
>>>>>>>>>>> driver at kernel level.
>>>>>>>>>>>
>>>>>>>>>>> While testing userspace test iio-ring to read data from ring buffer,
>>>>>>>>>>> generic_buffer code was executed, it proceeds till opening
>>>>>>>>>>> /sys/bus/iio/devices/device0:buffer0 and Read call fails.
>>>>>>>>>> Question 1: What's the kernel and where did you get it from?
>>>>>>>>>> (Interfaces are moving fast so it's plausible you've fallen in a hole
>>>>>>>>>> where userspace wasn't matching kernelspace).
>>>>>>>>>>>
>>>>>>>>>>> In fs I can list the iio device ad7793 with following properties
>>>>>>>>>>> get/set.
>>>>>>>>>>>
>>>>>>>>>>> root:/> ls /sys/bus/iio/devices/device0\:buffer0/
>>>>>>>>>>> bytes_per_datum enable power subsystem
>>>>>>>>>>> dev length scan_elements uevent
>>>>>>>>>>> root:/>
>>>>>>>>>>>
>>>>>>>>>>> I find access0 and event0 missing in this list. Is that the reason
>>>>>>>>> for read() fails.
>>>>>>>>>> Yes. Question is why and without kernel version I don't know where to
>>>>>>>>>> look I'm afraid.
>>>>>> Ah, this does look like a missmatch in interfaces between userspace and kernel.
>>>>>>
>>>>>> At this point in time we have scrapped the event0 chrdev (done via polling on
>>>>>> the access one) and the access one has be flattened into device0\:buffer0/
>>>>>> (read dev).
>>>>>>
>>>>>> Looks like the generic_buffer.c example does line up though. Where did the
>>>>>> 'test iio-ring' come from? Is that one yours Michael?
>>>
>>>
>>> iio-ring.c under uclinux2010/user/blkfin-test/iio-ring-test. The file is in the
>>> attached. I did not use that since i didn't find access0 or event0 files under
>>> /sys/bus/iio/devices/device0:buffer0.
>>>
>>> I have tested with the generic_buffer.c example (under iio/documentaion folder) to get
>>> Ad7793 received samples to user space from ring buffer.
>>> The app opens: /dev/device0:buffer0 for poll and reading samples.
>>> Is the device name for the open() correct.
>> Yes - that should be right.
> *************************
> Open fails for "/dev/device0:buffer0" device name
> I tried changing to "/sys/bus/iio/devices/device0:buffer0"- open() succeeded then but
> then read fails.
Read must be the one under dev. The other is a directory with description of the buffer.
What is the error on the open of /dev/device0:buffer0?
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: ad7793 iio-ring test read issue - Reg
2011-08-23 14:07 ` Jonathan Cameron
@ 2011-08-23 14:14 ` malas
2011-08-23 14:30 ` Hennerich, Michael
0 siblings, 1 reply; 17+ messages in thread
From: malas @ 2011-08-23 14:14 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: Hennerich, Michael, linux-iio
On Tue, 23 Aug 2011 15:07:22 +0100, Jonathan Cameron wrote
> On 08/23/11 14:48, malas wrote:
> > On Tue, 23 Aug 2011 14:41:57 +0100, Jonathan Cameron wrote
> >> On 08/23/11 14:24, malas wrote:
> >>> On Tue, 23 Aug 2011 13:58:34 +0100, Jonathan Cameron wrote
> >>>> On 08/23/11 13:43, malas wrote:
> >>>>> YES : Gregs updated kernel taken from link below:
> >>>>>
> >>>>> http://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6.git
> >>>> Right now that's pretty much mainline.
> >>>>
> >>>> See comments below and please reply inline as it makes this sort
> >>>> of discussion much easier to follow.
> >>>>>
> >>>>>
> >>>>> On Tue, 23 Aug 2011 13:39:12 +0100, Jonathan Cameron wrote
> >>>>>> On 08/23/11 13:17, malas wrote:
> >>>>>>>
> >>>>>>>
> >>>>>>> Sorry, I did not explicitly mention that. I did use the new staging kernel
> > referred by
> >>>>>>> Michael Hennerich and integrated with 2010RC5 uclinux dist .
> >>>>>>
> >>>>>> Hmm. As in current contents of Greg KH's staging/staging-next?
> >>>>>>
> >>>>>> I'll assume so... See below.
> >>>>>>
> >>>>>>>
> >>>>>>> On Tue, 23 Aug 2011 12:39:53 +0100, Hennerich, Michael wrote
> >>>>>>>> malas wrote on 2011-08-23:
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> Dear Jonathan Cameron,
> >>>>>>>>>
> >>>>>>>>> The kernel version I am using is :
> >>>>>>>>
> >>>>>>>> Didn't you say that you use the staging kernel?
> >>>>>>>>
> >>>>>>>>
> >>>>>>>
> >>>>>
> >>>
> >
http://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?_forum_action=MessageReply&message_id=102839&action=ForumBrowse
> >>>>>>>>
> >>>>>>>> Or copied drivers/staging/iio over to your Blackfin kernel tree?
> >>>>>>>>
> >>>>>>>>>
> >>>>>>>>> ---------------------------------------------------------------------
> >>>>>>>>> midas@ubuntu:~/Mala/Telemedicine/uclinux_source/uc2010_source/uclinux/2
> >>>>>>>>> 010R1$ svn info Path: . URL:
> >>>>>>>>> svn://blackfin.uclinux.org/uclinux-dist/branches/2010R1 Repository Root:
> >>>>>>>>> svn://blackfin.uclinux.org/uclinux-dist Repository UUID:
> >>>>>>>>> 3e2a5524-39e8-4cb9-84a9-c49da69cba3a Revision: 10161 Node Kind:
> >>>>>>>>> directory Schedule: normal Last Changed Author: vapier Last Changed Rev:
> >>>>>>>>> 10136 Last Changed Date: 2011-04-02 22:36:15 +0530 (Sat, 02 Apr 2011)
> >>>>>>>>> ---------------------------------------------------------------------
> >>>>>>>>>
> >>>>>>>>> Regards
> >>>>>>>>> Mala
> >>>>>>>>>
> >>>>>>>>> On Tue, 23 Aug 2011 12:21:25 +0100, Jonathan Cameron wrote
> >>>>>>>>>> On 08/23/11 09:18, malas wrote:
> >>>>>>>>>>>
> >>>>>>>>>>> Dear Michael Hennerich,
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>> I shall post iio quesris in this mail list as per your suggestions.
> >>>>>>>>>>>
> >>>>>>>>>>> AD7793 driver is built into kernel. The chip gets configured and am
> >>>>>>>>>>> able to read data on continuous mode via spi interface using ad7793
> >>>>>>>>>>> driver at kernel level.
> >>>>>>>>>>>
> >>>>>>>>>>> While testing userspace test iio-ring to read data from ring buffer,
> >>>>>>>>>>> generic_buffer code was executed, it proceeds till opening
> >>>>>>>>>>> /sys/bus/iio/devices/device0:buffer0 and Read call fails.
> >>>>>>>>>> Question 1: What's the kernel and where did you get it from?
> >>>>>>>>>> (Interfaces are moving fast so it's plausible you've fallen in a hole
> >>>>>>>>>> where userspace wasn't matching kernelspace).
> >>>>>>>>>>>
> >>>>>>>>>>> In fs I can list the iio device ad7793 with following properties
> >>>>>>>>>>> get/set.
> >>>>>>>>>>>
> >>>>>>>>>>> root:/> ls /sys/bus/iio/devices/device0\:buffer0/
> >>>>>>>>>>> bytes_per_datum enable power subsystem
> >>>>>>>>>>> dev length scan_elements uevent
> >>>>>>>>>>> root:/>
> >>>>>>>>>>>
> >>>>>>>>>>> I find access0 and event0 missing in this list. Is that the reason
> >>>>>>>>> for read() fails.
> >>>>>>>>>> Yes. Question is why and without kernel version I don't know where to
> >>>>>>>>>> look I'm afraid.
> >>>>>> Ah, this does look like a missmatch in interfaces between userspace and kernel.
> >>>>>>
> >>>>>> At this point in time we have scrapped the event0 chrdev (done via polling on
> >>>>>> the access one) and the access one has be flattened into device0\:buffer0/
> >>>>>> (read dev).
> >>>>>>
> >>>>>> Looks like the generic_buffer.c example does line up though. Where did the
> >>>>>> 'test iio-ring' come from? Is that one yours Michael?
> >>>
> >>>
> >>> iio-ring.c under uclinux2010/user/blkfin-test/iio-ring-test. The file is in the
> >>> attached. I did not use that since i didn't find access0 or event0 files under
> >>> /sys/bus/iio/devices/device0:buffer0.
> >>>
> >>> I have tested with the generic_buffer.c example (under iio/documentaion folder) to get
> >>> Ad7793 received samples to user space from ring buffer.
> >>> The app opens: /dev/device0:buffer0 for poll and reading samples.
> >>> Is the device name for the open() correct.
> >> Yes - that should be right.
> > *************************
> > Open fails for "/dev/device0:buffer0" device name
> > I tried changing to "/sys/bus/iio/devices/device0:buffer0"- open() succeeded then but
> > then read fails.
> Read must be the one under dev. The other is a directory with description of
> the buffer.
>
> What is the error on the open of /dev/device0:buffer0?
ERROR =>
Going to open access file /dev/device0:buffer0
Failed to open /dev/device0:buffer0
open returned fp as -1
--
Open WebMail Project (http://openwebmail.org)
^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: ad7793 iio-ring test read issue - Reg
2011-08-23 14:14 ` malas
@ 2011-08-23 14:30 ` Hennerich, Michael
2011-08-23 14:33 ` malas
2011-08-23 14:53 ` malas
0 siblings, 2 replies; 17+ messages in thread
From: Hennerich, Michael @ 2011-08-23 14:30 UTC (permalink / raw)
To: malas, Jonathan Cameron; +Cc: linux-iio@vger.kernel.org
malas wrote on 2011-08-23:
> On Tue, 23 Aug 2011 15:07:22 +0100, Jonathan Cameron wrote
>> On 08/23/11 14:48, malas wrote:
>>> On Tue, 23 Aug 2011 14:41:57 +0100, Jonathan Cameron wrote
>>>> On 08/23/11 14:24, malas wrote:
>>>>> On Tue, 23 Aug 2011 13:58:34 +0100, Jonathan Cameron wrote
>>>>>> On 08/23/11 13:43, malas wrote:
>>>>>>> YES : Gregs updated kernel taken from link below:
>>>>>>>
>>>>>>> http://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-
> 2.6.git
>>>>>> Right now that's pretty much mainline.
>>>>>>
>>>>>> See comments below and please reply inline as it makes this sort
>>>>>> of discussion much easier to follow.
>>>>>>>
>>>>>>>
>>>>>>> On Tue, 23 Aug 2011 13:39:12 +0100, Jonathan Cameron wrote
>>>>>>>> On 08/23/11 13:17, malas wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Sorry, I did not explicitly mention that. I did use the new
> staging kernel
>>> referred by
>>>>>>>>> Michael Hennerich and integrated with 2010RC5 uclinux dist .
>>>>>>>>
>>>>>>>> Hmm. As in current contents of Greg KH's staging/staging-next?
>>>>>>>>
>>>>>>>> I'll assume so... See below.
>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Tue, 23 Aug 2011 12:39:53 +0100, Hennerich, Michael wrote
>>>>>>>>>> malas wrote on 2011-08-23:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Dear Jonathan Cameron,
>>>>>>>>>>>
>>>>>>>>>>> The kernel version I am using is :
>>>>>>>>>>
>>>>>>>>>> Didn't you say that you use the staging kernel?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>
>>>
> http://blackfin.uclinux.org/gf/project/uclinux-
> dist/forum/?_forum_action=3DMessageReply&message_id=3D102839&action=3DFor=
umBr
> owse
>>>>>>>>>>
>>>>>>>>>> Or copied drivers/staging/iio over to your Blackfin kernel tree?
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> -----------------------------------------------------------
>>>>>>>>>>> ----------
>>>>>>>>>>>
>>>>>>>>>>> midas@ubuntu:~/Mala/Telemedicine/uclinux_source/uc2010_source/u
>>>>>>>>>>> clinux/2 010R1$ svn info Path: . URL:
>>>>>>>>>>> svn://blackfin.uclinux.org/uclinux-dist/branches/2010R1
>>>>>>>>>>> Repository Root: svn://blackfin.uclinux.org/uclinux-dist
>>>>>>>>>>> Repository UUID: 3e2a5524-39e8-4cb9-84a9-c49da69cba3a
>>>>>>>>>>> Revision: 10161 Node Kind: directory Schedule: normal Last
>>>>>>>>>>> Changed Author: vapier Last Changed Rev: 10136 Last Changed
>>>>>>>>>>> Date: 2011-04-02 22:36:15 +0530 (Sat, 02 Apr 2011)
>>>>>>>>>>> -----------------------------------------------------------
>>>>>>>>>>> ----------
>>>>>>>>>>>
>>>>>>>>>>> Regards
>>>>>>>>>>> Mala
>>>>>>>>>>>
>>>>>>>>>>> On Tue, 23 Aug 2011 12:21:25 +0100, Jonathan Cameron wrote
>>>>>>>>>>>> On 08/23/11 09:18, malas wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>> Dear Michael Hennerich,
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> I shall post iio quesris in this mail list as per your
>>>>>>>>>>>>> suggestions.
>>>>>>>>>>>>>
>>>>>>>>>>>>> AD7793 driver is built into kernel. The chip gets configured
>>>>>>>>>>>>> and am able to read data on continuous mode via spi
>>>>>>>>>>>>> interface using ad7793 driver at kernel level.
>>>>>>>>>>>>>
>>>>>>>>>>>>> While testing userspace test iio-ring to read data from ring
>>>>>>>>>>>>> buffer, generic_buffer code was executed, it proceeds till
>>>>>>>>>>>>> opening /sys/bus/iio/devices/device0:buffer0 and Read call
>>>>>>>>>>>>> fails.
>>>>>>>>>>>> Question 1: What's the kernel and where did you get it from?
>>>>>>>>>>>> (Interfaces are moving fast so it's plausible you've fallen
>>>>>>>>>>>> in a hole where userspace wasn't matching kernelspace).
>>>>>>>>>>>>>
>>>>>>>>>>>>> In fs I can list the iio device ad7793 with following
>>>>>>>>>>>>> properties get/set.
>>>>>>>>>>>>>
>>>>>>>>>>>>> root:/> ls /sys/bus/iio/devices/device0\:buffer0/
>>>>>>>>>>>>> bytes_per_datum enable power subsystem dev
>>>>>>>>>>>>> length scan_elements uevent root:/>
>>>>>>>>>>>>>
>>>>>>>>>>>>> I find access0 and event0 missing in this list. Is that
> the reason
>>>>>>>>>>> for read() fails.
>>>>>>>>>>>> Yes. Question is why and without kernel version I don't know
>>>>>>>>>>>> where to look I'm afraid.
>>>>>>>> Ah, this does look like a missmatch in interfaces between
>>>>>>>> userspace and kernel.
>>>>>>>>
>>>>>>>> At this point in time we have scrapped the event0 chrdev (done
>>>>>>>> via polling on the access one) and the access one has be
>>>>>>>> flattened into device0\:buffer0/ (read dev).
>>>>>>>>
>>>>>>>> Looks like the generic_buffer.c example does line up though.
>>>>>>>> Where did the 'test iio-ring' come from? Is that one yours
>>>>>>>> Michael?
>>>>>
>>>>>
>>>>> iio-ring.c under uclinux2010/user/blkfin-test/iio-ring-test. The
>>>>> file is in the attached. I did not use that since i didn't find
>>>>> access0 or event0 files under /sys/bus/iio/devices/device0:buffer0.
>>>>>
>>>>> I have tested with the generic_buffer.c example (under
>>>>> iio/documentaion folder) to get Ad7793 received samples to user
>>>>> space from ring buffer. The app opens: /dev/device0:buffer0 for poll
>>>>> and reading samples. Is the device name for the open() correct.
>>>> Yes - that should be right.
>>> *************************
>>> Open fails for "/dev/device0:buffer0" device name
>>> I tried changing to "/sys/bus/iio/devices/device0:buffer0"- open()
> succeeded then but
>>> then read fails.
>> Read must be the one under dev. The other is a directory with
>> description of the buffer.
>>
>> What is the error on the open of /dev/device0:buffer0?
>
> ERROR =3D>
> Going to open access file /dev/device0:buffer0
> Failed to open /dev/device0:buffer0
> open returned fp as -1
>
I think I asked you before to check if /dev/device0:buffer0 exists.
And I guess is does not - so you have to create it.
Greetings,
Michael
--
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin, Mar=
garet Seif
^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: ad7793 iio-ring test read issue - Reg
2011-08-23 14:30 ` Hennerich, Michael
@ 2011-08-23 14:33 ` malas
2011-08-23 14:53 ` malas
1 sibling, 0 replies; 17+ messages in thread
From: malas @ 2011-08-23 14:33 UTC (permalink / raw)
To: Hennerich, Michael, Jonathan Cameron; +Cc: linux-iio@vger.kernel.org
On Tue, 23 Aug 2011 15:30:39 +0100, Hennerich, Michael wrote
> malas wrote on 2011-08-23:
> > On Tue, 23 Aug 2011 15:07:22 +0100, Jonathan Cameron wrote
> >> On 08/23/11 14:48, malas wrote:
> >>> On Tue, 23 Aug 2011 14:41:57 +0100, Jonathan Cameron wrote
> >>>> On 08/23/11 14:24, malas wrote:
> >>>>> On Tue, 23 Aug 2011 13:58:34 +0100, Jonathan Cameron wrote
> >>>>>> On 08/23/11 13:43, malas wrote:
> >>>>>>> YES : Gregs updated kernel taken from link below:
> >>>>>>>
> >>>>>>> http://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-
> > 2.6.git
> >>>>>> Right now that's pretty much mainline.
> >>>>>>
> >>>>>> See comments below and please reply inline as it makes this sort
> >>>>>> of discussion much easier to follow.
> >>>>>>>
> >>>>>>>
> >>>>>>> On Tue, 23 Aug 2011 13:39:12 +0100, Jonathan Cameron wrote
> >>>>>>>> On 08/23/11 13:17, malas wrote:
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> Sorry, I did not explicitly mention that. I did use the new
> > staging kernel
> >>> referred by
> >>>>>>>>> Michael Hennerich and integrated with 2010RC5 uclinux dist .
> >>>>>>>>
> >>>>>>>> Hmm. As in current contents of Greg KH's staging/staging-next?
> >>>>>>>>
> >>>>>>>> I'll assume so... See below.
> >>>>>>>>
> >>>>>>>>>
> >>>>>>>>> On Tue, 23 Aug 2011 12:39:53 +0100, Hennerich, Michael wrote
> >>>>>>>>>> malas wrote on 2011-08-23:
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>> Dear Jonathan Cameron,
> >>>>>>>>>>>
> >>>>>>>>>>> The kernel version I am using is :
> >>>>>>>>>>
> >>>>>>>>>> Didn't you say that you use the staging kernel?
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>
> >>>>>>>
> >>>>>
> >>>
> > http://blackfin.uclinux.org/gf/project/uclinux-
> > dist/forum/?_forum_action=MessageReply&message_id=102839&action=ForumBr
> > owse
> >>>>>>>>>>
> >>>>>>>>>> Or copied drivers/staging/iio over to your Blackfin kernel tree?
> >>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>> -----------------------------------------------------------
> >>>>>>>>>>> ----------
> >>>>>>>>>>>
> >>>>>>>>>>> midas@ubuntu:~/Mala/Telemedicine/uclinux_source/uc2010_source/u
> >>>>>>>>>>> clinux/2 010R1$ svn info Path: . URL:
> >>>>>>>>>>> svn://blackfin.uclinux.org/uclinux-dist/branches/2010R1
> >>>>>>>>>>> Repository Root: svn://blackfin.uclinux.org/uclinux-dist
> >>>>>>>>>>> Repository UUID: 3e2a5524-39e8-4cb9-84a9-c49da69cba3a
> >>>>>>>>>>> Revision: 10161 Node Kind: directory Schedule: normal Last
> >>>>>>>>>>> Changed Author: vapier Last Changed Rev: 10136 Last Changed
> >>>>>>>>>>> Date: 2011-04-02 22:36:15 +0530 (Sat, 02 Apr 2011)
> >>>>>>>>>>> -----------------------------------------------------------
> >>>>>>>>>>> ----------
> >>>>>>>>>>>
> >>>>>>>>>>> Regards
> >>>>>>>>>>> Mala
> >>>>>>>>>>>
> >>>>>>>>>>> On Tue, 23 Aug 2011 12:21:25 +0100, Jonathan Cameron wrote
> >>>>>>>>>>>> On 08/23/11 09:18, malas wrote:
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> Dear Michael Hennerich,
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> I shall post iio quesris in this mail list as per your
> >>>>>>>>>>>>> suggestions.
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> AD7793 driver is built into kernel. The chip gets configured
> >>>>>>>>>>>>> and am able to read data on continuous mode via spi
> >>>>>>>>>>>>> interface using ad7793 driver at kernel level.
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> While testing userspace test iio-ring to read data from ring
> >>>>>>>>>>>>> buffer, generic_buffer code was executed, it proceeds till
> >>>>>>>>>>>>> opening /sys/bus/iio/devices/device0:buffer0 and Read call
> >>>>>>>>>>>>> fails.
> >>>>>>>>>>>> Question 1: What's the kernel and where did you get it from?
> >>>>>>>>>>>> (Interfaces are moving fast so it's plausible you've fallen
> >>>>>>>>>>>> in a hole where userspace wasn't matching kernelspace).
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> In fs I can list the iio device ad7793 with following
> >>>>>>>>>>>>> properties get/set.
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> root:/> ls /sys/bus/iio/devices/device0\:buffer0/
> >>>>>>>>>>>>> bytes_per_datum enable power subsystem dev
> >>>>>>>>>>>>> length scan_elements uevent root:/>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> I find access0 and event0 missing in this list. Is that
> > the reason
> >>>>>>>>>>> for read() fails.
> >>>>>>>>>>>> Yes. Question is why and without kernel version I don't know
> >>>>>>>>>>>> where to look I'm afraid.
> >>>>>>>> Ah, this does look like a missmatch in interfaces between
> >>>>>>>> userspace and kernel.
> >>>>>>>>
> >>>>>>>> At this point in time we have scrapped the event0 chrdev (done
> >>>>>>>> via polling on the access one) and the access one has be
> >>>>>>>> flattened into device0\:buffer0/ (read dev).
> >>>>>>>>
> >>>>>>>> Looks like the generic_buffer.c example does line up though.
> >>>>>>>> Where did the 'test iio-ring' come from? Is that one yours
> >>>>>>>> Michael?
> >>>>>
> >>>>>
> >>>>> iio-ring.c under uclinux2010/user/blkfin-test/iio-ring-test. The
> >>>>> file is in the attached. I did not use that since i didn't find
> >>>>> access0 or event0 files under /sys/bus/iio/devices/device0:buffer0.
> >>>>>
> >>>>> I have tested with the generic_buffer.c example (under
> >>>>> iio/documentaion folder) to get Ad7793 received samples to user
> >>>>> space from ring buffer. The app opens: /dev/device0:buffer0 for poll
> >>>>> and reading samples. Is the device name for the open() correct.
> >>>> Yes - that should be right.
> >>> *************************
> >>> Open fails for "/dev/device0:buffer0" device name
> >>> I tried changing to "/sys/bus/iio/devices/device0:buffer0"- open()
> > succeeded then but
> >>> then read fails.
> >> Read must be the one under dev. The other is a directory with
> >> description of the buffer.
> >>
> >> What is the error on the open of /dev/device0:buffer0?
> >
> > ERROR =>
> > Going to open access file /dev/device0:buffer0
> > Failed to open /dev/device0:buffer0
> > open returned fp as -1
> >
>
> I think I asked you before to check if /dev/device0:buffer0 exists.
> And I guess is does not - so you have to create it.
Greetings,
> Michael
Yes, now I get it. Shall do that and update with the tested results.
Thanks
Mala
>
>
>
> --
> Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
> Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
> Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
> Margaret Seif
--
Open WebMail Project (http://openwebmail.org)
^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: ad7793 iio-ring test read issue - Reg
2011-08-23 14:30 ` Hennerich, Michael
2011-08-23 14:33 ` malas
@ 2011-08-23 14:53 ` malas
2011-08-23 15:03 ` Michael Hennerich
1 sibling, 1 reply; 17+ messages in thread
From: malas @ 2011-08-23 14:53 UTC (permalink / raw)
To: Hennerich, Michael, Jonathan Cameron; +Cc: linux-iio@vger.kernel.org
On Tue, 23 Aug 2011 15:30:39 +0100, Hennerich, Michael wrote
> malas wrote on 2011-08-23:
> > On Tue, 23 Aug 2011 15:07:22 +0100, Jonathan Cameron wrote
> >> On 08/23/11 14:48, malas wrote:
> >>> On Tue, 23 Aug 2011 14:41:57 +0100, Jonathan Cameron wrote
> >>>> On 08/23/11 14:24, malas wrote:
> >>>>> On Tue, 23 Aug 2011 13:58:34 +0100, Jonathan Cameron wrote
> >>>>>> On 08/23/11 13:43, malas wrote:
> >>>>>>> YES : Gregs updated kernel taken from link below:
> >>>>>>>
> >>>>>>> http://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-
> > 2.6.git
> >>>>>> Right now that's pretty much mainline.
> >>>>>>
> >>>>>> See comments below and please reply inline as it makes this sort
> >>>>>> of discussion much easier to follow.
> >>>>>>>
> >>>>>>>
> >>>>>>> On Tue, 23 Aug 2011 13:39:12 +0100, Jonathan Cameron wrote
> >>>>>>>> On 08/23/11 13:17, malas wrote:
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> Sorry, I did not explicitly mention that. I did use the new
> > staging kernel
> >>> referred by
> >>>>>>>>> Michael Hennerich and integrated with 2010RC5 uclinux dist .
> >>>>>>>>
> >>>>>>>> Hmm. As in current contents of Greg KH's staging/staging-next?
> >>>>>>>>
> >>>>>>>> I'll assume so... See below.
> >>>>>>>>
> >>>>>>>>>
> >>>>>>>>> On Tue, 23 Aug 2011 12:39:53 +0100, Hennerich, Michael wrote
> >>>>>>>>>> malas wrote on 2011-08-23:
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>> Dear Jonathan Cameron,
> >>>>>>>>>>>
> >>>>>>>>>>> The kernel version I am using is :
> >>>>>>>>>>
> >>>>>>>>>> Didn't you say that you use the staging kernel?
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>
> >>>>>>>
> >>>>>
> >>>
> > http://blackfin.uclinux.org/gf/project/uclinux-
> > dist/forum/?_forum_action=MessageReply&message_id=102839&action=ForumBr
> > owse
> >>>>>>>>>>
> >>>>>>>>>> Or copied drivers/staging/iio over to your Blackfin kernel tree?
> >>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>> -----------------------------------------------------------
> >>>>>>>>>>> ----------
> >>>>>>>>>>>
> >>>>>>>>>>> midas@ubuntu:~/Mala/Telemedicine/uclinux_source/uc2010_source/u
> >>>>>>>>>>> clinux/2 010R1$ svn info Path: . URL:
> >>>>>>>>>>> svn://blackfin.uclinux.org/uclinux-dist/branches/2010R1
> >>>>>>>>>>> Repository Root: svn://blackfin.uclinux.org/uclinux-dist
> >>>>>>>>>>> Repository UUID: 3e2a5524-39e8-4cb9-84a9-c49da69cba3a
> >>>>>>>>>>> Revision: 10161 Node Kind: directory Schedule: normal Last
> >>>>>>>>>>> Changed Author: vapier Last Changed Rev: 10136 Last Changed
> >>>>>>>>>>> Date: 2011-04-02 22:36:15 +0530 (Sat, 02 Apr 2011)
> >>>>>>>>>>> -----------------------------------------------------------
> >>>>>>>>>>> ----------
> >>>>>>>>>>>
> >>>>>>>>>>> Regards
> >>>>>>>>>>> Mala
> >>>>>>>>>>>
> >>>>>>>>>>> On Tue, 23 Aug 2011 12:21:25 +0100, Jonathan Cameron wrote
> >>>>>>>>>>>> On 08/23/11 09:18, malas wrote:
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> Dear Michael Hennerich,
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> I shall post iio quesris in this mail list as per your
> >>>>>>>>>>>>> suggestions.
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> AD7793 driver is built into kernel. The chip gets configured
> >>>>>>>>>>>>> and am able to read data on continuous mode via spi
> >>>>>>>>>>>>> interface using ad7793 driver at kernel level.
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> While testing userspace test iio-ring to read data from ring
> >>>>>>>>>>>>> buffer, generic_buffer code was executed, it proceeds till
> >>>>>>>>>>>>> opening /sys/bus/iio/devices/device0:buffer0 and Read call
> >>>>>>>>>>>>> fails.
> >>>>>>>>>>>> Question 1: What's the kernel and where did you get it from?
> >>>>>>>>>>>> (Interfaces are moving fast so it's plausible you've fallen
> >>>>>>>>>>>> in a hole where userspace wasn't matching kernelspace).
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> In fs I can list the iio device ad7793 with following
> >>>>>>>>>>>>> properties get/set.
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> root:/> ls /sys/bus/iio/devices/device0\:buffer0/
> >>>>>>>>>>>>> bytes_per_datum enable power subsystem dev
> >>>>>>>>>>>>> length scan_elements uevent root:/>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> I find access0 and event0 missing in this list. Is that
> > the reason
> >>>>>>>>>>> for read() fails.
> >>>>>>>>>>>> Yes. Question is why and without kernel version I don't know
> >>>>>>>>>>>> where to look I'm afraid.
> >>>>>>>> Ah, this does look like a missmatch in interfaces between
> >>>>>>>> userspace and kernel.
> >>>>>>>>
> >>>>>>>> At this point in time we have scrapped the event0 chrdev (done
> >>>>>>>> via polling on the access one) and the access one has be
> >>>>>>>> flattened into device0\:buffer0/ (read dev).
> >>>>>>>>
> >>>>>>>> Looks like the generic_buffer.c example does line up though.
> >>>>>>>> Where did the 'test iio-ring' come from? Is that one yours
> >>>>>>>> Michael?
> >>>>>
> >>>>>
> >>>>> iio-ring.c under uclinux2010/user/blkfin-test/iio-ring-test. The
> >>>>> file is in the attached. I did not use that since i didn't find
> >>>>> access0 or event0 files under /sys/bus/iio/devices/device0:buffer0.
> >>>>>
> >>>>> I have tested with the generic_buffer.c example (under
> >>>>> iio/documentaion folder) to get Ad7793 received samples to user
> >>>>> space from ring buffer. The app opens: /dev/device0:buffer0 for poll
> >>>>> and reading samples. Is the device name for the open() correct.
> >>>> Yes - that should be right.
> >>> *************************
> >>> Open fails for "/dev/device0:buffer0" device name
> >>> I tried changing to "/sys/bus/iio/devices/device0:buffer0"- open()
> > succeeded then but
> >>> then read fails.
> >> Read must be the one under dev. The other is a directory with
> >> description of the buffer.
> >>
> >> What is the error on the open of /dev/device0:buffer0?
> >
> > ERROR =>
> > Going to open access file /dev/device0:buffer0
> > Failed to open /dev/device0:buffer0
> > open returned fp as -1
> >
>
> I think I asked you before to check if /dev/device0:buffer0 exists.
> And I guess is does not - so you have to create it.
>
> Greetings,
> Michael
I created a directory "device0:buffer0" under /dev.
Open() now succeeds, but read() is still failing, returns readSize as -1.
I have not initialised any trigger.Should I?
I am running generic_buffer specifying only driver name as:
root> generic_buffer -n ad7793
-mala
>
> --
> Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
> Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
> Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
> Margaret Seif
--
Open WebMail Project (http://openwebmail.org)
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: ad7793 iio-ring test read issue - Reg
2011-08-23 14:53 ` malas
@ 2011-08-23 15:03 ` Michael Hennerich
0 siblings, 0 replies; 17+ messages in thread
From: Michael Hennerich @ 2011-08-23 15:03 UTC (permalink / raw)
To: malas; +Cc: Jonathan Cameron, linux-iio@vger.kernel.org
On 08/23/2011 04:53 PM, malas wrote:
> On Tue, 23 Aug 2011 15:30:39 +0100, Hennerich, Michael wrote
>> malas wrote on 2011-08-23:
>>> On Tue, 23 Aug 2011 15:07:22 +0100, Jonathan Cameron wrote
>>>> On 08/23/11 14:48, malas wrote:
>>>>> On Tue, 23 Aug 2011 14:41:57 +0100, Jonathan Cameron wrote
>>>>>> On 08/23/11 14:24, malas wrote:
>>>>>>> On Tue, 23 Aug 2011 13:58:34 +0100, Jonathan Cameron wrote
>>>>>>>> On 08/23/11 13:43, malas wrote:
>>>>>>>>> YES : Gregs updated kernel taken from link below:
>>>>>>>>>
>>>>>>>>> http://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-
>>> 2.6.git
>>>>>>>> Right now that's pretty much mainline.
>>>>>>>>
>>>>>>>> See comments below and please reply inline as it makes this sort
>>>>>>>> of discussion much easier to follow.
>>>>>>>>>
>>>>>>>>> On Tue, 23 Aug 2011 13:39:12 +0100, Jonathan Cameron wrote
>>>>>>>>>> On 08/23/11 13:17, malas wrote:
>>>>>>>>>>>
>>>>>>>>>>> Sorry, I did not explicitly mention that. I did use the new
>>> staging kernel
>>>>> referred by
>>>>>>>>>>> Michael Hennerich and integrated with 2010RC5 uclinux dist .
>>>>>>>>>> Hmm. As in current contents of Greg KH's staging/staging-next?
>>>>>>>>>>
>>>>>>>>>> I'll assume so... See below.
>>>>>>>>>>
>>>>>>>>>>> On Tue, 23 Aug 2011 12:39:53 +0100, Hennerich, Michael wrote
>>>>>>>>>>>> malas wrote on 2011-08-23:
>>>>>>>>>>>>>
>>>>>>>>>>>>> Dear Jonathan Cameron,
>>>>>>>>>>>>>
>>>>>>>>>>>>> The kernel version I am using is :
>>>>>>>>>>>> Didn't you say that you use the staging kernel?
>>>>>>>>>>>>
>>>>>>>>>>>>
>>> http://blackfin.uclinux.org/gf/project/uclinux-
>>> dist/forum/?_forum_action=MessageReply&message_id=102839&action=ForumBr
>>> owse
>>>>>>>>>>>> Or copied drivers/staging/iio over to your Blackfin kernel tree?
>>>>>>>>>>>>
>>>>>>>>>>>>> -----------------------------------------------------------
>>>>>>>>>>>>> ----------
>>>>>>>>>>>>>
>>>>>>>>>>>>> midas@ubuntu:~/Mala/Telemedicine/uclinux_source/uc2010_source/u
>>>>>>>>>>>>> clinux/2 010R1$ svn info Path: . URL:
>>>>>>>>>>>>> svn://blackfin.uclinux.org/uclinux-dist/branches/2010R1
>>>>>>>>>>>>> Repository Root: svn://blackfin.uclinux.org/uclinux-dist
>>>>>>>>>>>>> Repository UUID: 3e2a5524-39e8-4cb9-84a9-c49da69cba3a
>>>>>>>>>>>>> Revision: 10161 Node Kind: directory Schedule: normal Last
>>>>>>>>>>>>> Changed Author: vapier Last Changed Rev: 10136 Last Changed
>>>>>>>>>>>>> Date: 2011-04-02 22:36:15 +0530 (Sat, 02 Apr 2011)
>>>>>>>>>>>>> -----------------------------------------------------------
>>>>>>>>>>>>> ----------
>>>>>>>>>>>>>
>>>>>>>>>>>>> Regards
>>>>>>>>>>>>> Mala
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Tue, 23 Aug 2011 12:21:25 +0100, Jonathan Cameron wrote
>>>>>>>>>>>>>> On 08/23/11 09:18, malas wrote:
>>>>>>>>>>>>>>> Dear Michael Hennerich,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I shall post iio quesris in this mail list as per your
>>>>>>>>>>>>>>> suggestions.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> AD7793 driver is built into kernel. The chip gets configured
>>>>>>>>>>>>>>> and am able to read data on continuous mode via spi
>>>>>>>>>>>>>>> interface using ad7793 driver at kernel level.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> While testing userspace test iio-ring to read data from ring
>>>>>>>>>>>>>>> buffer, generic_buffer code was executed, it proceeds till
>>>>>>>>>>>>>>> opening /sys/bus/iio/devices/device0:buffer0 and Read call
>>>>>>>>>>>>>>> fails.
>>>>>>>>>>>>>> Question 1: What's the kernel and where did you get it from?
>>>>>>>>>>>>>> (Interfaces are moving fast so it's plausible you've fallen
>>>>>>>>>>>>>> in a hole where userspace wasn't matching kernelspace).
>>>>>>>>>>>>>>> In fs I can list the iio device ad7793 with following
>>>>>>>>>>>>>>> properties get/set.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> root:/> ls /sys/bus/iio/devices/device0\:buffer0/
>>>>>>>>>>>>>>> bytes_per_datum enable power subsystem dev
>>>>>>>>>>>>>>> length scan_elements uevent root:/>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I find access0 and event0 missing in this list. Is that
>>> the reason
>>>>>>>>>>>>> for read() fails.
>>>>>>>>>>>>>> Yes. Question is why and without kernel version I don't know
>>>>>>>>>>>>>> where to look I'm afraid.
>>>>>>>>>> Ah, this does look like a missmatch in interfaces between
>>>>>>>>>> userspace and kernel.
>>>>>>>>>>
>>>>>>>>>> At this point in time we have scrapped the event0 chrdev (done
>>>>>>>>>> via polling on the access one) and the access one has be
>>>>>>>>>> flattened into device0\:buffer0/ (read dev).
>>>>>>>>>>
>>>>>>>>>> Looks like the generic_buffer.c example does line up though.
>>>>>>>>>> Where did the 'test iio-ring' come from? Is that one yours
>>>>>>>>>> Michael?
>>>>>>>
>>>>>>> iio-ring.c under uclinux2010/user/blkfin-test/iio-ring-test. The
>>>>>>> file is in the attached. I did not use that since i didn't find
>>>>>>> access0 or event0 files under /sys/bus/iio/devices/device0:buffer0.
>>>>>>>
>>>>>>> I have tested with the generic_buffer.c example (under
>>>>>>> iio/documentaion folder) to get Ad7793 received samples to user
>>>>>>> space from ring buffer. The app opens: /dev/device0:buffer0 for poll
>>>>>>> and reading samples. Is the device name for the open() correct.
>>>>>> Yes - that should be right.
>>>>> *************************
>>>>> Open fails for "/dev/device0:buffer0" device name
>>>>> I tried changing to "/sys/bus/iio/devices/device0:buffer0"- open()
>>> succeeded then but
>>>>> then read fails.
>>>> Read must be the one under dev. The other is a directory with
>>>> description of the buffer.
>>>>
>>>> What is the error on the open of /dev/device0:buffer0?
>>> ERROR =>
>>> Going to open access file /dev/device0:buffer0
>>> Failed to open /dev/device0:buffer0
>>> open returned fp as -1
>>>
>> I think I asked you before to check if /dev/device0:buffer0 exists.
>> And I guess is does not - so you have to create it.
>>
>> Greetings,
>> Michael
> I created a directory "device0:buffer0" under /dev.
Files under /dev are device nodes, so called pseudo files.
You have to create them using mknod, or have mdev create them for you.
Typically they are created automatically.
But on Blackfin they fail to be created when the IIO driver is
statically build into the kernel.
However mdev creates them when the driver is loaded as module.
The simplest for you would be to build ad7793 as module and use modprobe
on start.
> Open() now succeeds, but read() is still failing, returns readSize as -1.
> I have not initialised any trigger.Should I?
>
> I am running generic_buffer specifying only driver name as:
>
> root> generic_buffer -n ad7793
>
> -mala
>> --
>> Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
>> Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
>> Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
>> Margaret Seif
>
> --
> Open WebMail Project (http://openwebmail.org)
>
>
>
> --
> 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
>
--
Greetings,
Michael
--
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
Margaret Seif
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2011-08-23 15:03 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-23 8:18 ad7793 iio-ring test read issue - Reg malas
2011-08-23 11:21 ` Jonathan Cameron
2011-08-23 11:25 ` malas
2011-08-23 11:39 ` Hennerich, Michael
2011-08-23 12:17 ` malas
2011-08-23 12:39 ` Jonathan Cameron
2011-08-23 12:43 ` malas
2011-08-23 12:58 ` Jonathan Cameron
2011-08-23 13:24 ` malas
2011-08-23 13:41 ` Jonathan Cameron
2011-08-23 13:48 ` malas
2011-08-23 14:07 ` Jonathan Cameron
2011-08-23 14:14 ` malas
2011-08-23 14:30 ` Hennerich, Michael
2011-08-23 14:33 ` malas
2011-08-23 14:53 ` malas
2011-08-23 15:03 ` Michael Hennerich
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.