Exemple #1
0
static int __init optidma_init(void)
{
	return pci_register_driver(&optidma_pci_driver);
}
Exemple #2
0
int ath_pci_init(void)
{
	return pci_register_driver(&ath_pci_driver);
}
Exemple #3
0
static int __init abyss_init (void)
{
	return pci_register_driver(&abyss_driver);
}
Exemple #4
0
static int __init ninja32_init(void)
{
    return pci_register_driver(&ninja32_pci_driver);
}
static int __init fnic_init_module(void)
{
	size_t len;
	int err = 0;

	printk(KERN_INFO PFX "%s, ver %s\n", DRV_DESCRIPTION, DRV_VERSION);

	/* Allocate memory for trace buffer */
	err = fnic_trace_buf_init();
	if (err < 0) {
		printk(KERN_ERR PFX "Trace buffer initialization Failed "
				  "Fnic Tracing utility is disabled\n");
		fnic_trace_free();
	}

	/* Create a cache for allocation of default size sgls */
	len = sizeof(struct fnic_dflt_sgl_list);
	fnic_sgl_cache[FNIC_SGL_CACHE_DFLT] = (struct kmem_cache *)
			kmem_cache_create("fnic_sgl_dflt" ,
			len + FNIC_SG_DESC_ALIGN, 0,
			SLAB_CACHE_DMA, NULL, NULL);
	if (!fnic_sgl_cache[FNIC_SGL_CACHE_DFLT]) {
		printk(KERN_ERR PFX "failed to create fnic dflt sgl slab\n");
		err = -ENOMEM;
		goto err_create_fnic_sgl_slab_dflt;
	}

	/* Create a cache for allocation of max size sgls*/
	len = sizeof(struct fnic_sgl_list);
	fnic_sgl_cache[FNIC_SGL_CACHE_MAX] = (struct kmem_cache *)
			kmem_cache_create("fnic_sgl_max",
			len + FNIC_SG_DESC_ALIGN, 0,
			SLAB_CACHE_DMA, NULL, NULL);
	if (!fnic_sgl_cache[FNIC_SGL_CACHE_MAX]) {
		printk(KERN_ERR PFX "failed to create fnic max sgl slab\n");
		err = -ENOMEM;
		goto err_create_fnic_sgl_slab_max;
	}

	/* Create a cache of io_req structs for use via mempool */
	fnic_io_req_cache = (struct kmem_cache *)
				kmem_cache_create("fnic_io_req",
				      sizeof(struct fnic_io_req),
				      0, SLAB_HWCACHE_ALIGN, NULL,
				      NULL);
	if (!fnic_io_req_cache) {
		printk(KERN_ERR PFX "failed to create fnic io_req slab\n");
		err = -ENOMEM;
		goto err_create_fnic_ioreq_slab;
	}

	fnic_event_queue = create_singlethread_workqueue("fnic_event_wq");
	if (!fnic_event_queue) {
		printk(KERN_ERR PFX "fnic work queue create failed\n");
		err = -ENOMEM;
		goto err_create_fnic_workq;
	}

	spin_lock_init(&fnic_list_lock);
	INIT_LIST_HEAD(&fnic_list);

	fnic_fc_transport = fc_attach_transport(&fnic_fc_functions);
	if (!fnic_fc_transport) {
		printk(KERN_ERR PFX "fc_attach_transport error\n");
		err = -ENOMEM;
		goto err_fc_transport;
	}

	/* register the driver with PCI system */
	err = pci_register_driver(&fnic_driver);
	if (err < 0) {
		printk(KERN_ERR PFX "pci register error\n");
		goto err_pci_register;
	}

        /* Setup procfs */
        err = init_fnic_procfs();
        if (err < 0) {
                printk(KERN_ERR PFX "Failed to set up procfs\n");
                goto err_init_fnic_procfs;
        }
        return err;
err_init_fnic_procfs:
        teardown_fnic_procfs();


err_pci_register:
	fc_release_transport(fnic_fc_transport);
err_fc_transport:
	destroy_workqueue(fnic_event_queue);
err_create_fnic_workq:
	kmem_cache_destroy(fnic_io_req_cache);
err_create_fnic_ioreq_slab:
	kmem_cache_destroy(fnic_sgl_cache[FNIC_SGL_CACHE_MAX]);
err_create_fnic_sgl_slab_max:
	kmem_cache_destroy(fnic_sgl_cache[FNIC_SGL_CACHE_DFLT]);
err_create_fnic_sgl_slab_dflt:
	fnic_trace_free();
	return err;
}
Exemple #6
0
static int __init acqiris_init(void)
{
    int result;

    printk(ACQRS_INFO "Initializing module " MOD_NAME " (Acqiris PCI I/O Driver) version " MOD_VERSION "\n");
    printk(ACQRS_INFO "    compiled for linux kernel version %d.%d.%d\n", (LINUX_VERSION_CODE>>16)&0xff, (LINUX_VERSION_CODE>>8)&0xff, LINUX_VERSION_CODE&0xff);
    printk(ACQRS_INFO "- debug level = %#04x (%d) (modprobe " MOD_NAME " dbgl=N)\n", dbgl, dbgl);
    printk(ACQRS_INFO "    N: 0x1 DMA; 0x2 interrupt function; 0x4 module r/w ioctrl; 0x8 end of acquisition \n");
    printk(ACQRS_INFO "    N: 0x10 initialization; 0x20 memory allocations; 0x40 all operations \n");
    printk(ACQRS_INFO "- maximum devices = %d (modprobe " MOD_NAME " maxdev=N) (absolute max is 255)\n", maxdev);

    /* Creating the acqiris driver structure */
    result = acqiris_driver_init(&aq_drv);
    if (result < 0)
        return result;

    /* Attempt to register major region */
    if (MAJOR(aq_drv.dev) > 0)
        result = register_chrdev_region(aq_drv.dev, CDEV_MINOR_COUNT, MOD_NAME);
    else
        result = alloc_chrdev_region(&aq_drv.dev, CDEV_MINOR_FIRST, CDEV_MINOR_COUNT, MOD_NAME);

    if (result < 0)
    {
        printk(ACQRS_ERR "Cannot register chrdev region for major %d (%d).\n", MAJOR(aq_drv.dev), result);
        goto fail_region;
    }

    printk(ACQRS_INFO "- major number = %d (modprobe " MOD_NAME " major=N)\n", MAJOR(aq_drv.dev));

    /* Attempt to add character device */
    result = cdev_add(&aq_drv.cdev, aq_drv.dev, CDEV_MINOR_COUNT);
    if (result < 0)
    {
        printk(ACQRS_ERR "Unable to add character device.\n");
        kobject_put(&aq_drv.cdev.kobj);
        goto fail_cdev;
    }

    /* Attempt to register PCI driver */
    result = pci_register_driver(&aq_pci_driver);
    if (result < 0)
    {
        printk(ACQRS_ERR "Cannot register PCI driver (%d).\n", result);
        goto fail_pci;
    }

#ifdef AQ_USE_CLASSES
    acqiris_classP = class_create(THIS_MODULE, MOD_NAME);

    if (acqiris_classP == NULL)
    {
        printk(ACQRS_ERR "Unable to create class '%s'\n", MOD_NAME);
        result = -ENODEV;
        goto fail_all;
     }

    device_create(acqiris_classP, acqiris_deviceP, aq_drv.dev, MOD_NAME);

#endif

    nbrdev = aq_drv.nbr_devices;

    /* All is OK */
    return 0;

    goto fail_all; /* to prevent warning */
fail_all:
    pci_unregister_driver(&aq_pci_driver);
fail_pci:
    cdev_del(&aq_drv.cdev);
fail_cdev:
    unregister_chrdev_region(aq_drv.dev, CDEV_MINOR_COUNT);
fail_region:
    acqiris_driver_cleanup(&aq_drv);

    return result;
}
Exemple #7
0
static int __init c2_init_module(void)
{
	return pci_register_driver(&c2_pci_driver);
}
Exemple #8
0
static int __init hilscher_init_module(void)
{
	return pci_register_driver(&hilscher_pci_driver);
}
Exemple #9
0
/* PCI Driver registration function */
int ps_hdmi_hpd_register_driver(void)
{
	pr_debug("%s: Registering PCI driver for HDMI HPD\n", __func__);
	return pci_register_driver(&ps_hdmi_hpd_driver);
}
Exemple #10
0
static int __init emu_init(void)
{
	return pci_register_driver(&emu_driver);
}
Exemple #11
0
static int __init watchdog_init(void)
{
	return pci_register_driver(&esb_driver);
}
Exemple #12
0
static int __init jmicron_init(void)
{
	return pci_register_driver(&jmicron_pci_driver);
}
Exemple #13
0
static int __devinit sil680_init_one(struct pci_dev *pdev,
                                     const struct pci_device_id *id)
{
    static const struct ata_port_info info = {
        .flags = ATA_FLAG_SLAVE_POSS,
        .pio_mask = 0x1f,
        .mwdma_mask = 0x07,
        .udma_mask = ATA_UDMA6,
        .port_ops = &sil680_port_ops
    };
    static const struct ata_port_info info_slow = {
        .flags = ATA_FLAG_SLAVE_POSS,
        .pio_mask = 0x1f,
        .mwdma_mask = 0x07,
        .udma_mask = ATA_UDMA5,
        .port_ops = &sil680_port_ops
    };
    const struct ata_port_info *ppi[] = { &info, NULL };
    static int printed_version;
    struct ata_host *host;
    void __iomem *mmio_base;
    int rc, try_mmio;

    if (!printed_version++)
        dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");

    rc = pcim_enable_device(pdev);
    if (rc)
        return rc;

    switch (sil680_init_chip(pdev, &try_mmio)) {
    case 0:
        ppi[0] = &info_slow;
        break;
    case 0x30:
        return -ENODEV;
    }

    if (!try_mmio)
        goto use_ioports;

    /* Try to acquire MMIO resources and fallback to PIO if
     * that fails
     */
    rc = pcim_enable_device(pdev);
    if (rc)
        return rc;
    rc = pcim_iomap_regions(pdev, 1 << SIL680_MMIO_BAR, DRV_NAME);
    if (rc)
        goto use_ioports;

    /* Allocate host and set it up */
    host = ata_host_alloc_pinfo(&pdev->dev, ppi, 2);
    if (!host)
        return -ENOMEM;
    host->iomap = pcim_iomap_table(pdev);

    /* Setup DMA masks */
    rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);
    if (rc)
        return rc;
    rc = pci_set_consistent_dma_mask(pdev, ATA_DMA_MASK);
    if (rc)
        return rc;
    pci_set_master(pdev);

    /* Get MMIO base and initialize port addresses */
    mmio_base = host->iomap[SIL680_MMIO_BAR];
    host->ports[0]->ioaddr.bmdma_addr = mmio_base + 0x00;
    host->ports[0]->ioaddr.cmd_addr = mmio_base + 0x80;
    host->ports[0]->ioaddr.ctl_addr = mmio_base + 0x8a;
    host->ports[0]->ioaddr.altstatus_addr = mmio_base + 0x8a;
    ata_sff_std_ports(&host->ports[0]->ioaddr);
    host->ports[1]->ioaddr.bmdma_addr = mmio_base + 0x08;
    host->ports[1]->ioaddr.cmd_addr = mmio_base + 0xc0;
    host->ports[1]->ioaddr.ctl_addr = mmio_base + 0xca;
    host->ports[1]->ioaddr.altstatus_addr = mmio_base + 0xca;
    ata_sff_std_ports(&host->ports[1]->ioaddr);

    /* Register & activate */
    return ata_host_activate(host, pdev->irq, ata_sff_interrupt,
                             IRQF_SHARED, &sil680_sht);

use_ioports:
    return ata_pci_sff_init_one(pdev, ppi, &sil680_sht, NULL);
}

#ifdef CONFIG_PM
static int sil680_reinit_one(struct pci_dev *pdev)
{
    struct ata_host *host = dev_get_drvdata(&pdev->dev);
    int try_mmio, rc;

    rc = ata_pci_device_do_resume(pdev);
    if (rc)
        return rc;
    sil680_init_chip(pdev, &try_mmio);
    ata_host_resume(host);
    return 0;
}
#endif

static const struct pci_device_id sil680[] = {
    { PCI_VDEVICE(CMD, PCI_DEVICE_ID_SII_680), },

    { },
};

static struct pci_driver sil680_pci_driver = {
    .name         = DRV_NAME,
    .id_table    = sil680,
    .probe         = sil680_init_one,
    .remove        = ata_pci_remove_one,
#ifdef CONFIG_PM
    .suspend    = ata_pci_device_suspend,
    .resume        = sil680_reinit_one,
#endif
};

static int __init sil680_init(void)
{
    return pci_register_driver(&sil680_pci_driver);
}

static void __exit sil680_exit(void)
{
    pci_unregister_driver(&sil680_pci_driver);
}

MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("low-level driver for SI680 PATA");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, sil680);
MODULE_VERSION(DRV_VERSION);

module_init(sil680_init);
module_exit(sil680_exit);
static int __init poulsbo_init(void)
{
	return pci_register_driver(&poulsbo_driver);
}
Exemple #15
0
static int __init
scb2_flash_init(void)
{
	return pci_register_driver(&scb2_flash_driver);
}
static int __init rt2400pci_init(void)
{
	return pci_register_driver(&rt2400pci_driver);
}
Exemple #17
0
static int __devinit denali_init(void)
{
	printk(KERN_INFO "Spectra MTD driver\n");
	return pci_register_driver(&denali_pci_driver);
}
static int __init gemtek_pci_init_module( void )
{
    return pci_register_driver( &gemtek_pci_driver );
}
int __init xhci_register_pci(void)
{
	return pci_register_driver(&xhci_pci_driver);
}
static int __init cy82c693_init(void)
{
	return pci_register_driver(&cy82c693_pci_driver);
}
Exemple #21
0
static int __init marvell_init(void)
{
	return pci_register_driver(&marvell_pci_driver);
}
Exemple #22
0
static int philips_fmd1216_pll_init(struct dvb_frontend *fe)
{
	struct cx8802_dev *dev= fe->dvb->priv;

	/* this message is to set up ATC and ALC */
	static u8 fmd1216_init[] = { 0x0b, 0xdc, 0x9c, 0xa0 };
	struct i2c_msg msg =
		{ .addr = dev->core->pll_addr, .flags = 0,
		  .buf = fmd1216_init, .len = sizeof(fmd1216_init) };
	int err;

	if (fe->ops.i2c_gate_ctrl)
		fe->ops.i2c_gate_ctrl(fe, 1);
	if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) {
		if (err < 0)
			return err;
		else
			return -EREMOTEIO;
	}

	return 0;
}

static int dntv_live_dvbt_pro_tuner_set_params(struct dvb_frontend* fe,
					       struct dvb_frontend_parameters* params)
{
	struct cx8802_dev *dev= fe->dvb->priv;
	u8 buf[4];
	struct i2c_msg msg =
		{ .addr = dev->core->pll_addr, .flags = 0,
		  .buf = buf, .len = 4 };
	int err;

	/* Switch PLL to DVB mode */
	err = philips_fmd1216_pll_init(fe);
	if (err)
		return err;

	/* Tune PLL */
	dvb_pll_configure(dev->core->pll_desc, buf,
			  params->frequency,
			  params->u.ofdm.bandwidth);
	if (fe->ops.i2c_gate_ctrl)
		fe->ops.i2c_gate_ctrl(fe, 1);
	if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) {

		printk(KERN_WARNING "cx88-dvb: %s error "
			   "(addr %02x <- %02x, err = %i)\n",
			   __FUNCTION__, dev->core->pll_addr, buf[0], err);
		if (err < 0)
			return err;
		else
			return -EREMOTEIO;
	}

	return 0;
}

static struct mt352_config dntv_live_dvbt_pro_config = {
	.demod_address = 0x0f,
	.no_tuner      = 1,
	.demod_init    = dntv_live_dvbt_pro_demod_init,
};
#endif
#endif

#ifdef HAVE_ZL10353
static int dvico_hybrid_tuner_set_params(struct dvb_frontend *fe,
					 struct dvb_frontend_parameters *params)
{
	u8 pllbuf[4];
	struct cx8802_dev *dev= fe->dvb->priv;
	struct i2c_msg msg =
		{ .addr = dev->core->pll_addr, .flags = 0,
		  .buf = pllbuf, .len = 4 };
	int err;

	dvb_pll_configure(dev->core->pll_desc, pllbuf,
			  params->frequency,
			  params->u.ofdm.bandwidth);

	if (fe->ops.i2c_gate_ctrl)
		fe->ops.i2c_gate_ctrl(fe, 1);
	if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) {
		printk(KERN_WARNING "cx88-dvb: %s error "
			   "(addr %02x <- %02x, err = %i)\n",
			   __FUNCTION__, pllbuf[0], pllbuf[1], err);
		if (err < 0)
			return err;
		else
			return -EREMOTEIO;
	}

	return 0;
}

static struct zl10353_config dvico_fusionhdtv_hybrid = {
	.demod_address = 0x0F,
	.no_tuner      = 1,
};

static struct zl10353_config dvico_fusionhdtv_plus_v1_1 = {
	.demod_address = 0x0F,
};
#endif

#ifdef HAVE_CX22702
static struct cx22702_config connexant_refboard_config = {
	.demod_address = 0x43,
	.output_mode   = CX22702_SERIAL_OUTPUT,
};

static struct cx22702_config hauppauge_novat_config = {
	.demod_address = 0x43,
	.output_mode   = CX22702_SERIAL_OUTPUT,
};
static struct cx22702_config hauppauge_hvr1100_config = {
	.demod_address = 0x63,
	.output_mode   = CX22702_SERIAL_OUTPUT,
};
#endif

#ifdef HAVE_OR51132
static int or51132_set_ts_param(struct dvb_frontend* fe,
				int is_punctured)
{
	struct cx8802_dev *dev= fe->dvb->priv;
	dev->ts_gen_cntrl = is_punctured ? 0x04 : 0x00;
	return 0;
}

static struct or51132_config pchdtv_hd3000 = {
	.demod_address    = 0x15,
	.set_ts_params    = or51132_set_ts_param,
};
#endif

#ifdef HAVE_LGDT330X
static int lgdt3302_tuner_set_params(struct dvb_frontend* fe,
				     struct dvb_frontend_parameters* params)
{
	/* FIXME make this routine use the tuner-simple code.
	 * It could probably be shared with a number of ATSC
	 * frontends. Many share the same tuner with analog TV. */

	struct cx8802_dev *dev= fe->dvb->priv;
	struct cx88_core *core = dev->core;
	u8 buf[4];
	struct i2c_msg msg =
		{ .addr = dev->core->pll_addr, .flags = 0, .buf = buf, .len = 4 };
	int err;

	dvb_pll_configure(core->pll_desc, buf, params->frequency, 0);
	dprintk(1, "%s: tuner at 0x%02x bytes: 0x%02x 0x%02x 0x%02x 0x%02x\n",
			__FUNCTION__, msg.addr, buf[0],buf[1],buf[2],buf[3]);

	if (fe->ops.i2c_gate_ctrl)
		fe->ops.i2c_gate_ctrl(fe, 1);
	if ((err = i2c_transfer(&core->i2c_adap, &msg, 1)) != 1) {
		printk(KERN_WARNING "cx88-dvb: %s error "
			   "(addr %02x <- %02x, err = %i)\n",
			   __FUNCTION__, buf[0], buf[1], err);
		if (err < 0)
			return err;
		else
			return -EREMOTEIO;
	}
	return 0;
}

static int lgdt3303_tuner_set_params(struct dvb_frontend* fe,
				     struct dvb_frontend_parameters* params)
{
	struct cx8802_dev *dev= fe->dvb->priv;
	struct cx88_core *core = dev->core;

	/* Put the analog decoder in standby to keep it quiet */
	cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL);

	return lg_h06xf_pll_set(fe, &core->i2c_adap, params);
}

static int lgdt330x_pll_rf_set(struct dvb_frontend* fe, int index)
{
	struct cx8802_dev *dev= fe->dvb->priv;
	struct cx88_core *core = dev->core;

	dprintk(1, "%s: index = %d\n", __FUNCTION__, index);
	if (index == 0)
		cx_clear(MO_GP0_IO, 8);
	else
		cx_set(MO_GP0_IO, 8);
	return 0;
}

static int lgdt330x_set_ts_param(struct dvb_frontend* fe, int is_punctured)
{
	struct cx8802_dev *dev= fe->dvb->priv;
	if (is_punctured)
		dev->ts_gen_cntrl |= 0x04;
	else
		dev->ts_gen_cntrl &= ~0x04;
	return 0;
}

static struct lgdt330x_config fusionhdtv_3_gold = {
	.demod_address    = 0x0e,
	.demod_chip       = LGDT3302,
	.serial_mpeg      = 0x04, /* TPSERIAL for 3302 in TOP_CONTROL */
	.set_ts_params    = lgdt330x_set_ts_param,
};

static struct lgdt330x_config fusionhdtv_5_gold = {
	.demod_address    = 0x0e,
	.demod_chip       = LGDT3303,
	.serial_mpeg      = 0x40, /* TPSERIAL for 3303 in TOP_CONTROL */
	.set_ts_params    = lgdt330x_set_ts_param,
};

static struct lgdt330x_config pchdtv_hd5500 = {
	.demod_address    = 0x59,
	.demod_chip       = LGDT3303,
	.serial_mpeg      = 0x40, /* TPSERIAL for 3303 in TOP_CONTROL */
	.set_ts_params    = lgdt330x_set_ts_param,
};
#endif

#ifdef HAVE_NXT200X
static int nxt200x_set_ts_param(struct dvb_frontend* fe,
				int is_punctured)
{
	struct cx8802_dev *dev= fe->dvb->priv;
	dev->ts_gen_cntrl = is_punctured ? 0x04 : 0x00;
	return 0;
}

static int nxt200x_set_pll_input(u8* buf, int input)
{
	if (input)
		buf[3] |= 0x08;
	else
		buf[3] &= ~0x08;
	return 0;
}

static struct nxt200x_config ati_hdtvwonder = {
	.demod_address    = 0x0a,
	.set_pll_input    = nxt200x_set_pll_input,
	.set_ts_params    = nxt200x_set_ts_param,
};
#endif

#ifdef HAVE_CX24123
static int cx24123_set_ts_param(struct dvb_frontend* fe,
	int is_punctured)
{
	struct cx8802_dev *dev= fe->dvb->priv;
	dev->ts_gen_cntrl = 0x2;
	return 0;
}

static int kworld_dvbs_100_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage)
{
	struct cx8802_dev *dev= fe->dvb->priv;
	struct cx88_core *core = dev->core;

	if (voltage == SEC_VOLTAGE_OFF) {
		cx_write(MO_GP0_IO, 0x000006fB);
	} else {
		cx_write(MO_GP0_IO, 0x000006f9);
	}

	if (core->prev_set_voltage)
		return core->prev_set_voltage(fe, voltage);
	return 0;
}

static int geniatech_dvbs_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
{
	struct cx8802_dev *dev= fe->dvb->priv;
	struct cx88_core *core = dev->core;

	if (voltage == SEC_VOLTAGE_OFF) {
		dprintk(1,"LNB Voltage OFF\n");
		cx_write(MO_GP0_IO, 0x0000efff);
	}

	if (core->prev_set_voltage)
		return core->prev_set_voltage(fe, voltage);
	return 0;
}

static struct cx24123_config geniatech_dvbs_config = {
	.demod_address  = 0x55,
	.set_ts_params  = cx24123_set_ts_param,
};

static struct cx24123_config hauppauge_novas_config = {
	.demod_address		= 0x55,
	.set_ts_params		= cx24123_set_ts_param,
};

static struct cx24123_config kworld_dvbs_100_config = {
	.demod_address		= 0x15,
	.set_ts_params		= cx24123_set_ts_param,
};
#endif

static int dvb_register(struct cx8802_dev *dev)
{
	/* init struct videobuf_dvb */
	dev->dvb.name = dev->core->name;
	dev->ts_gen_cntrl = 0x0c;

	/* init frontend */
	switch (dev->core->board) {
#ifdef HAVE_CX22702
	case CX88_BOARD_HAUPPAUGE_DVB_T1:
		dev->dvb.frontend = cx22702_attach(&hauppauge_novat_config,
						   &dev->core->i2c_adap);
		if (dev->dvb.frontend != NULL) {
			dvb_pll_attach(dev->dvb.frontend, 0x61,
				       &dev->core->i2c_adap,
				       &dvb_pll_thomson_dtt759x);
		}
		break;
	case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1:
	case CX88_BOARD_CONEXANT_DVB_T1:
	case CX88_BOARD_KWORLD_DVB_T_CX22702:
	case CX88_BOARD_WINFAST_DTV1000:
		dev->dvb.frontend = cx22702_attach(&connexant_refboard_config,
						   &dev->core->i2c_adap);
		if (dev->dvb.frontend != NULL) {
			dvb_pll_attach(dev->dvb.frontend, 0x60,
				       &dev->core->i2c_adap,
				       &dvb_pll_thomson_dtt7579);
		}
		break;
	case CX88_BOARD_WINFAST_DTV2000H:
	case CX88_BOARD_HAUPPAUGE_HVR1100:
	case CX88_BOARD_HAUPPAUGE_HVR1100LP:
		dev->dvb.frontend = cx22702_attach(&hauppauge_hvr1100_config,
						   &dev->core->i2c_adap);
		if (dev->dvb.frontend != NULL) {
			dvb_pll_attach(dev->dvb.frontend, 0x61,
				       &dev->core->i2c_adap,
				       &dvb_pll_fmd1216me);
		}
		break;
#endif
#if defined(HAVE_MT352) || defined(HAVE_ZL10353)
	case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:
#ifdef HAVE_MT352
		dev->dvb.frontend = mt352_attach(&dvico_fusionhdtv,
						 &dev->core->i2c_adap);
		if (dev->dvb.frontend != NULL) {
			dvb_pll_attach(dev->dvb.frontend, 0x60,
				       &dev->core->i2c_adap,
				       &dvb_pll_thomson_dtt7579);
			break;
		}
#endif
#ifdef HAVE_ZL10353
		/* ZL10353 replaces MT352 on later cards */
		dev->dvb.frontend = zl10353_attach(&dvico_fusionhdtv_plus_v1_1,
						   &dev->core->i2c_adap);
		if (dev->dvb.frontend != NULL) {
			dvb_pll_attach(dev->dvb.frontend, 0x60,
				       &dev->core->i2c_adap,
				       &dvb_pll_thomson_dtt7579);
		}
#endif
		break;
	case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL:
#ifdef HAVE_MT352
		/* The tin box says DEE1601, but it seems to be DTT7579
		 * compatible, with a slightly different MT352 AGC gain. */
		dev->dvb.frontend = mt352_attach(&dvico_fusionhdtv_dual,
						 &dev->core->i2c_adap);
		if (dev->dvb.frontend != NULL) {
			dvb_pll_attach(dev->dvb.frontend, 0x61,
				       &dev->core->i2c_adap,
				       &dvb_pll_thomson_dtt7579);
			break;
		}
#endif
#ifdef HAVE_ZL10353
		/* ZL10353 replaces MT352 on later cards */
		dev->dvb.frontend = zl10353_attach(&dvico_fusionhdtv_plus_v1_1,
						   &dev->core->i2c_adap);
		if (dev->dvb.frontend != NULL) {
			dvb_pll_attach(dev->dvb.frontend, 0x61,
				       &dev->core->i2c_adap,
				       &dvb_pll_thomson_dtt7579);
		}
#endif
		break;
#endif /* HAVE_MT352 || HAVE_ZL10353 */
#ifdef HAVE_MT352
	case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
		dev->dvb.frontend = mt352_attach(&dvico_fusionhdtv,
						 &dev->core->i2c_adap);
		if (dev->dvb.frontend != NULL) {
			dvb_pll_attach(dev->dvb.frontend, 0x61,
				       &dev->core->i2c_adap,
				       &dvb_pll_lg_z201);
		}
		break;
	case CX88_BOARD_KWORLD_DVB_T:
	case CX88_BOARD_DNTV_LIVE_DVB_T:
	case CX88_BOARD_ADSTECH_DVB_T_PCI:
		dev->dvb.frontend = mt352_attach(&dntv_live_dvbt_config,
						 &dev->core->i2c_adap);
		if (dev->dvb.frontend != NULL) {
			dvb_pll_attach(dev->dvb.frontend, 0x61,
				       &dev->core->i2c_adap,
				       &dvb_pll_unknown_1);
		}
		break;
	case CX88_BOARD_DNTV_LIVE_DVB_T_PRO:
#ifdef HAVE_VP3054_I2C
		dev->core->pll_addr = 0x61;
		dev->core->pll_desc = &dvb_pll_fmd1216me;
		dev->dvb.frontend = mt352_attach(&dntv_live_dvbt_pro_config,
			&((struct vp3054_i2c_state *)dev->card_priv)->adap);
		if (dev->dvb.frontend != NULL) {
			dev->dvb.frontend->ops.tuner_ops.set_params = dntv_live_dvbt_pro_tuner_set_params;
		}
#else
		printk("%s: built without vp3054 support\n", dev->core->name);
#endif
		break;
#endif
#ifdef HAVE_ZL10353
	case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID:
		dev->core->pll_addr = 0x61;
		dev->core->pll_desc = &dvb_pll_thomson_fe6600;
		dev->dvb.frontend = zl10353_attach(&dvico_fusionhdtv_hybrid,
						   &dev->core->i2c_adap);
		if (dev->dvb.frontend != NULL) {
			dev->dvb.frontend->ops.tuner_ops.set_params = dvico_hybrid_tuner_set_params;
		}
		break;
#endif
#ifdef HAVE_OR51132
	case CX88_BOARD_PCHDTV_HD3000:
		dev->dvb.frontend = or51132_attach(&pchdtv_hd3000,
						 &dev->core->i2c_adap);
		if (dev->dvb.frontend != NULL) {
			dvb_pll_attach(dev->dvb.frontend, 0x61,
				       &dev->core->i2c_adap,
				       &dvb_pll_thomson_dtt761x);
		}
		break;
#endif
#ifdef HAVE_LGDT330X
	case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q:
		dev->ts_gen_cntrl = 0x08;
		{
		/* Do a hardware reset of chip before using it. */
		struct cx88_core *core = dev->core;

		cx_clear(MO_GP0_IO, 1);
		mdelay(100);
		cx_set(MO_GP0_IO, 1);
		mdelay(200);

		/* Select RF connector callback */
		fusionhdtv_3_gold.pll_rf_set = lgdt330x_pll_rf_set;
		dev->core->pll_addr = 0x61;
		dev->core->pll_desc = &dvb_pll_microtune_4042;
		dev->dvb.frontend = lgdt330x_attach(&fusionhdtv_3_gold,
						    &dev->core->i2c_adap);
		if (dev->dvb.frontend != NULL) {
			dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3302_tuner_set_params;
		}
		}
		break;
	case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T:
		dev->ts_gen_cntrl = 0x08;
		{
		/* Do a hardware reset of chip before using it. */
		struct cx88_core *core = dev->core;

		cx_clear(MO_GP0_IO, 1);
		mdelay(100);
		cx_set(MO_GP0_IO, 9);
		mdelay(200);
		dev->core->pll_addr = 0x61;
		dev->core->pll_desc = &dvb_pll_thomson_dtt761x;
		dev->dvb.frontend = lgdt330x_attach(&fusionhdtv_3_gold,
						    &dev->core->i2c_adap);
		if (dev->dvb.frontend != NULL) {
			dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3302_tuner_set_params;
		}
		}
		break;
	case CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD:
		dev->ts_gen_cntrl = 0x08;
		{
		/* Do a hardware reset of chip before using it. */
		struct cx88_core *core = dev->core;

		cx_clear(MO_GP0_IO, 1);
		mdelay(100);
		cx_set(MO_GP0_IO, 1);
		mdelay(200);
		dev->dvb.frontend = lgdt330x_attach(&fusionhdtv_5_gold,
						    &dev->core->i2c_adap);
		if (dev->dvb.frontend != NULL) {
			dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3303_tuner_set_params;
		}
		}
		break;
	case CX88_BOARD_PCHDTV_HD5500:
		dev->ts_gen_cntrl = 0x08;
		{
		/* Do a hardware reset of chip before using it. */
		struct cx88_core *core = dev->core;

		cx_clear(MO_GP0_IO, 1);
		mdelay(100);
		cx_set(MO_GP0_IO, 1);
		mdelay(200);
		dev->dvb.frontend = lgdt330x_attach(&pchdtv_hd5500,
						    &dev->core->i2c_adap);
		if (dev->dvb.frontend != NULL) {
			dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3303_tuner_set_params;
		}
		}
		break;
#endif
#ifdef HAVE_NXT200X
	case CX88_BOARD_ATI_HDTVWONDER:
		dev->dvb.frontend = nxt200x_attach(&ati_hdtvwonder,
						 &dev->core->i2c_adap);
		if (dev->dvb.frontend != NULL) {
			dvb_pll_attach(dev->dvb.frontend, 0x61,
				       &dev->core->i2c_adap,
				       &dvb_pll_tuv1236d);
		}
		break;
#endif
#ifdef HAVE_CX24123
	case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1:
	case CX88_BOARD_HAUPPAUGE_NOVASE2_S1:
		dev->dvb.frontend = cx24123_attach(&hauppauge_novas_config,
			&dev->core->i2c_adap);
		if (dev->dvb.frontend) {
			isl6421_attach(dev->dvb.frontend, &dev->core->i2c_adap,
				       0x08, 0x00, 0x00);
		}
		break;
	case CX88_BOARD_KWORLD_DVBS_100:
		dev->dvb.frontend = cx24123_attach(&kworld_dvbs_100_config,
			&dev->core->i2c_adap);
		if (dev->dvb.frontend) {
			dev->core->prev_set_voltage = dev->dvb.frontend->ops.set_voltage;
			dev->dvb.frontend->ops.set_voltage = kworld_dvbs_100_set_voltage;
		}
		break;
	case CX88_BOARD_GENIATECH_DVBS:
		dev->dvb.frontend = cx24123_attach(&geniatech_dvbs_config,
						   &dev->core->i2c_adap);
		if (dev->dvb.frontend) {
			dev->core->prev_set_voltage = dev->dvb.frontend->ops.set_voltage;
			dev->dvb.frontend->ops.set_voltage = geniatech_dvbs_set_voltage;
		}
		break;
#endif
	default:
		printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n",
		       dev->core->name);
		break;
	}
	if (NULL == dev->dvb.frontend) {
		printk("%s: frontend initialization failed\n",dev->core->name);
		return -1;
	}

	if (dev->core->pll_desc) {
		dev->dvb.frontend->ops.info.frequency_min = dev->core->pll_desc->min;
		dev->dvb.frontend->ops.info.frequency_max = dev->core->pll_desc->max;
	}

	/* Put the analog decoder in standby to keep it quiet */
	cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL);

	/* register everything */
	return videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, &dev->pci->dev);
}

/* ----------------------------------------------------------- */

static int __devinit dvb_probe(struct pci_dev *pci_dev,
			       const struct pci_device_id *pci_id)
{
	struct cx8802_dev *dev;
	struct cx88_core  *core;
	int err;

	/* general setup */
	core = cx88_core_get(pci_dev);
	if (NULL == core)
		return -EINVAL;

	err = -ENODEV;
	if (!cx88_boards[core->board].dvb)
		goto fail_core;

	err = -ENOMEM;
	dev = kzalloc(sizeof(*dev),GFP_KERNEL);
	if (NULL == dev)
		goto fail_core;
	dev->pci = pci_dev;
	dev->core = core;

	err = cx8802_init_common(dev);
	if (0 != err)
		goto fail_free;

#ifdef HAVE_VP3054_I2C
	err = vp3054_i2c_probe(dev);
	if (0 != err)
		goto fail_free;
#endif

	/* dvb stuff */
	printk("%s/2: cx2388x based dvb card\n", core->name);
	videobuf_queue_init(&dev->dvb.dvbq, &dvb_qops,
			    dev->pci, &dev->slock,
			    V4L2_BUF_TYPE_VIDEO_CAPTURE,
			    V4L2_FIELD_TOP,
			    sizeof(struct cx88_buffer),
			    dev);
	err = dvb_register(dev);
	if (0 != err)
		goto fail_fini;

	/* Maintain a reference to cx88-video can query the 8802 device. */
	core->dvbdev = dev;
	return 0;

 fail_fini:
	cx8802_fini_common(dev);
 fail_free:
	kfree(dev);
 fail_core:
	cx88_core_put(core,pci_dev);
	return err;
}

static void __devexit dvb_remove(struct pci_dev *pci_dev)
{
	struct cx8802_dev *dev = pci_get_drvdata(pci_dev);

	/* Destroy any 8802 reference. */
	dev->core->dvbdev = NULL;

	/* dvb */
	videobuf_dvb_unregister(&dev->dvb);

#ifdef HAVE_VP3054_I2C
	vp3054_i2c_remove(dev);
#endif

	/* common */
	cx8802_fini_common(dev);
	cx88_core_put(dev->core,dev->pci);
	kfree(dev);
}

static struct pci_device_id cx8802_pci_tbl[] = {
	{
		.vendor       = 0x14f1,
		.device       = 0x8802,
		.subvendor    = PCI_ANY_ID,
		.subdevice    = PCI_ANY_ID,
	},{
		/* --- end of list --- */
	}
};
MODULE_DEVICE_TABLE(pci, cx8802_pci_tbl);

static struct pci_driver dvb_pci_driver = {
	.name     = "cx88-dvb",
	.id_table = cx8802_pci_tbl,
	.probe    = dvb_probe,
	.remove   = __devexit_p(dvb_remove),
	.suspend  = cx8802_suspend_common,
	.resume   = cx8802_resume_common,
};

static int dvb_init(void)
{
	printk(KERN_INFO "cx2388x dvb driver version %d.%d.%d loaded\n",
	       (CX88_VERSION_CODE >> 16) & 0xff,
	       (CX88_VERSION_CODE >>  8) & 0xff,
	       CX88_VERSION_CODE & 0xff);
#ifdef SNAPSHOT
	printk(KERN_INFO "cx2388x: snapshot date %04d-%02d-%02d\n",
	       SNAPSHOT/10000, (SNAPSHOT/100)%100, SNAPSHOT%100);
#endif
	return pci_register_driver(&dvb_pci_driver);
}

static void dvb_fini(void)
{
	pci_unregister_driver(&dvb_pci_driver);
}

module_init(dvb_init);
module_exit(dvb_fini);
static int __init orinoco_nortel_init(void)
{
	printk(KERN_DEBUG "%s\n", version);
	return pci_register_driver(&orinoco_nortel_driver);
}
static int __init alsa_card_cs46xx_init(void)
{
	return pci_register_driver(&driver);
}
Exemple #25
0
static int __init agp_intel_i460_init(void)
{
	if (agp_off)
		return -EINVAL;
	return pci_register_driver(&agp_intel_i460_pci_driver);
}
Exemple #26
0
static int __init radisys_init(void)
{
	return pci_register_driver(&radisys_pci_driver);
}
Exemple #27
0
static int __init cs5520_init(void)
{
	return pci_register_driver(&cs5520_pci_driver);
}
Exemple #28
0
static int __init init_prism2_plx(void)
{
	return pci_register_driver(&prism2_plx_driver);
}
Exemple #29
0
static int __init rtsx_init(void)
{
	printk(KERN_INFO "Initializing Realtek PCIE storage driver...\n");

	return pci_register_driver(&driver);
}
static int __init pch_phub_pci_init(void)
{
	return pci_register_driver(&pch_phub_driver);
}