Comedi device layered on top of FT232RL

From: georg
Date: Tue Nov 25 2014 - 09:45:36 EST


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/