blob: 06400112aebbf54b1248ca466949a4319eea5086 [file] [log] [blame]
Thomas Gleixner09c434b2019-05-19 13:08:20 +01001// SPDX-License-Identifier: GPL-2.0-only
Hans Verkuilf8c08522012-01-16 05:00:26 -03002/*
3 * GemTek radio card driver
4 *
5 * Copyright 1998 Jonas Munsin <jmunsin@iki.fi>
Linus Torvalds1da177e2005-04-16 15:20:36 -07006 *
7 * GemTek hasn't released any specs on the card, so the protocol had to
8 * be reverse engineered with dosemu.
9 *
10 * Besides the protocol changes, this is mostly a copy of:
11 *
12 * RadioTrack II driver for Linux radio support (C) 1998 Ben Pfaff
Mauro Carvalho Chehab4286c6f2006-04-08 16:06:16 -030013 *
Linus Torvalds1da177e2005-04-16 15:20:36 -070014 * Based on RadioTrack I/RadioReveal (C) 1997 M. Kirkwood
Alan Coxd9b01442008-10-27 15:13:47 -030015 * Converted to new API by Alan Cox <alan@lxorguk.ukuu.org.uk>
Linus Torvalds1da177e2005-04-16 15:20:36 -070016 * Various bugfixes and enhancements by Russell Kroll <rkroll@exploits.org>
17 *
Hans Verkuilf8c08522012-01-16 05:00:26 -030018 * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com>
Mauro Carvalho Chehab32590812018-04-25 05:34:48 -040019 * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org>
Hans Verkuilf8c08522012-01-16 05:00:26 -030020 *
21 * Note: this card seems to swap the left and right audio channels!
22 *
23 * Fully tested with the Keene USB FM Transmitter and the v4l2-compliance tool.
Linus Torvalds1da177e2005-04-16 15:20:36 -070024 */
25
Mauro Carvalho Chehab6e6a8b52018-01-04 13:08:56 -050026#include <linux/module.h> /* Modules */
Linus Torvalds1da177e2005-04-16 15:20:36 -070027#include <linux/init.h> /* Initdata */
Peter Osterlundfb911ee2005-09-13 01:25:15 -070028#include <linux/ioport.h> /* request_region */
Linus Torvalds1da177e2005-04-16 15:20:36 -070029#include <linux/delay.h> /* udelay */
Mauro Carvalho Chehabd1c4ecd2006-08-08 09:10:01 -030030#include <linux/videodev2.h> /* kernel radio structs */
Hans Verkuil502b71b2009-03-06 13:50:42 -030031#include <linux/mutex.h>
32#include <linux/io.h> /* outb, outb_p */
Ondrej Zary38ed1ae2012-03-22 14:53:29 -030033#include <linux/pnp.h>
Hans Verkuil9f1dfcc2012-02-29 05:50:27 -030034#include <linux/slab.h>
Hans Verkuil502b71b2009-03-06 13:50:42 -030035#include <media/v4l2-ioctl.h>
36#include <media/v4l2-device.h>
Hans Verkuilf8c08522012-01-16 05:00:26 -030037#include "radio-isa.h"
Hans Verkuil502b71b2009-03-06 13:50:42 -030038
Pekka Seppanen47536472007-10-01 00:27:55 -030039/*
40 * Module info.
41 */
42
Mauro Carvalho Chehab29834c12011-06-25 10:15:42 -030043MODULE_AUTHOR("Jonas Munsin, Pekka Seppänen <pexu@kapsi.fi>");
Pekka Seppanen47536472007-10-01 00:27:55 -030044MODULE_DESCRIPTION("A driver for the GemTek Radio card.");
45MODULE_LICENSE("GPL");
Hans Verkuilf8c08522012-01-16 05:00:26 -030046MODULE_VERSION("1.0.0");
Pekka Seppanen47536472007-10-01 00:27:55 -030047
48/*
49 * Module params.
50 */
Mauro Carvalho Chehabd1c4ecd2006-08-08 09:10:01 -030051
Linus Torvalds1da177e2005-04-16 15:20:36 -070052#ifndef CONFIG_RADIO_GEMTEK_PORT
53#define CONFIG_RADIO_GEMTEK_PORT -1
54#endif
Pekka Seppanen47536472007-10-01 00:27:55 -030055#ifndef CONFIG_RADIO_GEMTEK_PROBE
56#define CONFIG_RADIO_GEMTEK_PROBE 1
57#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070058
Hans Verkuilf8c08522012-01-16 05:00:26 -030059#define GEMTEK_MAX 4
Linus Torvalds1da177e2005-04-16 15:20:36 -070060
Hans Verkuilf8c08522012-01-16 05:00:26 -030061static bool probe = CONFIG_RADIO_GEMTEK_PROBE;
62static bool hardmute;
63static int io[GEMTEK_MAX] = { [0] = CONFIG_RADIO_GEMTEK_PORT,
64 [1 ... (GEMTEK_MAX - 1)] = -1 };
65static int radio_nr[GEMTEK_MAX] = { [0 ... (GEMTEK_MAX - 1)] = -1 };
66
67module_param(probe, bool, 0444);
68MODULE_PARM_DESC(probe, "Enable automatic device probing.");
69
70module_param(hardmute, bool, 0644);
Mauro Carvalho Chehab547633d2016-10-18 17:44:25 -020071MODULE_PARM_DESC(hardmute, "Enable 'hard muting' by shutting down PLL, may reduce static noise.");
Hans Verkuilf8c08522012-01-16 05:00:26 -030072
73module_param_array(io, int, NULL, 0444);
Mauro Carvalho Chehab547633d2016-10-18 17:44:25 -020074MODULE_PARM_DESC(io, "Force I/O ports for the GemTek Radio card if automatic probing is disabled or fails. The most common I/O ports are: 0x20c 0x30c, 0x24c or 0x34c (0x20c, 0x248 and 0x28c have been reported to work for the combined sound/radiocard).");
Pekka Seppanen47536472007-10-01 00:27:55 -030075
Hans Verkuilf8c08522012-01-16 05:00:26 -030076module_param_array(radio_nr, int, NULL, 0444);
77MODULE_PARM_DESC(radio_nr, "Radio device numbers");
Pekka Seppanen47536472007-10-01 00:27:55 -030078
Trent Piepho857e5942007-10-01 00:32:25 -030079/*
80 * Frequency calculation constants. Intermediate frequency 10.52 MHz (nominal
81 * value 10.7 MHz), reference divisor 6.39 kHz (nominal 6.25 kHz).
82 */
83#define FSCALE 8
84#define IF_OFFSET ((unsigned int)(10.52 * 16000 * (1<<FSCALE)))
85#define REF_FREQ ((unsigned int)(6.39 * 16 * (1<<FSCALE)))
86
Pekka Seppanen47536472007-10-01 00:27:55 -030087#define GEMTEK_CK 0x01 /* Clock signal */
88#define GEMTEK_DA 0x02 /* Serial data */
89#define GEMTEK_CE 0x04 /* Chip enable */
90#define GEMTEK_NS 0x08 /* No signal */
91#define GEMTEK_MT 0x10 /* Line mute */
92#define GEMTEK_STDF_3_125_KHZ 0x01 /* Standard frequency 3.125 kHz */
93#define GEMTEK_PLL_OFF 0x07 /* PLL off */
94
95#define BU2614_BUS_SIZE 32 /* BU2614 / BU2614FS bus size */
Pekka Seppanen47536472007-10-01 00:27:55 -030096
97#define SHORT_DELAY 5 /* usec */
98#define LONG_DELAY 75 /* usec */
99
Hans Verkuil502b71b2009-03-06 13:50:42 -0300100struct gemtek {
Hans Verkuilf8c08522012-01-16 05:00:26 -0300101 struct radio_isa_card isa;
102 bool muted;
Trent Piephob25be972007-10-01 00:38:30 -0300103 u32 bu2614data;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104};
105
Mauro Carvalho Chehab6e6a8b52018-01-04 13:08:56 -0500106#define BU2614_FREQ_BITS 16 /* D0..D15, Frequency data */
Trent Piephob25be972007-10-01 00:38:30 -0300107#define BU2614_PORT_BITS 3 /* P0..P2, Output port control data */
Mauro Carvalho Chehab6e6a8b52018-01-04 13:08:56 -0500108#define BU2614_VOID_BITS 4 /* unused */
Trent Piephob25be972007-10-01 00:38:30 -0300109#define BU2614_FMES_BITS 1 /* CT, Frequency measurement beginning data */
110#define BU2614_STDF_BITS 3 /* R0..R2, Standard frequency data */
111#define BU2614_SWIN_BITS 1 /* S, Switch between FMIN / AMIN */
112#define BU2614_SWAL_BITS 1 /* PS, Swallow counter division (AMIN only)*/
113#define BU2614_VOID2_BITS 1 /* unused */
114#define BU2614_FMUN_BITS 1 /* GT, Frequency measurement time & unlock */
115#define BU2614_TEST_BITS 1 /* TS, Test data is input */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116
Mauro Carvalho Chehab6e6a8b52018-01-04 13:08:56 -0500117#define BU2614_FREQ_SHIFT 0
Trent Piephob25be972007-10-01 00:38:30 -0300118#define BU2614_PORT_SHIFT (BU2614_FREQ_BITS + BU2614_FREQ_SHIFT)
119#define BU2614_VOID_SHIFT (BU2614_PORT_BITS + BU2614_PORT_SHIFT)
120#define BU2614_FMES_SHIFT (BU2614_VOID_BITS + BU2614_VOID_SHIFT)
121#define BU2614_STDF_SHIFT (BU2614_FMES_BITS + BU2614_FMES_SHIFT)
122#define BU2614_SWIN_SHIFT (BU2614_STDF_BITS + BU2614_STDF_SHIFT)
123#define BU2614_SWAL_SHIFT (BU2614_SWIN_BITS + BU2614_SWIN_SHIFT)
124#define BU2614_VOID2_SHIFT (BU2614_SWAL_BITS + BU2614_SWAL_SHIFT)
125#define BU2614_FMUN_SHIFT (BU2614_VOID2_BITS + BU2614_VOID2_SHIFT)
126#define BU2614_TEST_SHIFT (BU2614_FMUN_BITS + BU2614_FMUN_SHIFT)
127
128#define MKMASK(field) (((1<<BU2614_##field##_BITS) - 1) << \
129 BU2614_##field##_SHIFT)
130#define BU2614_PORT_MASK MKMASK(PORT)
131#define BU2614_FREQ_MASK MKMASK(FREQ)
132#define BU2614_VOID_MASK MKMASK(VOID)
133#define BU2614_FMES_MASK MKMASK(FMES)
134#define BU2614_STDF_MASK MKMASK(STDF)
135#define BU2614_SWIN_MASK MKMASK(SWIN)
136#define BU2614_SWAL_MASK MKMASK(SWAL)
137#define BU2614_VOID2_MASK MKMASK(VOID2)
138#define BU2614_FMUN_MASK MKMASK(FMUN)
139#define BU2614_TEST_MASK MKMASK(TEST)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700140
Pekka Seppanen47536472007-10-01 00:27:55 -0300141/*
142 * Set data which will be sent to BU2614FS.
143 */
Trent Piephob25be972007-10-01 00:38:30 -0300144#define gemtek_bu2614_set(dev, field, data) ((dev)->bu2614data = \
145 ((dev)->bu2614data & ~field##_MASK) | ((data) << field##_SHIFT))
Pekka Seppanen47536472007-10-01 00:27:55 -0300146
147/*
148 * Transmit settings to BU2614FS over GemTek IC.
149 */
Hans Verkuil502b71b2009-03-06 13:50:42 -0300150static void gemtek_bu2614_transmit(struct gemtek *gt)
Pekka Seppanen47536472007-10-01 00:27:55 -0300151{
Hans Verkuilf8c08522012-01-16 05:00:26 -0300152 struct radio_isa_card *isa = &gt->isa;
Pekka Seppanen47536472007-10-01 00:27:55 -0300153 int i, bit, q, mute;
154
Hans Verkuil502b71b2009-03-06 13:50:42 -0300155 mute = gt->muted ? GEMTEK_MT : 0x00;
Pekka Seppanen47536472007-10-01 00:27:55 -0300156
Hans Verkuilf8c08522012-01-16 05:00:26 -0300157 outb_p(mute | GEMTEK_CE | GEMTEK_DA | GEMTEK_CK, isa->io);
Pekka Seppanen47536472007-10-01 00:27:55 -0300158 udelay(LONG_DELAY);
159
Hans Verkuil502b71b2009-03-06 13:50:42 -0300160 for (i = 0, q = gt->bu2614data; i < 32; i++, q >>= 1) {
161 bit = (q & 1) ? GEMTEK_DA : 0;
Hans Verkuilf8c08522012-01-16 05:00:26 -0300162 outb_p(mute | GEMTEK_CE | bit, isa->io);
Hans Verkuil502b71b2009-03-06 13:50:42 -0300163 udelay(SHORT_DELAY);
Hans Verkuilf8c08522012-01-16 05:00:26 -0300164 outb_p(mute | GEMTEK_CE | bit | GEMTEK_CK, isa->io);
Hans Verkuil502b71b2009-03-06 13:50:42 -0300165 udelay(SHORT_DELAY);
Pekka Seppanen47536472007-10-01 00:27:55 -0300166 }
167
Hans Verkuilf8c08522012-01-16 05:00:26 -0300168 outb_p(mute | GEMTEK_DA | GEMTEK_CK, isa->io);
Pekka Seppanen47536472007-10-01 00:27:55 -0300169 udelay(SHORT_DELAY);
Pekka Seppanen47536472007-10-01 00:27:55 -0300170}
171
172/*
Trent Piepho857e5942007-10-01 00:32:25 -0300173 * Calculate divisor from FM-frequency for BU2614FS (3.125 KHz STDF expected).
Pekka Seppanen47536472007-10-01 00:27:55 -0300174 */
Trent Piepho857e5942007-10-01 00:32:25 -0300175static unsigned long gemtek_convfreq(unsigned long freq)
Pekka Seppanen47536472007-10-01 00:27:55 -0300176{
Hans Verkuilf8c08522012-01-16 05:00:26 -0300177 return ((freq << FSCALE) + IF_OFFSET + REF_FREQ / 2) / REF_FREQ;
178}
179
180static struct radio_isa_card *gemtek_alloc(void)
181{
182 struct gemtek *gt = kzalloc(sizeof(*gt), GFP_KERNEL);
183
184 if (gt)
185 gt->muted = true;
186 return gt ? &gt->isa : NULL;
Pekka Seppanen47536472007-10-01 00:27:55 -0300187}
188
189/*
190 * Set FM-frequency.
191 */
Hans Verkuilf8c08522012-01-16 05:00:26 -0300192static int gemtek_s_frequency(struct radio_isa_card *isa, u32 freq)
Pekka Seppanen47536472007-10-01 00:27:55 -0300193{
Hans Verkuilf8c08522012-01-16 05:00:26 -0300194 struct gemtek *gt = container_of(isa, struct gemtek, isa);
Pekka Seppanen47536472007-10-01 00:27:55 -0300195
Hans Verkuilf8c08522012-01-16 05:00:26 -0300196 if (hardmute && gt->muted)
197 return 0;
Pekka Seppanen47536472007-10-01 00:27:55 -0300198
Hans Verkuil502b71b2009-03-06 13:50:42 -0300199 gemtek_bu2614_set(gt, BU2614_PORT, 0);
200 gemtek_bu2614_set(gt, BU2614_FMES, 0);
201 gemtek_bu2614_set(gt, BU2614_SWIN, 0); /* FM-mode */
202 gemtek_bu2614_set(gt, BU2614_SWAL, 0);
203 gemtek_bu2614_set(gt, BU2614_FMUN, 1); /* GT bit set */
204 gemtek_bu2614_set(gt, BU2614_TEST, 0);
Hans Verkuil502b71b2009-03-06 13:50:42 -0300205 gemtek_bu2614_set(gt, BU2614_STDF, GEMTEK_STDF_3_125_KHZ);
206 gemtek_bu2614_set(gt, BU2614_FREQ, gemtek_convfreq(freq));
Hans Verkuil502b71b2009-03-06 13:50:42 -0300207 gemtek_bu2614_transmit(gt);
Hans Verkuilf8c08522012-01-16 05:00:26 -0300208 return 0;
Pekka Seppanen47536472007-10-01 00:27:55 -0300209}
210
211/*
212 * Set mute flag.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700213 */
Hans Verkuilf8c08522012-01-16 05:00:26 -0300214static int gemtek_s_mute_volume(struct radio_isa_card *isa, bool mute, int vol)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700215{
Hans Verkuilf8c08522012-01-16 05:00:26 -0300216 struct gemtek *gt = container_of(isa, struct gemtek, isa);
Pekka Seppanen47536472007-10-01 00:27:55 -0300217 int i;
Hans Verkuil502b71b2009-03-06 13:50:42 -0300218
Hans Verkuilf8c08522012-01-16 05:00:26 -0300219 gt->muted = mute;
Pekka Seppanen47536472007-10-01 00:27:55 -0300220 if (hardmute) {
Hans Verkuilf8c08522012-01-16 05:00:26 -0300221 if (!mute)
222 return gemtek_s_frequency(isa, isa->freq);
223
Pekka Seppanen47536472007-10-01 00:27:55 -0300224 /* Turn off PLL, disable data output */
Hans Verkuil502b71b2009-03-06 13:50:42 -0300225 gemtek_bu2614_set(gt, BU2614_PORT, 0);
226 gemtek_bu2614_set(gt, BU2614_FMES, 0); /* CT bit off */
227 gemtek_bu2614_set(gt, BU2614_SWIN, 0); /* FM-mode */
228 gemtek_bu2614_set(gt, BU2614_SWAL, 0);
229 gemtek_bu2614_set(gt, BU2614_FMUN, 0); /* GT bit off */
230 gemtek_bu2614_set(gt, BU2614_TEST, 0);
231 gemtek_bu2614_set(gt, BU2614_STDF, GEMTEK_PLL_OFF);
232 gemtek_bu2614_set(gt, BU2614_FREQ, 0);
233 gemtek_bu2614_transmit(gt);
Hans Verkuilf8c08522012-01-16 05:00:26 -0300234 return 0;
Pekka Seppanen47536472007-10-01 00:27:55 -0300235 }
Hans Verkuil502b71b2009-03-06 13:50:42 -0300236
Hans Verkuil502b71b2009-03-06 13:50:42 -0300237 /* Read bus contents (CE, CK and DA). */
Hans Verkuilf8c08522012-01-16 05:00:26 -0300238 i = inb_p(isa->io);
Hans Verkuil502b71b2009-03-06 13:50:42 -0300239 /* Write it back with mute flag set. */
Hans Verkuilf8c08522012-01-16 05:00:26 -0300240 outb_p((i >> 5) | (mute ? GEMTEK_MT : 0), isa->io);
Hans Verkuil502b71b2009-03-06 13:50:42 -0300241 udelay(SHORT_DELAY);
Hans Verkuilf8c08522012-01-16 05:00:26 -0300242 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700243}
244
Hans Verkuilf8c08522012-01-16 05:00:26 -0300245static u32 gemtek_g_rxsubchans(struct radio_isa_card *isa)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700246{
Hans Verkuilf8c08522012-01-16 05:00:26 -0300247 if (inb_p(isa->io) & GEMTEK_NS)
248 return V4L2_TUNER_SUB_MONO;
249 return V4L2_TUNER_SUB_STEREO;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700250}
251
Pekka Seppanen47536472007-10-01 00:27:55 -0300252/*
253 * Check if requested card acts like GemTek Radio card.
254 */
Hans Verkuilf8c08522012-01-16 05:00:26 -0300255static bool gemtek_probe(struct radio_isa_card *isa, int io)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700256{
Pekka Seppanen47536472007-10-01 00:27:55 -0300257 int i, q;
258
Hans Verkuilf8c08522012-01-16 05:00:26 -0300259 q = inb_p(io); /* Read bus contents before probing. */
Pekka Seppanen47536472007-10-01 00:27:55 -0300260 /* Try to turn on CE, CK and DA respectively and check if card responds
261 properly. */
262 for (i = 0; i < 3; ++i) {
Hans Verkuilf8c08522012-01-16 05:00:26 -0300263 outb_p(1 << i, io);
Pekka Seppanen47536472007-10-01 00:27:55 -0300264 udelay(SHORT_DELAY);
265
Hans Verkuilf8c08522012-01-16 05:00:26 -0300266 if ((inb_p(io) & ~GEMTEK_NS) != (0x17 | (1 << (i + 5))))
267 return false;
Pekka Seppanen47536472007-10-01 00:27:55 -0300268 }
Hans Verkuilf8c08522012-01-16 05:00:26 -0300269 outb_p(q >> 5, io); /* Write bus contents back. */
Pekka Seppanen47536472007-10-01 00:27:55 -0300270 udelay(SHORT_DELAY);
Hans Verkuilf8c08522012-01-16 05:00:26 -0300271 return true;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700272}
273
Hans Verkuilf8c08522012-01-16 05:00:26 -0300274static const struct radio_isa_ops gemtek_ops = {
275 .alloc = gemtek_alloc,
276 .probe = gemtek_probe,
277 .s_mute_volume = gemtek_s_mute_volume,
278 .s_frequency = gemtek_s_frequency,
279 .g_rxsubchans = gemtek_g_rxsubchans,
Pekka Seppanen47536472007-10-01 00:27:55 -0300280};
281
Hans Verkuilf8c08522012-01-16 05:00:26 -0300282static const int gemtek_ioports[] = { 0x20c, 0x30c, 0x24c, 0x34c, 0x248, 0x28c };
Linus Torvalds1da177e2005-04-16 15:20:36 -0700283
Ondrej Zary38ed1ae2012-03-22 14:53:29 -0300284#ifdef CONFIG_PNP
Arvind Yadavdb4a8502017-08-16 01:30:10 -0400285static const struct pnp_device_id gemtek_pnp_devices[] = {
Ondrej Zary38ed1ae2012-03-22 14:53:29 -0300286 /* AOpen FX-3D/Pro Radio */
287 {.id = "ADS7183", .driver_data = 0},
288 {.id = ""}
289};
290
291MODULE_DEVICE_TABLE(pnp, gemtek_pnp_devices);
292#endif
293
Hans Verkuilf8c08522012-01-16 05:00:26 -0300294static struct radio_isa_driver gemtek_driver = {
295 .driver = {
296 .match = radio_isa_match,
297 .probe = radio_isa_probe,
298 .remove = radio_isa_remove,
299 .driver = {
300 .name = "radio-gemtek",
301 },
302 },
Ondrej Zary38ed1ae2012-03-22 14:53:29 -0300303#ifdef CONFIG_PNP
304 .pnp_driver = {
305 .name = "radio-gemtek",
306 .id_table = gemtek_pnp_devices,
307 .probe = radio_isa_pnp_probe,
308 .remove = radio_isa_pnp_remove,
309 },
310#endif
Hans Verkuilf8c08522012-01-16 05:00:26 -0300311 .io_params = io,
312 .radio_nr_params = radio_nr,
313 .io_ports = gemtek_ioports,
314 .num_of_io_ports = ARRAY_SIZE(gemtek_ioports),
315 .region_size = 1,
316 .card = "GemTek Radio",
317 .ops = &gemtek_ops,
318 .has_stereo = true,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700319};
320
Linus Torvalds1da177e2005-04-16 15:20:36 -0700321static int __init gemtek_init(void)
322{
Hans Verkuilf8c08522012-01-16 05:00:26 -0300323 gemtek_driver.probe = probe;
Ondrej Zary38ed1ae2012-03-22 14:53:29 -0300324#ifdef CONFIG_PNP
325 pnp_register_driver(&gemtek_driver.pnp_driver);
326#endif
Hans Verkuilf8c08522012-01-16 05:00:26 -0300327 return isa_register_driver(&gemtek_driver.driver, GEMTEK_MAX);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700328}
329
Pekka Seppanen47536472007-10-01 00:27:55 -0300330static void __exit gemtek_exit(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700331{
Mauro Carvalho Chehab8b4b6812014-09-03 15:54:17 -0300332 hardmute = true; /* Turn off PLL */
Ondrej Zary38ed1ae2012-03-22 14:53:29 -0300333#ifdef CONFIG_PNP
334 pnp_unregister_driver(&gemtek_driver.pnp_driver);
335#endif
Hans Verkuilf8c08522012-01-16 05:00:26 -0300336 isa_unregister_driver(&gemtek_driver.driver);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700337}
338
339module_init(gemtek_init);
Pekka Seppanen47536472007-10-01 00:27:55 -0300340module_exit(gemtek_exit);