On Wed, Oct 3, 2012 at 6:06 PM, Thomas Petazzoni
<thomas.petazz...@free-electrons.com> wrote:
>
> On Wed, 3 Oct 2012 22:18:43 +0200, Baruch Siach wrote:
>
>> > Therefore the whole idea of writing a "generic template kernel driver"
>> > is doomed to fail, as it is simply not possible.
>>
>> To me the significance of this template driver is not as a demonstration of 
>> IO
>> operations that are, as you correctly point out, subsystem specific. This
>> driver uses the concepts of file operations and platform driver, I guess,
>> because they are easy to emulate. But these are only means to demonstrate
>> common driver programming patterns and mechanisms like interrupt handling,
>> tasklets, workqueues, completion, etc. Details like DT binding, deprecated
>> /proc use, as well as some other issues, are fixable in my opinion.
>
> Still it doesn't make this driver really useful as a template. The best
> templates are quite certainly the existing drivers in drivers/<foo>/,
> where <foo> in the subsystem you are writing a driver for.
>

To add some value to this argument, video4linux subsystem has
a couple of template drivers -fully maintained- called vivi and mem2mem_testdev.

These are the starting point of any v4l developer.

Adding more drivers like these to other subsystems -mainlined, of course-
would be more worthy than maintaining a general template of them off-tree.

Just my two cents,
Ezequiel.
_______________________________________________
Celinux-dev mailing list
Celinux-dev@lists.celinuxforum.org
https://lists.celinuxforum.org/mailman/listinfo/celinux-dev

Reply via email to