#ifndef __SAA716x_PRIV_H #define __SAA716x_PRIV_H #include #include #include #include #include "dvbdev.h" #include "dvb_demux.h" #include "dmxdev.h" #include "dvb_frontend.h" #include "dvb_net.h" #define SAA716x_ERROR 0 #define SAA716x_NOTICE 1 #define SAA716x_INFO 2 #define SAA716x_DEBUG 3 #define dprintk(x, y, z, format, arg...) do { \ if (z) { \ if ((x > SAA716x_ERROR) && (x > y)) \ printk(KERN_ERR "%s (%d): " format "\n", __func__, saa716x->num, ##arg);\ else if ((x > SAA716x_NOTICE) && (x > y)) \ printk(KERN_ERR "%s (%d): " format "\n", __func__, saa716x->num, ##arg);\ else if ((x > SAA716x_INFO) && (x > y)) \ printk(KERN_ERR "%s (%d): " format "\n", __func__, saa716x->num, ##arg);\ else if ((x > SAA716x_DEBUG) && (x > y)) \ printk(KERN_ERR "%s (%d): " format "\n", __func__, saa716x->num, ##arg);\ } else { \ if (x > y) \ printk(format, ##arg); \ } \ } while (0); #define MAKE_ENTRY(subven, subdev, configptr) { \ .vendor = 0x1131, \ .device = 0x7162, \ .subvendor = (subven), \ .subdevice = (subdev), \ .driver_data = (unsigned long) (configptr) \ } #define saa716x_write(dat, addr) writel((dat), (saa716x->mmio)+(addr)) #define saa716x_read(addr) readl((saa716x->mmio)+(addr)) struct saa716x; typedef int (*saa716x_load_config_t)(struct saa716x *saa716x); struct saa716x_hwconfig { char *model_name; char *dev_type; saa716x_load_config_t load_config; }; struct saa716x_dma { struct tasklet_struct dma_tasklet; }; struct saa716x_dvb { struct dvb_adapter adapter; struct dvb_frontend *fe; struct dvb_demux demux; struct dmxdev dmxdev; struct dmx_frontend fe_hw; struct dmx_frontend fe_mem; struct dvb_net dvbnet; }; struct saa716x_i2c { struct device *dev; struct i2c_adapter adapter; wait_queue_head_t i2c_queue; }; struct saa716x { /* dev priv */ unsigned int verbose; unsigned int num; struct saa716x_hwconfig *hwconfig; /* PCI */ struct pci_dev *pdev; void __iomem *mmio; unsigned int irq; /* I2C */ struct saa716x_i2c i2c_adapter_a; struct saa716x_i2c i2c_adapter_b; /* DMA */ struct saa716x_dma dma_device_a; struct saa716x_dma dma_device_b; /* DVB */ struct saa716x_dvb dvb_device_a; struct saa716x_dvb dvb_device_b; }; extern void saa716x_i2c_disable(struct saa716x *saa716x); extern void saa716x_i2c_enable(struct saa716x *saa716x); extern int saa716x_pcie_init(struct saa716x *saa716x); extern void saa716x_pcie_exit(struct saa716x *saa716x); #endif //__SAA716x_PRIV_H