aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio
diff options
context:
space:
mode:
authorTobias Lorenz <tobias.lorenz@gmx.net>2008-05-31 14:06:50 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:08:29 -0400
commit6cc72658897ee970e4ecfefaae58f043a98a8e65 (patch)
tree92bec38507dd0e8eec3040909bda81ca190db4e1 /drivers/media/radio
parentce5829e5fc8204af09db5b226a3dce9824e7d596 (diff)
V4L/DVB (7994): si470x: let si470x_get_freq return errno
This patch brings the following changes: - version bumped to 1.0.8 for all the following patches - si470x_get_freq now returns errno Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/radio')
-rw-r--r--drivers/media/radio/radio-si470x.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/drivers/media/radio/radio-si470x.c b/drivers/media/radio/radio-si470x.c
index 707988edc1b..7df1163d709 100644
--- a/drivers/media/radio/radio-si470x.c
+++ b/drivers/media/radio/radio-si470x.c
@@ -24,6 +24,19 @@
24 24
25 25
26/* 26/*
27 * User Notes:
28 * - USB Audio is provided by the alsa snd_usb_audio module.
29 * For listing you have to redirect the sound, for example using:
30 * arecord -D hw:1,0 -r96000 -c2 -f S16_LE | artsdsp aplay -B -
31 * - regarding module parameters in /sys/module/radio_si470x/parameters:
32 * the contents of read-only files (0444) are not updated, even if
33 * space, band and de are changed using private video controls
34 * - increase tune_timeout, if you often get -EIO errors
35 * - hw_freq_seek returns -EAGAIN, when timed out or band limit is reached
36 */
37
38
39/*
27 * History: 40 * History:
28 * 2008-01-12 Tobias Lorenz <tobias.lorenz@gmx.net> 41 * 2008-01-12 Tobias Lorenz <tobias.lorenz@gmx.net>
29 * Version 1.0.0 42 * Version 1.0.0
@@ -86,6 +99,9 @@
86 * Version 1.0.7 99 * Version 1.0.7
87 * - usb autosuspend support 100 * - usb autosuspend support
88 * - unplugging fixed 101 * - unplugging fixed
102 * 2008-05-07 Tobias Lorenz <tobias.lorenz@gmx.net>
103 * Version 1.0.8
104 * - let si470x_get_freq return errno
89 * 105 *
90 * ToDo: 106 * ToDo:
91 * - add seeking support 107 * - add seeking support
@@ -98,10 +114,10 @@
98/* driver definitions */ 114/* driver definitions */
99#define DRIVER_AUTHOR "Tobias Lorenz <tobias.lorenz@gmx.net>" 115#define DRIVER_AUTHOR "Tobias Lorenz <tobias.lorenz@gmx.net>"
100#define DRIVER_NAME "radio-si470x" 116#define DRIVER_NAME "radio-si470x"
101#define DRIVER_KERNEL_VERSION KERNEL_VERSION(1, 0, 7) 117#define DRIVER_KERNEL_VERSION KERNEL_VERSION(1, 0, 8)
102#define DRIVER_CARD "Silicon Labs Si470x FM Radio Receiver" 118#define DRIVER_CARD "Silicon Labs Si470x FM Radio Receiver"
103#define DRIVER_DESC "USB radio driver for Si470x FM Radio Receivers" 119#define DRIVER_DESC "USB radio driver for Si470x FM Radio Receivers"
104#define DRIVER_VERSION "1.0.7" 120#define DRIVER_VERSION "1.0.8"
105 121
106 122
107/* kernel includes */ 123/* kernel includes */
@@ -631,9 +647,9 @@ static int si470x_set_chan(struct si470x_device *radio, unsigned short chan)
631/* 647/*
632 * si470x_get_freq - get the frequency 648 * si470x_get_freq - get the frequency
633 */ 649 */
634static unsigned int si470x_get_freq(struct si470x_device *radio) 650static int si470x_get_freq(struct si470x_device *radio, unsigned int *freq)
635{ 651{
636 unsigned int spacing, band_bottom, freq; 652 unsigned int spacing, band_bottom;
637 unsigned short chan; 653 unsigned short chan;
638 int retval; 654 int retval;
639 655
@@ -659,14 +675,12 @@ static unsigned int si470x_get_freq(struct si470x_device *radio)
659 675
660 /* read channel */ 676 /* read channel */
661 retval = si470x_get_register(radio, READCHAN); 677 retval = si470x_get_register(radio, READCHAN);
662 if (retval < 0)
663 return retval;
664 chan = radio->registers[READCHAN] & READCHAN_READCHAN; 678 chan = radio->registers[READCHAN] & READCHAN_READCHAN;
665 679
666 /* Frequency (MHz) = Spacing (kHz) x Channel + Bottom of Band (MHz) */ 680 /* Frequency (MHz) = Spacing (kHz) x Channel + Bottom of Band (MHz) */
667 freq = chan * spacing + band_bottom; 681 *freq = chan * spacing + band_bottom;
668 682
669 return freq; 683 return retval;
670} 684}
671 685
672 686
@@ -1351,9 +1365,7 @@ static int si470x_vidioc_g_frequency(struct file *file, void *priv,
1351 return -EIO; 1365 return -EIO;
1352 1366
1353 freq->type = V4L2_TUNER_RADIO; 1367 freq->type = V4L2_TUNER_RADIO;
1354 freq->frequency = si470x_get_freq(radio); 1368 return si470x_get_freq(radio, &radio->frequency);
1355
1356 return 0;
1357} 1369}
1358 1370
1359 1371