diff options
author | Kenneth Aafloy <devnull@localhost> | 2004-07-16 14:46:29 +0000 |
---|---|---|
committer | Kenneth Aafloy <devnull@localhost> | 2004-07-16 14:46:29 +0000 |
commit | f1f25e77af737129e46568e8a1013b8d8988143b (patch) | |
tree | 40b9ceac04e41b5e3f93af1f583eb8d4c376b900 /linux/drivers/media/dvb | |
parent | a43144ada64f80f38143344df0e2fc3f9249570f (diff) | |
download | mediapointer-dvb-s2-f1f25e77af737129e46568e8a1013b8d8988143b.tar.gz mediapointer-dvb-s2-f1f25e77af737129e46568e8a1013b8d8988143b.tar.bz2 |
- Adding I2C_DRIVERID for all frontends to dvb_i2c.h
- dvb_dummy_fe conversion to Kernel I2C
- Conversion from deprecated MODULE_PARM* to module_param*
- Adding/renaming existing *debug* parameter to debug.
- Common naming scheme for debug/I2C: dvbfe_*
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvb_i2c.h | 17 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/alps_tdlb7.c | 24 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/alps_tdmb7.c | 23 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/at76c651.c | 17 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/dvb_dummy_fe.c | 88 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/sp887x.c | 23 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/stv0299.c | 30 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/tda1004x.c | 25 |
8 files changed, 173 insertions, 74 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_i2c.h b/linux/drivers/media/dvb/dvb-core/dvb_i2c.h index 3e9cb6870..5b37c132a 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_i2c.h +++ b/linux/drivers/media/dvb/dvb-core/dvb_i2c.h @@ -26,6 +26,23 @@ #include "dvbdev.h" +//FIXME: Move to i2c-id.h +#define I2C_DRIVERID_DVBFE_ALPS_TDLB7 I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_ALPS_TDMB7 I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_AT76C651 I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_CX24110 I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_DST I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_DUMMY I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_L64781 I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_MT312 I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_MT352 I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_NXT6000 I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_SP887X I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_STV0299 I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_TDA1004X I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_TDA8083 I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_VES1820 I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_VES1X93 I2C_DRIVERID_EXP2 struct dvb_i2c_bus { struct list_head list_head; diff --git a/linux/drivers/media/dvb/frontends/alps_tdlb7.c b/linux/drivers/media/dvb/frontends/alps_tdlb7.c index d6171d6e8..12d818c10 100644 --- a/linux/drivers/media/dvb/frontends/alps_tdlb7.c +++ b/linux/drivers/media/dvb/frontends/alps_tdlb7.c @@ -39,12 +39,18 @@ #include "dvb_frontend.h" #include "dvb_functions.h" -/* fixme: add this to i2c-id.h */ -#define I2C_DRIVERID_TDLB7 I2C_DRIVERID_EXP3 +#define FRONTEND_NAME "dvbfe_alps_tdlb7" -static int debug = 255; +#define dprintk(args...) \ + do { \ + if (debug) printk(KERN_DEBUG FRONTEND_NAME ": " args); \ + } while (0) + +static int debug; + +module_param(debug, int, 0644); +MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); -#define dprintk if (debug) printk /* firmware size for sp8870 */ #define SP8870_FIRMWARE_SIZE 16382 @@ -710,8 +716,8 @@ static int command (struct i2c_client *client, unsigned int cmd, void *arg) static struct i2c_driver driver = { .owner = THIS_MODULE, - .name = "tdlb7", - .id = I2C_DRIVERID_TDLB7, + .name = FRONTEND_NAME, + .id = I2C_DRIVERID_DVBFE_ALPS_TDLB7, .flags = I2C_DF_NOTIFY, .attach_adapter = attach_adapter, .detach_client = detach_client, @@ -719,7 +725,7 @@ static struct i2c_driver driver = { }; static struct i2c_client client_template = { - I2C_DEVNAME("tdlb7"), + .name = FRONTEND_NAME, .flags = I2C_CLIENT_ALLOW_USE, .driver = &driver, }; @@ -738,9 +744,7 @@ static void __exit exit_tdlb7(void) module_init(init_tdlb7); module_exit(exit_tdlb7); -MODULE_PARM(debug,"i"); -MODULE_PARM_DESC(debug, "enable verbose debug messages"); - MODULE_DESCRIPTION("TDLB7 DVB-T Frontend"); MODULE_AUTHOR("Juergen Peitz"); MODULE_LICENSE("GPL"); + diff --git a/linux/drivers/media/dvb/frontends/alps_tdmb7.c b/linux/drivers/media/dvb/frontends/alps_tdmb7.c index 7956303ff..0d53b4aa6 100644 --- a/linux/drivers/media/dvb/frontends/alps_tdmb7.c +++ b/linux/drivers/media/dvb/frontends/alps_tdmb7.c @@ -29,11 +29,18 @@ #include "dvb_frontend.h" #include "dvb_functions.h" -static int debug = 0; -#define dprintk if (debug) printk +#define FRONTEND_NAME "dvbfe_alps_tdmb7" + +#define dprintk(args...) \ + do { \ + if (debug) printk(KERN_DEBUG FRONTEND_NAME ": " args); \ + } while (0) + +static int debug; + +module_param(debug, int, 0644); +MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); -// FIXME: Move to i2c-id.h -#define I2C_DRIVERID_DVBFE_TDMB7 I2C_DRIVERID_EXP0 static struct dvb_frontend_info tdmb7_info = { .name = "Alps TDMB7", @@ -491,8 +498,8 @@ static int command (struct i2c_client *client, static struct i2c_driver driver = { .owner = THIS_MODULE, - .name = "alps_tdmb7", - .id = I2C_DRIVERID_DVBFE_TDMB7, + .name = FRONTEND_NAME, + .id = I2C_DRIVERID_DVBFE_ALPS_TDMB7, .flags = I2C_DF_NOTIFY, .attach_adapter = attach_adapter, .detach_client = detach_client, @@ -500,7 +507,7 @@ static struct i2c_driver driver = { }; static struct i2c_client client_template = { - I2C_DEVNAME("alps_tdmb7"), + .name = FRONTEND_NAME, .flags = I2C_CLIENT_ALLOW_USE, .driver = &driver, }; @@ -519,8 +526,6 @@ static void __exit exit_tdmb7 (void) module_init (init_tdmb7); module_exit (exit_tdmb7); -MODULE_PARM(debug,"i"); -MODULE_PARM_DESC(debug, "enable verbose debug messages"); MODULE_DESCRIPTION("TDMB7 DVB Frontend driver"); MODULE_AUTHOR("Holger Waechtler"); MODULE_LICENSE("GPL"); diff --git a/linux/drivers/media/dvb/frontends/at76c651.c b/linux/drivers/media/dvb/frontends/at76c651.c index 7bd80c738..856693361 100644 --- a/linux/drivers/media/dvb/frontends/at76c651.c +++ b/linux/drivers/media/dvb/frontends/at76c651.c @@ -43,12 +43,18 @@ #include "dvb_i2c.h" #include "dvb_functions.h" +#define FRONTEND_NAME "dvbfe_at76c651" + +#define dprintk(args...) \ + do { \ + if (debug) printk(KERN_DEBUG FRONTEND_NAME ": " args); \ + } while (0) + static int debug; -#define dprintk if (debug) printk +module_param(debug, int, 0644); +MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); -//FIXME: Move to i2c-id.h -#define I2C_DRIVERID_DVBFE_AT76C651 I2C_DRIVERID_EXP0 static struct dvb_frontend_info at76c651_info = { .name = "Atmel AT76C651B with TUA6010XS", @@ -532,7 +538,7 @@ static int command(struct i2c_client *client, unsigned int cmd, void *arg) static struct i2c_driver driver = { .owner = THIS_MODULE, - .name = "at76c651", + .name = FRONTEND_NAME, .id = I2C_DRIVERID_DVBFE_AT76C651, .flags = I2C_DF_NOTIFY, .attach_adapter = attach_adapter, @@ -541,7 +547,7 @@ static struct i2c_driver driver = { }; static struct i2c_client client_template = { - I2C_DEVNAME("at76c651"), + .name = FRONTEND_NAME, .flags = I2C_CLIENT_ALLOW_USE, .driver = &driver, }; @@ -559,7 +565,6 @@ static void __exit at76c651_exit(void) module_init(at76c651_init); module_exit(at76c651_exit); -module_param(debug, int, 0444); MODULE_DESCRIPTION("at76c651/tua6010xs dvb-c frontend driver"); MODULE_AUTHOR("Andreas Oberritter <obi@linuxtv.org>"); diff --git a/linux/drivers/media/dvb/frontends/dvb_dummy_fe.c b/linux/drivers/media/dvb/frontends/dvb_dummy_fe.c index e3f473eec..bab8ea3a2 100644 --- a/linux/drivers/media/dvb/frontends/dvb_dummy_fe.c +++ b/linux/drivers/media/dvb/frontends/dvb_dummy_fe.c @@ -24,8 +24,11 @@ #include "dvb_frontend.h" -static int sct = 0; +#define FRONTEND_NAME "dvbfe_dummy" +static int frontend_type; +module_param(frontend_type, int, 0444); +MODULE_PARM_DESC(frontend_type, "0 == DVB-S, 1 == DVB-C, 2 == DVB-T"); /* depending on module parameter sct deliver different infos */ @@ -87,8 +90,7 @@ static struct dvb_frontend_info dvb_t_dummyfe_info = { struct dvb_frontend_info *frontend_info(void) { - switch(sct) - { + switch(frontend_type) { case 2: return &dvb_t_dummyfe_info; case 1: @@ -168,38 +170,96 @@ static int dvbdummyfe_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *ar return 0; } +static struct i2c_client client_template; -static int dvbdummyfe_attach (struct dvb_i2c_bus *i2c, void **data) +static int dvbdummyfe_attach_adapter(struct i2c_adapter *adapter) { - return dvb_register_frontend (dvbdummyfe_ioctl, i2c, NULL, frontend_info()); + struct dvb_adapter *dvb; + struct i2c_client *client; + int ret; + + if ((client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL))) + return -ENOMEM; + + memcpy(client, &client_template, sizeof(struct i2c_client)); + client->adapter = adapter; + + if ((ret = i2c_attach_client(client))) { + kfree(client); + return ret; + } + + dvb = i2c_get_clientdata(client); + BUG_ON(!dvb); + + if ((ret = dvb_register_frontend_new(dvbdummyfe_ioctl, dvb, NULL, + frontend_info(), THIS_MODULE))) { + kfree(client); + return ret; + } + + return 0; } -static void dvbdummyfe_detach (struct dvb_i2c_bus *i2c, void *data) +static int dvbdummyfe_detach_client(struct i2c_client *client) { - dvb_unregister_frontend (dvbdummyfe_ioctl, i2c); + struct dvb_adapter *dvb = i2c_get_clientdata(client); + + dvb_unregister_frontend_new(dvbdummyfe_ioctl, dvb); + i2c_detach_client(client); + kfree(client); + return 0; } +static int dvbdummyfe_command(struct i2c_client *client, + unsigned int cmd, void *arg) +{ + switch(cmd) { + case FE_REGISTER: + i2c_set_clientdata(client, arg); + break; + case FE_UNREGISTER: + break; + default: + return -EOPNOTSUPP; + } + + return 0; +} + +static struct i2c_driver driver = { + .owner = THIS_MODULE, + .name = FRONTEND_NAME, + .id = I2C_DRIVERID_DVBFE_DUMMY, + .flags = I2C_DF_NOTIFY, + .attach_adapter = dvbdummyfe_attach_adapter, + .detach_client = dvbdummyfe_detach_client, + .command = dvbdummyfe_command, +}; + +static struct i2c_client client_template = { + .name = FRONTEND_NAME, + .flags = I2C_CLIENT_ALLOW_USE, + .driver = &driver, +}; static int __init init_dvbdummyfe (void) { - return dvb_register_i2c_device (THIS_MODULE, - dvbdummyfe_attach, - dvbdummyfe_detach); + return i2c_add_driver(&driver); } - static void __exit exit_dvbdummyfe (void) { - dvb_unregister_i2c_device (dvbdummyfe_attach); + if (i2c_del_driver(&driver)) + printk(KERN_ERR "dummyfe: driver deregistration failed.\n"); } module_init(init_dvbdummyfe); module_exit(exit_dvbdummyfe); - MODULE_DESCRIPTION("DVB DUMMY Frontend"); MODULE_AUTHOR("Emard"); MODULE_LICENSE("GPL"); -MODULE_PARM(sct, "i"); + diff --git a/linux/drivers/media/dvb/frontends/sp887x.c b/linux/drivers/media/dvb/frontends/sp887x.c index 1f53e09c3..06645548b 100644 --- a/linux/drivers/media/dvb/frontends/sp887x.c +++ b/linux/drivers/media/dvb/frontends/sp887x.c @@ -23,14 +23,17 @@ #include "dvb_frontend.h" #include "dvb_functions.h" -/* fixme: add this to i2c-id.h */ -#define I2C_DRIVERID_SP887X I2C_DRIVERID_EXP3 +#define FRONTEND_NAME "dvbfe_sp887x" -#if 0 -#define dprintk(x...) printk(x) -#else -#define dprintk(x...) -#endif +#define dprintk(args...) \ + do { \ + if (debug) printk(KERN_DEBUG FRONTEND_NAME ": " args); \ + } while (0) + +static int debug; + +module_param(debug, int, 0644); +MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); #if 0 #define LOG(dir,addr,buf,len) \ @@ -673,8 +676,8 @@ static int command (struct i2c_client *client, unsigned int cmd, void *arg) static struct i2c_driver driver = { .owner = THIS_MODULE, - .name = "sp887x", - .id = I2C_DRIVERID_SP887X, + .name = FRONTEND_NAME, + .id = I2C_DRIVERID_DVBFE_SP887X, .flags = I2C_DF_NOTIFY, .attach_adapter = attach_adapter, .detach_client = detach_client, @@ -682,7 +685,7 @@ static struct i2c_driver driver = { }; static struct i2c_client client_template = { - I2C_DEVNAME("sp887x"), + .name = FRONTEND_NAME, .flags = I2C_CLIENT_ALLOW_USE, .driver = &driver, }; diff --git a/linux/drivers/media/dvb/frontends/stv0299.c b/linux/drivers/media/dvb/frontends/stv0299.c index e4cd9a351..bc8d13ea2 100644 --- a/linux/drivers/media/dvb/frontends/stv0299.c +++ b/linux/drivers/media/dvb/frontends/stv0299.c @@ -55,16 +55,21 @@ #include "dvb_frontend.h" #include "dvb_functions.h" -/* fixme: add this to i2c-id.h */ -#define I2C_DRIVERID_STV0299 I2C_DRIVERID_EXP0 +#define FRONTEND_NAME "dvbfe_stv0299" -#if 0 -#define dprintk(x...) printk(x) -#else -#define dprintk(x...) -#endif +#define dprintk(args...) \ + do { \ + if (debug) printk(KERN_DEBUG FRONTEND_NAME ": " args); \ + } while (0) -static int stv0299_status = 0; +static int debug; +static int stv0299_status; + +module_param(debug, int, 0644); +MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); +module_param(stv0299_status, int, 0444); +MODULE_PARM_DESC(stv0299_status, "Which status value to support " + "(0 == BER (default), 1 == UCBLOCKS)"); #define STATUS_BER 0 #define STATUS_UCBLOCKS 1 @@ -1440,8 +1445,8 @@ static int command (struct i2c_client *client, unsigned int cmd, void *arg) static struct i2c_driver driver = { .owner = THIS_MODULE, - .name = "stv0299", - .id = I2C_DRIVERID_STV0299, + .name = FRONTEND_NAME, + .id = I2C_DRIVERID_DVBFE_STV0299, .flags = I2C_DF_NOTIFY, .attach_adapter = attach_adapter, .detach_client = detach_client, @@ -1449,7 +1454,7 @@ static struct i2c_driver driver = { }; static struct i2c_client client_template = { - I2C_DEVNAME("stv0299"), + .name = FRONTEND_NAME, .flags = I2C_CLIENT_ALLOW_USE, .driver = &driver, }; @@ -1473,6 +1478,3 @@ MODULE_AUTHOR("Ralph Metzler, Holger Waechtler, Peter Schildmann, Felix Domke, " "Andreas Oberritter, Andrew de Quincey, Kenneth Aafløy"); MODULE_LICENSE("GPL"); -MODULE_PARM(stv0299_status, "i"); -MODULE_PARM_DESC(stv0299_status, "Which status value to support (0: BER, 1: UCBLOCKS)"); - diff --git a/linux/drivers/media/dvb/frontends/tda1004x.c b/linux/drivers/media/dvb/frontends/tda1004x.c index 1368cceaa..3f9103650 100644 --- a/linux/drivers/media/dvb/frontends/tda1004x.c +++ b/linux/drivers/media/dvb/frontends/tda1004x.c @@ -39,13 +39,20 @@ #include <linux/device.h> #include <linux/firmware.h> -/* fixme: add this to i2c-id.h */ -#define I2C_DRIVERID_TDA1004X I2C_DRIVERID_EXP2 - #include "dvb_frontend.h" #include "dvb_functions.h" -static int tda1004x_debug = 0; +#define FRONTEND_NAME "dvbfe_tda1004x" + +#define dprintk(args...) \ + do { \ + if (debug) printk(KERN_DEBUG FRONTEND_NAME ": " args); \ + } while (0) + +static int debug; + +module_param(debug, int, 0644); +MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); #define MC44BC374_ADDRESS 0x65 @@ -133,8 +140,6 @@ static int tda1004x_debug = 0; #define TUNER_TYPE_TD1344 0 #define TUNER_TYPE_TD1316 1 -#define dprintk if (tda1004x_debug) printk - static struct dvb_frontend_info tda10045h_info = { .name = "Philips TDA10045H", .type = FE_OFDM, @@ -1572,8 +1577,8 @@ static int command (struct i2c_client *client, unsigned int cmd, void *arg) static struct i2c_driver driver = { .owner = THIS_MODULE, - .name = "tda1004x", - .id = I2C_DRIVERID_TDA1004X, + .name = FRONTEND_NAME, + .id = I2C_DRIVERID_DVBFE_TDA1004X, .flags = I2C_DF_NOTIFY, .attach_adapter = attach_adapter, .detach_client = detach_client, @@ -1581,7 +1586,7 @@ static struct i2c_driver driver = { }; static struct i2c_client client_template = { - I2C_DEVNAME("tda1004x"), + .name = FRONTEND_NAME, .flags = I2C_CLIENT_ALLOW_USE, .driver = &driver, }; @@ -1604,5 +1609,3 @@ MODULE_DESCRIPTION("Philips TDA10045H & TDA10046H DVB-T Frontend"); MODULE_AUTHOR("Andrew de Quincey & Robert Schlabbach"); MODULE_LICENSE("GPL"); -MODULE_PARM(tda1004x_debug, "i"); -MODULE_PARM_DESC(tda1004x_debug, "enable verbose debug messages"); |