aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-04-13 04:50:18 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-04-16 16:57:27 -0400
commit18c73af6961c528fe5ce95eb510ef63582d47014 (patch)
tree828c7d0464fb3cb38e98ad06951c625432ec08e0 /drivers/media
parentffd3c2330473f6a07f36bf3bd64f7a1158bdd759 (diff)
[media] cx25821: remove unused fields, ioctls
Do some spring cleaning: - there are no board defines with tuners, so remove bogus tuner support. - tv standard handling has nothing to do with tuners, so keep that. - replace the deprecated current_norm by g_std. - querystd isn't implemented, so remove the ioctl. - remove a bunch of unused fields in cx25821.h Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/pci/cx25821/cx25821-cards.c1
-rw-r--r--drivers/media/pci/cx25821/cx25821-video.c130
-rw-r--r--drivers/media/pci/cx25821/cx25821-video.h13
-rw-r--r--drivers/media/pci/cx25821/cx25821.h18
4 files changed, 10 insertions, 152 deletions
diff --git a/drivers/media/pci/cx25821/cx25821-cards.c b/drivers/media/pci/cx25821/cx25821-cards.c
index 99988c988095..c09ec68460e4 100644
--- a/drivers/media/pci/cx25821/cx25821-cards.c
+++ b/drivers/media/pci/cx25821/cx25821-cards.c
@@ -30,7 +30,6 @@
30#include <media/cx25840.h> 30#include <media/cx25840.h>
31 31
32#include "cx25821.h" 32#include "cx25821.h"
33#include "tuner-xc2028.h"
34 33
35/* board config info */ 34/* board config info */
36 35
diff --git a/drivers/media/pci/cx25821/cx25821-video.c b/drivers/media/pci/cx25821/cx25821-video.c
index e785bb98d533..8ff8fc218f38 100644
--- a/drivers/media/pci/cx25821/cx25821-video.c
+++ b/drivers/media/pci/cx25821/cx25821-video.c
@@ -138,7 +138,6 @@ void cx25821_video_wakeup(struct cx25821_dev *dev, struct cx25821_dmaqueue *q,
138 pr_err("%s: %d buffers handled (should be 1)\n", __func__, bc); 138 pr_err("%s: %d buffers handled (should be 1)\n", __func__, bc);
139} 139}
140 140
141#ifdef TUNER_FLAG
142int cx25821_set_tvnorm(struct cx25821_dev *dev, v4l2_std_id norm) 141int cx25821_set_tvnorm(struct cx25821_dev *dev, v4l2_std_id norm)
143{ 142{
144 dprintk(1, "%s(norm = 0x%08x) name: [%s]\n", 143 dprintk(1, "%s(norm = 0x%08x) name: [%s]\n",
@@ -151,7 +150,6 @@ int cx25821_set_tvnorm(struct cx25821_dev *dev, v4l2_std_id norm)
151 150
152 return 0; 151 return 0;
153} 152}
154#endif
155 153
156struct video_device *cx25821_vdev_init(struct cx25821_dev *dev, 154struct video_device *cx25821_vdev_init(struct cx25821_dev *dev,
157 struct pci_dev *pci, 155 struct pci_dev *pci,
@@ -1036,8 +1034,6 @@ int cx25821_vidioc_querycap(struct file *file, void *priv,
1036 cap->version = CX25821_VERSION_CODE; 1034 cap->version = CX25821_VERSION_CODE;
1037 cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | 1035 cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
1038 V4L2_CAP_STREAMING; 1036 V4L2_CAP_STREAMING;
1039 if (UNSET != dev->tuner_type)
1040 cap->capabilities |= V4L2_CAP_TUNER;
1041 return 0; 1037 return 0;
1042} 1038}
1043 1039
@@ -1093,7 +1089,14 @@ int cx25821_vidioc_s_priority(struct file *file, void *f,
1093 prio); 1089 prio);
1094} 1090}
1095 1091
1096#ifdef TUNER_FLAG 1092int cx25821_vidioc_g_std(struct file *file, void *priv, v4l2_std_id *tvnorms)
1093{
1094 struct cx25821_dev *dev = ((struct cx25821_fh *)priv)->dev;
1095
1096 *tvnorms = dev->tvnorm;
1097 return 0;
1098}
1099
1097int cx25821_vidioc_s_std(struct file *file, void *priv, v4l2_std_id tvnorms) 1100int cx25821_vidioc_s_std(struct file *file, void *priv, v4l2_std_id tvnorms)
1098{ 1101{
1099 struct cx25821_fh *fh = priv; 1102 struct cx25821_fh *fh = priv;
@@ -1120,7 +1123,6 @@ int cx25821_vidioc_s_std(struct file *file, void *priv, v4l2_std_id tvnorms)
1120 1123
1121 return 0; 1124 return 0;
1122} 1125}
1123#endif
1124 1126
1125int cx25821_enum_input(struct cx25821_dev *dev, struct v4l2_input *i) 1127int cx25821_enum_input(struct cx25821_dev *dev, struct v4l2_input *i)
1126{ 1128{
@@ -1189,57 +1191,6 @@ int cx25821_vidioc_s_input(struct file *file, void *priv, unsigned int i)
1189 return 0; 1191 return 0;
1190} 1192}
1191 1193
1192#ifdef TUNER_FLAG
1193int cx25821_vidioc_g_frequency(struct file *file, void *priv,
1194 struct v4l2_frequency *f)
1195{
1196 struct cx25821_fh *fh = priv;
1197 struct cx25821_dev *dev = fh->dev;
1198
1199 f->frequency = dev->freq;
1200
1201 cx25821_call_all(dev, tuner, g_frequency, f);
1202
1203 return 0;
1204}
1205
1206int cx25821_set_freq(struct cx25821_dev *dev, const struct v4l2_frequency *f)
1207{
1208 mutex_lock(&dev->lock);
1209 dev->freq = f->frequency;
1210
1211 cx25821_call_all(dev, tuner, s_frequency, f);
1212
1213 /* When changing channels it is required to reset TVAUDIO */
1214 msleep(10);
1215
1216 mutex_unlock(&dev->lock);
1217
1218 return 0;
1219}
1220
1221int cx25821_vidioc_s_frequency(struct file *file, void *priv,
1222 const struct v4l2_frequency *f)
1223{
1224 struct cx25821_fh *fh = priv;
1225 struct cx25821_dev *dev;
1226 int err;
1227
1228 if (fh) {
1229 dev = fh->dev;
1230 err = v4l2_prio_check(&dev->channels[fh->channel_id].prio,
1231 fh->prio);
1232 if (0 != err)
1233 return err;
1234 } else {
1235 pr_err("Invalid fh pointer!\n");
1236 return -EINVAL;
1237 }
1238
1239 return cx25821_set_freq(dev, f);
1240}
1241#endif
1242
1243#ifdef CONFIG_VIDEO_ADV_DEBUG 1194#ifdef CONFIG_VIDEO_ADV_DEBUG
1244int cx25821_vidioc_g_register(struct file *file, void *fh, 1195int cx25821_vidioc_g_register(struct file *file, void *fh,
1245 struct v4l2_dbg_register *reg) 1196 struct v4l2_dbg_register *reg)
@@ -1269,48 +1220,6 @@ int cx25821_vidioc_s_register(struct file *file, void *fh,
1269 1220
1270#endif 1221#endif
1271 1222
1272#ifdef TUNER_FLAG
1273int cx25821_vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
1274{
1275 struct cx25821_dev *dev = ((struct cx25821_fh *)priv)->dev;
1276
1277 if (unlikely(UNSET == dev->tuner_type))
1278 return -EINVAL;
1279 if (0 != t->index)
1280 return -EINVAL;
1281
1282 strcpy(t->name, "Television");
1283 t->type = V4L2_TUNER_ANALOG_TV;
1284 t->capability = V4L2_TUNER_CAP_NORM;
1285 t->rangehigh = 0xffffffffUL;
1286
1287 t->signal = 0xffff; /* LOCKED */
1288 return 0;
1289}
1290
1291int cx25821_vidioc_s_tuner(struct file *file, void *priv, const struct v4l2_tuner *t)
1292{
1293 struct cx25821_dev *dev = ((struct cx25821_fh *)priv)->dev;
1294 struct cx25821_fh *fh = priv;
1295 int err;
1296
1297 if (fh) {
1298 err = v4l2_prio_check(&dev->channels[fh->channel_id].prio,
1299 fh->prio);
1300 if (0 != err)
1301 return err;
1302 }
1303
1304 dprintk(1, "%s()\n", __func__);
1305 if (UNSET == dev->tuner_type)
1306 return -EINVAL;
1307 if (0 != t->index)
1308 return -EINVAL;
1309
1310 return 0;
1311}
1312
1313#endif
1314/*****************************************************************************/ 1223/*****************************************************************************/
1315static const struct v4l2_queryctrl no_ctl = { 1224static const struct v4l2_queryctrl no_ctl = {
1316 .name = "42", 1225 .name = "42",
@@ -1523,14 +1432,6 @@ int cx25821_vidioc_g_crop(struct file *file, void *priv, struct v4l2_crop *crop)
1523 return -EINVAL; 1432 return -EINVAL;
1524} 1433}
1525 1434
1526int cx25821_vidioc_querystd(struct file *file, void *priv, v4l2_std_id * norm)
1527{
1528 /* medusa does not support video standard sensing of current input */
1529 *norm = CX25821_NORMS;
1530
1531 return 0;
1532}
1533
1534int cx25821_is_valid_width(u32 width, v4l2_std_id tvnorm) 1435int cx25821_is_valid_width(u32 width, v4l2_std_id tvnorm)
1535{ 1436{
1536 if (tvnorm == V4L2_STD_PAL_BG) { 1437 if (tvnorm == V4L2_STD_PAL_BG) {
@@ -1842,10 +1743,8 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
1842 .vidioc_querybuf = cx25821_vidioc_querybuf, 1743 .vidioc_querybuf = cx25821_vidioc_querybuf,
1843 .vidioc_qbuf = cx25821_vidioc_qbuf, 1744 .vidioc_qbuf = cx25821_vidioc_qbuf,
1844 .vidioc_dqbuf = vidioc_dqbuf, 1745 .vidioc_dqbuf = vidioc_dqbuf,
1845#ifdef TUNER_FLAG 1746 .vidioc_g_std = cx25821_vidioc_g_std,
1846 .vidioc_s_std = cx25821_vidioc_s_std, 1747 .vidioc_s_std = cx25821_vidioc_s_std,
1847 .vidioc_querystd = cx25821_vidioc_querystd,
1848#endif
1849 .vidioc_cropcap = cx25821_vidioc_cropcap, 1748 .vidioc_cropcap = cx25821_vidioc_cropcap,
1850 .vidioc_s_crop = cx25821_vidioc_s_crop, 1749 .vidioc_s_crop = cx25821_vidioc_s_crop,
1851 .vidioc_g_crop = cx25821_vidioc_g_crop, 1750 .vidioc_g_crop = cx25821_vidioc_g_crop,
@@ -1860,12 +1759,6 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
1860 .vidioc_log_status = vidioc_log_status, 1759 .vidioc_log_status = vidioc_log_status,
1861 .vidioc_g_priority = cx25821_vidioc_g_priority, 1760 .vidioc_g_priority = cx25821_vidioc_g_priority,
1862 .vidioc_s_priority = cx25821_vidioc_s_priority, 1761 .vidioc_s_priority = cx25821_vidioc_s_priority,
1863#ifdef TUNER_FLAG
1864 .vidioc_g_tuner = cx25821_vidioc_g_tuner,
1865 .vidioc_s_tuner = cx25821_vidioc_s_tuner,
1866 .vidioc_g_frequency = cx25821_vidioc_g_frequency,
1867 .vidioc_s_frequency = cx25821_vidioc_s_frequency,
1868#endif
1869#ifdef CONFIG_VIDEO_ADV_DEBUG 1762#ifdef CONFIG_VIDEO_ADV_DEBUG
1870 .vidioc_g_register = cx25821_vidioc_g_register, 1763 .vidioc_g_register = cx25821_vidioc_g_register,
1871 .vidioc_s_register = cx25821_vidioc_s_register, 1764 .vidioc_s_register = cx25821_vidioc_s_register,
@@ -1878,7 +1771,6 @@ static const struct video_device cx25821_video_device = {
1878 .minor = -1, 1771 .minor = -1,
1879 .ioctl_ops = &video_ioctl_ops, 1772 .ioctl_ops = &video_ioctl_ops,
1880 .tvnorms = CX25821_NORMS, 1773 .tvnorms = CX25821_NORMS,
1881 .current_norm = V4L2_STD_NTSC_M,
1882}; 1774};
1883 1775
1884void cx25821_video_unregister(struct cx25821_dev *dev, int chan_num) 1776void cx25821_video_unregister(struct cx25821_dev *dev, int chan_num)
@@ -1953,10 +1845,8 @@ int cx25821_video_register(struct cx25821_dev *dev)
1953 1845
1954 /* initial device configuration */ 1846 /* initial device configuration */
1955 mutex_lock(&dev->lock); 1847 mutex_lock(&dev->lock);
1956#ifdef TUNER_FLAG 1848 dev->tvnorm = V4L2_STD_NTSC_M,
1957 dev->tvnorm = cx25821_video_device.current_norm;
1958 cx25821_set_tvnorm(dev, dev->tvnorm); 1849 cx25821_set_tvnorm(dev, dev->tvnorm);
1959#endif
1960 mutex_unlock(&dev->lock); 1850 mutex_unlock(&dev->lock);
1961 1851
1962 return 0; 1852 return 0;
diff --git a/drivers/media/pci/cx25821/cx25821-video.h b/drivers/media/pci/cx25821/cx25821-video.h
index 37cb0c1b2de0..eb12e35d6de1 100644
--- a/drivers/media/pci/cx25821/cx25821-video.h
+++ b/drivers/media/pci/cx25821/cx25821-video.h
@@ -40,8 +40,6 @@
40#include <media/v4l2-common.h> 40#include <media/v4l2-common.h>
41#include <media/v4l2-ioctl.h> 41#include <media/v4l2-ioctl.h>
42 42
43#define TUNER_FLAG
44
45#define VIDEO_DEBUG 0 43#define VIDEO_DEBUG 0
46 44
47#define dprintk(level, fmt, arg...) \ 45#define dprintk(level, fmt, arg...) \
@@ -88,9 +86,7 @@ extern struct cx25821_data timeout_data[MAX_VID_CHANNEL_NUM];
88extern void cx25821_video_wakeup(struct cx25821_dev *dev, 86extern void cx25821_video_wakeup(struct cx25821_dev *dev,
89 struct cx25821_dmaqueue *q, u32 count); 87 struct cx25821_dmaqueue *q, u32 count);
90 88
91#ifdef TUNER_FLAG
92extern int cx25821_set_tvnorm(struct cx25821_dev *dev, v4l2_std_id norm); 89extern int cx25821_set_tvnorm(struct cx25821_dev *dev, v4l2_std_id norm);
93#endif
94 90
95extern int cx25821_res_get(struct cx25821_dev *dev, struct cx25821_fh *fh, 91extern int cx25821_res_get(struct cx25821_dev *dev, struct cx25821_fh *fh,
96 unsigned int bit); 92 unsigned int bit);
@@ -146,19 +142,10 @@ extern int cx25821_vidioc_g_ctrl(struct file *file, void *priv,
146 struct v4l2_control *ctl); 142 struct v4l2_control *ctl);
147extern int cx25821_vidioc_g_fmt_vid_cap(struct file *file, void *priv, 143extern int cx25821_vidioc_g_fmt_vid_cap(struct file *file, void *priv,
148 struct v4l2_format *f); 144 struct v4l2_format *f);
149extern int cx25821_vidioc_g_frequency(struct file *file, void *priv,
150 struct v4l2_frequency *f);
151extern int cx25821_set_freq(struct cx25821_dev *dev, const struct v4l2_frequency *f);
152extern int cx25821_vidioc_s_frequency(struct file *file, void *priv,
153 const struct v4l2_frequency *f);
154extern int cx25821_vidioc_g_register(struct file *file, void *fh, 145extern int cx25821_vidioc_g_register(struct file *file, void *fh,
155 struct v4l2_dbg_register *reg); 146 struct v4l2_dbg_register *reg);
156extern int cx25821_vidioc_s_register(struct file *file, void *fh, 147extern int cx25821_vidioc_s_register(struct file *file, void *fh,
157 const struct v4l2_dbg_register *reg); 148 const struct v4l2_dbg_register *reg);
158extern int cx25821_vidioc_g_tuner(struct file *file, void *priv,
159 struct v4l2_tuner *t);
160extern int cx25821_vidioc_s_tuner(struct file *file, void *priv,
161 const struct v4l2_tuner *t);
162 149
163extern int cx25821_is_valid_width(u32 width, v4l2_std_id tvnorm); 150extern int cx25821_is_valid_width(u32 width, v4l2_std_id tvnorm);
164extern int cx25821_is_valid_height(u32 height, v4l2_std_id tvnorm); 151extern int cx25821_is_valid_height(u32 height, v4l2_std_id tvnorm);
diff --git a/drivers/media/pci/cx25821/cx25821.h b/drivers/media/pci/cx25821/cx25821.h
index 04c3cb0b6f42..fdeecdf09ef5 100644
--- a/drivers/media/pci/cx25821/cx25821.h
+++ b/drivers/media/pci/cx25821/cx25821.h
@@ -33,7 +33,6 @@
33 33
34#include <media/v4l2-common.h> 34#include <media/v4l2-common.h>
35#include <media/v4l2-device.h> 35#include <media/v4l2-device.h>
36#include <media/tuner.h>
37#include <media/tveeprom.h> 36#include <media/tveeprom.h>
38#include <media/videobuf-dma-sg.h> 37#include <media/videobuf-dma-sg.h>
39#include <media/videobuf-dvb.h> 38#include <media/videobuf-dvb.h>
@@ -43,7 +42,6 @@
43#include "cx25821-medusa-reg.h" 42#include "cx25821-medusa-reg.h"
44#include "cx25821-sram.h" 43#include "cx25821-sram.h"
45#include "cx25821-audio.h" 44#include "cx25821-audio.h"
46#include "media/cx2341x.h"
47 45
48#include <linux/version.h> 46#include <linux/version.h>
49#include <linux/mutex.h> 47#include <linux/mutex.h>
@@ -184,8 +182,6 @@ struct cx25821_board {
184 enum port porta; 182 enum port porta;
185 enum port portb; 183 enum port portb;
186 enum port portc; 184 enum port portc;
187 unsigned int tuner_type;
188 unsigned char tuner_addr;
189 185
190 u32 clk_freq; 186 u32 clk_freq;
191 struct cx25821_input input[CX25821_NR_INPUT]; 187 struct cx25821_input input[CX25821_NR_INPUT];
@@ -283,12 +279,7 @@ struct cx25821_dev {
283 /* Analog video */ 279 /* Analog video */
284 u32 resources; 280 u32 resources;
285 unsigned int input; 281 unsigned int input;
286 u32 tvaudio;
287 v4l2_std_id tvnorm; 282 v4l2_std_id tvnorm;
288 unsigned int tuner_type;
289 unsigned char tuner_addr;
290 unsigned int videc_type;
291 unsigned char videc_addr;
292 unsigned short _max_num_decoders; 283 unsigned short _max_num_decoders;
293 284
294 /* Analog Audio Upstream */ 285 /* Analog Audio Upstream */
@@ -314,8 +305,6 @@ struct cx25821_dev {
314 char *_audiofilename; 305 char *_audiofilename;
315 306
316 /* V4l */ 307 /* V4l */
317 u32 freq;
318
319 spinlock_t slock; 308 spinlock_t slock;
320 309
321 /* Video Upstream */ 310 /* Video Upstream */
@@ -363,13 +352,6 @@ struct cx25821_dev {
363 char *_filename_ch2; 352 char *_filename_ch2;
364 char *_defaultname_ch2; 353 char *_defaultname_ch2;
365 354
366 /* MPEG Encoder ONLY settings */
367 u32 cx23417_mailbox;
368 struct cx2341x_mpeg_params mpeg_params;
369 struct video_device *v4l_device;
370 atomic_t v4l_reader_count;
371 struct cx25821_tvnorm encodernorm;
372
373 u32 upstream_riscbuf_size; 355 u32 upstream_riscbuf_size;
374 u32 upstream_databuf_size; 356 u32 upstream_databuf_size;
375 u32 upstream_riscbuf_size_ch2; 357 u32 upstream_riscbuf_size_ch2;