Template for a new driver
Hello,
I am writing a new driver for a video decoder, and wanted to ask if there was any particular driver people would suggest as a model to look at for new drivers. For example, I am not completely familiar with which interfaces are deprecated, and want to make sure I use a driver as a template that reflects the latest standards/conventions.
Suggestions welcome.
Thanks in advance,
Devin
Signature · 8 lines
Devin J. Heitmueller http://www.devinheitmueller.com AIM: devinheitmueller -- video4linux-list mailing list Unsubscribe mailto:[email protected]?subject=unsubscribe https://www.redhat.com/mailman/listinfo/video4linux-list
Thanks,
Vaibhav Hiremath
Quoted 9 lines
-----Original Message-----
From: [email protected] [mailto:video4linux-list- [email protected]] On Behalf Of Devin Heitmueller
Sent: Monday, December 15, 2008 6:31 AM
To: V4L
Subject: Template for a new driverHello,
Quoted 8 lines
I am writing a new driver for a video decoder, and wanted to ask if there was any particular driver people would suggest as a model to look at for new drivers. For example, I am not completely familiar with which interfaces are deprecated, and want to make sure I use a driver as a template that reflects the latest standards/conventions.
Suggestions welcome.
[Hiremath, Vaibhav] I would suggest using new sub-device framework which recently Hans has submitted, since all other frameworks are going to be deprecated. Please refer to the mail-chain for more info -
http://marc.info/?l=linux-video&m=122756460125873&w=2
http://marc.info/?l=linux-video&m=122808129216519&w=2
Quoted 9 lines
Thanks in advance,
Devin
--
Devin J. Heitmueller
http://www.devinheitmueller.com
AIM: devinheitmueller
Quoted 5 lines
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-
[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
Quoted 8 lines · On Monday 15 December 2008 02:01:14 Devin Heitmueller wrote:
Hello,
I am writing a new driver for a video decoder, and wanted to ask if there was any particular driver people would suggest as a model to look at for new drivers. For example, I am not completely familiar with which interfaces are deprecated, and want to make sure I use a driver as a template that reflects the latest standards/conventions.
Quoted 5 lines
Suggestions welcome.
Thanks in advance,
Devin
Hi Devin,
You definitely want to use the new v4l2_subdev framework for this. Read Documentation/video4linux/v4l2-framework.txt for more info.
A good example template is probably saa7115.c. Not as big and complicated as the audio-video decoder cx25840, but still a good non-trivial example.
I also recommend using struct v4l2_i2c_driver_data if you desire to be compatible with older kernels. The main reason for having this struct is to hide all the ugly kernel #ifdefs.
Regards,
Hans
Signature · 6 lines
Hans Verkuil - video4linux developer - sponsored by TANDBERG -- video4linux-list mailing list Unsubscribe mailto:[email protected]?subject=unsubscribe https://www.redhat.com/mailman/listinfo/video4linux-list
Quoted 24 lines · Hans Verkuil
Quoted 8 lines · On Monday 15 December 2008 02:01:14 Devin Heitmueller wrote:
Hello,
I am writing a new driver for a video decoder, and wanted to ask if there was any particular driver people would suggest as a model to look at for new drivers. For example, I am not completely familiar with which interfaces are deprecated, and want to make sure I use a driver as a template that reflects the latest standards/conventions.
Quoted 5 lines
Suggestions welcome.
Thanks in advance,
Devin
Hi Devin,
You definitely want to use the new
v4l2_subdevframework for this. ReadDocumentation/video4linux/v4l2-framework.txtfor more info.A good example template is probably
saa7115.c. Not as big and complicated as the audio-video decoder cx25840, but still a good non-trivial example.
Quoted 7 lines
I also recommend using struct
v4l2_i2c_driver_dataif you desire to be compatible with older kernels. The main reason for having this struct is to hide all the ugly kernel #ifdefs.Regards,
Hans
Thanks for the feedback. Because I didn't wait for more responses last night, I ended up using the cx25840 driver as the base, which seems to have been a good choice.
Cheers,
Devin
Signature · 8 lines
Devin J. Heitmueller http://www.devinheitmueller.com AIM: devinheitmueller -- video4linux-list mailing list Unsubscribe mailto:[email protected]?subject=unsubscribe https://www.redhat.com/mailman/listinfo/video4linux-list