diff options
author | Adrian Bunk <bunk@kernel.org> | 2008-09-03 15:47:36 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-09-03 17:36:40 -0400 |
commit | c7087f56a42b0aa82b181d9a08a376c4add7a683 (patch) | |
tree | fe10aa1063749e3e98eaa2617bf2dd0e101d7c99 | |
parent | f75c4950bb6e677e89479192b2ecfbec0beab14e (diff) |
V4L/DVB (8678): Remove the dead CONFIG_RADIO_MIROPCM20{,_RDS} code
The CONFIG_RADIO_MIROPCM20{,_RDS} code became dead code 1.5 years ago.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/radio/Makefile | 4 | ||||
-rw-r--r-- | drivers/media/radio/miropcm20-radio.c | 266 | ||||
-rw-r--r-- | drivers/media/radio/miropcm20-rds-core.c | 211 | ||||
-rw-r--r-- | drivers/media/radio/miropcm20-rds-core.h | 19 | ||||
-rw-r--r-- | drivers/media/radio/miropcm20-rds.c | 136 |
5 files changed, 0 insertions, 636 deletions
diff --git a/drivers/media/radio/Makefile b/drivers/media/radio/Makefile index a30159f6fa42..7ca71ab96b43 100644 --- a/drivers/media/radio/Makefile +++ b/drivers/media/radio/Makefile | |||
@@ -2,8 +2,6 @@ | |||
2 | # Makefile for the kernel character device drivers. | 2 | # Makefile for the kernel character device drivers. |
3 | # | 3 | # |
4 | 4 | ||
5 | miropcm20-objs := miropcm20-rds-core.o miropcm20-radio.o | ||
6 | |||
7 | obj-$(CONFIG_RADIO_AZTECH) += radio-aztech.o | 5 | obj-$(CONFIG_RADIO_AZTECH) += radio-aztech.o |
8 | obj-$(CONFIG_RADIO_RTRACK2) += radio-rtrack2.o | 6 | obj-$(CONFIG_RADIO_RTRACK2) += radio-rtrack2.o |
9 | obj-$(CONFIG_RADIO_SF16FMI) += radio-sf16fmi.o | 7 | obj-$(CONFIG_RADIO_SF16FMI) += radio-sf16fmi.o |
@@ -14,8 +12,6 @@ obj-$(CONFIG_RADIO_TERRATEC) += radio-terratec.o | |||
14 | obj-$(CONFIG_RADIO_MAXIRADIO) += radio-maxiradio.o | 12 | obj-$(CONFIG_RADIO_MAXIRADIO) += radio-maxiradio.o |
15 | obj-$(CONFIG_RADIO_RTRACK) += radio-aimslab.o | 13 | obj-$(CONFIG_RADIO_RTRACK) += radio-aimslab.o |
16 | obj-$(CONFIG_RADIO_ZOLTRIX) += radio-zoltrix.o | 14 | obj-$(CONFIG_RADIO_ZOLTRIX) += radio-zoltrix.o |
17 | obj-$(CONFIG_RADIO_MIROPCM20) += miropcm20.o | ||
18 | obj-$(CONFIG_RADIO_MIROPCM20_RDS) += miropcm20-rds.o | ||
19 | obj-$(CONFIG_RADIO_GEMTEK) += radio-gemtek.o | 15 | obj-$(CONFIG_RADIO_GEMTEK) += radio-gemtek.o |
20 | obj-$(CONFIG_RADIO_GEMTEK_PCI) += radio-gemtek-pci.o | 16 | obj-$(CONFIG_RADIO_GEMTEK_PCI) += radio-gemtek-pci.o |
21 | obj-$(CONFIG_RADIO_TRUST) += radio-trust.o | 17 | obj-$(CONFIG_RADIO_TRUST) += radio-trust.o |
diff --git a/drivers/media/radio/miropcm20-radio.c b/drivers/media/radio/miropcm20-radio.c deleted file mode 100644 index 7fd7ee2d32c1..000000000000 --- a/drivers/media/radio/miropcm20-radio.c +++ /dev/null | |||
@@ -1,266 +0,0 @@ | |||
1 | /* Miro PCM20 radio driver for Linux radio support | ||
2 | * (c) 1998 Ruurd Reitsma <R.A.Reitsma@wbmt.tudelft.nl> | ||
3 | * Thanks to Norberto Pellici for the ACI device interface specification | ||
4 | * The API part is based on the radiotrack driver by M. Kirkwood | ||
5 | * This driver relies on the aci mixer (drivers/sound/aci.c) | ||
6 | * Look there for further info... | ||
7 | */ | ||
8 | |||
9 | /* Revision history: | ||
10 | * | ||
11 | * 1998 Ruurd Reitsma <R.A.Reitsma@wbmt.tudelft.nl> | ||
12 | * 2000-09-05 Robert Siemer <Robert.Siemer@gmx.de> | ||
13 | * removed unfinished volume control (maybe adding it later again) | ||
14 | * use OSS-mixer; added stereo control | ||
15 | */ | ||
16 | |||
17 | /* What ever you think about the ACI, version 0x07 is not very well! | ||
18 | * I can't get frequency, 'tuner status', 'tuner flags' or mute/mono | ||
19 | * conditions... Robert | ||
20 | */ | ||
21 | |||
22 | #include <linux/module.h> | ||
23 | #include <linux/init.h> | ||
24 | #include <linux/videodev.h> | ||
25 | #include <media/v4l2-common.h> | ||
26 | #include <media/v4l2-ioctl.h> | ||
27 | #include "oss/aci.h" | ||
28 | #include "miropcm20-rds-core.h" | ||
29 | |||
30 | static int radio_nr = -1; | ||
31 | module_param(radio_nr, int, 0); | ||
32 | |||
33 | struct pcm20_device { | ||
34 | unsigned long freq; | ||
35 | int muted; | ||
36 | int stereo; | ||
37 | }; | ||
38 | |||
39 | |||
40 | static int pcm20_mute(struct pcm20_device *dev, unsigned char mute) | ||
41 | { | ||
42 | dev->muted = mute; | ||
43 | return aci_write_cmd(ACI_SET_TUNERMUTE, mute); | ||
44 | } | ||
45 | |||
46 | static int pcm20_stereo(struct pcm20_device *dev, unsigned char stereo) | ||
47 | { | ||
48 | dev->stereo = stereo; | ||
49 | return aci_write_cmd(ACI_SET_TUNERMONO, !stereo); | ||
50 | } | ||
51 | |||
52 | static int pcm20_setfreq(struct pcm20_device *dev, unsigned long freq) | ||
53 | { | ||
54 | unsigned char freql; | ||
55 | unsigned char freqh; | ||
56 | |||
57 | dev->freq=freq; | ||
58 | |||
59 | freq /= 160; | ||
60 | if (!(aci_version==0x07 || aci_version>=0xb0)) | ||
61 | freq /= 10; /* I don't know exactly which version | ||
62 | * needs this hack */ | ||
63 | freql = freq & 0xff; | ||
64 | freqh = freq >> 8; | ||
65 | |||
66 | aci_rds_cmd(RDS_RESET, NULL, 0); | ||
67 | pcm20_stereo(dev, 1); | ||
68 | |||
69 | return aci_rw_cmd(ACI_WRITE_TUNE, freql, freqh); | ||
70 | } | ||
71 | |||
72 | static int pcm20_getflags(struct pcm20_device *dev, __u32 *flags, __u16 *signal) | ||
73 | { | ||
74 | /* okay, check for signal, stereo and rds here... */ | ||
75 | int i; | ||
76 | unsigned char buf; | ||
77 | |||
78 | if ((i=aci_rw_cmd(ACI_READ_TUNERSTATION, -1, -1))<0) | ||
79 | return i; | ||
80 | pr_debug("check_sig: 0x%x\n", i); | ||
81 | if (i & 0x80) { | ||
82 | /* no signal from tuner */ | ||
83 | *flags=0; | ||
84 | *signal=0; | ||
85 | return 0; | ||
86 | } else | ||
87 | *signal=0xffff; | ||
88 | |||
89 | if ((i=aci_rw_cmd(ACI_READ_TUNERSTEREO, -1, -1))<0) | ||
90 | return i; | ||
91 | if (i & 0x40) { | ||
92 | *flags=0; | ||
93 | } else { | ||
94 | /* stereo */ | ||
95 | *flags=VIDEO_TUNER_STEREO_ON; | ||
96 | /* I can't see stereo, when forced to mono */ | ||
97 | dev->stereo=1; | ||
98 | } | ||
99 | |||
100 | if ((i=aci_rds_cmd(RDS_STATUS, &buf, 1))<0) | ||
101 | return i; | ||
102 | if (buf & 1) | ||
103 | /* RDS available */ | ||
104 | *flags|=VIDEO_TUNER_RDS_ON; | ||
105 | else | ||
106 | return 0; | ||
107 | |||
108 | if ((i=aci_rds_cmd(RDS_RXVALUE, &buf, 1))<0) | ||
109 | return i; | ||
110 | pr_debug("rds-signal: %d\n", buf); | ||
111 | if (buf > 15) { | ||
112 | printk("miropcm20-radio: RX strengths unexpected high...\n"); | ||
113 | buf=15; | ||
114 | } | ||
115 | /* refine signal */ | ||
116 | if ((*signal=SCALE(15, 0xffff, buf))==0) | ||
117 | *signal = 1; | ||
118 | |||
119 | return 0; | ||
120 | } | ||
121 | |||
122 | static int pcm20_do_ioctl(struct inode *inode, struct file *file, | ||
123 | unsigned int cmd, void *arg) | ||
124 | { | ||
125 | struct video_device *dev = video_devdata(file); | ||
126 | struct pcm20_device *pcm20 = dev->priv; | ||
127 | int i; | ||
128 | |||
129 | switch(cmd) | ||
130 | { | ||
131 | case VIDIOCGCAP: | ||
132 | { | ||
133 | struct video_capability *v = arg; | ||
134 | memset(v,0,sizeof(*v)); | ||
135 | v->type=VID_TYPE_TUNER; | ||
136 | strcpy(v->name, "Miro PCM20"); | ||
137 | v->channels=1; | ||
138 | v->audios=1; | ||
139 | return 0; | ||
140 | } | ||
141 | case VIDIOCGTUNER: | ||
142 | { | ||
143 | struct video_tuner *v = arg; | ||
144 | if(v->tuner) /* Only 1 tuner */ | ||
145 | return -EINVAL; | ||
146 | v->rangelow=87*16000; | ||
147 | v->rangehigh=108*16000; | ||
148 | pcm20_getflags(pcm20, &v->flags, &v->signal); | ||
149 | v->flags|=VIDEO_TUNER_LOW; | ||
150 | v->mode=VIDEO_MODE_AUTO; | ||
151 | strcpy(v->name, "FM"); | ||
152 | return 0; | ||
153 | } | ||
154 | case VIDIOCSTUNER: | ||
155 | { | ||
156 | struct video_tuner *v = arg; | ||
157 | if(v->tuner!=0) | ||
158 | return -EINVAL; | ||
159 | /* Only 1 tuner so no setting needed ! */ | ||
160 | return 0; | ||
161 | } | ||
162 | case VIDIOCGFREQ: | ||
163 | { | ||
164 | unsigned long *freq = arg; | ||
165 | *freq = pcm20->freq; | ||
166 | return 0; | ||
167 | } | ||
168 | case VIDIOCSFREQ: | ||
169 | { | ||
170 | unsigned long *freq = arg; | ||
171 | pcm20->freq = *freq; | ||
172 | i=pcm20_setfreq(pcm20, pcm20->freq); | ||
173 | pr_debug("First view (setfreq): 0x%x\n", i); | ||
174 | return i; | ||
175 | } | ||
176 | case VIDIOCGAUDIO: | ||
177 | { | ||
178 | struct video_audio *v = arg; | ||
179 | memset(v,0, sizeof(*v)); | ||
180 | v->flags=VIDEO_AUDIO_MUTABLE; | ||
181 | if (pcm20->muted) | ||
182 | v->flags|=VIDEO_AUDIO_MUTE; | ||
183 | v->mode=VIDEO_SOUND_STEREO; | ||
184 | if (pcm20->stereo) | ||
185 | v->mode|=VIDEO_SOUND_MONO; | ||
186 | /* v->step=2048; */ | ||
187 | strcpy(v->name, "Radio"); | ||
188 | return 0; | ||
189 | } | ||
190 | case VIDIOCSAUDIO: | ||
191 | { | ||
192 | struct video_audio *v = arg; | ||
193 | if(v->audio) | ||
194 | return -EINVAL; | ||
195 | |||
196 | pcm20_mute(pcm20, !!(v->flags&VIDEO_AUDIO_MUTE)); | ||
197 | if(v->flags&VIDEO_SOUND_MONO) | ||
198 | pcm20_stereo(pcm20, 0); | ||
199 | if(v->flags&VIDEO_SOUND_STEREO) | ||
200 | pcm20_stereo(pcm20, 1); | ||
201 | |||
202 | return 0; | ||
203 | } | ||
204 | default: | ||
205 | return -ENOIOCTLCMD; | ||
206 | } | ||
207 | } | ||
208 | |||
209 | static int pcm20_ioctl(struct inode *inode, struct file *file, | ||
210 | unsigned int cmd, unsigned long arg) | ||
211 | { | ||
212 | return video_usercopy(inode, file, cmd, arg, pcm20_do_ioctl); | ||
213 | } | ||
214 | |||
215 | static struct pcm20_device pcm20_unit = { | ||
216 | .freq = 87*16000, | ||
217 | .muted = 1, | ||
218 | }; | ||
219 | |||
220 | static const struct file_operations pcm20_fops = { | ||
221 | .owner = THIS_MODULE, | ||
222 | .open = video_exclusive_open, | ||
223 | .release = video_exclusive_release, | ||
224 | .ioctl = pcm20_ioctl, | ||
225 | #ifdef CONFIG_COMPAT | ||
226 | .compat_ioctl = v4l_compat_ioctl32, | ||
227 | #endif | ||
228 | .llseek = no_llseek, | ||
229 | }; | ||
230 | |||
231 | static struct video_device pcm20_radio = { | ||
232 | .name = "Miro PCM 20 radio", | ||
233 | .fops = &pcm20_fops, | ||
234 | .priv = &pcm20_unit | ||
235 | }; | ||
236 | |||
237 | static int __init pcm20_init(void) | ||
238 | { | ||
239 | if(video_register_device(&pcm20_radio, VFL_TYPE_RADIO, radio_nr)==-1) | ||
240 | goto video_register_device; | ||
241 | |||
242 | if(attach_aci_rds()<0) | ||
243 | goto attach_aci_rds; | ||
244 | |||
245 | printk(KERN_INFO "Miro PCM20 radio card driver.\n"); | ||
246 | |||
247 | return 0; | ||
248 | |||
249 | attach_aci_rds: | ||
250 | video_unregister_device(&pcm20_radio); | ||
251 | video_register_device: | ||
252 | return -EINVAL; | ||
253 | } | ||
254 | |||
255 | MODULE_AUTHOR("Ruurd Reitsma"); | ||
256 | MODULE_DESCRIPTION("A driver for the Miro PCM20 radio card."); | ||
257 | MODULE_LICENSE("GPL"); | ||
258 | |||
259 | static void __exit pcm20_cleanup(void) | ||
260 | { | ||
261 | unload_aci_rds(); | ||
262 | video_unregister_device(&pcm20_radio); | ||
263 | } | ||
264 | |||
265 | module_init(pcm20_init); | ||
266 | module_exit(pcm20_cleanup); | ||
diff --git a/drivers/media/radio/miropcm20-rds-core.c b/drivers/media/radio/miropcm20-rds-core.c deleted file mode 100644 index 9428d8b2642c..000000000000 --- a/drivers/media/radio/miropcm20-rds-core.c +++ /dev/null | |||
@@ -1,211 +0,0 @@ | |||
1 | /* | ||
2 | * Many thanks to Fred Seidel <seidel@metabox.de>, the | ||
3 | * designer of the RDS decoder hardware. With his help | ||
4 | * I was able to code this driver. | ||
5 | * Thanks also to Norberto Pellicci, Dominic Mounteney | ||
6 | * <DMounteney@pinnaclesys.com> and www.teleauskunft.de | ||
7 | * for good hints on finding Fred. It was somewhat hard | ||
8 | * to locate him here in Germany... [: | ||
9 | * | ||
10 | * Revision history: | ||
11 | * | ||
12 | * 2000-08-09 Robert Siemer <Robert.Siemer@gmx.de> | ||
13 | * RDS support for MiroSound PCM20 radio | ||
14 | */ | ||
15 | |||
16 | #include <linux/module.h> | ||
17 | #include <linux/errno.h> | ||
18 | #include <linux/string.h> | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/slab.h> | ||
21 | #include <linux/mutex.h> | ||
22 | |||
23 | #include <asm/io.h> | ||
24 | #include "oss/aci.h" | ||
25 | #include "miropcm20-rds-core.h" | ||
26 | |||
27 | #define DEBUG 0 | ||
28 | |||
29 | static struct mutex aci_rds_mutex; | ||
30 | |||
31 | #define RDS_DATASHIFT 2 /* Bit 2 */ | ||
32 | #define RDS_DATAMASK (1 << RDS_DATASHIFT) | ||
33 | #define RDS_BUSYMASK 0x10 /* Bit 4 */ | ||
34 | #define RDS_CLOCKMASK 0x08 /* Bit 3 */ | ||
35 | |||
36 | #define RDS_DATA(x) (((x) >> RDS_DATASHIFT) & 1) | ||
37 | |||
38 | |||
39 | #if DEBUG | ||
40 | static void print_matrix(char array[], unsigned int length) | ||
41 | { | ||
42 | int i, j; | ||
43 | |||
44 | for (i=0; i<length; i++) { | ||
45 | printk(KERN_DEBUG "aci-rds: "); | ||
46 | for (j=7; j>=0; j--) { | ||
47 | printk("%d", (array[i] >> j) & 0x1); | ||
48 | } | ||
49 | if (i%8 == 0) | ||
50 | printk(" byte-border\n"); | ||
51 | else | ||
52 | printk("\n"); | ||
53 | } | ||
54 | } | ||
55 | #endif /* DEBUG */ | ||
56 | |||
57 | static int byte2trans(unsigned char byte, unsigned char sendbuffer[], int size) | ||
58 | { | ||
59 | int i; | ||
60 | |||
61 | if (size != 8) | ||
62 | return -1; | ||
63 | for (i = 7; i >= 0; i--) | ||
64 | sendbuffer[7-i] = (byte & (1 << i)) ? RDS_DATAMASK : 0; | ||
65 | sendbuffer[0] |= RDS_CLOCKMASK; | ||
66 | |||
67 | return 0; | ||
68 | } | ||
69 | |||
70 | static int rds_waitread(void) | ||
71 | { | ||
72 | unsigned char byte; | ||
73 | int i=2000; | ||
74 | |||
75 | do { | ||
76 | byte=inb(RDS_REGISTER); | ||
77 | i--; | ||
78 | } | ||
79 | while ((byte & RDS_BUSYMASK) && i); | ||
80 | |||
81 | if (i) { | ||
82 | #if DEBUG | ||
83 | printk(KERN_DEBUG "rds_waitread()"); | ||
84 | print_matrix(&byte, 1); | ||
85 | #endif | ||
86 | return (byte); | ||
87 | } else { | ||
88 | printk(KERN_WARNING "aci-rds: rds_waitread() timeout...\n"); | ||
89 | return -1; | ||
90 | } | ||
91 | } | ||
92 | |||
93 | /* don't use any ..._nowait() function if you are not sure what you do... */ | ||
94 | |||
95 | static inline void rds_rawwrite_nowait(unsigned char byte) | ||
96 | { | ||
97 | #if DEBUG | ||
98 | printk(KERN_DEBUG "rds_rawwrite()"); | ||
99 | print_matrix(&byte, 1); | ||
100 | #endif | ||
101 | outb(byte, RDS_REGISTER); | ||
102 | } | ||
103 | |||
104 | static int rds_rawwrite(unsigned char byte) | ||
105 | { | ||
106 | if (rds_waitread() >= 0) { | ||
107 | rds_rawwrite_nowait(byte); | ||
108 | return 0; | ||
109 | } else | ||
110 | return -1; | ||
111 | } | ||
112 | |||
113 | static int rds_write(unsigned char cmd) | ||
114 | { | ||
115 | unsigned char sendbuffer[8]; | ||
116 | int i; | ||
117 | |||
118 | if (byte2trans(cmd, sendbuffer, 8) != 0){ | ||
119 | return -1; | ||
120 | } else { | ||
121 | for (i=0; i<8; i++) { | ||
122 | rds_rawwrite(sendbuffer[i]); | ||
123 | } | ||
124 | } | ||
125 | return 0; | ||
126 | } | ||
127 | |||
128 | static int rds_readcycle_nowait(void) | ||
129 | { | ||
130 | rds_rawwrite_nowait(0); | ||
131 | return rds_waitread(); | ||
132 | } | ||
133 | |||
134 | static int rds_readcycle(void) | ||
135 | { | ||
136 | if (rds_rawwrite(0) < 0) | ||
137 | return -1; | ||
138 | return rds_waitread(); | ||
139 | } | ||
140 | |||
141 | static int rds_read(unsigned char databuffer[], int datasize) | ||
142 | { | ||
143 | #define READSIZE (8*datasize) | ||
144 | |||
145 | int i,j; | ||
146 | |||
147 | if (datasize < 1) /* nothing to read */ | ||
148 | return 0; | ||
149 | |||
150 | /* to be able to use rds_readcycle_nowait() | ||
151 | I have to waitread() here */ | ||
152 | if (rds_waitread() < 0) | ||
153 | return -1; | ||
154 | |||
155 | memset(databuffer, 0, datasize); | ||
156 | |||
157 | for (i=0; i< READSIZE; i++) | ||
158 | if((j=rds_readcycle_nowait()) < 0) { | ||
159 | return -1; | ||
160 | } else { | ||
161 | databuffer[i/8]|=(RDS_DATA(j) << (7-(i%8))); | ||
162 | } | ||
163 | |||
164 | return 0; | ||
165 | } | ||
166 | |||
167 | static int rds_ack(void) | ||
168 | { | ||
169 | int i=rds_readcycle(); | ||
170 | |||
171 | if (i < 0) | ||
172 | return -1; | ||
173 | if (i & RDS_DATAMASK) { | ||
174 | return 0; /* ACK */ | ||
175 | } else { | ||
176 | printk(KERN_DEBUG "aci-rds: NACK\n"); | ||
177 | return 1; /* NACK */ | ||
178 | } | ||
179 | } | ||
180 | |||
181 | int aci_rds_cmd(unsigned char cmd, unsigned char databuffer[], int datasize) | ||
182 | { | ||
183 | int ret; | ||
184 | |||
185 | if (mutex_lock_interruptible(&aci_rds_mutex)) | ||
186 | return -EINTR; | ||
187 | |||
188 | rds_write(cmd); | ||
189 | |||
190 | /* RDS_RESET doesn't need further processing */ | ||
191 | if (cmd!=RDS_RESET && (rds_ack() || rds_read(databuffer, datasize))) | ||
192 | ret = -1; | ||
193 | else | ||
194 | ret = 0; | ||
195 | |||
196 | mutex_unlock(&aci_rds_mutex); | ||
197 | |||
198 | return ret; | ||
199 | } | ||
200 | EXPORT_SYMBOL(aci_rds_cmd); | ||
201 | |||
202 | int __init attach_aci_rds(void) | ||
203 | { | ||
204 | mutex_init(&aci_rds_mutex); | ||
205 | return 0; | ||
206 | } | ||
207 | |||
208 | void __exit unload_aci_rds(void) | ||
209 | { | ||
210 | } | ||
211 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/media/radio/miropcm20-rds-core.h b/drivers/media/radio/miropcm20-rds-core.h deleted file mode 100644 index aeb5761f0469..000000000000 --- a/drivers/media/radio/miropcm20-rds-core.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | #ifndef _MIROPCM20_RDS_CORE_H_ | ||
2 | #define _MIROPCM20_RDS_CORE_H_ | ||
3 | |||
4 | extern int aci_rds_cmd(unsigned char cmd, unsigned char databuffer[], int datasize); | ||
5 | |||
6 | #define RDS_STATUS 0x01 | ||
7 | #define RDS_STATIONNAME 0x02 | ||
8 | #define RDS_TEXT 0x03 | ||
9 | #define RDS_ALTFREQ 0x04 | ||
10 | #define RDS_TIMEDATE 0x05 | ||
11 | #define RDS_PI_CODE 0x06 | ||
12 | #define RDS_PTYTATP 0x07 | ||
13 | #define RDS_RESET 0x08 | ||
14 | #define RDS_RXVALUE 0x09 | ||
15 | |||
16 | extern void __exit unload_aci_rds(void); | ||
17 | extern int __init attach_aci_rds(void); | ||
18 | |||
19 | #endif /* _MIROPCM20_RDS_CORE_H_ */ | ||
diff --git a/drivers/media/radio/miropcm20-rds.c b/drivers/media/radio/miropcm20-rds.c deleted file mode 100644 index 3e840f74d45c..000000000000 --- a/drivers/media/radio/miropcm20-rds.c +++ /dev/null | |||
@@ -1,136 +0,0 @@ | |||
1 | /* MiroSOUND PCM20 radio rds interface driver | ||
2 | * (c) 2001 Robert Siemer <Robert.Siemer@gmx.de> | ||
3 | * Thanks to Fred Seidel. See miropcm20-rds-core.c for further information. | ||
4 | */ | ||
5 | |||
6 | /* Revision history: | ||
7 | * | ||
8 | * 2001-04-18 Robert Siemer <Robert.Siemer@gmx.de> | ||
9 | * separate file for user interface driver | ||
10 | */ | ||
11 | |||
12 | #include <linux/module.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/slab.h> | ||
15 | #include <linux/smp_lock.h> | ||
16 | #include <linux/fs.h> | ||
17 | #include <linux/miscdevice.h> | ||
18 | #include <linux/delay.h> | ||
19 | #include <asm/uaccess.h> | ||
20 | #include "miropcm20-rds-core.h" | ||
21 | |||
22 | static char * text_buffer; | ||
23 | static int rds_users; | ||
24 | |||
25 | |||
26 | static int rds_f_open(struct inode *in, struct file *fi) | ||
27 | { | ||
28 | if (rds_users) | ||
29 | return -EBUSY; | ||
30 | |||
31 | lock_kernel(); | ||
32 | rds_users++; | ||
33 | if ((text_buffer=kmalloc(66, GFP_KERNEL)) == 0) { | ||
34 | rds_users--; | ||
35 | printk(KERN_NOTICE "aci-rds: Out of memory by open()...\n"); | ||
36 | unlock_kernel(); | ||
37 | return -ENOMEM; | ||
38 | } | ||
39 | |||
40 | unlock_kernel(); | ||
41 | return 0; | ||
42 | } | ||
43 | |||
44 | static int rds_f_release(struct inode *in, struct file *fi) | ||
45 | { | ||
46 | kfree(text_buffer); | ||
47 | |||
48 | rds_users--; | ||
49 | return 0; | ||
50 | } | ||
51 | |||
52 | static void print_matrix(char *ch, char out[]) | ||
53 | { | ||
54 | int j; | ||
55 | |||
56 | for (j=7; j>=0; j--) { | ||
57 | out[7-j] = ((*ch >> j) & 0x1) + '0'; | ||
58 | } | ||
59 | } | ||
60 | |||
61 | static ssize_t rds_f_read(struct file *file, char __user *buffer, size_t length, loff_t *offset) | ||
62 | { | ||
63 | // i = sprintf(text_buffer, "length: %d, offset: %d\n", length, *offset); | ||
64 | |||
65 | char c; | ||
66 | char bits[8]; | ||
67 | |||
68 | msleep(2000); | ||
69 | aci_rds_cmd(RDS_STATUS, &c, 1); | ||
70 | print_matrix(&c, bits); | ||
71 | if (copy_to_user(buffer, bits, 8)) | ||
72 | return -EFAULT; | ||
73 | |||
74 | /* if ((c >> 3) & 1) { | ||
75 | aci_rds_cmd(RDS_STATIONNAME, text_buffer+1, 8); | ||
76 | text_buffer[0] = ' ' ; | ||
77 | text_buffer[9] = '\n'; | ||
78 | return copy_to_user(buffer+8, text_buffer, 10) ? -EFAULT: 18; | ||
79 | } | ||
80 | */ | ||
81 | /* if ((c >> 6) & 1) { | ||
82 | aci_rds_cmd(RDS_PTYTATP, &c, 1); | ||
83 | if ( c & 1) | ||
84 | sprintf(text_buffer, " M"); | ||
85 | else | ||
86 | sprintf(text_buffer, " S"); | ||
87 | if ((c >> 1) & 1) | ||
88 | sprintf(text_buffer+2, " TA"); | ||
89 | else | ||
90 | sprintf(text_buffer+2, " --"); | ||
91 | if ((c >> 7) & 1) | ||
92 | sprintf(text_buffer+5, " TP"); | ||
93 | else | ||
94 | sprintf(text_buffer+5, " --"); | ||
95 | sprintf(text_buffer+8, " %2d\n", (c >> 2) & 0x1f); | ||
96 | return copy_to_user(buffer+8, text_buffer, 12) ? -EFAULT: 20; | ||
97 | } | ||
98 | */ | ||
99 | |||
100 | if ((c >> 4) & 1) { | ||
101 | aci_rds_cmd(RDS_TEXT, text_buffer, 65); | ||
102 | text_buffer[0] = ' ' ; | ||
103 | text_buffer[65] = '\n'; | ||
104 | return copy_to_user(buffer+8, text_buffer,66) ? -EFAULT : 66+8; | ||
105 | } else { | ||
106 | put_user('\n', buffer+8); | ||
107 | return 9; | ||
108 | } | ||
109 | } | ||
110 | |||
111 | static const struct file_operations rds_fops = { | ||
112 | .owner = THIS_MODULE, | ||
113 | .read = rds_f_read, | ||
114 | .open = rds_f_open, | ||
115 | .release = rds_f_release | ||
116 | }; | ||
117 | |||
118 | static struct miscdevice rds_miscdev = { | ||
119 | .minor = MISC_DYNAMIC_MINOR, | ||
120 | .name = "radiotext", | ||
121 | .fops = &rds_fops, | ||
122 | }; | ||
123 | |||
124 | static int __init miropcm20_rds_init(void) | ||
125 | { | ||
126 | return misc_register(&rds_miscdev); | ||
127 | } | ||
128 | |||
129 | static void __exit miropcm20_rds_cleanup(void) | ||
130 | { | ||
131 | misc_deregister(&rds_miscdev); | ||
132 | } | ||
133 | |||
134 | module_init(miropcm20_rds_init); | ||
135 | module_exit(miropcm20_rds_cleanup); | ||
136 | MODULE_LICENSE("GPL"); | ||