mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Comedi device layered on top of FT232RL
@ 2014-11-25 14:39 georg
  2014-11-26 12:23 ` One Thousand Gnomes
  0 siblings, 1 reply; 2+ messages in thread
From: georg @ 2014-11-25 14:39 UTC (permalink / raw)
  To: linux-kernel

Hi LKML,
right now i try to understand if the following thing is possible:

I have an embedded device with an FT232RL interface which gets
handled by ftdi_ser.ko. I can with userspace tools talk to it over
/dev/ttyUSB0. The device control some digital inputs/outputs and some
ADC/DACs. All is handled over a serial protocol.

I thought about following options:
1.Userspace daemon which sits on /dev/ttyUSB0
  Pro: Easy to implement
  Con: It would not be an comedi device and thus not able to use the
       comedi features

2.Kernel driver:
  Pro: It would be possible to use the comedi interface
  Con: I would duplicate much of the code used for ftdi_ser.ko.

OFC i would like to avoid code duplication but i would like to use the
features and interface from comedi.

What is the recommended way to solve such issue?

I tried to look through the comedi drivers and found the usbdux. It
uses usb urbs to talk to its hardware. I tried to find a hint in
LDD3 book but i just got hints about talking with it with urbs.
That is why i came to option 2 (but i see the cons).

The driver would just add the parsing of the stream. Convert the
comedi calls to a stream for the device. That is in fact the thing
i want to put under the hood of comedi.

Best Regards
Georg


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

* Re: Comedi device layered on top of FT232RL
  2014-11-25 14:39 Comedi device layered on top of FT232RL georg
@ 2014-11-26 12:23 ` One Thousand Gnomes
  0 siblings, 0 replies; 2+ messages in thread
From: One Thousand Gnomes @ 2014-11-26 12:23 UTC (permalink / raw)
  To: georg; +Cc: linux-kernel

On Tue, 25 Nov 2014 15:39:28 +0100
georg@schorsch-tech.de wrote:

> Hi LKML,
> right now i try to understand if the following thing is possible:
> 
> I have an embedded device with an FT232RL interface which gets
> handled by ftdi_ser.ko. I can with userspace tools talk to it over
> /dev/ttyUSB0. The device control some digital inputs/outputs and some
> ADC/DACs. All is handled over a serial protocol.
> 
> I thought about following options:
> 1.Userspace daemon which sits on /dev/ttyUSB0
>   Pro: Easy to implement
>   Con: It would not be an comedi device and thus not able to use the
>        comedi features
> 
> 2.Kernel driver:
>   Pro: It would be possible to use the comedi interface
>   Con: I would duplicate much of the code used for ftdi_ser.ko.
> 
> OFC i would like to avoid code duplication but i would like to use the
> features and interface from comedi.
> 
> What is the recommended way to solve such issue?

That depends a lot on the protocol and interface. If the Comedi interface
over the ftdi is a serial protocol then the right way to use it is
to write a line discipline. It can then sit on top of the existing serial
drivers and will also conveniently work with any other kind of tty serial
driver (or even ptys) which can be useful if you need to remote control
devices etc.

Alan

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

end of thread, other threads:[~2014-11-26 12:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-25 14:39 Comedi device layered on top of FT232RL georg
2014-11-26 12:23 ` One Thousand Gnomes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®