From 4522e825dbfc19537a08f65719dc3d69c46fe661 Mon Sep 17 00:00:00 2001 From: Ondrej Zary Date: Mon, 23 May 2011 09:17:19 -0300 Subject: [media] tea575x: convert to control framework Convert tea575x-tuner to use the new V4L2 control framework. Also add ext_init() callback that can be used by a card driver for additional initialization right before registering the video device (for SF16-FMR2). Also embed struct video_device to struct snd_tea575x to simplify the code. Signed-off-by: Ondrej Zary Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/sound/tea575x-tuner.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/sound') diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h index d2ea112fc20..5aa8186e782 100644 --- a/include/sound/tea575x-tuner.h +++ b/include/sound/tea575x-tuner.h @@ -23,8 +23,8 @@ */ #include +#include #include -#include #define TEA575X_FMIF 10700 @@ -42,7 +42,7 @@ struct snd_tea575x_ops { }; struct snd_tea575x { - struct video_device *vd; /* video device */ + struct video_device vd; /* video device */ bool tea5759; /* 5759 chip is present */ bool mute; /* Device is muted? */ bool stereo; /* receiving stereo */ @@ -54,6 +54,8 @@ struct snd_tea575x { void *private_data; u8 card[32]; u8 bus_info[32]; + struct v4l2_ctrl_handler ctrl_handler; + int (*ext_init)(struct snd_tea575x *tea); }; int snd_tea575x_init(struct snd_tea575x *tea); -- cgit v1.2.3 From 6a529c1a4a87e0f5d143ad3bc0d37179332f210e Mon Sep 17 00:00:00 2001 From: Ondrej Zary Date: Sat, 11 Jun 2011 10:28:59 -0300 Subject: [media] tea575x: allow multiple opens Change locking to allow tea575x-radio device to be opened multiple times. Signed-off-by: Ondrej Zary Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/sound/tea575x-tuner.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/sound') diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h index 5aa8186e782..726e94742a5 100644 --- a/include/sound/tea575x-tuner.h +++ b/include/sound/tea575x-tuner.h @@ -49,7 +49,7 @@ struct snd_tea575x { bool tuned; /* tuned to a station */ unsigned int val; /* hw value */ unsigned long freq; /* frequency */ - unsigned long in_use; /* set if the device is in use */ + struct mutex mutex; struct snd_tea575x_ops *ops; void *private_data; u8 card[32]; -- cgit v1.2.3