diff options
Diffstat (limited to 'drivers/media/dvb/mantis')
-rw-r--r-- | drivers/media/dvb/mantis/Kconfig | 2 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/hopper_cards.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/hopper_vp3028.c | 6 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_cards.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_common.h | 4 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_dvb.c | 17 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_input.c | 76 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_ioc.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_ioc.h | 2 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_vp1033.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_vp1034.c | 10 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_vp1041.c | 6 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_vp2033.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_vp2040.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_vp3030.c | 8 |
15 files changed, 85 insertions, 64 deletions
diff --git a/drivers/media/dvb/mantis/Kconfig b/drivers/media/dvb/mantis/Kconfig index fd0830ed10d..a13a5050313 100644 --- a/drivers/media/dvb/mantis/Kconfig +++ b/drivers/media/dvb/mantis/Kconfig @@ -1,6 +1,6 @@ config MANTIS_CORE tristate "Mantis/Hopper PCI bridge based devices" - depends on PCI && I2C && INPUT && IR_CORE + depends on PCI && I2C && INPUT && RC_CORE help Support for PCI cards based on the Mantis and Hopper PCi bridge. diff --git a/drivers/media/dvb/mantis/hopper_cards.c b/drivers/media/dvb/mantis/hopper_cards.c index 09e9fc78518..70e73afefb3 100644 --- a/drivers/media/dvb/mantis/hopper_cards.c +++ b/drivers/media/dvb/mantis/hopper_cards.c @@ -251,6 +251,8 @@ static struct pci_device_id hopper_pci_table[] = { { } }; +MODULE_DEVICE_TABLE(pci, hopper_pci_table); + static struct pci_driver hopper_pci_driver = { .name = DRIVER_NAME, .id_table = hopper_pci_table, diff --git a/drivers/media/dvb/mantis/hopper_vp3028.c b/drivers/media/dvb/mantis/hopper_vp3028.c index 96674c78e86..68a29f8bdf7 100644 --- a/drivers/media/dvb/mantis/hopper_vp3028.c +++ b/drivers/media/dvb/mantis/hopper_vp3028.c @@ -47,17 +47,17 @@ static int vp3028_frontend_init(struct mantis_pci *mantis, struct dvb_frontend * struct mantis_hwconfig *config = mantis->hwconfig; int err = 0; - gpio_set_bits(mantis, config->reset, 0); + mantis_gpio_set_bits(mantis, config->reset, 0); msleep(100); err = mantis_frontend_power(mantis, POWER_ON); msleep(100); - gpio_set_bits(mantis, config->reset, 1); + mantis_gpio_set_bits(mantis, config->reset, 1); err = mantis_frontend_power(mantis, POWER_ON); if (err == 0) { msleep(250); dprintk(MANTIS_ERROR, 1, "Probing for 10353 (DVB-T)"); - fe = zl10353_attach(&hopper_vp3028_config, adapter); + fe = dvb_attach(zl10353_attach, &hopper_vp3028_config, adapter); if (!fe) return -1; diff --git a/drivers/media/dvb/mantis/mantis_cards.c b/drivers/media/dvb/mantis/mantis_cards.c index cf4b39ffdaa..40da225098c 100644 --- a/drivers/media/dvb/mantis/mantis_cards.c +++ b/drivers/media/dvb/mantis/mantis_cards.c @@ -281,6 +281,8 @@ static struct pci_device_id mantis_pci_table[] = { { } }; +MODULE_DEVICE_TABLE(pci, mantis_pci_table); + static struct pci_driver mantis_pci_driver = { .name = DRIVER_NAME, .id_table = mantis_pci_table, diff --git a/drivers/media/dvb/mantis/mantis_common.h b/drivers/media/dvb/mantis/mantis_common.h index d0b645a483c..bd400d21b81 100644 --- a/drivers/media/dvb/mantis/mantis_common.h +++ b/drivers/media/dvb/mantis/mantis_common.h @@ -171,7 +171,9 @@ struct mantis_pci { struct work_struct uart_work; spinlock_t uart_lock; - struct input_dev *rc; + struct rc_dev *rc; + char input_name[80]; + char input_phys[80]; }; #define MANTIS_HIF_STATUS (mantis->gpio_status) diff --git a/drivers/media/dvb/mantis/mantis_dvb.c b/drivers/media/dvb/mantis/mantis_dvb.c index 99d82eec3b0..e5180e45d31 100644 --- a/drivers/media/dvb/mantis/mantis_dvb.c +++ b/drivers/media/dvb/mantis/mantis_dvb.c @@ -47,15 +47,15 @@ int mantis_frontend_power(struct mantis_pci *mantis, enum mantis_power power) switch (power) { case POWER_ON: dprintk(MANTIS_DEBUG, 1, "Power ON"); - gpio_set_bits(mantis, config->power, POWER_ON); + mantis_gpio_set_bits(mantis, config->power, POWER_ON); msleep(100); - gpio_set_bits(mantis, config->power, POWER_ON); + mantis_gpio_set_bits(mantis, config->power, POWER_ON); msleep(100); break; case POWER_OFF: dprintk(MANTIS_DEBUG, 1, "Power OFF"); - gpio_set_bits(mantis, config->power, POWER_OFF); + mantis_gpio_set_bits(mantis, config->power, POWER_OFF); msleep(100); break; @@ -73,13 +73,13 @@ void mantis_frontend_soft_reset(struct mantis_pci *mantis) struct mantis_hwconfig *config = mantis->hwconfig; dprintk(MANTIS_DEBUG, 1, "Frontend RESET"); - gpio_set_bits(mantis, config->reset, 0); + mantis_gpio_set_bits(mantis, config->reset, 0); msleep(100); - gpio_set_bits(mantis, config->reset, 0); + mantis_gpio_set_bits(mantis, config->reset, 0); msleep(100); - gpio_set_bits(mantis, config->reset, 1); + mantis_gpio_set_bits(mantis, config->reset, 1); msleep(100); - gpio_set_bits(mantis, config->reset, 1); + mantis_gpio_set_bits(mantis, config->reset, 1); msleep(100); return; @@ -117,6 +117,7 @@ static int mantis_dvb_start_feed(struct dvb_demux_feed *dvbdmxfeed) if (mantis->feeds == 1) { dprintk(MANTIS_DEBUG, 1, "mantis start feed & dma"); mantis_dma_start(mantis); + tasklet_enable(&mantis->tasklet); } return mantis->feeds; @@ -136,6 +137,7 @@ static int mantis_dvb_stop_feed(struct dvb_demux_feed *dvbdmxfeed) mantis->feeds--; if (mantis->feeds == 0) { dprintk(MANTIS_DEBUG, 1, "mantis stop feed and dma"); + tasklet_disable(&mantis->tasklet); mantis_dma_stop(mantis); } @@ -216,6 +218,7 @@ int __devinit mantis_dvb_init(struct mantis_pci *mantis) dvb_net_init(&mantis->dvb_adapter, &mantis->dvbnet, &mantis->demux.dmx); tasklet_init(&mantis->tasklet, mantis_dma_xfer, (unsigned long) mantis); + tasklet_disable(&mantis->tasklet); if (mantis->hwconfig) { result = config->frontend_init(mantis, mantis->fe); if (result < 0) { diff --git a/drivers/media/dvb/mantis/mantis_input.c b/drivers/media/dvb/mantis/mantis_input.c index a99489b8418..db6d54d3fec 100644 --- a/drivers/media/dvb/mantis/mantis_input.c +++ b/drivers/media/dvb/mantis/mantis_input.c @@ -18,8 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/input.h> -#include <media/ir-core.h> +#include <media/rc-core.h> #include <linux/pci.h> #include "dmxdev.h" @@ -33,8 +32,9 @@ #include "mantis_uart.h" #define MODULE_NAME "mantis_core" +#define RC_MAP_MANTIS "rc-mantis" -static struct ir_scancode mantis_ir_table[] = { +static struct rc_map_table mantis_ir_table[] = { { 0x29, KEY_POWER }, { 0x28, KEY_FAVORITES }, { 0x30, KEY_TEXT }, @@ -95,53 +95,65 @@ static struct ir_scancode mantis_ir_table[] = { { 0x00, KEY_BLUE }, }; -struct ir_scancode_table ir_mantis = { - .scan = mantis_ir_table, - .size = ARRAY_SIZE(mantis_ir_table), +static struct rc_map_list ir_mantis_map = { + .map = { + .scan = mantis_ir_table, + .size = ARRAY_SIZE(mantis_ir_table), + .rc_type = RC_TYPE_UNKNOWN, + .name = RC_MAP_MANTIS, + } }; -EXPORT_SYMBOL_GPL(ir_mantis); int mantis_input_init(struct mantis_pci *mantis) { - struct input_dev *rc; - char name[80], dev[80]; + struct rc_dev *dev; int err; - rc = input_allocate_device(); - if (!rc) { - dprintk(MANTIS_ERROR, 1, "Input device allocate failed"); - return -ENOMEM; - } + err = rc_map_register(&ir_mantis_map); + if (err) + goto out; - sprintf(name, "Mantis %s IR receiver", mantis->hwconfig->model_name); - sprintf(dev, "pci-%s/ir0", pci_name(mantis->pdev)); + dev = rc_allocate_device(); + if (!dev) { + dprintk(MANTIS_ERROR, 1, "Remote device allocation failed"); + err = -ENOMEM; + goto out_map; + } - rc->name = name; - rc->phys = dev; + sprintf(mantis->input_name, "Mantis %s IR receiver", mantis->hwconfig->model_name); + sprintf(mantis->input_phys, "pci-%s/ir0", pci_name(mantis->pdev)); - rc->id.bustype = BUS_PCI; - rc->id.vendor = mantis->vendor_id; - rc->id.product = mantis->device_id; - rc->id.version = 1; - rc->dev = mantis->pdev->dev; + dev->input_name = mantis->input_name; + dev->input_phys = mantis->input_phys; + dev->input_id.bustype = BUS_PCI; + dev->input_id.vendor = mantis->vendor_id; + dev->input_id.product = mantis->device_id; + dev->input_id.version = 1; + dev->driver_name = MODULE_NAME; + dev->map_name = RC_MAP_MANTIS; + dev->dev.parent = &mantis->pdev->dev; - err = __ir_input_register(rc, &ir_mantis, NULL, MODULE_NAME); + err = rc_register_device(dev); if (err) { dprintk(MANTIS_ERROR, 1, "IR device registration failed, ret = %d", err); - input_free_device(rc); - return -ENODEV; + goto out_dev; } - mantis->rc = rc; - + mantis->rc = dev; return 0; + +out_dev: + rc_free_device(dev); +out_map: + rc_map_unregister(&ir_mantis_map); +out: + return err; } int mantis_exit(struct mantis_pci *mantis) { - struct input_dev *rc = mantis->rc; - - ir_input_unregister(rc); - + rc_unregister_device(mantis->rc); + rc_map_unregister(&ir_mantis_map); return 0; } + diff --git a/drivers/media/dvb/mantis/mantis_ioc.c b/drivers/media/dvb/mantis/mantis_ioc.c index fe31cfb0b15..479086dbb9a 100644 --- a/drivers/media/dvb/mantis/mantis_ioc.c +++ b/drivers/media/dvb/mantis/mantis_ioc.c @@ -75,7 +75,7 @@ int mantis_get_mac(struct mantis_pci *mantis) EXPORT_SYMBOL_GPL(mantis_get_mac); /* Turn the given bit on or off. */ -void gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value) +void mantis_gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value) { u32 cur; @@ -90,7 +90,7 @@ void gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value) mmwrite(mantis->gpio_status, MANTIS_GPIF_ADDR); mmwrite(0x00, MANTIS_GPIF_DOUT); } -EXPORT_SYMBOL_GPL(gpio_set_bits); +EXPORT_SYMBOL_GPL(mantis_gpio_set_bits); int mantis_stream_control(struct mantis_pci *mantis, enum mantis_stream_control stream_ctl) { diff --git a/drivers/media/dvb/mantis/mantis_ioc.h b/drivers/media/dvb/mantis/mantis_ioc.h index 188fe5a8161..d56e002b295 100644 --- a/drivers/media/dvb/mantis/mantis_ioc.h +++ b/drivers/media/dvb/mantis/mantis_ioc.h @@ -44,7 +44,7 @@ enum mantis_stream_control { }; extern int mantis_get_mac(struct mantis_pci *mantis); -extern void gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value); +extern void mantis_gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value); extern int mantis_stream_control(struct mantis_pci *mantis, enum mantis_stream_control stream_ctl); diff --git a/drivers/media/dvb/mantis/mantis_vp1033.c b/drivers/media/dvb/mantis/mantis_vp1033.c index 4a723bda003..deec927c7f7 100644 --- a/drivers/media/dvb/mantis/mantis_vp1033.c +++ b/drivers/media/dvb/mantis/mantis_vp1033.c @@ -173,7 +173,7 @@ static int vp1033_frontend_init(struct mantis_pci *mantis, struct dvb_frontend * msleep(250); dprintk(MANTIS_ERROR, 1, "Probing for STV0299 (DVB-S)"); - fe = stv0299_attach(&lgtdqcs001f_config, adapter); + fe = dvb_attach(stv0299_attach, &lgtdqcs001f_config, adapter); if (fe) { fe->ops.tuner_ops.set_params = lgtdqcs001f_tuner_set; diff --git a/drivers/media/dvb/mantis/mantis_vp1034.c b/drivers/media/dvb/mantis/mantis_vp1034.c index 8e6ae558ee5..26bc0cbe84d 100644 --- a/drivers/media/dvb/mantis/mantis_vp1034.c +++ b/drivers/media/dvb/mantis/mantis_vp1034.c @@ -50,13 +50,13 @@ int vp1034_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) switch (voltage) { case SEC_VOLTAGE_13: dprintk(MANTIS_ERROR, 1, "Polarization=[13V]"); - gpio_set_bits(mantis, 13, 1); - gpio_set_bits(mantis, 14, 0); + mantis_gpio_set_bits(mantis, 13, 1); + mantis_gpio_set_bits(mantis, 14, 0); break; case SEC_VOLTAGE_18: dprintk(MANTIS_ERROR, 1, "Polarization=[18V]"); - gpio_set_bits(mantis, 13, 1); - gpio_set_bits(mantis, 14, 1); + mantis_gpio_set_bits(mantis, 13, 1); + mantis_gpio_set_bits(mantis, 14, 1); break; case SEC_VOLTAGE_OFF: dprintk(MANTIS_ERROR, 1, "Frontend (dummy) POWERDOWN"); @@ -82,7 +82,7 @@ static int vp1034_frontend_init(struct mantis_pci *mantis, struct dvb_frontend * msleep(250); dprintk(MANTIS_ERROR, 1, "Probing for MB86A16 (DVB-S/DSS)"); - fe = mb86a16_attach(&vp1034_mb86a16_config, adapter); + fe = dvb_attach(mb86a16_attach, &vp1034_mb86a16_config, adapter); if (fe) { dprintk(MANTIS_ERROR, 1, "found MB86A16 DVB-S/DSS frontend @0x%02x", diff --git a/drivers/media/dvb/mantis/mantis_vp1041.c b/drivers/media/dvb/mantis/mantis_vp1041.c index d1aa2bc0c15..38a436ca2fd 100644 --- a/drivers/media/dvb/mantis/mantis_vp1041.c +++ b/drivers/media/dvb/mantis/mantis_vp1041.c @@ -316,14 +316,14 @@ static int vp1041_frontend_init(struct mantis_pci *mantis, struct dvb_frontend * if (err == 0) { mantis_frontend_soft_reset(mantis); msleep(250); - mantis->fe = stb0899_attach(&vp1041_stb0899_config, adapter); + mantis->fe = dvb_attach(stb0899_attach, &vp1041_stb0899_config, adapter); if (mantis->fe) { dprintk(MANTIS_ERROR, 1, "found STB0899 DVB-S/DVB-S2 frontend @0x%02x", vp1041_stb0899_config.demod_address); - if (stb6100_attach(mantis->fe, &vp1041_stb6100_config, adapter)) { - if (!lnbp21_attach(mantis->fe, adapter, 0, 0)) + if (dvb_attach(stb6100_attach, mantis->fe, &vp1041_stb6100_config, adapter)) { + if (!dvb_attach(lnbp21_attach, mantis->fe, adapter, 0, 0)) dprintk(MANTIS_ERROR, 1, "No LNBP21 found!"); } } else { diff --git a/drivers/media/dvb/mantis/mantis_vp2033.c b/drivers/media/dvb/mantis/mantis_vp2033.c index 10ce81790a8..06da0ddf05a 100644 --- a/drivers/media/dvb/mantis/mantis_vp2033.c +++ b/drivers/media/dvb/mantis/mantis_vp2033.c @@ -132,7 +132,7 @@ static int vp2033_frontend_init(struct mantis_pci *mantis, struct dvb_frontend * msleep(250); dprintk(MANTIS_ERROR, 1, "Probing for CU1216 (DVB-C)"); - fe = tda10021_attach(&vp2033_tda1002x_cu1216_config, + fe = dvb_attach(tda10021_attach, &vp2033_tda1002x_cu1216_config, adapter, read_pwm(mantis)); @@ -141,7 +141,7 @@ static int vp2033_frontend_init(struct mantis_pci *mantis, struct dvb_frontend * "found Philips CU1216 DVB-C frontend (TDA10021) @ 0x%02x", vp2033_tda1002x_cu1216_config.demod_address); } else { - fe = tda10023_attach(&vp2033_tda10023_cu1216_config, + fe = dvb_attach(tda10023_attach, &vp2033_tda10023_cu1216_config, adapter, read_pwm(mantis)); diff --git a/drivers/media/dvb/mantis/mantis_vp2040.c b/drivers/media/dvb/mantis/mantis_vp2040.c index a7ca233e800..f72b137b765 100644 --- a/drivers/media/dvb/mantis/mantis_vp2040.c +++ b/drivers/media/dvb/mantis/mantis_vp2040.c @@ -132,7 +132,7 @@ static int vp2040_frontend_init(struct mantis_pci *mantis, struct dvb_frontend * msleep(250); dprintk(MANTIS_ERROR, 1, "Probing for CU1216 (DVB-C)"); - fe = tda10021_attach(&vp2040_tda1002x_cu1216_config, + fe = dvb_attach(tda10021_attach, &vp2040_tda1002x_cu1216_config, adapter, read_pwm(mantis)); @@ -141,7 +141,7 @@ static int vp2040_frontend_init(struct mantis_pci *mantis, struct dvb_frontend * "found Philips CU1216 DVB-C frontend (TDA10021) @ 0x%02x", vp2040_tda1002x_cu1216_config.demod_address); } else { - fe = tda10023_attach(&vp2040_tda10023_cu1216_config, + fe = dvb_attach(tda10023_attach, &vp2040_tda10023_cu1216_config, adapter, read_pwm(mantis)); diff --git a/drivers/media/dvb/mantis/mantis_vp3030.c b/drivers/media/dvb/mantis/mantis_vp3030.c index 1f433421495..c09308cd3ac 100644 --- a/drivers/media/dvb/mantis/mantis_vp3030.c +++ b/drivers/media/dvb/mantis/mantis_vp3030.c @@ -59,21 +59,21 @@ static int vp3030_frontend_init(struct mantis_pci *mantis, struct dvb_frontend * struct mantis_hwconfig *config = mantis->hwconfig; int err = 0; - gpio_set_bits(mantis, config->reset, 0); + mantis_gpio_set_bits(mantis, config->reset, 0); msleep(100); err = mantis_frontend_power(mantis, POWER_ON); msleep(100); - gpio_set_bits(mantis, config->reset, 1); + mantis_gpio_set_bits(mantis, config->reset, 1); if (err == 0) { msleep(250); dprintk(MANTIS_ERROR, 1, "Probing for 10353 (DVB-T)"); - fe = zl10353_attach(&mantis_vp3030_config, adapter); + fe = dvb_attach(zl10353_attach, &mantis_vp3030_config, adapter); if (!fe) return -1; - tda665x_attach(fe, &env57h12d5_config, adapter); + dvb_attach(tda665x_attach, fe, &env57h12d5_config, adapter); } else { dprintk(MANTIS_ERROR, 1, "Frontend on <%s> POWER ON failed! <%d>", adapter->name, |