Skip to contentSkip to conversation

v4l2 subdevices and fops

DISCUSSION m7aalton 2 participants 3 messages Mar 8, 2010 – Mar 9, 2010 3 messages not in the archive Media (V4L/DVB)

lore
Share & tools
lore

m7aalton

author
#2 lore raw
In reply to a message not in the archive

Hello.

I'm writing a radio driver which uses subdevice file operations to handle RDS reception and transmission. Some IOCTL call-backs to the main device are easy to pass to the subdevice driver. To me it seems that adding the fops pointer to the following struct in v4l2-subdev.h would make passing the file operation call-backs equally convenient.

struct v4l2_subdev_ops {
	const struct v4l2_subdev_core_ops  *core;
	const struct v4l2_subdev_tuner_ops *tuner;
	const struct v4l2_subdev_audio_ops *audio;
	const struct v4l2_subdev_video_ops *video;
	const struct v4l2_subdev_pad_ops   *pad;
};

Could I expand the above struct in the way I described? Have I missed something? Do you understand what I'm saying? :-)

Cheers,
Matti

#3 lore raw
Quoted 16 lines · On Monday 08 March 2010 13:44:25 m7aalton wrote:

Hello.

I'm writing a radio driver which uses subdevice file operations to handle RDS reception and transmission. Some IOCTL call-backs to the main device are easy to pass to the subdevice driver. To me it seems that adding the fops pointer to the following struct in v4l2-subdev.h would make passing the file operation call-backs equally convenient.

struct v4l2_subdev_ops {
	const struct v4l2_subdev_core_ops  *core;
	const struct v4l2_subdev_tuner_ops *tuner;
	const struct v4l2_subdev_audio_ops *audio;
	const struct v4l2_subdev_video_ops *video;
	const struct v4l2_subdev_pad_ops   *pad;
};
Quoted 2 lines

Could I expand the above struct in the way I described? Have I missed something? Do you understand what I'm saying? :-)

Yes, I understand :-)

It is possible to add rds ops. The question is whether it is used often enough to warrant the addition of a new rds_ops struct. Until recently rds was a rare beast to see inside a driver. If the rds ops are general enough to be used in more than one subdev driver, then I think you should make a proposal. If the rds ops are unique to your driver, though, then it should be done through the core ops ioctl callback.

Regards,

Hans

Quoted 10 lines

Cheers,
Matti

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 1 line
Hans Verkuil - video4linux developer - sponsored by TANDBERG
author
#4 lore raw

Hi.

Quoted 20 lines · ext Hans Verkuil
Quoted 16 lines · On Monday 08 March 2010 13:44:25 m7aalton wrote:

Hello.

I'm writing a radio driver which uses subdevice file operations to handle RDS reception and transmission. Some IOCTL call-backs to the main device are easy to pass to the subdevice driver. To me it seems that adding the fops pointer to the following struct in v4l2-subdev.h would make passing the file operation call-backs equally convenient.

struct v4l2_subdev_ops {
	const struct v4l2_subdev_core_ops  *core;
	const struct v4l2_subdev_tuner_ops *tuner;
	const struct v4l2_subdev_audio_ops *audio;
	const struct v4l2_subdev_video_ops *video;
	const struct v4l2_subdev_pad_ops   *pad;
};
Quoted 2 lines

Could I expand the above struct in the way I described? Have I missed something? Do you understand what I'm saying? :-)

Quoted 8 lines

Yes, I understand :-)

It is possible to add rds ops. The question is whether it is used often enough to warrant the addition of a new rds_ops struct. Until recently rds was a rare beast to see inside a driver. If the rds ops are general enough to be used in more than one subdev driver, then I think you should make a proposal. If the rds ops are unique to your driver, though, then it should be done through the core ops ioctl callback.

I mean file operation like open, close, read and write, which should be general enough. Our driver just passes through the RDS data... But it's probably best if we send the patches to this list so that everyone can comment. It may need a couple of iterations before it gets accepted.

Thanks,

Matti

Quoted 15 lines

Regards,

Hans

Quoted 10 lines

Cheers,
Matti

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html