aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio
diff options
context:
space:
mode:
authorOndrej Zary <linux@rainbow-software.org>2012-03-22 13:53:29 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-04-10 18:53:19 -0400
commit38ed1aef92ab4ba1a3881940ce3e8b680dddf50a (patch)
tree9cb073a5cc2b46c246263ca22cb53e8f6fff55ef /drivers/media/radio
parent865d7ec93433a3c9d8d2c2372e582853f52a7327 (diff)
[media] radio-gemtek: add PnP support for AOpen FX-3D/Pro Radio
Add PnP support to radio-gemtek for AOpen FX-3D/Pro Radio card (AD1816 + Gemtek radio). Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio')
-rw-r--r--drivers/media/radio/radio-gemtek.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/media/radio/radio-gemtek.c b/drivers/media/radio/radio-gemtek.c
index 2e639ce6f256..235c0e349820 100644
--- a/drivers/media/radio/radio-gemtek.c
+++ b/drivers/media/radio/radio-gemtek.c
@@ -29,6 +29,7 @@
29#include <linux/videodev2.h> /* kernel radio structs */ 29#include <linux/videodev2.h> /* kernel radio structs */
30#include <linux/mutex.h> 30#include <linux/mutex.h>
31#include <linux/io.h> /* outb, outb_p */ 31#include <linux/io.h> /* outb, outb_p */
32#include <linux/pnp.h>
32#include <linux/slab.h> 33#include <linux/slab.h>
33#include <media/v4l2-ioctl.h> 34#include <media/v4l2-ioctl.h>
34#include <media/v4l2-device.h> 35#include <media/v4l2-device.h>
@@ -283,6 +284,16 @@ static const struct radio_isa_ops gemtek_ops = {
283 284
284static const int gemtek_ioports[] = { 0x20c, 0x30c, 0x24c, 0x34c, 0x248, 0x28c }; 285static const int gemtek_ioports[] = { 0x20c, 0x30c, 0x24c, 0x34c, 0x248, 0x28c };
285 286
287#ifdef CONFIG_PNP
288static struct pnp_device_id gemtek_pnp_devices[] = {
289 /* AOpen FX-3D/Pro Radio */
290 {.id = "ADS7183", .driver_data = 0},
291 {.id = ""}
292};
293
294MODULE_DEVICE_TABLE(pnp, gemtek_pnp_devices);
295#endif
296
286static struct radio_isa_driver gemtek_driver = { 297static struct radio_isa_driver gemtek_driver = {
287 .driver = { 298 .driver = {
288 .match = radio_isa_match, 299 .match = radio_isa_match,
@@ -292,6 +303,14 @@ static struct radio_isa_driver gemtek_driver = {
292 .name = "radio-gemtek", 303 .name = "radio-gemtek",
293 }, 304 },
294 }, 305 },
306#ifdef CONFIG_PNP
307 .pnp_driver = {
308 .name = "radio-gemtek",
309 .id_table = gemtek_pnp_devices,
310 .probe = radio_isa_pnp_probe,
311 .remove = radio_isa_pnp_remove,
312 },
313#endif
295 .io_params = io, 314 .io_params = io,
296 .radio_nr_params = radio_nr, 315 .radio_nr_params = radio_nr,
297 .io_ports = gemtek_ioports, 316 .io_ports = gemtek_ioports,
@@ -305,12 +324,18 @@ static struct radio_isa_driver gemtek_driver = {
305static int __init gemtek_init(void) 324static int __init gemtek_init(void)
306{ 325{
307 gemtek_driver.probe = probe; 326 gemtek_driver.probe = probe;
327#ifdef CONFIG_PNP
328 pnp_register_driver(&gemtek_driver.pnp_driver);
329#endif
308 return isa_register_driver(&gemtek_driver.driver, GEMTEK_MAX); 330 return isa_register_driver(&gemtek_driver.driver, GEMTEK_MAX);
309} 331}
310 332
311static void __exit gemtek_exit(void) 333static void __exit gemtek_exit(void)
312{ 334{
313 hardmute = 1; /* Turn off PLL */ 335 hardmute = 1; /* Turn off PLL */
336#ifdef CONFIG_PNP
337 pnp_unregister_driver(&gemtek_driver.pnp_driver);
338#endif
314 isa_unregister_driver(&gemtek_driver.driver); 339 isa_unregister_driver(&gemtek_driver.driver);
315} 340}
316 341