aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/i2c/cx25840/cx25840-core.c2
-rw-r--r--drivers/media/i2c/msp3400-driver.c2
-rw-r--r--drivers/media/i2c/tvaudio.c2
-rw-r--r--drivers/media/i2c/upd64031a.c2
-rw-r--r--drivers/media/i2c/wm8775.c2
-rw-r--r--drivers/media/pci/bt8xx/bttv-driver.c14
-rw-r--r--drivers/media/pci/cx18/cx18-av-core.c2
-rw-r--r--drivers/media/pci/cx18/cx18-ioctl.c2
-rw-r--r--drivers/media/pci/cx18/cx18-ioctl.h2
-rw-r--r--drivers/media/pci/cx23885/cx23885-417.c2
-rw-r--r--drivers/media/pci/cx23885/cx23885-video.c8
-rw-r--r--drivers/media/pci/cx23885/cx23885.h2
-rw-r--r--drivers/media/pci/cx25821/cx25821-video.c4
-rw-r--r--drivers/media/pci/cx25821/cx25821-video.h4
-rw-r--r--drivers/media/pci/cx88/cx88-blackbird.c2
-rw-r--r--drivers/media/pci/cx88/cx88-video.c10
-rw-r--r--drivers/media/pci/cx88/cx88.h2
-rw-r--r--drivers/media/pci/ivtv/ivtv-ioctl.c2
-rw-r--r--drivers/media/pci/ivtv/ivtv-ioctl.h2
-rw-r--r--drivers/media/pci/saa7134/saa7134-video.c2
-rw-r--r--drivers/media/pci/saa7146/mxb.c4
-rw-r--r--drivers/media/pci/saa7164/saa7164-encoder.c2
-rw-r--r--drivers/media/pci/saa7164/saa7164-vbi.c2
-rw-r--r--drivers/media/pci/ttpci/av7110_v4l.c2
-rw-r--r--drivers/media/radio/dsbr100.c2
-rw-r--r--drivers/media/radio/radio-cadet.c46
-rw-r--r--drivers/media/radio/radio-isa.c9
-rw-r--r--drivers/media/radio/radio-keene.c8
-rw-r--r--drivers/media/radio/radio-ma901.c2
-rw-r--r--drivers/media/radio/radio-miropcm20.c4
-rw-r--r--drivers/media/radio/radio-mr800.c2
-rw-r--r--drivers/media/radio/radio-sf16fmi.c2
-rw-r--r--drivers/media/radio/radio-si4713.c2
-rw-r--r--drivers/media/radio/radio-tea5764.c2
-rw-r--r--drivers/media/radio/radio-tea5777.c2
-rw-r--r--drivers/media/radio/radio-timb.c2
-rw-r--r--drivers/media/radio/radio-wl1273.c2
-rw-r--r--drivers/media/radio/si470x/radio-si470x-common.c2
-rw-r--r--drivers/media/radio/si4713-i2c.c5
-rw-r--r--drivers/media/radio/tef6862.c2
-rw-r--r--drivers/media/radio/wl128x/fmdrv_v4l2.c6
-rw-r--r--drivers/media/usb/au0828/au0828-video.c2
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-video.c7
-rw-r--r--drivers/media/usb/cx231xx/cx231xx.h2
-rw-r--r--drivers/media/usb/em28xx/em28xx-video.c7
-rw-r--r--drivers/media/usb/pvrusb2/pvrusb2-v4l2.c2
-rw-r--r--drivers/media/usb/tlg2300/pd-radio.c2
-rw-r--r--drivers/media/usb/tlg2300/pd-video.c5
-rw-r--r--drivers/media/usb/tm6000/tm6000-video.c2
-rw-r--r--drivers/media/usb/usbvision/usbvision-video.c2
-rw-r--r--drivers/media/v4l2-core/tuner-core.c2
-rw-r--r--drivers/media/v4l2-core/v4l2-ioctl.c2
-rw-r--r--drivers/staging/media/go7007/go7007-v4l2.c2
-rw-r--r--include/media/v4l2-ioctl.h2
-rw-r--r--include/media/v4l2-subdev.h2
-rw-r--r--sound/i2c/other/tea575x-tuner.c4
56 files changed, 115 insertions, 110 deletions
diff --git a/drivers/media/i2c/cx25840/cx25840-core.c b/drivers/media/i2c/cx25840/cx25840-core.c
index f4149eb4d7b4..f4339ed8f2e5 100644
--- a/drivers/media/i2c/cx25840/cx25840-core.c
+++ b/drivers/media/i2c/cx25840/cx25840-core.c
@@ -1835,7 +1835,7 @@ static int cx25840_s_audio_routing(struct v4l2_subdev *sd,
1835 return set_input(client, state->vid_input, input); 1835 return set_input(client, state->vid_input, input);
1836} 1836}
1837 1837
1838static int cx25840_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *freq) 1838static int cx25840_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequency *freq)
1839{ 1839{
1840 struct i2c_client *client = v4l2_get_subdevdata(sd); 1840 struct i2c_client *client = v4l2_get_subdevdata(sd);
1841 1841
diff --git a/drivers/media/i2c/msp3400-driver.c b/drivers/media/i2c/msp3400-driver.c
index 766305f69a28..77053ba09627 100644
--- a/drivers/media/i2c/msp3400-driver.c
+++ b/drivers/media/i2c/msp3400-driver.c
@@ -445,7 +445,7 @@ static int msp_s_radio(struct v4l2_subdev *sd)
445 return 0; 445 return 0;
446} 446}
447 447
448static int msp_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *freq) 448static int msp_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequency *freq)
449{ 449{
450 struct i2c_client *client = v4l2_get_subdevdata(sd); 450 struct i2c_client *client = v4l2_get_subdevdata(sd);
451 451
diff --git a/drivers/media/i2c/tvaudio.c b/drivers/media/i2c/tvaudio.c
index 4c91b355b55a..4b12c5188075 100644
--- a/drivers/media/i2c/tvaudio.c
+++ b/drivers/media/i2c/tvaudio.c
@@ -1817,7 +1817,7 @@ static int tvaudio_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
1817 return 0; 1817 return 0;
1818} 1818}
1819 1819
1820static int tvaudio_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *freq) 1820static int tvaudio_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequency *freq)
1821{ 1821{
1822 struct CHIPSTATE *chip = to_state(sd); 1822 struct CHIPSTATE *chip = to_state(sd);
1823 struct CHIPDESC *desc = chip->desc; 1823 struct CHIPDESC *desc = chip->desc;
diff --git a/drivers/media/i2c/upd64031a.c b/drivers/media/i2c/upd64031a.c
index 1e7446542091..d15cfd944e57 100644
--- a/drivers/media/i2c/upd64031a.c
+++ b/drivers/media/i2c/upd64031a.c
@@ -111,7 +111,7 @@ static void upd64031a_write(struct v4l2_subdev *sd, u8 reg, u8 val)
111/* ------------------------------------------------------------------------ */ 111/* ------------------------------------------------------------------------ */
112 112
113/* The input changed due to new input or channel changed */ 113/* The input changed due to new input or channel changed */
114static int upd64031a_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *freq) 114static int upd64031a_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequency *freq)
115{ 115{
116 struct upd64031a_state *state = to_state(sd); 116 struct upd64031a_state *state = to_state(sd);
117 u8 reg = state->regs[R00]; 117 u8 reg = state->regs[R00];
diff --git a/drivers/media/i2c/wm8775.c b/drivers/media/i2c/wm8775.c
index bee77ea9f49e..27c27b4ae238 100644
--- a/drivers/media/i2c/wm8775.c
+++ b/drivers/media/i2c/wm8775.c
@@ -174,7 +174,7 @@ static int wm8775_log_status(struct v4l2_subdev *sd)
174 return 0; 174 return 0;
175} 175}
176 176
177static int wm8775_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *freq) 177static int wm8775_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequency *freq)
178{ 178{
179 wm8775_set_audio(sd, 0); 179 wm8775_set_audio(sd, 0);
180 return 0; 180 return 0;
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
index 2fb2168f74e2..3156daf2c804 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -1852,24 +1852,26 @@ static int bttv_g_frequency(struct file *file, void *priv,
1852 return 0; 1852 return 0;
1853} 1853}
1854 1854
1855static void bttv_set_frequency(struct bttv *btv, struct v4l2_frequency *f) 1855static void bttv_set_frequency(struct bttv *btv, const struct v4l2_frequency *f)
1856{ 1856{
1857 struct v4l2_frequency new_freq = *f;
1858
1857 bttv_call_all(btv, tuner, s_frequency, f); 1859 bttv_call_all(btv, tuner, s_frequency, f);
1858 /* s_frequency may clamp the frequency, so get the actual 1860 /* s_frequency may clamp the frequency, so get the actual
1859 frequency before assigning radio/tv_freq. */ 1861 frequency before assigning radio/tv_freq. */
1860 bttv_call_all(btv, tuner, g_frequency, f); 1862 bttv_call_all(btv, tuner, g_frequency, &new_freq);
1861 if (f->type == V4L2_TUNER_RADIO) { 1863 if (new_freq.type == V4L2_TUNER_RADIO) {
1862 radio_enable(btv); 1864 radio_enable(btv);
1863 btv->radio_freq = f->frequency; 1865 btv->radio_freq = new_freq.frequency;
1864 if (btv->has_matchbox) 1866 if (btv->has_matchbox)
1865 tea5757_set_freq(btv, btv->radio_freq); 1867 tea5757_set_freq(btv, btv->radio_freq);
1866 } else { 1868 } else {
1867 btv->tv_freq = f->frequency; 1869 btv->tv_freq = new_freq.frequency;
1868 } 1870 }
1869} 1871}
1870 1872
1871static int bttv_s_frequency(struct file *file, void *priv, 1873static int bttv_s_frequency(struct file *file, void *priv,
1872 struct v4l2_frequency *f) 1874 const struct v4l2_frequency *f)
1873{ 1875{
1874 struct bttv_fh *fh = priv; 1876 struct bttv_fh *fh = priv;
1875 struct bttv *btv = fh->btv; 1877 struct bttv *btv = fh->btv;
diff --git a/drivers/media/pci/cx18/cx18-av-core.c b/drivers/media/pci/cx18/cx18-av-core.c
index f164b7f610a5..a2c51e0468a8 100644
--- a/drivers/media/pci/cx18/cx18-av-core.c
+++ b/drivers/media/pci/cx18/cx18-av-core.c
@@ -576,7 +576,7 @@ static void input_change(struct cx18 *cx)
576} 576}
577 577
578static int cx18_av_s_frequency(struct v4l2_subdev *sd, 578static int cx18_av_s_frequency(struct v4l2_subdev *sd,
579 struct v4l2_frequency *freq) 579 const struct v4l2_frequency *freq)
580{ 580{
581 struct cx18 *cx = v4l2_get_subdevdata(sd); 581 struct cx18 *cx = v4l2_get_subdevdata(sd);
582 input_change(cx); 582 input_change(cx);
diff --git a/drivers/media/pci/cx18/cx18-ioctl.c b/drivers/media/pci/cx18/cx18-ioctl.c
index cd8d2c2b1624..5cd22e7095e6 100644
--- a/drivers/media/pci/cx18/cx18-ioctl.c
+++ b/drivers/media/pci/cx18/cx18-ioctl.c
@@ -614,7 +614,7 @@ static int cx18_g_frequency(struct file *file, void *fh,
614 return 0; 614 return 0;
615} 615}
616 616
617int cx18_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf) 617int cx18_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *vf)
618{ 618{
619 struct cx18_open_id *id = fh2id(fh); 619 struct cx18_open_id *id = fh2id(fh);
620 struct cx18 *cx = id->cx; 620 struct cx18 *cx = id->cx;
diff --git a/drivers/media/pci/cx18/cx18-ioctl.h b/drivers/media/pci/cx18/cx18-ioctl.h
index 2f9dd591ee0f..aa9b44a611d3 100644
--- a/drivers/media/pci/cx18/cx18-ioctl.h
+++ b/drivers/media/pci/cx18/cx18-ioctl.h
@@ -27,5 +27,5 @@ void cx18_expand_service_set(struct v4l2_sliced_vbi_format *fmt, int is_pal);
27u16 cx18_get_service_set(struct v4l2_sliced_vbi_format *fmt); 27u16 cx18_get_service_set(struct v4l2_sliced_vbi_format *fmt);
28void cx18_set_funcs(struct video_device *vdev); 28void cx18_set_funcs(struct video_device *vdev);
29int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std); 29int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std);
30int cx18_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf); 30int cx18_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *vf);
31int cx18_s_input(struct file *file, void *fh, unsigned int inp); 31int cx18_s_input(struct file *file, void *fh, unsigned int inp);
diff --git a/drivers/media/pci/cx23885/cx23885-417.c b/drivers/media/pci/cx23885/cx23885-417.c
index 5d5052d0253f..84a1b75d5444 100644
--- a/drivers/media/pci/cx23885/cx23885-417.c
+++ b/drivers/media/pci/cx23885/cx23885-417.c
@@ -1311,7 +1311,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
1311} 1311}
1312 1312
1313static int vidioc_s_frequency(struct file *file, void *priv, 1313static int vidioc_s_frequency(struct file *file, void *priv,
1314 struct v4l2_frequency *f) 1314 const struct v4l2_frequency *f)
1315{ 1315{
1316 return cx23885_set_frequency(file, priv, f); 1316 return cx23885_set_frequency(file, priv, f);
1317} 1317}
diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c
index 5991bc8dc158..5ba15b8dafe0 100644
--- a/drivers/media/pci/cx23885/cx23885-video.c
+++ b/drivers/media/pci/cx23885/cx23885-video.c
@@ -1518,7 +1518,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
1518 return 0; 1518 return 0;
1519} 1519}
1520 1520
1521static int cx23885_set_freq(struct cx23885_dev *dev, struct v4l2_frequency *f) 1521static int cx23885_set_freq(struct cx23885_dev *dev, const struct v4l2_frequency *f)
1522{ 1522{
1523 struct v4l2_control ctrl; 1523 struct v4l2_control ctrl;
1524 1524
@@ -1550,7 +1550,7 @@ static int cx23885_set_freq(struct cx23885_dev *dev, struct v4l2_frequency *f)
1550} 1550}
1551 1551
1552static int cx23885_set_freq_via_ops(struct cx23885_dev *dev, 1552static int cx23885_set_freq_via_ops(struct cx23885_dev *dev,
1553 struct v4l2_frequency *f) 1553 const struct v4l2_frequency *f)
1554{ 1554{
1555 struct v4l2_control ctrl; 1555 struct v4l2_control ctrl;
1556 struct videobuf_dvb_frontend *vfe; 1556 struct videobuf_dvb_frontend *vfe;
@@ -1608,7 +1608,7 @@ static int cx23885_set_freq_via_ops(struct cx23885_dev *dev,
1608} 1608}
1609 1609
1610int cx23885_set_frequency(struct file *file, void *priv, 1610int cx23885_set_frequency(struct file *file, void *priv,
1611 struct v4l2_frequency *f) 1611 const struct v4l2_frequency *f)
1612{ 1612{
1613 struct cx23885_fh *fh = priv; 1613 struct cx23885_fh *fh = priv;
1614 struct cx23885_dev *dev = fh->dev; 1614 struct cx23885_dev *dev = fh->dev;
@@ -1628,7 +1628,7 @@ int cx23885_set_frequency(struct file *file, void *priv,
1628} 1628}
1629 1629
1630static int vidioc_s_frequency(struct file *file, void *priv, 1630static int vidioc_s_frequency(struct file *file, void *priv,
1631 struct v4l2_frequency *f) 1631 const struct v4l2_frequency *f)
1632{ 1632{
1633 return cx23885_set_frequency(file, priv, f); 1633 return cx23885_set_frequency(file, priv, f);
1634} 1634}
diff --git a/drivers/media/pci/cx23885/cx23885.h b/drivers/media/pci/cx23885/cx23885.h
index 59c322d870f2..5687d3f678db 100644
--- a/drivers/media/pci/cx23885/cx23885.h
+++ b/drivers/media/pci/cx23885/cx23885.h
@@ -587,7 +587,7 @@ extern void cx23885_video_wakeup(struct cx23885_dev *dev,
587int cx23885_enum_input(struct cx23885_dev *dev, struct v4l2_input *i); 587int cx23885_enum_input(struct cx23885_dev *dev, struct v4l2_input *i);
588int cx23885_set_input(struct file *file, void *priv, unsigned int i); 588int cx23885_set_input(struct file *file, void *priv, unsigned int i);
589int cx23885_get_input(struct file *file, void *priv, unsigned int *i); 589int cx23885_get_input(struct file *file, void *priv, unsigned int *i);
590int cx23885_set_frequency(struct file *file, void *priv, struct v4l2_frequency *f); 590int cx23885_set_frequency(struct file *file, void *priv, const struct v4l2_frequency *f);
591int cx23885_set_control(struct cx23885_dev *dev, struct v4l2_control *ctl); 591int cx23885_set_control(struct cx23885_dev *dev, struct v4l2_control *ctl);
592int cx23885_get_control(struct cx23885_dev *dev, struct v4l2_control *ctl); 592int cx23885_get_control(struct cx23885_dev *dev, struct v4l2_control *ctl);
593int cx23885_set_tvnorm(struct cx23885_dev *dev, v4l2_std_id norm); 593int cx23885_set_tvnorm(struct cx23885_dev *dev, v4l2_std_id norm);
diff --git a/drivers/media/pci/cx25821/cx25821-video.c b/drivers/media/pci/cx25821/cx25821-video.c
index d4de021dc844..1219d60cdd79 100644
--- a/drivers/media/pci/cx25821/cx25821-video.c
+++ b/drivers/media/pci/cx25821/cx25821-video.c
@@ -1312,7 +1312,7 @@ int cx25821_vidioc_g_frequency(struct file *file, void *priv,
1312 return 0; 1312 return 0;
1313} 1313}
1314 1314
1315int cx25821_set_freq(struct cx25821_dev *dev, struct v4l2_frequency *f) 1315int cx25821_set_freq(struct cx25821_dev *dev, const struct v4l2_frequency *f)
1316{ 1316{
1317 mutex_lock(&dev->lock); 1317 mutex_lock(&dev->lock);
1318 dev->freq = f->frequency; 1318 dev->freq = f->frequency;
@@ -1328,7 +1328,7 @@ int cx25821_set_freq(struct cx25821_dev *dev, struct v4l2_frequency *f)
1328} 1328}
1329 1329
1330int cx25821_vidioc_s_frequency(struct file *file, void *priv, 1330int cx25821_vidioc_s_frequency(struct file *file, void *priv,
1331 struct v4l2_frequency *f) 1331 const struct v4l2_frequency *f)
1332{ 1332{
1333 struct cx25821_fh *fh = priv; 1333 struct cx25821_fh *fh = priv;
1334 struct cx25821_dev *dev; 1334 struct cx25821_dev *dev;
diff --git a/drivers/media/pci/cx25821/cx25821-video.h b/drivers/media/pci/cx25821/cx25821-video.h
index c265e35b37c3..969340c2dcfa 100644
--- a/drivers/media/pci/cx25821/cx25821-video.h
+++ b/drivers/media/pci/cx25821/cx25821-video.h
@@ -149,9 +149,9 @@ extern int cx25821_vidioc_g_fmt_vid_cap(struct file *file, void *priv,
149 struct v4l2_format *f); 149 struct v4l2_format *f);
150extern int cx25821_vidioc_g_frequency(struct file *file, void *priv, 150extern int cx25821_vidioc_g_frequency(struct file *file, void *priv,
151 struct v4l2_frequency *f); 151 struct v4l2_frequency *f);
152extern int cx25821_set_freq(struct cx25821_dev *dev, struct v4l2_frequency *f); 152extern int cx25821_set_freq(struct cx25821_dev *dev, const struct v4l2_frequency *f);
153extern int cx25821_vidioc_s_frequency(struct file *file, void *priv, 153extern int cx25821_vidioc_s_frequency(struct file *file, void *priv,
154 struct v4l2_frequency *f); 154 const struct v4l2_frequency *f);
155extern int cx25821_vidioc_g_register(struct file *file, void *fh, 155extern int cx25821_vidioc_g_register(struct file *file, void *fh,
156 struct v4l2_dbg_register *reg); 156 struct v4l2_dbg_register *reg);
157extern int cx25821_vidioc_s_register(struct file *file, void *fh, 157extern int cx25821_vidioc_s_register(struct file *file, void *fh,
diff --git a/drivers/media/pci/cx88/cx88-blackbird.c b/drivers/media/pci/cx88/cx88-blackbird.c
index a6ff8a6f4fc0..82aa11f526f0 100644
--- a/drivers/media/pci/cx88/cx88-blackbird.c
+++ b/drivers/media/pci/cx88/cx88-blackbird.c
@@ -815,7 +815,7 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
815} 815}
816 816
817static int vidioc_s_frequency (struct file *file, void *priv, 817static int vidioc_s_frequency (struct file *file, void *priv,
818 struct v4l2_frequency *f) 818 const struct v4l2_frequency *f)
819{ 819{
820 struct cx8802_fh *fh = priv; 820 struct cx8802_fh *fh = priv;
821 struct cx8802_dev *dev = fh->dev; 821 struct cx8802_dev *dev = fh->dev;
diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c
index bc78354262ac..4f10875295e8 100644
--- a/drivers/media/pci/cx88/cx88-video.c
+++ b/drivers/media/pci/cx88/cx88-video.c
@@ -1321,8 +1321,10 @@ static int vidioc_g_frequency (struct file *file, void *priv,
1321} 1321}
1322 1322
1323int cx88_set_freq (struct cx88_core *core, 1323int cx88_set_freq (struct cx88_core *core,
1324 struct v4l2_frequency *f) 1324 const struct v4l2_frequency *f)
1325{ 1325{
1326 struct v4l2_frequency new_freq = *f;
1327
1326 if (unlikely(UNSET == core->board.tuner_type)) 1328 if (unlikely(UNSET == core->board.tuner_type))
1327 return -EINVAL; 1329 return -EINVAL;
1328 if (unlikely(f->tuner != 0)) 1330 if (unlikely(f->tuner != 0))
@@ -1331,8 +1333,8 @@ int cx88_set_freq (struct cx88_core *core,
1331 mutex_lock(&core->lock); 1333 mutex_lock(&core->lock);
1332 cx88_newstation(core); 1334 cx88_newstation(core);
1333 call_all(core, tuner, s_frequency, f); 1335 call_all(core, tuner, s_frequency, f);
1334 call_all(core, tuner, g_frequency, f); 1336 call_all(core, tuner, g_frequency, &new_freq);
1335 core->freq = f->frequency; 1337 core->freq = new_freq.frequency;
1336 1338
1337 /* When changing channels it is required to reset TVAUDIO */ 1339 /* When changing channels it is required to reset TVAUDIO */
1338 msleep (10); 1340 msleep (10);
@@ -1345,7 +1347,7 @@ int cx88_set_freq (struct cx88_core *core,
1345EXPORT_SYMBOL(cx88_set_freq); 1347EXPORT_SYMBOL(cx88_set_freq);
1346 1348
1347static int vidioc_s_frequency (struct file *file, void *priv, 1349static int vidioc_s_frequency (struct file *file, void *priv,
1348 struct v4l2_frequency *f) 1350 const struct v4l2_frequency *f)
1349{ 1351{
1350 struct cx8800_fh *fh = priv; 1352 struct cx8800_fh *fh = priv;
1351 struct cx88_core *core = fh->dev->core; 1353 struct cx88_core *core = fh->dev->core;
diff --git a/drivers/media/pci/cx88/cx88.h b/drivers/media/pci/cx88/cx88.h
index feff53c0a251..eca02c2435de 100644
--- a/drivers/media/pci/cx88/cx88.h
+++ b/drivers/media/pci/cx88/cx88.h
@@ -740,7 +740,7 @@ void cx8802_cancel_buffers(struct cx8802_dev *dev);
740/* ----------------------------------------------------------- */ 740/* ----------------------------------------------------------- */
741/* cx88-video.c*/ 741/* cx88-video.c*/
742int cx88_enum_input (struct cx88_core *core,struct v4l2_input *i); 742int cx88_enum_input (struct cx88_core *core,struct v4l2_input *i);
743int cx88_set_freq (struct cx88_core *core,struct v4l2_frequency *f); 743int cx88_set_freq(struct cx88_core *core, const struct v4l2_frequency *f);
744int cx88_video_mux(struct cx88_core *core, unsigned int input); 744int cx88_video_mux(struct cx88_core *core, unsigned int input);
745void cx88_querycap(struct file *file, struct cx88_core *core, 745void cx88_querycap(struct file *file, struct cx88_core *core,
746 struct v4l2_capability *cap); 746 struct v4l2_capability *cap);
diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c
index 7a8b0d0b6127..e6258b68d22c 100644
--- a/drivers/media/pci/ivtv/ivtv-ioctl.c
+++ b/drivers/media/pci/ivtv/ivtv-ioctl.c
@@ -1078,7 +1078,7 @@ static int ivtv_g_frequency(struct file *file, void *fh, struct v4l2_frequency *
1078 return 0; 1078 return 0;
1079} 1079}
1080 1080
1081int ivtv_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf) 1081int ivtv_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *vf)
1082{ 1082{
1083 struct ivtv *itv = fh2id(fh)->itv; 1083 struct ivtv *itv = fh2id(fh)->itv;
1084 struct ivtv_stream *s = &itv->streams[fh2id(fh)->type]; 1084 struct ivtv_stream *s = &itv->streams[fh2id(fh)->type];
diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.h b/drivers/media/pci/ivtv/ivtv-ioctl.h
index 7c553d16579b..34c6bc132ebd 100644
--- a/drivers/media/pci/ivtv/ivtv-ioctl.h
+++ b/drivers/media/pci/ivtv/ivtv-ioctl.h
@@ -29,7 +29,7 @@ int ivtv_set_speed(struct ivtv *itv, int speed);
29void ivtv_set_funcs(struct video_device *vdev); 29void ivtv_set_funcs(struct video_device *vdev);
30void ivtv_s_std_enc(struct ivtv *itv, v4l2_std_id *std); 30void ivtv_s_std_enc(struct ivtv *itv, v4l2_std_id *std);
31void ivtv_s_std_dec(struct ivtv *itv, v4l2_std_id *std); 31void ivtv_s_std_dec(struct ivtv *itv, v4l2_std_id *std);
32int ivtv_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf); 32int ivtv_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *vf);
33int ivtv_s_input(struct file *file, void *fh, unsigned int inp); 33int ivtv_s_input(struct file *file, void *fh, unsigned int inp);
34 34
35#endif 35#endif
diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c
index 7c503fb68526..6c619d13f731 100644
--- a/drivers/media/pci/saa7134/saa7134-video.c
+++ b/drivers/media/pci/saa7134/saa7134-video.c
@@ -2057,7 +2057,7 @@ static int saa7134_g_frequency(struct file *file, void *priv,
2057} 2057}
2058 2058
2059static int saa7134_s_frequency(struct file *file, void *priv, 2059static int saa7134_s_frequency(struct file *file, void *priv,
2060 struct v4l2_frequency *f) 2060 const struct v4l2_frequency *f)
2061{ 2061{
2062 struct saa7134_fh *fh = priv; 2062 struct saa7134_fh *fh = priv;
2063 struct saa7134_dev *dev = fh->dev; 2063 struct saa7134_dev *dev = fh->dev;
diff --git a/drivers/media/pci/saa7146/mxb.c b/drivers/media/pci/saa7146/mxb.c
index 91369daad722..27dc49b03d02 100644
--- a/drivers/media/pci/saa7146/mxb.c
+++ b/drivers/media/pci/saa7146/mxb.c
@@ -595,7 +595,7 @@ static int vidioc_g_frequency(struct file *file, void *fh, struct v4l2_frequency
595 return 0; 595 return 0;
596} 596}
597 597
598static int vidioc_s_frequency(struct file *file, void *fh, struct v4l2_frequency *f) 598static int vidioc_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *f)
599{ 599{
600 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; 600 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
601 struct mxb *mxb = (struct mxb *)dev->ext_priv; 601 struct mxb *mxb = (struct mxb *)dev->ext_priv;
@@ -612,8 +612,8 @@ static int vidioc_s_frequency(struct file *file, void *fh, struct v4l2_frequency
612 /* tune in desired frequency */ 612 /* tune in desired frequency */
613 tuner_call(mxb, tuner, s_frequency, f); 613 tuner_call(mxb, tuner, s_frequency, f);
614 /* let the tuner subdev clamp the frequency to the tuner range */ 614 /* let the tuner subdev clamp the frequency to the tuner range */
615 tuner_call(mxb, tuner, g_frequency, f);
616 mxb->cur_freq = *f; 615 mxb->cur_freq = *f;
616 tuner_call(mxb, tuner, g_frequency, &mxb->cur_freq);
617 if (mxb->cur_audinput == 0) 617 if (mxb->cur_audinput == 0)
618 mxb_update_audmode(mxb); 618 mxb_update_audmode(mxb);
619 619
diff --git a/drivers/media/pci/saa7164/saa7164-encoder.c b/drivers/media/pci/saa7164/saa7164-encoder.c
index 9bb0903ee5f1..34f700da2e7a 100644
--- a/drivers/media/pci/saa7164/saa7164-encoder.c
+++ b/drivers/media/pci/saa7164/saa7164-encoder.c
@@ -337,7 +337,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
337} 337}
338 338
339static int vidioc_s_frequency(struct file *file, void *priv, 339static int vidioc_s_frequency(struct file *file, void *priv,
340 struct v4l2_frequency *f) 340 const struct v4l2_frequency *f)
341{ 341{
342 struct saa7164_encoder_fh *fh = file->private_data; 342 struct saa7164_encoder_fh *fh = file->private_data;
343 struct saa7164_port *port = fh->port; 343 struct saa7164_port *port = fh->port;
diff --git a/drivers/media/pci/saa7164/saa7164-vbi.c b/drivers/media/pci/saa7164/saa7164-vbi.c
index b4532299c0ed..5a8a6adb894b 100644
--- a/drivers/media/pci/saa7164/saa7164-vbi.c
+++ b/drivers/media/pci/saa7164/saa7164-vbi.c
@@ -309,7 +309,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
309} 309}
310 310
311static int vidioc_s_frequency(struct file *file, void *priv, 311static int vidioc_s_frequency(struct file *file, void *priv,
312 struct v4l2_frequency *f) 312 const struct v4l2_frequency *f)
313{ 313{
314 struct saa7164_vbi_fh *fh = file->private_data; 314 struct saa7164_vbi_fh *fh = file->private_data;
315 struct saa7164_port *port = fh->port; 315 struct saa7164_port *port = fh->port;
diff --git a/drivers/media/pci/ttpci/av7110_v4l.c b/drivers/media/pci/ttpci/av7110_v4l.c
index 730e906ea912..65adaa74c511 100644
--- a/drivers/media/pci/ttpci/av7110_v4l.c
+++ b/drivers/media/pci/ttpci/av7110_v4l.c
@@ -426,7 +426,7 @@ static int vidioc_g_frequency(struct file *file, void *fh, struct v4l2_frequency
426 return 0; 426 return 0;
427} 427}
428 428
429static int vidioc_s_frequency(struct file *file, void *fh, struct v4l2_frequency *f) 429static int vidioc_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *f)
430{ 430{
431 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; 431 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
432 struct av7110 *av7110 = (struct av7110 *)dev->ext_priv; 432 struct av7110 *av7110 = (struct av7110 *)dev->ext_priv;
diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c
index 63b112b555b2..e140a725820d 100644
--- a/drivers/media/radio/dsbr100.c
+++ b/drivers/media/radio/dsbr100.c
@@ -214,7 +214,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
214} 214}
215 215
216static int vidioc_s_frequency(struct file *file, void *priv, 216static int vidioc_s_frequency(struct file *file, void *priv,
217 struct v4l2_frequency *f) 217 const struct v4l2_frequency *f)
218{ 218{
219 struct dsbr100_device *radio = video_drvdata(file); 219 struct dsbr100_device *radio = video_drvdata(file);
220 220
diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c
index 643d80ac28fb..59be293cbf42 100644
--- a/drivers/media/radio/radio-cadet.c
+++ b/drivers/media/radio/radio-cadet.c
@@ -90,6 +90,26 @@ static u16 sigtable[2][4] = {
90 { 2185, 4369, 13107, 65535 }, 90 { 2185, 4369, 13107, 65535 },
91}; 91};
92 92
93static const struct v4l2_frequency_band bands[] = {
94 {
95 .index = 0,
96 .type = V4L2_TUNER_RADIO,
97 .capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_FREQ_BANDS,
98 .rangelow = 8320, /* 520 kHz */
99 .rangehigh = 26400, /* 1650 kHz */
100 .modulation = V4L2_BAND_MODULATION_AM,
101 }, {
102 .index = 1,
103 .type = V4L2_TUNER_RADIO,
104 .capability = V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_RDS |
105 V4L2_TUNER_CAP_RDS_BLOCK_IO | V4L2_TUNER_CAP_LOW |
106 V4L2_TUNER_CAP_FREQ_BANDS,
107 .rangelow = 1400000, /* 87.5 MHz */
108 .rangehigh = 1728000, /* 108.0 MHz */
109 .modulation = V4L2_BAND_MODULATION_FM,
110 },
111};
112
93 113
94static int cadet_getstereo(struct cadet *dev) 114static int cadet_getstereo(struct cadet *dev)
95{ 115{
@@ -196,6 +216,8 @@ static void cadet_setfreq(struct cadet *dev, unsigned freq)
196 int i, j, test; 216 int i, j, test;
197 int curvol; 217 int curvol;
198 218
219 freq = clamp(freq, bands[dev->is_fm_band].rangelow,
220 bands[dev->is_fm_band].rangehigh);
199 dev->curfreq = freq; 221 dev->curfreq = freq;
200 /* 222 /*
201 * Formulate a fifo command 223 * Formulate a fifo command
@@ -337,26 +359,6 @@ static int vidioc_querycap(struct file *file, void *priv,
337 return 0; 359 return 0;
338} 360}
339 361
340static const struct v4l2_frequency_band bands[] = {
341 {
342 .index = 0,
343 .type = V4L2_TUNER_RADIO,
344 .capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_FREQ_BANDS,
345 .rangelow = 8320, /* 520 kHz */
346 .rangehigh = 26400, /* 1650 kHz */
347 .modulation = V4L2_BAND_MODULATION_AM,
348 }, {
349 .index = 1,
350 .type = V4L2_TUNER_RADIO,
351 .capability = V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_RDS |
352 V4L2_TUNER_CAP_RDS_BLOCK_IO | V4L2_TUNER_CAP_LOW |
353 V4L2_TUNER_CAP_FREQ_BANDS,
354 .rangelow = 1400000, /* 87.5 MHz */
355 .rangehigh = 1728000, /* 108.0 MHz */
356 .modulation = V4L2_BAND_MODULATION_FM,
357 },
358};
359
360static int vidioc_g_tuner(struct file *file, void *priv, 362static int vidioc_g_tuner(struct file *file, void *priv,
361 struct v4l2_tuner *v) 363 struct v4l2_tuner *v)
362{ 364{
@@ -418,7 +420,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
418 420
419 421
420static int vidioc_s_frequency(struct file *file, void *priv, 422static int vidioc_s_frequency(struct file *file, void *priv,
421 struct v4l2_frequency *f) 423 const struct v4l2_frequency *f)
422{ 424{
423 struct cadet *dev = video_drvdata(file); 425 struct cadet *dev = video_drvdata(file);
424 426
@@ -426,8 +428,6 @@ static int vidioc_s_frequency(struct file *file, void *priv,
426 return -EINVAL; 428 return -EINVAL;
427 dev->is_fm_band = 429 dev->is_fm_band =
428 f->frequency >= (bands[0].rangehigh + bands[1].rangelow) / 2; 430 f->frequency >= (bands[0].rangehigh + bands[1].rangelow) / 2;
429 clamp(f->frequency, bands[dev->is_fm_band].rangelow,
430 bands[dev->is_fm_band].rangehigh);
431 cadet_setfreq(dev, f->frequency); 431 cadet_setfreq(dev, f->frequency);
432 return 0; 432 return 0;
433} 433}
diff --git a/drivers/media/radio/radio-isa.c b/drivers/media/radio/radio-isa.c
index fe0a4f85c422..0c1e27b13e69 100644
--- a/drivers/media/radio/radio-isa.c
+++ b/drivers/media/radio/radio-isa.c
@@ -102,17 +102,18 @@ static int radio_isa_s_tuner(struct file *file, void *priv,
102} 102}
103 103
104static int radio_isa_s_frequency(struct file *file, void *priv, 104static int radio_isa_s_frequency(struct file *file, void *priv,
105 struct v4l2_frequency *f) 105 const struct v4l2_frequency *f)
106{ 106{
107 struct radio_isa_card *isa = video_drvdata(file); 107 struct radio_isa_card *isa = video_drvdata(file);
108 u32 freq = f->frequency;
108 int res; 109 int res;
109 110
110 if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) 111 if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO)
111 return -EINVAL; 112 return -EINVAL;
112 f->frequency = clamp(f->frequency, FREQ_LOW, FREQ_HIGH); 113 freq = clamp(freq, FREQ_LOW, FREQ_HIGH);
113 res = isa->drv->ops->s_frequency(isa, f->frequency); 114 res = isa->drv->ops->s_frequency(isa, freq);
114 if (res == 0) 115 if (res == 0)
115 isa->freq = f->frequency; 116 isa->freq = freq;
116 return res; 117 return res;
117} 118}
118 119
diff --git a/drivers/media/radio/radio-keene.c b/drivers/media/radio/radio-keene.c
index 296941a9ae25..4c9ae767fb31 100644
--- a/drivers/media/radio/radio-keene.c
+++ b/drivers/media/radio/radio-keene.c
@@ -215,15 +215,15 @@ static int vidioc_s_modulator(struct file *file, void *priv,
215} 215}
216 216
217static int vidioc_s_frequency(struct file *file, void *priv, 217static int vidioc_s_frequency(struct file *file, void *priv,
218 struct v4l2_frequency *f) 218 const struct v4l2_frequency *f)
219{ 219{
220 struct keene_device *radio = video_drvdata(file); 220 struct keene_device *radio = video_drvdata(file);
221 unsigned freq = f->frequency;
221 222
222 if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) 223 if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO)
223 return -EINVAL; 224 return -EINVAL;
224 f->frequency = clamp(f->frequency, 225 freq = clamp(freq, FREQ_MIN * FREQ_MUL, FREQ_MAX * FREQ_MUL);
225 FREQ_MIN * FREQ_MUL, FREQ_MAX * FREQ_MUL); 226 return keene_cmd_main(radio, freq, true);
226 return keene_cmd_main(radio, f->frequency, true);
227} 227}
228 228
229static int vidioc_g_frequency(struct file *file, void *priv, 229static int vidioc_g_frequency(struct file *file, void *priv,
diff --git a/drivers/media/radio/radio-ma901.c b/drivers/media/radio/radio-ma901.c
index c61f590029ad..7f85c6f98009 100644
--- a/drivers/media/radio/radio-ma901.c
+++ b/drivers/media/radio/radio-ma901.c
@@ -257,7 +257,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
257 257
258/* vidioc_s_frequency - set tuner radio frequency */ 258/* vidioc_s_frequency - set tuner radio frequency */
259static int vidioc_s_frequency(struct file *file, void *priv, 259static int vidioc_s_frequency(struct file *file, void *priv,
260 struct v4l2_frequency *f) 260 const struct v4l2_frequency *f)
261{ 261{
262 struct ma901radio_device *radio = video_drvdata(file); 262 struct ma901radio_device *radio = video_drvdata(file);
263 263
diff --git a/drivers/media/radio/radio-miropcm20.c b/drivers/media/radio/radio-miropcm20.c
index 3d0ff4404d12..2b8d31d8330b 100644
--- a/drivers/media/radio/radio-miropcm20.c
+++ b/drivers/media/radio/radio-miropcm20.c
@@ -131,14 +131,14 @@ static int vidioc_g_frequency(struct file *file, void *priv,
131 131
132 132
133static int vidioc_s_frequency(struct file *file, void *priv, 133static int vidioc_s_frequency(struct file *file, void *priv,
134 struct v4l2_frequency *f) 134 const struct v4l2_frequency *f)
135{ 135{
136 struct pcm20 *dev = video_drvdata(file); 136 struct pcm20 *dev = video_drvdata(file);
137 137
138 if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) 138 if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO)
139 return -EINVAL; 139 return -EINVAL;
140 140
141 dev->freq = clamp(f->frequency, 87 * 16000U, 108 * 16000U); 141 dev->freq = clamp_t(u32, f->frequency, 87 * 16000U, 108 * 16000U);
142 pcm20_setfreq(dev, dev->freq); 142 pcm20_setfreq(dev, dev->freq);
143 return 0; 143 return 0;
144} 144}
diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index 9c5a267b60b4..f9cdd8b96add 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -323,7 +323,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
323 323
324/* vidioc_s_frequency - set tuner radio frequency */ 324/* vidioc_s_frequency - set tuner radio frequency */
325static int vidioc_s_frequency(struct file *file, void *priv, 325static int vidioc_s_frequency(struct file *file, void *priv,
326 struct v4l2_frequency *f) 326 const struct v4l2_frequency *f)
327{ 327{
328 struct amradio_device *radio = video_drvdata(file); 328 struct amradio_device *radio = video_drvdata(file);
329 329
diff --git a/drivers/media/radio/radio-sf16fmi.c b/drivers/media/radio/radio-sf16fmi.c
index 637a55564958..6142b5b3e81b 100644
--- a/drivers/media/radio/radio-sf16fmi.c
+++ b/drivers/media/radio/radio-sf16fmi.c
@@ -151,7 +151,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
151} 151}
152 152
153static int vidioc_s_frequency(struct file *file, void *priv, 153static int vidioc_s_frequency(struct file *file, void *priv,
154 struct v4l2_frequency *f) 154 const struct v4l2_frequency *f)
155{ 155{
156 struct fmi *fmi = video_drvdata(file); 156 struct fmi *fmi = video_drvdata(file);
157 157
diff --git a/drivers/media/radio/radio-si4713.c b/drivers/media/radio/radio-si4713.c
index 3df4339460d2..2a2d21ed9133 100644
--- a/drivers/media/radio/radio-si4713.c
+++ b/drivers/media/radio/radio-si4713.c
@@ -215,7 +215,7 @@ static int radio_si4713_g_frequency(struct file *file, void *p,
215} 215}
216 216
217static int radio_si4713_s_frequency(struct file *file, void *p, 217static int radio_si4713_s_frequency(struct file *file, void *p,
218 struct v4l2_frequency *vf) 218 const struct v4l2_frequency *vf)
219{ 219{
220 return v4l2_device_call_until_err(get_v4l2_dev(file), 0, tuner, 220 return v4l2_device_call_until_err(get_v4l2_dev(file), 0, tuner,
221 s_frequency, vf); 221 s_frequency, vf);
diff --git a/drivers/media/radio/radio-tea5764.c b/drivers/media/radio/radio-tea5764.c
index 1978516af67e..893842874d89 100644
--- a/drivers/media/radio/radio-tea5764.c
+++ b/drivers/media/radio/radio-tea5764.c
@@ -351,7 +351,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
351} 351}
352 352
353static int vidioc_s_frequency(struct file *file, void *priv, 353static int vidioc_s_frequency(struct file *file, void *priv,
354 struct v4l2_frequency *f) 354 const struct v4l2_frequency *f)
355{ 355{
356 struct tea5764_device *radio = video_drvdata(file); 356 struct tea5764_device *radio = video_drvdata(file);
357 357
diff --git a/drivers/media/radio/radio-tea5777.c b/drivers/media/radio/radio-tea5777.c
index 4b5190d4fea5..fcd7c195e0c5 100644
--- a/drivers/media/radio/radio-tea5777.c
+++ b/drivers/media/radio/radio-tea5777.c
@@ -368,7 +368,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
368} 368}
369 369
370static int vidioc_s_frequency(struct file *file, void *priv, 370static int vidioc_s_frequency(struct file *file, void *priv,
371 struct v4l2_frequency *f) 371 const struct v4l2_frequency *f)
372{ 372{
373 struct radio_tea5777 *tea = video_drvdata(file); 373 struct radio_tea5777 *tea = video_drvdata(file);
374 374
diff --git a/drivers/media/radio/radio-timb.c b/drivers/media/radio/radio-timb.c
index b87effeb5dc6..1712c05c113d 100644
--- a/drivers/media/radio/radio-timb.c
+++ b/drivers/media/radio/radio-timb.c
@@ -91,7 +91,7 @@ static int timbradio_vidioc_s_audio(struct file *file, void *priv,
91} 91}
92 92
93static int timbradio_vidioc_s_frequency(struct file *file, void *priv, 93static int timbradio_vidioc_s_frequency(struct file *file, void *priv,
94 struct v4l2_frequency *f) 94 const struct v4l2_frequency *f)
95{ 95{
96 struct timbradio *tr = video_drvdata(file); 96 struct timbradio *tr = video_drvdata(file);
97 return v4l2_subdev_call(tr->sd_tuner, tuner, s_frequency, f); 97 return v4l2_subdev_call(tr->sd_tuner, tuner, s_frequency, f);
diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c
index 02151e0e6e63..9a02fee904bf 100644
--- a/drivers/media/radio/radio-wl1273.c
+++ b/drivers/media/radio/radio-wl1273.c
@@ -1640,7 +1640,7 @@ static int wl1273_fm_vidioc_g_frequency(struct file *file, void *priv,
1640} 1640}
1641 1641
1642static int wl1273_fm_vidioc_s_frequency(struct file *file, void *priv, 1642static int wl1273_fm_vidioc_s_frequency(struct file *file, void *priv,
1643 struct v4l2_frequency *freq) 1643 const struct v4l2_frequency *freq)
1644{ 1644{
1645 struct wl1273_device *radio = video_get_drvdata(video_devdata(file)); 1645 struct wl1273_device *radio = video_get_drvdata(video_devdata(file));
1646 struct wl1273_core *core = radio->core; 1646 struct wl1273_core *core = radio->core;
diff --git a/drivers/media/radio/si470x/radio-si470x-common.c b/drivers/media/radio/si470x/radio-si470x-common.c
index 18989388ddc1..5708633a3d78 100644
--- a/drivers/media/radio/si470x/radio-si470x-common.c
+++ b/drivers/media/radio/si470x/radio-si470x-common.c
@@ -678,7 +678,7 @@ static int si470x_vidioc_g_frequency(struct file *file, void *priv,
678 * si470x_vidioc_s_frequency - set tuner or modulator radio frequency 678 * si470x_vidioc_s_frequency - set tuner or modulator radio frequency
679 */ 679 */
680static int si470x_vidioc_s_frequency(struct file *file, void *priv, 680static int si470x_vidioc_s_frequency(struct file *file, void *priv,
681 struct v4l2_frequency *freq) 681 const struct v4l2_frequency *freq)
682{ 682{
683 struct si470x_device *radio = video_drvdata(file); 683 struct si470x_device *radio = video_drvdata(file);
684 int retval; 684 int retval;
diff --git a/drivers/media/radio/si4713-i2c.c b/drivers/media/radio/si4713-i2c.c
index bd61b3bd0ca3..e305c14272b5 100644
--- a/drivers/media/radio/si4713-i2c.c
+++ b/drivers/media/radio/si4713-i2c.c
@@ -1212,7 +1212,7 @@ exit:
1212 return rval; 1212 return rval;
1213} 1213}
1214 1214
1215static int si4713_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f); 1215static int si4713_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequency *f);
1216static int si4713_s_modulator(struct v4l2_subdev *sd, const struct v4l2_modulator *); 1216static int si4713_s_modulator(struct v4l2_subdev *sd, const struct v4l2_modulator *);
1217/* 1217/*
1218 * si4713_setup - Sets the device up with current configuration. 1218 * si4713_setup - Sets the device up with current configuration.
@@ -1950,7 +1950,7 @@ unlock:
1950} 1950}
1951 1951
1952/* si4713_s_frequency - set tuner or modulator radio frequency */ 1952/* si4713_s_frequency - set tuner or modulator radio frequency */
1953static int si4713_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f) 1953static int si4713_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequency *f)
1954{ 1954{
1955 struct si4713_device *sdev = to_si4713_device(sd); 1955 struct si4713_device *sdev = to_si4713_device(sd);
1956 int rval = 0; 1956 int rval = 0;
@@ -1970,7 +1970,6 @@ static int si4713_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f)
1970 rval = 0; 1970 rval = 0;
1971 } 1971 }
1972 sdev->frequency = frequency; 1972 sdev->frequency = frequency;
1973 f->frequency = si4713_to_v4l2(frequency);
1974 1973
1975unlock: 1974unlock:
1976 mutex_unlock(&sdev->mutex); 1975 mutex_unlock(&sdev->mutex);
diff --git a/drivers/media/radio/tef6862.c b/drivers/media/radio/tef6862.c
index b18c2dc268ba..867395568f92 100644
--- a/drivers/media/radio/tef6862.c
+++ b/drivers/media/radio/tef6862.c
@@ -101,7 +101,7 @@ static int tef6862_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *v)
101 return v->index ? -EINVAL : 0; 101 return v->index ? -EINVAL : 0;
102} 102}
103 103
104static int tef6862_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f) 104static int tef6862_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequency *f)
105{ 105{
106 struct tef6862_state *state = to_state(sd); 106 struct tef6862_state *state = to_state(sd);
107 struct i2c_client *client = v4l2_get_subdevdata(sd); 107 struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/radio/wl128x/fmdrv_v4l2.c b/drivers/media/radio/wl128x/fmdrv_v4l2.c
index 0a8ee8fab924..0183956d9b02 100644
--- a/drivers/media/radio/wl128x/fmdrv_v4l2.c
+++ b/drivers/media/radio/wl128x/fmdrv_v4l2.c
@@ -388,7 +388,7 @@ static int fm_v4l2_vidioc_g_freq(struct file *file, void *priv,
388 388
389/* Set tuner or modulator radio frequency */ 389/* Set tuner or modulator radio frequency */
390static int fm_v4l2_vidioc_s_freq(struct file *file, void *priv, 390static int fm_v4l2_vidioc_s_freq(struct file *file, void *priv,
391 struct v4l2_frequency *freq) 391 const struct v4l2_frequency *freq)
392{ 392{
393 struct fmdev *fmdev = video_drvdata(file); 393 struct fmdev *fmdev = video_drvdata(file);
394 394
@@ -396,9 +396,7 @@ static int fm_v4l2_vidioc_s_freq(struct file *file, void *priv,
396 * As V4L2_TUNER_CAP_LOW is set 1 user sends the frequency 396 * As V4L2_TUNER_CAP_LOW is set 1 user sends the frequency
397 * in units of 62.5 Hz. 397 * in units of 62.5 Hz.
398 */ 398 */
399 freq->frequency = (u32)(freq->frequency / 16); 399 return fmc_set_freq(fmdev, freq->frequency / 16);
400
401 return fmc_set_freq(fmdev, freq->frequency);
402} 400}
403 401
404/* Set hardware frequency seek. If current mode is NOT RX, set it RX. */ 402/* Set hardware frequency seek. If current mode is NOT RX, set it RX. */
diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c
index 8b9e8268e911..b1d6b034e1a1 100644
--- a/drivers/media/usb/au0828/au0828-video.c
+++ b/drivers/media/usb/au0828/au0828-video.c
@@ -1545,7 +1545,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
1545} 1545}
1546 1546
1547static int vidioc_s_frequency(struct file *file, void *priv, 1547static int vidioc_s_frequency(struct file *file, void *priv,
1548 struct v4l2_frequency *freq) 1548 const struct v4l2_frequency *freq)
1549{ 1549{
1550 struct au0828_fh *fh = priv; 1550 struct au0828_fh *fh = priv;
1551 struct au0828_dev *dev = fh->dev; 1551 struct au0828_dev *dev = fh->dev;
diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c
index ac6200870a62..96f65318d788 100644
--- a/drivers/media/usb/cx231xx/cx231xx-video.c
+++ b/drivers/media/usb/cx231xx/cx231xx-video.c
@@ -1172,10 +1172,11 @@ int cx231xx_g_frequency(struct file *file, void *priv,
1172} 1172}
1173 1173
1174int cx231xx_s_frequency(struct file *file, void *priv, 1174int cx231xx_s_frequency(struct file *file, void *priv,
1175 struct v4l2_frequency *f) 1175 const struct v4l2_frequency *f)
1176{ 1176{
1177 struct cx231xx_fh *fh = priv; 1177 struct cx231xx_fh *fh = priv;
1178 struct cx231xx *dev = fh->dev; 1178 struct cx231xx *dev = fh->dev;
1179 struct v4l2_frequency new_freq = *f;
1179 int rc; 1180 int rc;
1180 u32 if_frequency = 5400000; 1181 u32 if_frequency = 5400000;
1181 1182
@@ -1194,8 +1195,8 @@ int cx231xx_s_frequency(struct file *file, void *priv,
1194 rc = cx231xx_tuner_pre_channel_change(dev); 1195 rc = cx231xx_tuner_pre_channel_change(dev);
1195 1196
1196 call_all(dev, tuner, s_frequency, f); 1197 call_all(dev, tuner, s_frequency, f);
1197 call_all(dev, tuner, g_frequency, f); 1198 call_all(dev, tuner, g_frequency, &new_freq);
1198 dev->ctl_freq = f->frequency; 1199 dev->ctl_freq = new_freq.frequency;
1199 1200
1200 /* set post channel change settings in DIF first */ 1201 /* set post channel change settings in DIF first */
1201 rc = cx231xx_tuner_post_channel_change(dev); 1202 rc = cx231xx_tuner_post_channel_change(dev);
diff --git a/drivers/media/usb/cx231xx/cx231xx.h b/drivers/media/usb/cx231xx/cx231xx.h
index dff3f1d73f28..6f701e9bec44 100644
--- a/drivers/media/usb/cx231xx/cx231xx.h
+++ b/drivers/media/usb/cx231xx/cx231xx.h
@@ -940,7 +940,7 @@ int cx231xx_s_tuner(struct file *file, void *priv, struct v4l2_tuner *t);
940int cx231xx_g_frequency(struct file *file, void *priv, 940int cx231xx_g_frequency(struct file *file, void *priv,
941 struct v4l2_frequency *f); 941 struct v4l2_frequency *f);
942int cx231xx_s_frequency(struct file *file, void *priv, 942int cx231xx_s_frequency(struct file *file, void *priv,
943 struct v4l2_frequency *f); 943 const struct v4l2_frequency *f);
944int cx231xx_enum_input(struct file *file, void *priv, 944int cx231xx_enum_input(struct file *file, void *priv,
945 struct v4l2_input *i); 945 struct v4l2_input *i);
946int cx231xx_g_input(struct file *file, void *priv, unsigned int *i); 946int cx231xx_g_input(struct file *file, void *priv, unsigned int *i);
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index d585c19a5d9c..af79089a0169 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -1221,8 +1221,9 @@ static int vidioc_g_frequency(struct file *file, void *priv,
1221} 1221}
1222 1222
1223static int vidioc_s_frequency(struct file *file, void *priv, 1223static int vidioc_s_frequency(struct file *file, void *priv,
1224 struct v4l2_frequency *f) 1224 const struct v4l2_frequency *f)
1225{ 1225{
1226 struct v4l2_frequency new_freq = *f;
1226 struct em28xx_fh *fh = priv; 1227 struct em28xx_fh *fh = priv;
1227 struct em28xx *dev = fh->dev; 1228 struct em28xx *dev = fh->dev;
1228 1229
@@ -1230,8 +1231,8 @@ static int vidioc_s_frequency(struct file *file, void *priv,
1230 return -EINVAL; 1231 return -EINVAL;
1231 1232
1232 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, f); 1233 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, f);
1233 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, g_frequency, f); 1234 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, g_frequency, &new_freq);
1234 dev->ctl_freq = f->frequency; 1235 dev->ctl_freq = new_freq.frequency;
1235 1236
1236 return 0; 1237 return 0;
1237} 1238}
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
index 34c3b6e80e86..75657c6dc013 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
@@ -365,7 +365,7 @@ static int pvr2_s_tuner(struct file *file, void *priv, struct v4l2_tuner *vt)
365 vt->audmode); 365 vt->audmode);
366} 366}
367 367
368static int pvr2_s_frequency(struct file *file, void *priv, struct v4l2_frequency *vf) 368static int pvr2_s_frequency(struct file *file, void *priv, const struct v4l2_frequency *vf)
369{ 369{
370 struct pvr2_v4l2_fh *fh = file->private_data; 370 struct pvr2_v4l2_fh *fh = file->private_data;
371 struct pvr2_hdw *hdw = fh->channel.mc_head->hdw; 371 struct pvr2_hdw *hdw = fh->channel.mc_head->hdw;
diff --git a/drivers/media/usb/tlg2300/pd-radio.c b/drivers/media/usb/tlg2300/pd-radio.c
index 0f958f74dbc4..8b1daf1f1e99 100644
--- a/drivers/media/usb/tlg2300/pd-radio.c
+++ b/drivers/media/usb/tlg2300/pd-radio.c
@@ -252,7 +252,7 @@ error:
252} 252}
253 253
254static int fm_set_freq(struct file *file, void *priv, 254static int fm_set_freq(struct file *file, void *priv,
255 struct v4l2_frequency *argp) 255 const struct v4l2_frequency *argp)
256{ 256{
257 struct poseidon *p = video_drvdata(file); 257 struct poseidon *p = video_drvdata(file);
258 258
diff --git a/drivers/media/usb/tlg2300/pd-video.c b/drivers/media/usb/tlg2300/pd-video.c
index dab0ca32d396..8ef7c8c419f7 100644
--- a/drivers/media/usb/tlg2300/pd-video.c
+++ b/drivers/media/usb/tlg2300/pd-video.c
@@ -1079,10 +1079,11 @@ static int set_frequency(struct poseidon *pd, u32 *frequency)
1079} 1079}
1080 1080
1081static int vidioc_s_frequency(struct file *file, void *fh, 1081static int vidioc_s_frequency(struct file *file, void *fh,
1082 struct v4l2_frequency *freq) 1082 const struct v4l2_frequency *freq)
1083{ 1083{
1084 struct front_face *front = fh; 1084 struct front_face *front = fh;
1085 struct poseidon *pd = front->pd; 1085 struct poseidon *pd = front->pd;
1086 u32 frequency = freq->frequency;
1086 1087
1087 if (freq->tuner) 1088 if (freq->tuner)
1088 return -EINVAL; 1089 return -EINVAL;
@@ -1090,7 +1091,7 @@ static int vidioc_s_frequency(struct file *file, void *fh,
1090 pd->pm_suspend = pm_video_suspend; 1091 pd->pm_suspend = pm_video_suspend;
1091 pd->pm_resume = pm_video_resume; 1092 pd->pm_resume = pm_video_resume;
1092#endif 1093#endif
1093 return set_frequency(pd, &freq->frequency); 1094 return set_frequency(pd, &frequency);
1094} 1095}
1095 1096
1096static int vidioc_reqbufs(struct file *file, void *fh, 1097static int vidioc_reqbufs(struct file *file, void *fh,
diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c
index 1a6857929c15..49df7537fa63 100644
--- a/drivers/media/usb/tm6000/tm6000-video.c
+++ b/drivers/media/usb/tm6000/tm6000-video.c
@@ -1255,7 +1255,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
1255} 1255}
1256 1256
1257static int vidioc_s_frequency(struct file *file, void *priv, 1257static int vidioc_s_frequency(struct file *file, void *priv,
1258 struct v4l2_frequency *f) 1258 const struct v4l2_frequency *f)
1259{ 1259{
1260 struct tm6000_fh *fh = priv; 1260 struct tm6000_fh *fh = priv;
1261 struct tm6000_core *dev = fh->dev; 1261 struct tm6000_core *dev = fh->dev;
diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c
index cd1fe78a5532..b66844564144 100644
--- a/drivers/media/usb/usbvision/usbvision-video.c
+++ b/drivers/media/usb/usbvision/usbvision-video.c
@@ -657,7 +657,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
657} 657}
658 658
659static int vidioc_s_frequency(struct file *file, void *priv, 659static int vidioc_s_frequency(struct file *file, void *priv,
660 struct v4l2_frequency *freq) 660 const struct v4l2_frequency *freq)
661{ 661{
662 struct usb_usbvision *usbvision = video_drvdata(file); 662 struct usb_usbvision *usbvision = video_drvdata(file);
663 663
diff --git a/drivers/media/v4l2-core/tuner-core.c b/drivers/media/v4l2-core/tuner-core.c
index b5a8aac2e126..279f65efe9ba 100644
--- a/drivers/media/v4l2-core/tuner-core.c
+++ b/drivers/media/v4l2-core/tuner-core.c
@@ -1134,7 +1134,7 @@ static int tuner_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
1134 return 0; 1134 return 0;
1135} 1135}
1136 1136
1137static int tuner_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f) 1137static int tuner_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequency *f)
1138{ 1138{
1139 struct tuner *t = to_tuner(sd); 1139 struct tuner *t = to_tuner(sd);
1140 1140
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index aa6e7c788db2..8ec8abe0ffe7 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1316,7 +1316,7 @@ static int v4l_s_frequency(const struct v4l2_ioctl_ops *ops,
1316 struct file *file, void *fh, void *arg) 1316 struct file *file, void *fh, void *arg)
1317{ 1317{
1318 struct video_device *vfd = video_devdata(file); 1318 struct video_device *vfd = video_devdata(file);
1319 struct v4l2_frequency *p = arg; 1319 const struct v4l2_frequency *p = arg;
1320 enum v4l2_tuner_type type; 1320 enum v4l2_tuner_type type;
1321 1321
1322 type = (vfd->vfl_type == VFL_TYPE_RADIO) ? 1322 type = (vfd->vfl_type == VFL_TYPE_RADIO) ?
diff --git a/drivers/staging/media/go7007/go7007-v4l2.c b/drivers/staging/media/go7007/go7007-v4l2.c
index cb9fe33050c7..1288f1cab129 100644
--- a/drivers/staging/media/go7007/go7007-v4l2.c
+++ b/drivers/staging/media/go7007/go7007-v4l2.c
@@ -1281,7 +1281,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
1281} 1281}
1282 1282
1283static int vidioc_s_frequency(struct file *file, void *priv, 1283static int vidioc_s_frequency(struct file *file, void *priv,
1284 struct v4l2_frequency *f) 1284 const struct v4l2_frequency *f)
1285{ 1285{
1286 struct go7007 *go = ((struct go7007_file *) priv)->go; 1286 struct go7007 *go = ((struct go7007_file *) priv)->go;
1287 1287
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index 4118ad1324c9..f06436dbaf75 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -223,7 +223,7 @@ struct v4l2_ioctl_ops {
223 int (*vidioc_g_frequency) (struct file *file, void *fh, 223 int (*vidioc_g_frequency) (struct file *file, void *fh,
224 struct v4l2_frequency *a); 224 struct v4l2_frequency *a);
225 int (*vidioc_s_frequency) (struct file *file, void *fh, 225 int (*vidioc_s_frequency) (struct file *file, void *fh,
226 struct v4l2_frequency *a); 226 const struct v4l2_frequency *a);
227 int (*vidioc_enum_freq_bands) (struct file *file, void *fh, 227 int (*vidioc_enum_freq_bands) (struct file *file, void *fh,
228 struct v4l2_frequency_band *band); 228 struct v4l2_frequency_band *band);
229 229
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index b137a5e1151a..1a82a50ea9c8 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -191,7 +191,7 @@ struct v4l2_subdev_core_ops {
191 */ 191 */
192struct v4l2_subdev_tuner_ops { 192struct v4l2_subdev_tuner_ops {
193 int (*s_radio)(struct v4l2_subdev *sd); 193 int (*s_radio)(struct v4l2_subdev *sd);
194 int (*s_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq); 194 int (*s_frequency)(struct v4l2_subdev *sd, const struct v4l2_frequency *freq);
195 int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq); 195 int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
196 int (*g_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt); 196 int (*g_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
197 int (*s_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt); 197 int (*s_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
diff --git a/sound/i2c/other/tea575x-tuner.c b/sound/i2c/other/tea575x-tuner.c
index 3c6c1e3226f3..738c5ad9c93f 100644
--- a/sound/i2c/other/tea575x-tuner.c
+++ b/sound/i2c/other/tea575x-tuner.c
@@ -336,7 +336,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
336} 336}
337 337
338static int vidioc_s_frequency(struct file *file, void *priv, 338static int vidioc_s_frequency(struct file *file, void *priv,
339 struct v4l2_frequency *f) 339 const struct v4l2_frequency *f)
340{ 340{
341 struct snd_tea575x *tea = video_drvdata(file); 341 struct snd_tea575x *tea = video_drvdata(file);
342 342
@@ -350,7 +350,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
350 else 350 else
351 tea->band = BAND_FM; 351 tea->band = BAND_FM;
352 352
353 tea->freq = clamp(f->frequency, bands[tea->band].rangelow, 353 tea->freq = clamp_t(u32, f->frequency, bands[tea->band].rangelow,
354 bands[tea->band].rangehigh); 354 bands[tea->band].rangehigh);
355 snd_tea575x_set_freq(tea); 355 snd_tea575x_set_freq(tea);
356 return 0; 356 return 0;