aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-video.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx88/cx88-video.c')
-rw-r--r--drivers/media/video/cx88/cx88-video.c71
1 files changed, 10 insertions, 61 deletions
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index 85e51831e774..8ba994273292 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -86,56 +86,7 @@ static LIST_HEAD(cx8800_devlist);
86/* ------------------------------------------------------------------- */ 86/* ------------------------------------------------------------------- */
87/* static data */ 87/* static data */
88 88
89struct v4l2_tvnorm cx88_tvnorms[] = { 89v4l2_std_id radionorms[] = { 0 };
90 {
91 .name = "NTSC-M",
92 .id = V4L2_STD_NTSC_M,
93 },{
94 .name = "NTSC-JP",
95 .id = V4L2_STD_NTSC_M_JP,
96 },{
97 .name = "NTSC-4.43",
98 .id = V4L2_STD_NTSC_443,
99 },{
100 .name = "PAL-BG",
101 .id = V4L2_STD_PAL_BG,
102 },{
103 .name = "PAL-DK",
104 .id = V4L2_STD_PAL_DK,
105 },{
106 .name = "PAL-I",
107 .id = V4L2_STD_PAL_I,
108 },{
109 .name = "PAL-M",
110 .id = V4L2_STD_PAL_M,
111 },{
112 .name = "PAL-N",
113 .id = V4L2_STD_PAL_N,
114 },{
115 .name = "PAL-Nc",
116 .id = V4L2_STD_PAL_Nc,
117 },{
118 .name = "PAL-60",
119 .id = V4L2_STD_PAL_60,
120 },{
121 .name = "SECAM-L",
122 .id = V4L2_STD_SECAM_L,
123 },{
124 .name = "SECAM-DK",
125 .id = V4L2_STD_SECAM_DK,
126 }
127};
128EXPORT_SYMBOL(cx88_tvnorms);
129
130unsigned int cx88_tvnormsize=ARRAY_SIZE(cx88_tvnorms);
131EXPORT_SYMBOL(cx88_tvnormsize);
132
133static struct v4l2_tvnorm radionorms[] = {
134 {
135 .name = "RADIO",
136 .id = 0,
137 }
138};
139 90
140static struct cx8800_fmt formats[] = { 91static struct cx8800_fmt formats[] = {
141 { 92 {
@@ -999,7 +950,7 @@ int cx88_set_control(struct cx88_core *core, struct v4l2_control *ctl)
999 950
1000 value = ((ctl->value - c->off) << c->shift) & c->mask; 951 value = ((ctl->value - c->off) << c->shift) & c->mask;
1001 952
1002 if (core->tvnorm->id & V4L2_STD_SECAM) { 953 if (core->tvnorm & V4L2_STD_SECAM) {
1003 /* For SECAM, both U and V sat should be equal */ 954 /* For SECAM, both U and V sat should be equal */
1004 value=value<<8|value; 955 value=value<<8|value;
1005 } else { 956 } else {
@@ -1242,13 +1193,14 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
1242 return 0; 1193 return 0;
1243} 1194}
1244 1195
1245static int vidioc_s_std (struct file *file, void *priv, unsigned int i) 1196static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *tvnorms)
1246{ 1197{
1247 struct cx88_core *core = ((struct cx8800_fh *)priv)->dev->core; 1198 struct cx88_core *core = ((struct cx8800_fh *)priv)->dev->core;
1248 1199
1249 mutex_lock(&core->lock); 1200 mutex_lock(&core->lock);
1250 cx88_set_tvnorm(core,&cx88_tvnorms[i]); 1201 cx88_set_tvnorm(core,*tvnorms);
1251 mutex_unlock(&core->lock); 1202 mutex_unlock(&core->lock);
1203
1252 return 0; 1204 return 0;
1253} 1205}
1254 1206
@@ -1280,8 +1232,7 @@ int cx88_enum_input (struct cx88_core *core,struct v4l2_input *i)
1280 if ((CX88_VMUX_TELEVISION == INPUT(n)->type) || 1232 if ((CX88_VMUX_TELEVISION == INPUT(n)->type) ||
1281 (CX88_VMUX_CABLE == INPUT(n)->type)) 1233 (CX88_VMUX_CABLE == INPUT(n)->type))
1282 i->type = V4L2_INPUT_TYPE_TUNER; 1234 i->type = V4L2_INPUT_TYPE_TUNER;
1283 for (n = 0; n < ARRAY_SIZE(cx88_tvnorms); n++) 1235 i->std = CX88_NORMS;
1284 i->std |= cx88_tvnorms[n].id;
1285 return 0; 1236 return 0;
1286} 1237}
1287EXPORT_SYMBOL(cx88_enum_input); 1238EXPORT_SYMBOL(cx88_enum_input);
@@ -1703,8 +1654,8 @@ static struct video_device cx8800_video_template =
1703 .vidioc_s_tuner = vidioc_s_tuner, 1654 .vidioc_s_tuner = vidioc_s_tuner,
1704 .vidioc_g_frequency = vidioc_g_frequency, 1655 .vidioc_g_frequency = vidioc_g_frequency,
1705 .vidioc_s_frequency = vidioc_s_frequency, 1656 .vidioc_s_frequency = vidioc_s_frequency,
1706 .tvnorms = cx88_tvnorms, 1657 .tvnorms = CX88_NORMS,
1707 .tvnormsize = ARRAY_SIZE(cx88_tvnorms), 1658 .current_norm = V4L2_STD_PAL_BG,
1708}; 1659};
1709 1660
1710static const struct file_operations radio_fops = 1661static const struct file_operations radio_fops =
@@ -1736,8 +1687,6 @@ static struct video_device cx8800_radio_template =
1736 .vidioc_s_ctrl = vidioc_s_ctrl, 1687 .vidioc_s_ctrl = vidioc_s_ctrl,
1737 .vidioc_g_frequency = vidioc_g_frequency, 1688 .vidioc_g_frequency = vidioc_g_frequency,
1738 .vidioc_s_frequency = vidioc_s_frequency, 1689 .vidioc_s_frequency = vidioc_s_frequency,
1739 .tvnorms = radionorms,
1740 .tvnormsize = ARRAY_SIZE(radionorms),
1741}; 1690};
1742 1691
1743/* ----------------------------------------------------------- */ 1692/* ----------------------------------------------------------- */
@@ -1815,7 +1764,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
1815 1764
1816 /* initialize driver struct */ 1765 /* initialize driver struct */
1817 spin_lock_init(&dev->slock); 1766 spin_lock_init(&dev->slock);
1818 core->tvnorm = cx88_tvnorms; 1767 core->tvnorm = cx8800_video_template.current_norm;
1819 1768
1820 /* init video dma queues */ 1769 /* init video dma queues */
1821 INIT_LIST_HEAD(&dev->vidq.active); 1770 INIT_LIST_HEAD(&dev->vidq.active);
@@ -1896,7 +1845,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
1896 1845
1897 /* initial device configuration */ 1846 /* initial device configuration */
1898 mutex_lock(&core->lock); 1847 mutex_lock(&core->lock);
1899 cx88_set_tvnorm(core,cx88_tvnorms); 1848 cx88_set_tvnorm(core,core->tvnorm);
1900 init_controls(core); 1849 init_controls(core);
1901 cx88_video_mux(core,0); 1850 cx88_video_mux(core,0);
1902 mutex_unlock(&core->lock); 1851 mutex_unlock(&core->lock);