Merge master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb
This commit is contained in:
commit
593195f9b2
|
@ -142,3 +142,4 @@
|
|||
141 -> Asound Skyeye PCTV
|
||||
142 -> Sabrent TV-FM (bttv version)
|
||||
143 -> Hauppauge ImpactVCB (bt878) [0070:13eb]
|
||||
144 -> MagicTV
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
18 -> Hauppauge Nova-T DVB-T [0070:9002,0070:9001]
|
||||
19 -> Conexant DVB-T reference design [14f1:0187]
|
||||
20 -> Provideo PV259 [1540:2580]
|
||||
21 -> DViCO FusionHDTV DVB-T Plus [18ac:db10]
|
||||
21 -> DViCO FusionHDTV DVB-T Plus [18ac:db10,18ac:db11]
|
||||
22 -> pcHDTV HD3000 HDTV [7063:3000]
|
||||
23 -> digitalnow DNTV Live! DVB-T [17de:a8a6]
|
||||
24 -> Hauppauge WinTV 28xxx (Roslyn) models [0070:2801]
|
||||
|
|
|
@ -109,10 +109,9 @@ static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages)
|
|||
struct page *pg;
|
||||
int i;
|
||||
|
||||
sglist = kmalloc(sizeof(struct scatterlist)*nr_pages, GFP_KERNEL);
|
||||
sglist = kcalloc(nr_pages, sizeof(struct scatterlist), GFP_KERNEL);
|
||||
if (NULL == sglist)
|
||||
return NULL;
|
||||
memset(sglist,0,sizeof(struct scatterlist)*nr_pages);
|
||||
for (i = 0; i < nr_pages; i++, virt += PAGE_SIZE) {
|
||||
pg = vmalloc_to_page(virt);
|
||||
if (NULL == pg)
|
||||
|
@ -306,15 +305,13 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent
|
|||
struct saa7146_dev *dev;
|
||||
int err = -ENOMEM;
|
||||
|
||||
dev = kmalloc(sizeof(struct saa7146_dev), GFP_KERNEL);
|
||||
/* clear out mem for sure */
|
||||
dev = kzalloc(sizeof(struct saa7146_dev), GFP_KERNEL);
|
||||
if (!dev) {
|
||||
ERR(("out of memory.\n"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* clear out mem for sure */
|
||||
memset(dev, 0x0, sizeof(struct saa7146_dev));
|
||||
|
||||
DEB_EE(("pci:%p\n",pci));
|
||||
|
||||
err = pci_enable_device(pci);
|
||||
|
|
|
@ -239,13 +239,12 @@ static int fops_open(struct inode *inode, struct file *file)
|
|||
}
|
||||
|
||||
/* allocate per open data */
|
||||
fh = kmalloc(sizeof(*fh),GFP_KERNEL);
|
||||
fh = kzalloc(sizeof(*fh),GFP_KERNEL);
|
||||
if (NULL == fh) {
|
||||
DEB_S(("cannot allocate memory for per open data.\n"));
|
||||
result = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
memset(fh,0,sizeof(*fh));
|
||||
|
||||
file->private_data = fh;
|
||||
fh->dev = dev;
|
||||
|
@ -464,12 +463,11 @@ static struct video_device device_template =
|
|||
|
||||
int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv)
|
||||
{
|
||||
struct saa7146_vv *vv = kmalloc (sizeof(struct saa7146_vv),GFP_KERNEL);
|
||||
struct saa7146_vv *vv = kzalloc (sizeof(struct saa7146_vv),GFP_KERNEL);
|
||||
if( NULL == vv ) {
|
||||
ERR(("out of memory. aborting.\n"));
|
||||
return -1;
|
||||
}
|
||||
memset(vv, 0x0, sizeof(*vv));
|
||||
|
||||
DEB_EE(("dev:%p\n",dev));
|
||||
|
||||
|
|
|
@ -220,20 +220,18 @@ EXPORT_SYMBOL(flexcop_reset_block_300);
|
|||
struct flexcop_device *flexcop_device_kmalloc(size_t bus_specific_len)
|
||||
{
|
||||
void *bus;
|
||||
struct flexcop_device *fc = kmalloc(sizeof(struct flexcop_device), GFP_KERNEL);
|
||||
struct flexcop_device *fc = kzalloc(sizeof(struct flexcop_device), GFP_KERNEL);
|
||||
if (!fc) {
|
||||
err("no memory");
|
||||
return NULL;
|
||||
}
|
||||
memset(fc, 0, sizeof(struct flexcop_device));
|
||||
|
||||
bus = kmalloc(bus_specific_len, GFP_KERNEL);
|
||||
bus = kzalloc(bus_specific_len, GFP_KERNEL);
|
||||
if (!bus) {
|
||||
err("no memory");
|
||||
kfree(fc);
|
||||
return NULL;
|
||||
}
|
||||
memset(bus, 0, bus_specific_len);
|
||||
|
||||
fc->bus_specific = bus;
|
||||
|
||||
|
|
|
@ -786,10 +786,9 @@ static int dvb_bt8xx_probe(struct device *dev)
|
|||
struct pci_dev* bttv_pci_dev;
|
||||
int ret;
|
||||
|
||||
if (!(card = kmalloc(sizeof(struct dvb_bt8xx_card), GFP_KERNEL)))
|
||||
if (!(card = kzalloc(sizeof(struct dvb_bt8xx_card), GFP_KERNEL)))
|
||||
return -ENOMEM;
|
||||
|
||||
memset(card, 0, sizeof(*card));
|
||||
init_MUTEX(&card->lock);
|
||||
card->bttv_nr = sub->core->nr;
|
||||
strncpy(card->card_name, sub->core->name, sizeof(sub->core->name));
|
||||
|
|
|
@ -1649,21 +1649,17 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter,
|
|||
return -EINVAL;
|
||||
|
||||
/* initialise the system data */
|
||||
if ((ca =
|
||||
(struct dvb_ca_private *) kmalloc(sizeof(struct dvb_ca_private),
|
||||
GFP_KERNEL)) == NULL) {
|
||||
if ((ca = kzalloc(sizeof(struct dvb_ca_private), GFP_KERNEL)) == NULL) {
|
||||
ret = -ENOMEM;
|
||||
goto error;
|
||||
}
|
||||
memset(ca, 0, sizeof(struct dvb_ca_private));
|
||||
ca->pub = pubca;
|
||||
ca->flags = flags;
|
||||
ca->slot_count = slot_count;
|
||||
if ((ca->slot_info = kmalloc(sizeof(struct dvb_ca_slot) * slot_count, GFP_KERNEL)) == NULL) {
|
||||
if ((ca->slot_info = kcalloc(slot_count, sizeof(struct dvb_ca_slot), GFP_KERNEL)) == NULL) {
|
||||
ret = -ENOMEM;
|
||||
goto error;
|
||||
}
|
||||
memset(ca->slot_info, 0, sizeof(struct dvb_ca_slot) * slot_count);
|
||||
init_waitqueue_head(&ca->wait_queue);
|
||||
ca->thread_pid = 0;
|
||||
init_waitqueue_head(&ca->thread_queue);
|
||||
|
|
|
@ -1024,13 +1024,12 @@ int dvb_register_frontend(struct dvb_adapter* dvb,
|
|||
if (down_interruptible (&frontend_mutex))
|
||||
return -ERESTARTSYS;
|
||||
|
||||
fe->frontend_priv = kmalloc(sizeof(struct dvb_frontend_private), GFP_KERNEL);
|
||||
fe->frontend_priv = kzalloc(sizeof(struct dvb_frontend_private), GFP_KERNEL);
|
||||
if (fe->frontend_priv == NULL) {
|
||||
up(&frontend_mutex);
|
||||
return -ENOMEM;
|
||||
}
|
||||
fepriv = fe->frontend_priv;
|
||||
memset(fe->frontend_priv, 0, sizeof(struct dvb_frontend_private));
|
||||
|
||||
init_MUTEX (&fepriv->sem);
|
||||
init_waitqueue_head (&fepriv->wait_queue);
|
||||
|
|
|
@ -253,6 +253,26 @@ static int cxusb_dee1601_demod_init(struct dvb_frontend* fe)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int cxusb_mt352_demod_init(struct dvb_frontend* fe)
|
||||
{ /* used in both lgz201 and th7579 */
|
||||
static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x39 };
|
||||
static u8 reset [] = { RESET, 0x80 };
|
||||
static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 };
|
||||
static u8 agc_cfg [] = { AGC_TARGET, 0x24, 0x20 };
|
||||
static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x33 };
|
||||
static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 };
|
||||
|
||||
mt352_write(fe, clock_config, sizeof(clock_config));
|
||||
udelay(200);
|
||||
mt352_write(fe, reset, sizeof(reset));
|
||||
mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
|
||||
|
||||
mt352_write(fe, agc_cfg, sizeof(agc_cfg));
|
||||
mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg));
|
||||
mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct cx22702_config cxusb_cx22702_config = {
|
||||
.demod_address = 0x63,
|
||||
|
||||
|
@ -274,6 +294,13 @@ struct mt352_config cxusb_dee1601_config = {
|
|||
.pll_set = dvb_usb_pll_set,
|
||||
};
|
||||
|
||||
struct mt352_config cxusb_mt352_config = {
|
||||
/* used in both lgz201 and th7579 */
|
||||
.demod_address = 0x0f,
|
||||
.demod_init = cxusb_mt352_demod_init,
|
||||
.pll_set = dvb_usb_pll_set,
|
||||
};
|
||||
|
||||
/* Callbacks for DVB USB */
|
||||
static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_device *d)
|
||||
{
|
||||
|
@ -302,6 +329,20 @@ static int cxusb_dee1601_tuner_attach(struct dvb_usb_device *d)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int cxusb_lgz201_tuner_attach(struct dvb_usb_device *d)
|
||||
{
|
||||
d->pll_addr = 0x61;
|
||||
d->pll_desc = &dvb_pll_lg_z201;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cxusb_dtt7579_tuner_attach(struct dvb_usb_device *d)
|
||||
{
|
||||
d->pll_addr = 0x60;
|
||||
d->pll_desc = &dvb_pll_thomson_dtt7579;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d)
|
||||
{
|
||||
u8 b;
|
||||
|
@ -329,6 +370,19 @@ static int cxusb_lgdt330x_frontend_attach(struct dvb_usb_device *d)
|
|||
return -EIO;
|
||||
}
|
||||
|
||||
static int cxusb_mt352_frontend_attach(struct dvb_usb_device *d)
|
||||
{ /* used in both lgz201 and th7579 */
|
||||
if (usb_set_interface(d->udev,0,0) < 0)
|
||||
err("set interface failed");
|
||||
|
||||
cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);
|
||||
|
||||
if ((d->fe = mt352_attach(&cxusb_mt352_config, &d->i2c_adap)) != NULL)
|
||||
return 0;
|
||||
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
static int cxusb_dee1601_frontend_attach(struct dvb_usb_device *d)
|
||||
{
|
||||
if (usb_set_interface(d->udev,0,0) < 0)
|
||||
|
@ -370,13 +424,17 @@ static int bluebird_patch_dvico_firmware_download(struct usb_device *udev, const
|
|||
static struct dvb_usb_properties cxusb_medion_properties;
|
||||
static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties;
|
||||
static struct dvb_usb_properties cxusb_bluebird_dee1601_properties;
|
||||
static struct dvb_usb_properties cxusb_bluebird_lgz201_properties;
|
||||
static struct dvb_usb_properties cxusb_bluebird_dtt7579_properties;
|
||||
|
||||
static int cxusb_probe(struct usb_interface *intf,
|
||||
const struct usb_device_id *id)
|
||||
{
|
||||
if (dvb_usb_device_init(intf,&cxusb_medion_properties,THIS_MODULE,NULL) == 0 ||
|
||||
dvb_usb_device_init(intf,&cxusb_bluebird_lgh064f_properties,THIS_MODULE,NULL) == 0 ||
|
||||
dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL) == 0) {
|
||||
dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL) == 0 ||
|
||||
dvb_usb_device_init(intf,&cxusb_bluebird_lgz201_properties,THIS_MODULE,NULL) == 0 ||
|
||||
dvb_usb_device_init(intf,&cxusb_bluebird_dtt7579_properties,THIS_MODULE,NULL) == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -389,6 +447,12 @@ static struct usb_device_id cxusb_table [] = {
|
|||
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_WARM) },
|
||||
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_COLD) },
|
||||
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_WARM) },
|
||||
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LGZ201_COLD) },
|
||||
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LGZ201_WARM) },
|
||||
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_TH7579_COLD) },
|
||||
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_TH7579_WARM) },
|
||||
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DIGITALNOW_BLUEBIRD_DEE1601_COLD) },
|
||||
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DIGITALNOW_BLUEBIRD_DEE1601_WARM) },
|
||||
{} /* Terminating entry */
|
||||
};
|
||||
MODULE_DEVICE_TABLE (usb, cxusb_table);
|
||||
|
@ -505,12 +569,96 @@ static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = {
|
|||
}
|
||||
},
|
||||
|
||||
.num_device_descs = 1,
|
||||
.num_device_descs = 2,
|
||||
.devices = {
|
||||
{ "DViCO FusionHDTV DVB-T Dual USB",
|
||||
{ &cxusb_table[3], NULL },
|
||||
{ &cxusb_table[4], NULL },
|
||||
},
|
||||
{ "DigitalNow DVB-T Dual USB",
|
||||
{ &cxusb_table[9], NULL },
|
||||
{ &cxusb_table[10], NULL },
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
static struct dvb_usb_properties cxusb_bluebird_lgz201_properties = {
|
||||
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
|
||||
|
||||
.usb_ctrl = DEVICE_SPECIFIC,
|
||||
.firmware = "dvb-usb-bluebird-01.fw",
|
||||
.download_firmware = bluebird_patch_dvico_firmware_download,
|
||||
/* use usb alt setting 0 for EP4 transfer (dvb-t),
|
||||
use usb alt setting 7 for EP2 transfer (atsc) */
|
||||
|
||||
.size_of_priv = sizeof(struct cxusb_state),
|
||||
|
||||
.streaming_ctrl = cxusb_streaming_ctrl,
|
||||
.power_ctrl = cxusb_power_ctrl,
|
||||
.frontend_attach = cxusb_mt352_frontend_attach,
|
||||
.tuner_attach = cxusb_lgz201_tuner_attach,
|
||||
|
||||
.i2c_algo = &cxusb_i2c_algo,
|
||||
|
||||
.generic_bulk_ctrl_endpoint = 0x01,
|
||||
/* parameter for the MPEG2-data transfer */
|
||||
.urb = {
|
||||
.type = DVB_USB_BULK,
|
||||
.count = 5,
|
||||
.endpoint = 0x04,
|
||||
.u = {
|
||||
.bulk = {
|
||||
.buffersize = 8192,
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
.num_device_descs = 1,
|
||||
.devices = {
|
||||
{ "DViCO FusionHDTV DVB-T USB (LGZ201)",
|
||||
{ &cxusb_table[5], NULL },
|
||||
{ &cxusb_table[6], NULL },
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
static struct dvb_usb_properties cxusb_bluebird_dtt7579_properties = {
|
||||
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
|
||||
|
||||
.usb_ctrl = DEVICE_SPECIFIC,
|
||||
.firmware = "dvb-usb-bluebird-01.fw",
|
||||
.download_firmware = bluebird_patch_dvico_firmware_download,
|
||||
/* use usb alt setting 0 for EP4 transfer (dvb-t),
|
||||
use usb alt setting 7 for EP2 transfer (atsc) */
|
||||
|
||||
.size_of_priv = sizeof(struct cxusb_state),
|
||||
|
||||
.streaming_ctrl = cxusb_streaming_ctrl,
|
||||
.power_ctrl = cxusb_power_ctrl,
|
||||
.frontend_attach = cxusb_mt352_frontend_attach,
|
||||
.tuner_attach = cxusb_dtt7579_tuner_attach,
|
||||
|
||||
.i2c_algo = &cxusb_i2c_algo,
|
||||
|
||||
.generic_bulk_ctrl_endpoint = 0x01,
|
||||
/* parameter for the MPEG2-data transfer */
|
||||
.urb = {
|
||||
.type = DVB_USB_BULK,
|
||||
.count = 5,
|
||||
.endpoint = 0x04,
|
||||
.u = {
|
||||
.bulk = {
|
||||
.buffersize = 8192,
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
.num_device_descs = 1,
|
||||
.devices = {
|
||||
{ "DViCO FusionHDTV DVB-T USB (TH7579)",
|
||||
{ &cxusb_table[7], NULL },
|
||||
{ &cxusb_table[8], NULL },
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -156,10 +156,9 @@ struct dvb_frontend* dtt200u_fe_attach(struct dvb_usb_device *d)
|
|||
struct dtt200u_fe_state* state = NULL;
|
||||
|
||||
/* allocate memory for the internal state */
|
||||
state = (struct dtt200u_fe_state*) kmalloc(sizeof(struct dtt200u_fe_state), GFP_KERNEL);
|
||||
state = kzalloc(sizeof(struct dtt200u_fe_state), GFP_KERNEL);
|
||||
if (state == NULL)
|
||||
goto error;
|
||||
memset(state,0,sizeof(struct dtt200u_fe_state));
|
||||
|
||||
deb_info("attaching frontend dtt200u\n");
|
||||
|
||||
|
|
|
@ -95,6 +95,8 @@
|
|||
#define USB_PID_DVICO_BLUEBIRD_TH7579_WARM 0xdb11
|
||||
#define USB_PID_DVICO_BLUEBIRD_DEE1601_COLD 0xdb50
|
||||
#define USB_PID_DVICO_BLUEBIRD_DEE1601_WARM 0xdb51
|
||||
#define USB_PID_DIGITALNOW_BLUEBIRD_DEE1601_COLD 0xdb54
|
||||
#define USB_PID_DIGITALNOW_BLUEBIRD_DEE1601_WARM 0xdb55
|
||||
#define USB_PID_MEDION_MD95700 0x0932
|
||||
#define USB_PID_KYE_DVB_T_COLD 0x701e
|
||||
#define USB_PID_KYE_DVB_T_WARM 0x701f
|
||||
|
|
|
@ -154,12 +154,11 @@ int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_properties
|
|||
}
|
||||
|
||||
info("found a '%s' in warm state.",desc->name);
|
||||
d = kmalloc(sizeof(struct dvb_usb_device),GFP_KERNEL);
|
||||
d = kzalloc(sizeof(struct dvb_usb_device),GFP_KERNEL);
|
||||
if (d == NULL) {
|
||||
err("no memory for 'struct dvb_usb_device'");
|
||||
return ret;
|
||||
}
|
||||
memset(d,0,sizeof(struct dvb_usb_device));
|
||||
|
||||
d->udev = udev;
|
||||
memcpy(&d->props,props,sizeof(struct dvb_usb_properties));
|
||||
|
@ -167,13 +166,12 @@ int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_properties
|
|||
d->owner = owner;
|
||||
|
||||
if (d->props.size_of_priv > 0) {
|
||||
d->priv = kmalloc(d->props.size_of_priv,GFP_KERNEL);
|
||||
d->priv = kzalloc(d->props.size_of_priv,GFP_KERNEL);
|
||||
if (d->priv == NULL) {
|
||||
err("no memory for priv in 'struct dvb_usb_device'");
|
||||
kfree(d);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(d->priv,0,d->props.size_of_priv);
|
||||
}
|
||||
|
||||
usb_set_intfdata(intf, d);
|
||||
|
|
|
@ -175,15 +175,13 @@ static int dvb_usb_allocate_stream_buffers(struct dvb_usb_device *d, int num, un
|
|||
|
||||
deb_mem("all in all I will use %lu bytes for streaming\n",num*size);
|
||||
|
||||
if ((d->buf_list = kmalloc(num*sizeof(u8 *), GFP_ATOMIC)) == NULL)
|
||||
if ((d->buf_list = kcalloc(num, sizeof(u8 *), GFP_ATOMIC)) == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
if ((d->dma_addr = kmalloc(num*sizeof(dma_addr_t), GFP_ATOMIC)) == NULL) {
|
||||
if ((d->dma_addr = kcalloc(num, sizeof(dma_addr_t), GFP_ATOMIC)) == NULL) {
|
||||
kfree(d->buf_list);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(d->buf_list,0,num*sizeof(u8 *));
|
||||
memset(d->dma_addr,0,num*sizeof(dma_addr_t));
|
||||
|
||||
d->state |= DVB_USB_STATE_URB_BUF;
|
||||
|
||||
|
@ -285,10 +283,9 @@ int dvb_usb_urb_init(struct dvb_usb_device *d)
|
|||
usb_clear_halt(d->udev,usb_rcvbulkpipe(d->udev,d->props.urb.endpoint));
|
||||
|
||||
/* allocate the array for the data transfer URBs */
|
||||
d->urb_list = kmalloc(d->props.urb.count * sizeof(struct urb *),GFP_KERNEL);
|
||||
d->urb_list = kzalloc(d->props.urb.count * sizeof(struct urb *),GFP_KERNEL);
|
||||
if (d->urb_list == NULL)
|
||||
return -ENOMEM;
|
||||
memset(d->urb_list,0,d->props.urb.count * sizeof(struct urb *));
|
||||
d->state |= DVB_USB_STATE_URB_LIST;
|
||||
|
||||
switch (d->props.urb.type) {
|
||||
|
|
|
@ -281,10 +281,9 @@ static struct dvb_frontend_ops vp702x_fe_ops;
|
|||
|
||||
struct dvb_frontend * vp702x_fe_attach(struct dvb_usb_device *d)
|
||||
{
|
||||
struct vp702x_fe_state *s = kmalloc(sizeof(struct vp702x_fe_state), GFP_KERNEL);
|
||||
struct vp702x_fe_state *s = kzalloc(sizeof(struct vp702x_fe_state), GFP_KERNEL);
|
||||
if (s == NULL)
|
||||
goto error;
|
||||
memset(s,0,sizeof(struct vp702x_fe_state));
|
||||
|
||||
s->d = d;
|
||||
s->fe.ops = &vp702x_fe_ops;
|
||||
|
|
|
@ -145,10 +145,9 @@ static struct dvb_frontend_ops vp7045_fe_ops;
|
|||
|
||||
struct dvb_frontend * vp7045_fe_attach(struct dvb_usb_device *d)
|
||||
{
|
||||
struct vp7045_fe_state *s = kmalloc(sizeof(struct vp7045_fe_state), GFP_KERNEL);
|
||||
struct vp7045_fe_state *s = kzalloc(sizeof(struct vp7045_fe_state), GFP_KERNEL);
|
||||
if (s == NULL)
|
||||
goto error;
|
||||
memset(s,0,sizeof(struct vp7045_fe_state));
|
||||
|
||||
s->d = d;
|
||||
s->fe.ops = &vp7045_fe_ops;
|
||||
|
|
|
@ -782,10 +782,9 @@ struct dvb_frontend* bcm3510_attach(const struct bcm3510_config *config,
|
|||
bcm3510_register_value v;
|
||||
|
||||
/* allocate memory for the internal state */
|
||||
state = kmalloc(sizeof(struct bcm3510_state), GFP_KERNEL);
|
||||
state = kzalloc(sizeof(struct bcm3510_state), GFP_KERNEL);
|
||||
if (state == NULL)
|
||||
goto error;
|
||||
memset(state,0,sizeof(struct bcm3510_state));
|
||||
|
||||
/* setup the state */
|
||||
|
||||
|
|
|
@ -700,10 +700,9 @@ struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config,
|
|||
struct dib3000_state* state = NULL;
|
||||
|
||||
/* allocate memory for the internal state */
|
||||
state = kmalloc(sizeof(struct dib3000_state), GFP_KERNEL);
|
||||
state = kzalloc(sizeof(struct dib3000_state), GFP_KERNEL);
|
||||
if (state == NULL)
|
||||
goto error;
|
||||
memset(state,0,sizeof(struct dib3000_state));
|
||||
|
||||
/* setup the state */
|
||||
state->i2c = i2c;
|
||||
|
|
|
@ -832,10 +832,9 @@ struct dvb_frontend* dib3000mc_attach(const struct dib3000_config* config,
|
|||
u16 devid;
|
||||
|
||||
/* allocate memory for the internal state */
|
||||
state = kmalloc(sizeof(struct dib3000_state), GFP_KERNEL);
|
||||
state = kzalloc(sizeof(struct dib3000_state), GFP_KERNEL);
|
||||
if (state == NULL)
|
||||
goto error;
|
||||
memset(state,0,sizeof(struct dib3000_state));
|
||||
|
||||
/* setup the state */
|
||||
state->i2c = i2c;
|
||||
|
|
|
@ -345,6 +345,23 @@ struct dvb_pll_desc dvb_pll_tbmv30111in = {
|
|||
};
|
||||
EXPORT_SYMBOL(dvb_pll_tbmv30111in);
|
||||
|
||||
/*
|
||||
* Philips SD1878 Tuner.
|
||||
*/
|
||||
struct dvb_pll_desc dvb_pll_philips_sd1878_tda8261 = {
|
||||
.name = "Philips SD1878",
|
||||
.min = 950000,
|
||||
.max = 2150000,
|
||||
.count = 4,
|
||||
.entries = {
|
||||
{ 1250000, 499, 500, 0xc4, 0x00},
|
||||
{ 1550000, 499, 500, 0xc4, 0x40},
|
||||
{ 2050000, 499, 500, 0xc4, 0x80},
|
||||
{ 2150000, 499, 500, 0xc4, 0xc0},
|
||||
},
|
||||
};
|
||||
EXPORT_SYMBOL(dvb_pll_philips_sd1878_tda8261);
|
||||
|
||||
/* ----------------------------------------------------------- */
|
||||
/* code */
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ extern struct dvb_pll_desc dvb_pll_tded4;
|
|||
extern struct dvb_pll_desc dvb_pll_tuv1236d;
|
||||
extern struct dvb_pll_desc dvb_pll_tdhu2;
|
||||
extern struct dvb_pll_desc dvb_pll_tbmv30111in;
|
||||
extern struct dvb_pll_desc dvb_pll_philips_sd1878_tda8261;
|
||||
|
||||
int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf,
|
||||
u32 freq, int bandwidth);
|
||||
|
|
|
@ -714,10 +714,9 @@ struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config,
|
|||
u8 buf[1];
|
||||
|
||||
/* Allocate memory for the internal state */
|
||||
state = (struct lgdt330x_state*) kmalloc(sizeof(struct lgdt330x_state), GFP_KERNEL);
|
||||
state = kzalloc(sizeof(struct lgdt330x_state), GFP_KERNEL);
|
||||
if (state == NULL)
|
||||
goto error;
|
||||
memset(state,0,sizeof(*state));
|
||||
|
||||
/* Setup the state */
|
||||
state->config = config;
|
||||
|
|
|
@ -535,9 +535,8 @@ struct dvb_frontend* mt352_attach(const struct mt352_config* config,
|
|||
struct mt352_state* state = NULL;
|
||||
|
||||
/* allocate memory for the internal state */
|
||||
state = kmalloc(sizeof(struct mt352_state), GFP_KERNEL);
|
||||
state = kzalloc(sizeof(struct mt352_state), GFP_KERNEL);
|
||||
if (state == NULL) goto error;
|
||||
memset(state,0,sizeof(*state));
|
||||
|
||||
/* setup the state */
|
||||
state->i2c = i2c;
|
||||
|
|
|
@ -1110,10 +1110,9 @@ struct dvb_frontend* nxt200x_attach(const struct nxt200x_config* config,
|
|||
u8 buf [] = {0,0,0,0,0};
|
||||
|
||||
/* allocate memory for the internal state */
|
||||
state = (struct nxt200x_state*) kmalloc(sizeof(struct nxt200x_state), GFP_KERNEL);
|
||||
state = kzalloc(sizeof(struct nxt200x_state), GFP_KERNEL);
|
||||
if (state == NULL)
|
||||
goto error;
|
||||
memset(state,0,sizeof(*state));
|
||||
|
||||
/* setup the state */
|
||||
state->config = config;
|
||||
|
|
|
@ -584,11 +584,10 @@ static int __devinit pluto2_probe(struct pci_dev *pdev,
|
|||
struct dmx_demux *dmx;
|
||||
int ret = -ENOMEM;
|
||||
|
||||
pluto = kmalloc(sizeof(struct pluto), GFP_KERNEL);
|
||||
pluto = kzalloc(sizeof(struct pluto), GFP_KERNEL);
|
||||
if (!pluto)
|
||||
goto out;
|
||||
|
||||
memset(pluto, 0, sizeof(struct pluto));
|
||||
pluto->pdev = pdev;
|
||||
|
||||
ret = pci_enable_device(pdev);
|
||||
|
|
|
@ -2565,14 +2565,12 @@ static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d
|
|||
}
|
||||
|
||||
/* prepare the av7110 device struct */
|
||||
av7110 = kmalloc(sizeof(struct av7110), GFP_KERNEL);
|
||||
av7110 = kzalloc(sizeof(struct av7110), GFP_KERNEL);
|
||||
if (!av7110) {
|
||||
dprintk(1, "out of memory\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
memset(av7110, 0, sizeof(struct av7110));
|
||||
|
||||
av7110->card_name = (char*) pci_ext->ext_priv;
|
||||
av7110->dev = dev;
|
||||
dev->ext_priv = av7110;
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "stv0299.h"
|
||||
#include "tda10021.h"
|
||||
#include "tda1004x.h"
|
||||
#include "dvb-pll.h"
|
||||
#include <media/saa7146_vv.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/errno.h>
|
||||
|
@ -864,8 +865,117 @@ static struct tda1004x_config philips_tu1216_config = {
|
|||
.request_firmware = philips_tu1216_request_firmware,
|
||||
};
|
||||
|
||||
static u8 philips_sd1878_inittab[] = {
|
||||
0x01, 0x15,
|
||||
0x02, 0x30,
|
||||
0x03, 0x00,
|
||||
0x04, 0x7d,
|
||||
0x05, 0x35,
|
||||
0x06, 0x40,
|
||||
0x07, 0x00,
|
||||
0x08, 0x43,
|
||||
0x09, 0x02,
|
||||
0x0C, 0x51,
|
||||
0x0D, 0x82,
|
||||
0x0E, 0x23,
|
||||
0x10, 0x3f,
|
||||
0x11, 0x84,
|
||||
0x12, 0xb9,
|
||||
0x15, 0xc9,
|
||||
0x16, 0x19,
|
||||
0x17, 0x8c,
|
||||
0x18, 0x59,
|
||||
0x19, 0xf8,
|
||||
0x1a, 0xfe,
|
||||
0x1c, 0x7f,
|
||||
0x1d, 0x00,
|
||||
0x1e, 0x00,
|
||||
0x1f, 0x50,
|
||||
0x20, 0x00,
|
||||
0x21, 0x00,
|
||||
0x22, 0x00,
|
||||
0x23, 0x00,
|
||||
0x28, 0x00,
|
||||
0x29, 0x28,
|
||||
0x2a, 0x14,
|
||||
0x2b, 0x0f,
|
||||
0x2c, 0x09,
|
||||
0x2d, 0x09,
|
||||
0x31, 0x1f,
|
||||
0x32, 0x19,
|
||||
0x33, 0xfc,
|
||||
0x34, 0x93,
|
||||
0xff, 0xff
|
||||
};
|
||||
|
||||
static int philips_sd1878_tda8261_pll_set(struct dvb_frontend *fe,
|
||||
struct i2c_adapter *i2c,
|
||||
struct dvb_frontend_parameters *params)
|
||||
{
|
||||
u8 buf[4];
|
||||
int rc;
|
||||
struct i2c_msg tuner_msg = {.addr=0x60,.flags=0,.buf=buf,.len=sizeof(buf)};
|
||||
|
||||
if((params->frequency < 950000) || (params->frequency > 2150000))
|
||||
return -EINVAL;
|
||||
|
||||
rc=dvb_pll_configure(&dvb_pll_philips_sd1878_tda8261, buf,
|
||||
params->frequency, 0);
|
||||
if(rc < 0) return rc;
|
||||
|
||||
if(i2c_transfer(i2c, &tuner_msg, 1) != 1)
|
||||
return -EIO;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int philips_sd1878_ci_set_symbol_rate(struct dvb_frontend *fe,
|
||||
u32 srate, u32 ratio)
|
||||
{
|
||||
u8 aclk = 0;
|
||||
u8 bclk = 0;
|
||||
u8 m1;
|
||||
|
||||
aclk = 0xb5;
|
||||
if (srate < 2000000)
|
||||
bclk = 0x86;
|
||||
else if (srate < 5000000)
|
||||
bclk = 0x89;
|
||||
else if (srate < 15000000)
|
||||
bclk = 0x8f;
|
||||
else if (srate < 45000000)
|
||||
bclk = 0x95;
|
||||
|
||||
m1 = 0x14;
|
||||
if (srate < 4000000)
|
||||
m1 = 0x10;
|
||||
|
||||
stv0299_writereg(fe, 0x0e, 0x23);
|
||||
stv0299_writereg(fe, 0x0f, 0x94);
|
||||
stv0299_writereg(fe, 0x10, 0x39);
|
||||
stv0299_writereg(fe, 0x13, aclk);
|
||||
stv0299_writereg(fe, 0x14, bclk);
|
||||
stv0299_writereg(fe, 0x15, 0xc9);
|
||||
stv0299_writereg(fe, 0x1f, (ratio >> 16) & 0xff);
|
||||
stv0299_writereg(fe, 0x20, (ratio >> 8) & 0xff);
|
||||
stv0299_writereg(fe, 0x21, (ratio) & 0xf0);
|
||||
stv0299_writereg(fe, 0x0f, 0x80 | m1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct stv0299_config philips_sd1878_config = {
|
||||
.demod_address = 0x68,
|
||||
.inittab = philips_sd1878_inittab,
|
||||
.mclk = 88000000UL,
|
||||
.invert = 0,
|
||||
.skip_reinit = 0,
|
||||
.lock_output = STV0229_LOCKOUTPUT_1,
|
||||
.volt13_op0_op1 = STV0299_VOLT13_OP0,
|
||||
.min_delay_ms = 100,
|
||||
.set_symbol_rate = philips_sd1878_ci_set_symbol_rate,
|
||||
.pll_set = philips_sd1878_tda8261_pll_set,
|
||||
};
|
||||
|
||||
static u8 read_pwm(struct budget_av *budget_av)
|
||||
{
|
||||
|
@ -886,7 +996,10 @@ static u8 read_pwm(struct budget_av *budget_av)
|
|||
#define SUBID_DVBS_KNC1_PLUS 0x0011
|
||||
#define SUBID_DVBS_TYPHOON 0x4f56
|
||||
#define SUBID_DVBS_CINERGY1200 0x1154
|
||||
#define SUBID_DVBS_CYNERGY1200N 0x1155
|
||||
|
||||
#define SUBID_DVBS_TV_STAR 0x0014
|
||||
#define SUBID_DVBS_TV_STAR_CI 0x0016
|
||||
#define SUBID_DVBC_KNC1 0x0020
|
||||
#define SUBID_DVBC_KNC1_PLUS 0x0021
|
||||
#define SUBID_DVBC_CINERGY1200 0x1156
|
||||
|
@ -922,6 +1035,13 @@ static void frontend_init(struct budget_av *budget_av)
|
|||
}
|
||||
break;
|
||||
|
||||
case SUBID_DVBS_TV_STAR:
|
||||
case SUBID_DVBS_TV_STAR_CI:
|
||||
case SUBID_DVBS_CYNERGY1200N:
|
||||
fe = stv0299_attach(&philips_sd1878_config,
|
||||
&budget_av->budget.i2c_adap);
|
||||
break;
|
||||
|
||||
case SUBID_DVBS_KNC1_PLUS:
|
||||
case SUBID_DVBS_TYPHOON:
|
||||
fe = stv0299_attach(&typhoon_config,
|
||||
|
@ -1027,11 +1147,9 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio
|
|||
|
||||
dprintk(2, "dev: %p\n", dev);
|
||||
|
||||
if (!(budget_av = kmalloc(sizeof(struct budget_av), GFP_KERNEL)))
|
||||
if (!(budget_av = kzalloc(sizeof(struct budget_av), GFP_KERNEL)))
|
||||
return -ENOMEM;
|
||||
|
||||
memset(budget_av, 0, sizeof(struct budget_av));
|
||||
|
||||
budget_av->has_saa7113 = 0;
|
||||
budget_av->budget.ci_present = 0;
|
||||
|
||||
|
@ -1166,10 +1284,12 @@ static struct saa7146_extension budget_extension;
|
|||
MAKE_BUDGET_INFO(knc1s, "KNC1 DVB-S", BUDGET_KNC1S);
|
||||
MAKE_BUDGET_INFO(knc1c, "KNC1 DVB-C", BUDGET_KNC1C);
|
||||
MAKE_BUDGET_INFO(knc1t, "KNC1 DVB-T", BUDGET_KNC1T);
|
||||
MAKE_BUDGET_INFO(kncxs, "KNC TV STAR DVB-S", BUDGET_TVSTAR);
|
||||
MAKE_BUDGET_INFO(knc1sp, "KNC1 DVB-S Plus", BUDGET_KNC1SP);
|
||||
MAKE_BUDGET_INFO(knc1cp, "KNC1 DVB-C Plus", BUDGET_KNC1CP);
|
||||
MAKE_BUDGET_INFO(knc1tp, "KNC1 DVB-T Plus", BUDGET_KNC1TP);
|
||||
MAKE_BUDGET_INFO(cin1200s, "TerraTec Cinergy 1200 DVB-S", BUDGET_CIN1200S);
|
||||
MAKE_BUDGET_INFO(cin1200sn, "TerraTec Cinergy 1200 DVB-S", BUDGET_CIN1200S);
|
||||
MAKE_BUDGET_INFO(cin1200c, "Terratec Cinergy 1200 DVB-C", BUDGET_CIN1200C);
|
||||
MAKE_BUDGET_INFO(cin1200t, "Terratec Cinergy 1200 DVB-T", BUDGET_CIN1200T);
|
||||
|
||||
|
@ -1178,11 +1298,14 @@ static struct pci_device_id pci_tbl[] = {
|
|||
MAKE_EXTENSION_PCI(knc1s, 0x1131, 0x0010),
|
||||
MAKE_EXTENSION_PCI(knc1s, 0x1894, 0x0010),
|
||||
MAKE_EXTENSION_PCI(knc1sp, 0x1131, 0x0011),
|
||||
MAKE_EXTENSION_PCI(kncxs, 0x1894, 0x0014),
|
||||
MAKE_EXTENSION_PCI(kncxs, 0x1894, 0x0016),
|
||||
MAKE_EXTENSION_PCI(knc1c, 0x1894, 0x0020),
|
||||
MAKE_EXTENSION_PCI(knc1cp, 0x1894, 0x0021),
|
||||
MAKE_EXTENSION_PCI(knc1t, 0x1894, 0x0030),
|
||||
MAKE_EXTENSION_PCI(knc1tp, 0x1894, 0x0031),
|
||||
MAKE_EXTENSION_PCI(cin1200s, 0x153b, 0x1154),
|
||||
MAKE_EXTENSION_PCI(cin1200sn, 0x153b, 0x1155),
|
||||
MAKE_EXTENSION_PCI(cin1200c, 0x153b, 0x1156),
|
||||
MAKE_EXTENSION_PCI(cin1200t, 0x153b, 0x1157),
|
||||
{
|
||||
|
|
|
@ -95,6 +95,7 @@ static struct saa7146_pci_extension_data x_var = { \
|
|||
#define BUDGET_KNC1SP 11
|
||||
#define BUDGET_KNC1CP 12
|
||||
#define BUDGET_KNC1TP 13
|
||||
#define BUDGET_TVSTAR 14
|
||||
|
||||
#define BUDGET_VIDEO_PORTA 0
|
||||
#define BUDGET_VIDEO_PORTB 1
|
||||
|
|
|
@ -1489,11 +1489,9 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i
|
|||
|
||||
if (intf->altsetting->desc.bInterfaceNumber != 1) return -ENODEV;
|
||||
|
||||
if (!(ttusb = kmalloc(sizeof(struct ttusb), GFP_KERNEL)))
|
||||
if (!(ttusb = kzalloc(sizeof(struct ttusb), GFP_KERNEL)))
|
||||
return -ENOMEM;
|
||||
|
||||
memset(ttusb, 0, sizeof(struct ttusb));
|
||||
|
||||
ttusb->dev = udev;
|
||||
ttusb->c = 0;
|
||||
ttusb->mux_state = 0;
|
||||
|
|
|
@ -1606,15 +1606,13 @@ static int ttusb_dec_probe(struct usb_interface *intf,
|
|||
|
||||
udev = interface_to_usbdev(intf);
|
||||
|
||||
if (!(dec = kmalloc(sizeof(struct ttusb_dec), GFP_KERNEL))) {
|
||||
if (!(dec = kzalloc(sizeof(struct ttusb_dec), GFP_KERNEL))) {
|
||||
printk("%s: couldn't allocate memory.\n", __FUNCTION__);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
usb_set_intfdata(intf, (void *)dec);
|
||||
|
||||
memset(dec, 0, sizeof(struct ttusb_dec));
|
||||
|
||||
switch (le16_to_cpu(id->idProduct)) {
|
||||
case 0x1006:
|
||||
ttusb_dec_set_model(dec, TTUSB_DEC3000S);
|
||||
|
|
|
@ -318,11 +318,10 @@ static int __devinit gemtek_pci_probe( struct pci_dev *pci_dev, const struct pci
|
|||
struct gemtek_pci_card *card;
|
||||
struct video_device *devradio;
|
||||
|
||||
if ( (card = kmalloc( sizeof( struct gemtek_pci_card ), GFP_KERNEL )) == NULL ) {
|
||||
if ( (card = kzalloc( sizeof( struct gemtek_pci_card ), GFP_KERNEL )) == NULL ) {
|
||||
printk( KERN_ERR "gemtek_pci: out of memory\n" );
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset( card, 0, sizeof( struct gemtek_pci_card ) );
|
||||
|
||||
if ( pci_enable_device( pci_dev ) )
|
||||
goto err_pci;
|
||||
|
|
|
@ -183,7 +183,7 @@ config VIDEO_STRADIS
|
|||
help
|
||||
Say Y here to enable support for the Stradis 4:2:2 MPEG-2 video
|
||||
driver for PCI. There is a product page at
|
||||
<http://www.stradis.com/decoder.html>.
|
||||
<http://www.stradis.com/>.
|
||||
|
||||
config VIDEO_ZORAN
|
||||
tristate "Zoran ZR36057/36067 Video For Linux"
|
||||
|
|
|
@ -413,10 +413,9 @@ adv7170_detect_client (struct i2c_adapter *adapter,
|
|||
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
|
||||
return 0;
|
||||
|
||||
client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
if (client == 0)
|
||||
return -ENOMEM;
|
||||
memset(client, 0, sizeof(struct i2c_client));
|
||||
client->addr = address;
|
||||
client->adapter = adapter;
|
||||
client->driver = &i2c_driver_adv7170;
|
||||
|
@ -433,12 +432,11 @@ adv7170_detect_client (struct i2c_adapter *adapter,
|
|||
}
|
||||
strlcpy(I2C_NAME(client), dname, sizeof(I2C_NAME(client)));
|
||||
|
||||
encoder = kmalloc(sizeof(struct adv7170), GFP_KERNEL);
|
||||
encoder = kzalloc(sizeof(struct adv7170), GFP_KERNEL);
|
||||
if (encoder == NULL) {
|
||||
kfree(client);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(encoder, 0, sizeof(struct adv7170));
|
||||
encoder->norm = VIDEO_MODE_NTSC;
|
||||
encoder->input = 0;
|
||||
encoder->enable = 1;
|
||||
|
|
|
@ -463,10 +463,9 @@ adv7175_detect_client (struct i2c_adapter *adapter,
|
|||
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
|
||||
return 0;
|
||||
|
||||
client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
if (client == 0)
|
||||
return -ENOMEM;
|
||||
memset(client, 0, sizeof(struct i2c_client));
|
||||
client->addr = address;
|
||||
client->adapter = adapter;
|
||||
client->driver = &i2c_driver_adv7175;
|
||||
|
@ -483,12 +482,11 @@ adv7175_detect_client (struct i2c_adapter *adapter,
|
|||
}
|
||||
strlcpy(I2C_NAME(client), dname, sizeof(I2C_NAME(client)));
|
||||
|
||||
encoder = kmalloc(sizeof(struct adv7175), GFP_KERNEL);
|
||||
encoder = kzalloc(sizeof(struct adv7175), GFP_KERNEL);
|
||||
if (encoder == NULL) {
|
||||
kfree(client);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(encoder, 0, sizeof(struct adv7175));
|
||||
encoder->norm = VIDEO_MODE_PAL;
|
||||
encoder->input = 0;
|
||||
encoder->enable = 1;
|
||||
|
|
|
@ -528,21 +528,18 @@ bt819_detect_client (struct i2c_adapter *adapter,
|
|||
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
|
||||
return 0;
|
||||
|
||||
client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
if (client == 0)
|
||||
return -ENOMEM;
|
||||
memset(client, 0, sizeof(struct i2c_client));
|
||||
client->addr = address;
|
||||
client->adapter = adapter;
|
||||
client->driver = &i2c_driver_bt819;
|
||||
|
||||
decoder = kmalloc(sizeof(struct bt819), GFP_KERNEL);
|
||||
decoder = kzalloc(sizeof(struct bt819), GFP_KERNEL);
|
||||
if (decoder == NULL) {
|
||||
kfree(client);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
memset(decoder, 0, sizeof(struct bt819));
|
||||
decoder->norm = VIDEO_MODE_NTSC;
|
||||
decoder->input = 0;
|
||||
decoder->enable = 1;
|
||||
|
|
|
@ -75,13 +75,13 @@ int bt832_hexdump(struct i2c_client *i2c_client_s, unsigned char *buf)
|
|||
|
||||
if(debug>1) {
|
||||
int i;
|
||||
v4l_dbg(2,i2c_client_s,"hexdump:");
|
||||
v4l_dbg(2, debug,i2c_client_s,"hexdump:");
|
||||
for(i=1;i<65;i++) {
|
||||
if(i!=1) {
|
||||
if(((i-1)%8)==0) printk(" ");
|
||||
if(((i-1)%16)==0) {
|
||||
printk("\n");
|
||||
v4l_dbg(2,i2c_client_s,"hexdump:");
|
||||
v4l_dbg(2, debug,i2c_client_s,"hexdump:");
|
||||
}
|
||||
}
|
||||
printk(" %02x",buf[i]);
|
||||
|
@ -167,9 +167,8 @@ static int bt832_attach(struct i2c_adapter *adap, int addr, int kind)
|
|||
client_template.adapter = adap;
|
||||
client_template.addr = addr;
|
||||
|
||||
if (NULL == (t = kmalloc(sizeof(*t), GFP_KERNEL)))
|
||||
if (NULL == (t = kzalloc(sizeof(*t), GFP_KERNEL)))
|
||||
return -ENOMEM;
|
||||
memset(t,0,sizeof(*t));
|
||||
t->client = client_template;
|
||||
i2c_set_clientdata(&t->client, t);
|
||||
i2c_attach_client(&t->client);
|
||||
|
|
|
@ -316,21 +316,19 @@ bt856_detect_client (struct i2c_adapter *adapter,
|
|||
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
|
||||
return 0;
|
||||
|
||||
client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
if (client == 0)
|
||||
return -ENOMEM;
|
||||
memset(client, 0, sizeof(struct i2c_client));
|
||||
client->addr = address;
|
||||
client->adapter = adapter;
|
||||
client->driver = &i2c_driver_bt856;
|
||||
strlcpy(I2C_NAME(client), "bt856", sizeof(I2C_NAME(client)));
|
||||
|
||||
encoder = kmalloc(sizeof(struct bt856), GFP_KERNEL);
|
||||
encoder = kzalloc(sizeof(struct bt856), GFP_KERNEL);
|
||||
if (encoder == NULL) {
|
||||
kfree(client);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(encoder, 0, sizeof(struct bt856));
|
||||
encoder->norm = VIDEO_MODE_NTSC;
|
||||
encoder->enable = 1;
|
||||
i2c_set_clientdata(client, encoder);
|
||||
|
|
|
@ -321,7 +321,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.audio_inputs = 1,
|
||||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.muxsel = { 2, 3, 1, 0},
|
||||
.muxsel = { 2, 3, 1, 0 },
|
||||
.tuner_type = -1,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
.radio_addr = ADDR_UNSET,
|
||||
|
@ -333,8 +333,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 15,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 2, 0, 0, 0, 10},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 2, 0, 0, 0, 10 },
|
||||
.needs_tvaudio = 1,
|
||||
.tuner_type = -1,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -347,8 +347,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 7,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 0, 1, 2, 3, 4},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0, 1, 2, 3, 4 },
|
||||
.needs_tvaudio = 1,
|
||||
.tuner_type = -1,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -361,8 +361,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 7,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 4, 0, 2, 3, 1},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 4, 0, 2, 3, 1 },
|
||||
.no_msp34xx = 1,
|
||||
.needs_tvaudio = 1,
|
||||
.tuner_type = TUNER_PHILIPS_NTSC,
|
||||
|
@ -380,7 +380,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = -1,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0 },
|
||||
.needs_tvaudio = 0,
|
||||
.tuner_type = 4,
|
||||
|
@ -394,8 +394,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 3,
|
||||
.muxsel = { 2, 3, 1, 0},
|
||||
.audiomux = { 0, 1, 0, 1, 3},
|
||||
.muxsel = { 2, 3, 1, 0 },
|
||||
.audiomux = { 0, 1, 0, 1, 3 },
|
||||
.needs_tvaudio = 1,
|
||||
.tuner_type = -1,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -407,9 +407,9 @@ struct tvcard bttv_tvcards[] = {
|
|||
.audio_inputs = 1,
|
||||
.tuner = 0,
|
||||
.svhs = 3,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.gpiomask = 0x0f,
|
||||
.audiomux = { 0x0c, 0x04, 0x08, 0x04, 0},
|
||||
.audiomux = { 0x0c, 0x04, 0x08, 0x04, 0 },
|
||||
/* 0x04 for some cards ?? */
|
||||
.needs_tvaudio = 1,
|
||||
.tuner_type = -1,
|
||||
|
@ -425,8 +425,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = -1,
|
||||
.svhs = 3,
|
||||
.gpiomask = 0,
|
||||
.muxsel = { 2, 3, 1, 0, 0},
|
||||
.audiomux = {0 },
|
||||
.muxsel = { 2, 3, 1, 0, 0 },
|
||||
.audiomux = { 0 },
|
||||
.needs_tvaudio = 1,
|
||||
.tuner_type = -1,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -441,8 +441,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0xc00,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 0, 0xc00, 0x800, 0x400, 0xc00, 0},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0, 0xc00, 0x800, 0x400, 0xc00, 0 },
|
||||
.needs_tvaudio = 1,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = -1,
|
||||
|
@ -456,8 +456,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 3,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 1, 1, 2, 3, 0},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 1, 1, 2, 3, 0 },
|
||||
.needs_tvaudio = 0,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = TUNER_TEMIC_PAL,
|
||||
|
@ -471,8 +471,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x0f, /* old: 7 */
|
||||
.muxsel = { 2, 0, 1, 1},
|
||||
.audiomux = { 0, 1, 2, 3, 4},
|
||||
.muxsel = { 2, 0, 1, 1 },
|
||||
.audiomux = { 0, 1, 2, 3, 4 },
|
||||
.needs_tvaudio = 1,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = -1,
|
||||
|
@ -486,8 +486,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x3014f,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 0x20001,0x10001, 0, 0,10},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0x20001,0x10001, 0, 0,10 },
|
||||
.needs_tvaudio = 1,
|
||||
.tuner_type = -1,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -502,8 +502,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 15,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 13, 14, 11, 7, 0, 0},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 13, 14, 11, 7, 0, 0 },
|
||||
.needs_tvaudio = 1,
|
||||
.tuner_type = -1,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -516,8 +516,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 15,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 13, 14, 11, 7, 0, 0},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 13, 14, 11, 7, 0, 0 },
|
||||
.needs_tvaudio = 1,
|
||||
.msp34xx_alt = 1,
|
||||
.pll = PLL_28,
|
||||
|
@ -534,8 +534,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 7,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 0, 2, 1, 3, 4}, /* old: { 0, 1, 2, 3, 4} */
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0, 2, 1, 3, 4 }, /* old: {0, 1, 2, 3, 4} */
|
||||
.needs_tvaudio = 1,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = -1,
|
||||
|
@ -549,8 +549,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 15,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = {0 , 0, 1 , 0, 10},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0 , 0, 1 , 0, 10 },
|
||||
.needs_tvaudio = 1,
|
||||
.tuner_type = -1,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -565,7 +565,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x01fe00,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
#if 0
|
||||
/* old */
|
||||
.audiomux = { 0x01c000, 0, 0x018000, 0x014000, 0x002000, 0 },
|
||||
|
@ -584,8 +584,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x8300f8,
|
||||
.muxsel = { 2, 3, 1, 1,0},
|
||||
.audiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007},
|
||||
.muxsel = { 2, 3, 1, 1,0 },
|
||||
.audiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007 },
|
||||
.needs_tvaudio = 1,
|
||||
.tuner_type = -1,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -600,8 +600,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0,
|
||||
.muxsel = {2, 3, 1, 1},
|
||||
.audiomux = {1, 0, 0, 0, 0},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 1, 0, 0, 0, 0 },
|
||||
.needs_tvaudio = 1,
|
||||
.tuner_type = -1,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -614,7 +614,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = -1,
|
||||
.svhs = -1,
|
||||
.gpiomask = 0x8dff00,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0 },
|
||||
.no_msp34xx = 1,
|
||||
.tuner_type = -1,
|
||||
|
@ -629,7 +629,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.audio_inputs = 3,
|
||||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.muxsel = {2, 3, 1, 1},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.tuner_type = -1,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
.radio_addr = ADDR_UNSET,
|
||||
|
@ -641,8 +641,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x1800,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800 },
|
||||
.pll = PLL_28,
|
||||
.tuner_type = TUNER_PHILIPS_PAL_I,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -655,8 +655,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0xc00,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = {0, 1, 0x800, 0x400, 0xc00, 0},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0, 1, 0x800, 0x400, 0xc00, 0 },
|
||||
.needs_tvaudio = 1,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = -1,
|
||||
|
@ -688,8 +688,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0xe00,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = {0x400, 0x400, 0x400, 0x400, 0xc00},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = {0x400, 0x400, 0x400, 0x400, 0xc00 },
|
||||
.needs_tvaudio = 1,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = -1,
|
||||
|
@ -704,8 +704,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x1f0fff,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 0x20000, 0x30000, 0x10000, 0, 0x40000},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0x20000, 0x30000, 0x10000, 0, 0x40000 },
|
||||
.needs_tvaudio = 0,
|
||||
.tuner_type = TUNER_PHILIPS_PAL,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -719,8 +719,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 3,
|
||||
.gpiomask = 7,
|
||||
.muxsel = { 2, 0, 1, 1},
|
||||
.audiomux = { 0, 1, 2, 3, 4},
|
||||
.muxsel = { 2, 0, 1, 1 },
|
||||
.audiomux = { 0, 1, 2, 3, 4 },
|
||||
.needs_tvaudio = 1,
|
||||
.tuner_type = -1,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -733,8 +733,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x1800,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800 },
|
||||
.pll = PLL_28,
|
||||
.tuner_type = TUNER_PHILIPS_SECAM,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -749,8 +749,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x1f0fff,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 0x20000, 0x30000, 0x10000, 0x00000, 0x40000},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0x20000, 0x30000, 0x10000, 0x00000, 0x40000 },
|
||||
.needs_tvaudio = 0,
|
||||
.tuner_type = TUNER_PHILIPS_PAL,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -812,7 +812,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x1800, /* 0x8dfe00 */
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0, 0x0800, 0x1000, 0x1000, 0x1800, 0 },
|
||||
.pll = PLL_28,
|
||||
.tuner_type = -1,
|
||||
|
@ -826,7 +826,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 3,
|
||||
.gpiomask = 1,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 1, 0, 0, 0, 0 },
|
||||
.pll = PLL_28,
|
||||
.tuner_type = TUNER_PHILIPS_PAL,
|
||||
|
@ -842,7 +842,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = -1,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0 },
|
||||
.needs_tvaudio = 0,
|
||||
.tuner_type = 4,
|
||||
|
@ -856,8 +856,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0xffff00,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 0x500, 0, 0x300, 0x900, 0x900},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0x500, 0, 0x300, 0x900, 0x900 },
|
||||
.needs_tvaudio = 1,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = TUNER_PHILIPS_PAL,
|
||||
|
@ -870,7 +870,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.audio_inputs = 1,
|
||||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.muxsel = { 2, 3, 1, 1, 0}, /* TV, CVid, SVid, CVid over SVid connector */
|
||||
.muxsel = { 2, 3, 1, 1, 0 }, /* TV, CVid, SVid, CVid over SVid connector */
|
||||
#if 0
|
||||
.gpiomask = 0xc33000,
|
||||
.audiomux = { 0x422000,0x1000,0x0000,0x620000,0x800000 },
|
||||
|
@ -906,8 +906,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x1800,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800 },
|
||||
.pll = PLL_28,
|
||||
.tuner_type = -1,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -922,7 +922,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x1800,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800, 0 },
|
||||
.pll = PLL_28,
|
||||
.tuner_type = -1,
|
||||
|
@ -952,7 +952,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x551e00,
|
||||
.muxsel = { 2, 3, 1, 0},
|
||||
.muxsel = { 2, 3, 1, 0 },
|
||||
.audiomux = { 0x551400, 0x551200, 0, 0, 0x551c00, 0x551200 },
|
||||
.needs_tvaudio = 1,
|
||||
.pll = PLL_28,
|
||||
|
@ -968,8 +968,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x03000F,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 2, 0xd0001, 0, 0, 1},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 2, 0xd0001, 0, 0, 1 },
|
||||
.needs_tvaudio = 0,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = -1,
|
||||
|
@ -985,8 +985,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 7,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 4, 0, 2, 3, 1},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 4, 0, 2, 3, 1 },
|
||||
.no_msp34xx = 1,
|
||||
.needs_tvaudio = 1,
|
||||
.tuner_type = TUNER_PHILIPS_NTSC,
|
||||
|
@ -1002,8 +1002,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 15,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 13, 4, 11, 7, 0, 0},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 13, 4, 11, 7, 0, 0 },
|
||||
.needs_tvaudio = 1,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = -1,
|
||||
|
@ -1035,8 +1035,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0xe00b,
|
||||
.muxsel = {2, 3, 1, 1},
|
||||
.audiomux = {0xff9ff6, 0xff9ff6, 0xff1ff7, 0, 0xff3ffc},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0, 0xff3ffc },
|
||||
.no_msp34xx = 1,
|
||||
.tuner_type = -1,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -1051,8 +1051,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = -1,
|
||||
.gpiomask = 3,
|
||||
.muxsel = {2, 3, 1, 1},
|
||||
.audiomux = {1, 1, 0, 2, 3},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 1, 1, 0, 2, 3 },
|
||||
.no_msp34xx = 1,
|
||||
.pll = PLL_NONE,
|
||||
.tuner_type = -1,
|
||||
|
@ -1066,8 +1066,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = -1,
|
||||
.svhs = 3,
|
||||
.gpiomask = 0,
|
||||
.muxsel = { 2, 3, 1, 0, 0},
|
||||
.audiomux = {0 },
|
||||
.muxsel = { 2, 3, 1, 0, 0 },
|
||||
.audiomux = { 0 },
|
||||
.no_msp34xx = 1,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = -1,
|
||||
|
@ -1081,8 +1081,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0xbcf03f,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0, 0xbcb03f},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0, 0xbcb03f },
|
||||
.no_msp34xx = 1,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = 21,
|
||||
|
@ -1096,7 +1096,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x70000,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0x20000, 0x30000, 0x10000, 0, 0x40000, 0x20000 },
|
||||
.needs_tvaudio = 1,
|
||||
.no_msp34xx = 1,
|
||||
|
@ -1115,8 +1115,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 15,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = {2,0,0,0,1},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = {2,0,0,0,1 },
|
||||
.needs_tvaudio = 1,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = -1,
|
||||
|
@ -1130,8 +1130,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x010f00,
|
||||
.muxsel = {2, 3, 0, 0},
|
||||
.audiomux = {0x10000, 0, 0x10000, 0, 0, 0},
|
||||
.muxsel = {2, 3, 0, 0 },
|
||||
.audiomux = {0x10000, 0, 0x10000, 0, 0, 0 },
|
||||
.no_msp34xx = 1,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = TUNER_ALPS_TSHC6_NTSC,
|
||||
|
@ -1172,8 +1172,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 7,
|
||||
.muxsel = { 2, 0, 1, 1},
|
||||
.audiomux = { 0, 1, 2, 3, 4},
|
||||
.muxsel = { 2, 0, 1, 1 },
|
||||
.audiomux = { 0, 1, 2, 3, 4 },
|
||||
.pll = PLL_28,
|
||||
.tuner_type = -1 /* TUNER_ALPS_TMDH2_NTSC */,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -1189,8 +1189,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 3,
|
||||
.gpiomask = 0x03000F,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 1, 0xd0001, 0, 0, 10},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 1, 0xd0001, 0, 0, 10 },
|
||||
/* sound path (5 sources):
|
||||
MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
|
||||
0= ext. Audio IN
|
||||
|
@ -1215,7 +1215,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x1c,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0, 0, 0x10, 8, 4 },
|
||||
.needs_tvaudio = 1,
|
||||
.pll = PLL_28,
|
||||
|
@ -1236,7 +1236,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x18e0,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0x0000,0x0800,0x1000,0x1000,0x18e0 },
|
||||
/* For cards with tda9820/tda9821:
|
||||
0x0000: Tuner normal stereo
|
||||
|
@ -1256,8 +1256,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0xF,
|
||||
.muxsel = { 2, 3, 1, 0},
|
||||
.audiomux = { 2, 0, 0, 0, 10},
|
||||
.muxsel = { 2, 3, 1, 0 },
|
||||
.audiomux = { 2, 0, 0, 0, 10 },
|
||||
.needs_tvaudio = 0,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = TUNER_TEMIC_PAL,
|
||||
|
@ -1274,7 +1274,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x1800,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800, 0 },
|
||||
.pll = PLL_28,
|
||||
.tuner_type = 5,
|
||||
|
@ -1324,8 +1324,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x03000F,
|
||||
.muxsel = { 2, 3, 1, 0},
|
||||
.audiomux = { 2,0,0,0,1 },
|
||||
.muxsel = { 2, 3, 1, 0 },
|
||||
.audiomux = { 2, 0, 0, 0, 1 },
|
||||
.pll = PLL_28,
|
||||
.tuner_type = 0,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -1341,8 +1341,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = -1,
|
||||
.gpiomask = 11,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 2, 0, 0, 1, 8},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 2, 0, 0, 1, 8 },
|
||||
.pll = PLL_35,
|
||||
.tuner_type = TUNER_TEMIC_PAL,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -1356,7 +1356,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = -1,
|
||||
.svhs = 1,
|
||||
.gpiomask = 0xF,
|
||||
.muxsel = { 2, 2},
|
||||
.muxsel = { 2, 2 },
|
||||
.audiomux = { },
|
||||
.no_msp34xx = 1,
|
||||
.needs_tvaudio = 0,
|
||||
|
@ -1375,8 +1375,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0xFF,
|
||||
.muxsel = { 2, 3, 1, 0},
|
||||
.audiomux = { 1, 0, 4, 4, 9},
|
||||
.muxsel = { 2, 3, 1, 0 },
|
||||
.audiomux = { 1, 0, 4, 4, 9 },
|
||||
.needs_tvaudio = 0,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = TUNER_PHILIPS_PAL,
|
||||
|
@ -1392,7 +1392,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.svhs = 2,
|
||||
.gpiomask = 0xf03f,
|
||||
.muxsel = { 2, 3, 1, 0 },
|
||||
.audiomux = { 0xbffe, 0, 0xbfff, 0, 0xbffe},
|
||||
.audiomux = { 0xbffe, 0, 0xbfff, 0, 0xbffe },
|
||||
.pll = PLL_28,
|
||||
.tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -1408,8 +1408,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = -1,
|
||||
.gpiomask = 1,
|
||||
.muxsel = { 2, 3, 0, 1},
|
||||
.audiomux = { 0, 0, 1, 0, 0},
|
||||
.muxsel = { 2, 3, 0, 1 },
|
||||
.audiomux = { 0, 0, 1, 0, 0 },
|
||||
.no_msp34xx = 1,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
|
||||
|
@ -1424,7 +1424,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x18e0,
|
||||
.muxsel = { 2, 3, 0, 1},
|
||||
.muxsel = { 2, 3, 0, 1 },
|
||||
/* Radio changed from 1e80 to 0x800 to make
|
||||
FlyVideo2000S in .hu happy (gm)*/
|
||||
/* -dk-???: set mute=0x1800 for tda9874h daughterboard */
|
||||
|
@ -1445,8 +1445,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0xffff00,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 0x500, 0x500, 0x300, 0x900, 0x900},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0x500, 0x500, 0x300, 0x900, 0x900 },
|
||||
.needs_tvaudio = 1,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = TUNER_PHILIPS_PAL,
|
||||
|
@ -1462,8 +1462,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x010f00,
|
||||
.muxsel = {2, 3, 0, 0},
|
||||
.audiomux = {0x10000, 0, 0x10000, 0, 0, 0},
|
||||
.muxsel = {2, 3, 0, 0 },
|
||||
.audiomux = {0x10000, 0, 0x10000, 0, 0, 0 },
|
||||
.no_msp34xx = 1,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
|
||||
|
@ -1487,7 +1487,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.audiomux = {0x947fff, 0x987fff,0x947fff,0x947fff, 0x947fff},
|
||||
/* tvtuner, radio, external,internal, mute, stereo
|
||||
* tuner, Composit, SVid, Composit-on-Svid-adapter */
|
||||
.muxsel = { 2, 3 ,0 ,1},
|
||||
.muxsel = { 2, 3 ,0 ,1 },
|
||||
.tuner_type = TUNER_MT2032,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
.radio_addr = ADDR_UNSET,
|
||||
|
@ -1515,8 +1515,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 15,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 0, 0, 11, 7, 13, 0}, /* TV and Radio with same GPIO ! */
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0, 0, 11, 7, 13, 0 }, /* TV and Radio with same GPIO ! */
|
||||
.needs_tvaudio = 1,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = 25,
|
||||
|
@ -1537,7 +1537,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.audio_inputs = 0,
|
||||
.tuner = -1,
|
||||
.svhs = 2,
|
||||
.muxsel = { 2, 3, 1, 1}, /* AV1, AV2, SVHS, CVid adapter on SVHS */
|
||||
.muxsel = { 2, 3, 1, 1 }, /* AV1, AV2, SVHS, CVid adapter on SVHS */
|
||||
.pll = PLL_28,
|
||||
.no_msp34xx = 1,
|
||||
.tuner_type = UNSET,
|
||||
|
@ -1583,7 +1583,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = -1,
|
||||
.svhs = 4,
|
||||
.gpiomask = 0,
|
||||
.muxsel = { 2, 3, 1, 0, 0},
|
||||
.muxsel = { 2, 3, 1, 0, 0 },
|
||||
.audiomux = { 0 },
|
||||
.needs_tvaudio = 0,
|
||||
.tuner_type = -1,
|
||||
|
@ -1696,7 +1696,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.name = "DSP Design TCVIDEO",
|
||||
.video_inputs = 4,
|
||||
.svhs = -1,
|
||||
.muxsel = { 2, 3, 1, 0},
|
||||
.muxsel = { 2, 3, 1, 0 },
|
||||
.pll = PLL_28,
|
||||
.tuner_type = -1,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -1710,7 +1710,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.audio_inputs = 1,
|
||||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.muxsel = { 2, 0, 1, 1},
|
||||
.muxsel = { 2, 0, 1, 1 },
|
||||
.needs_tvaudio = 1,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = -1,
|
||||
|
@ -1727,7 +1727,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x0f0f80,
|
||||
.muxsel = {2, 3, 1, 0},
|
||||
.muxsel = {2, 3, 1, 0 },
|
||||
.audiomux = {0x030000, 0x010000, 0, 0, 0x020000, 0},
|
||||
.no_msp34xx = 1,
|
||||
.pll = PLL_28,
|
||||
|
@ -1944,7 +1944,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.no_msp34xx = 1,
|
||||
.no_tda9875 = 1,
|
||||
.no_tda7432 = 1,
|
||||
.muxsel = { 3, 0, 1, 2},
|
||||
.muxsel = { 3, 0, 1, 2 },
|
||||
.pll = PLL_28,
|
||||
.no_gpioirq = 1,
|
||||
.has_dvb = 1,
|
||||
|
@ -1957,7 +1957,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.svhs = 3,
|
||||
.gpiomask = 2,
|
||||
/* TV, Comp1, Composite over SVID con, SVID */
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 2, 2, 0, 0, 0 },
|
||||
.pll = PLL_28,
|
||||
.has_radio = 1,
|
||||
|
@ -2074,7 +2074,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.audio_inputs = 1,
|
||||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.muxsel = { 2, 3, 1, 1}, /* Tuner, CVid, SVid, CVid over SVid connector */
|
||||
.muxsel = { 2, 3, 1, 1 }, /* Tuner, CVid, SVid, CVid over SVid connector */
|
||||
.gpiomask = 0,
|
||||
.no_tda9875 = 1,
|
||||
.no_tda7432 = 1,
|
||||
|
@ -2128,7 +2128,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.video_inputs = 1,
|
||||
.tuner = -1,
|
||||
.svhs = -1,
|
||||
.muxsel = { 2, 3, 1, 0},
|
||||
.muxsel = { 2, 3, 1, 0 },
|
||||
.no_msp34xx = 1,
|
||||
.no_tda9875 = 1,
|
||||
.no_tda7432 = 1,
|
||||
|
@ -2166,7 +2166,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = -1, /* card has no tuner */
|
||||
.svhs = 3,
|
||||
.gpiomask = 0x00,
|
||||
.muxsel = { 2, 3, 1, 0},
|
||||
.muxsel = { 2, 3, 1, 0 },
|
||||
.audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
|
||||
.needs_tvaudio = 1,
|
||||
.pll = PLL_28,
|
||||
|
@ -2181,7 +2181,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = -1, /* card has no tuner */
|
||||
.svhs = 3,
|
||||
.gpiomask = 0x00,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
|
||||
.needs_tvaudio = 1,
|
||||
.pll = PLL_28,
|
||||
|
@ -2268,7 +2268,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.audio_inputs = 1,
|
||||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.muxsel = { 2, 3, 1, 0},
|
||||
.muxsel = { 2, 3, 1, 0 },
|
||||
.tuner_type = TUNER_PHILIPS_ATSC,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
.radio_addr = ADDR_UNSET,
|
||||
|
@ -2291,7 +2291,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.audio_inputs = 0,
|
||||
.svhs = 1,
|
||||
.tuner = -1,
|
||||
.muxsel = { 3, 1, 1, 3}, /* Vid In, SVid In, Vid over SVid in connector */
|
||||
.muxsel = { 3, 1, 1, 3 }, /* Vid In, SVid In, Vid over SVid in connector */
|
||||
.no_msp34xx = 1,
|
||||
.no_tda9875 = 1,
|
||||
.no_tda7432 = 1,
|
||||
|
@ -2307,8 +2307,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 3,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 1, 1, 1, 1, 0},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 1, 1, 1, 1, 0 },
|
||||
.needs_tvaudio = 1,
|
||||
.tuner_type = TUNER_PHILIPS_PAL,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -2327,7 +2327,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner_addr = ADDR_UNSET,
|
||||
.radio_addr = ADDR_UNSET,
|
||||
.pll = PLL_28,
|
||||
.muxsel = { 2, 2, 2, 2},
|
||||
.muxsel = { 2, 2, 2, 2 },
|
||||
.gpiomask = 0x3F,
|
||||
.muxsel_hook = gvc1100_muxsel,
|
||||
},
|
||||
|
@ -2338,8 +2338,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x008007,
|
||||
.muxsel = {2, 3, 0, 0},
|
||||
.audiomux = {0, 0, 0, 0, 0x000003, 0},
|
||||
.muxsel = { 2, 3, 0, 0 },
|
||||
.audiomux = { 0, 0, 0, 0, 0x000003, 0 },
|
||||
.pll = PLL_28,
|
||||
.tuner_type = TUNER_PHILIPS_PAL,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
|
@ -2374,7 +2374,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.svhs = 2,
|
||||
.needs_tvaudio = 0,
|
||||
.gpiomask = 0x68,
|
||||
.muxsel = { 2, 3, 1},
|
||||
.muxsel = { 2, 3, 1 },
|
||||
.audiomux = { 0x68, 0x68, 0x61, 0x61, 0x00 },
|
||||
.pll = PLL_28,
|
||||
},
|
||||
|
@ -2433,7 +2433,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.svhs = 2,
|
||||
.gpiomask = 0x0000000f,
|
||||
.muxsel = { 2, 1, 1 },
|
||||
.audiomux = { 0x02, 0x00, 0x00, 0x00, 0x00},
|
||||
.audiomux = { 0x02, 0x00, 0x00, 0x00, 0x00 },
|
||||
.tuner_type = TUNER_TEMIC_PAL,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
.radio_addr = ADDR_UNSET,
|
||||
|
@ -2466,7 +2466,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.video_inputs = 2,
|
||||
.tuner = -1,
|
||||
.svhs = 1,
|
||||
.muxsel = { 3, 1, 2, 0}, /* Comp0, S-Video, ?, ? */
|
||||
.muxsel = { 3, 1, 2, 0 }, /* Comp0, S-Video, ?, ? */
|
||||
.no_msp34xx = 1,
|
||||
.no_tda9875 = 1,
|
||||
.no_tda7432 = 1,
|
||||
|
@ -2523,8 +2523,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = -1,
|
||||
.gpiomask = 0xFF,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 2, 0, 0, 0, 10},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 2, 0, 0, 0, 10 },
|
||||
.needs_tvaudio = 0,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = TUNER_PHILIPS_PAL,
|
||||
|
@ -2557,8 +2557,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x3f,
|
||||
.muxsel = {2, 3, 1, 0},
|
||||
.audiomux = {0x31, 0x31, 0x31, 0x31, 0x31, 0x31},
|
||||
.muxsel = {2, 3, 1, 0 },
|
||||
.audiomux = {0x31, 0x31, 0x31, 0x31, 0x31, 0x31 },
|
||||
.no_msp34xx = 1,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = TUNER_PHILIPS_NTSC_M,
|
||||
|
@ -2576,12 +2576,12 @@ struct tvcard bttv_tvcards[] = {
|
|||
.audio_inputs = 1,
|
||||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.muxsel = { 2, 3, 1, 0},
|
||||
.muxsel = { 2, 3, 1, 0 },
|
||||
.tuner_type = TUNER_PHILIPS_NTSC,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
.radio_addr = ADDR_UNSET,
|
||||
.gpiomask = 0x008007,
|
||||
.audiomux = { 0, 0x000001,0,0, 0},
|
||||
.audiomux = { 0, 0x000001,0,0, 0 },
|
||||
.needs_tvaudio = 1,
|
||||
.has_radio = 1,
|
||||
},
|
||||
|
@ -2672,7 +2672,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.audio_inputs = 1,
|
||||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.muxsel = { 2, 3, 1, 0},
|
||||
.muxsel = { 2, 3, 1, 0 },
|
||||
.tuner_type = -1,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
.radio_addr = ADDR_UNSET,
|
||||
|
@ -2706,7 +2706,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x01fe00,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0x001e00, 0, 0x018000, 0x014000, 0x002000, 0 },
|
||||
.needs_tvaudio = 1,
|
||||
.pll = PLL_28,
|
||||
|
@ -2794,8 +2794,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 15,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = {2,0,0,0,1},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 2, 0, 0, 0, 1 },
|
||||
.needs_tvaudio = 1,
|
||||
.pll = PLL_28,
|
||||
.tuner_type = 2,
|
||||
|
@ -2810,8 +2810,8 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 0x108007,
|
||||
.muxsel = { 2, 3, 1, 1},
|
||||
.audiomux = { 100000, 100002, 100002, 100000},
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 100000, 100002, 100002, 100000 },
|
||||
.no_msp34xx = 1,
|
||||
.no_tda9875 = 1,
|
||||
.no_tda7432 = 1,
|
||||
|
@ -2828,7 +2828,7 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner = -1,
|
||||
.svhs = -1,
|
||||
.gpiomask = 0x0f, /* old: 7 */
|
||||
.muxsel = { 0, 1, 3, 2}, /* Composite 0-3 */
|
||||
.muxsel = { 0, 1, 3, 2 }, /* Composite 0-3 */
|
||||
.no_msp34xx = 1,
|
||||
.no_tda9875 = 1,
|
||||
.no_tda7432 = 1,
|
||||
|
@ -2836,6 +2836,29 @@ struct tvcard bttv_tvcards[] = {
|
|||
.tuner_addr = ADDR_UNSET,
|
||||
.radio_addr = ADDR_UNSET,
|
||||
},
|
||||
[BTTV_BOARD_MACHTV_MAGICTV] = {
|
||||
/* Julian Calaby <julian.calaby@gmail.com>
|
||||
* Slightly different from original MachTV definition (0x60)
|
||||
|
||||
* FIXME: RegSpy says gpiomask should be "0x001c800f", but it
|
||||
* stuffs up remote chip. Bug is a pin on the jaecs is not set
|
||||
* properly (methinks) causing no keyup bits being set */
|
||||
|
||||
.name = "MagicTV", /* rebranded MachTV */
|
||||
.video_inputs = 3,
|
||||
.audio_inputs = 1,
|
||||
.tuner = 0,
|
||||
.svhs = 2,
|
||||
.gpiomask = 7,
|
||||
.muxsel = { 2, 3, 1, 1 },
|
||||
.audiomux = { 0, 1, 2, 3, 4 },
|
||||
.tuner_type = TUNER_TEMIC_4009FR5_PAL,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
.radio_addr = ADDR_UNSET,
|
||||
.pll = PLL_28,
|
||||
.has_radio = 1,
|
||||
.has_remote = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
|
||||
|
|
|
@ -64,10 +64,9 @@ int bttv_sub_add_device(struct bttv_core *core, char *name)
|
|||
struct bttv_sub_device *sub;
|
||||
int err;
|
||||
|
||||
sub = kmalloc(sizeof(*sub),GFP_KERNEL);
|
||||
sub = kzalloc(sizeof(*sub),GFP_KERNEL);
|
||||
if (NULL == sub)
|
||||
return -ENOMEM;
|
||||
memset(sub,0,sizeof(*sub));
|
||||
|
||||
sub->core = core;
|
||||
sub->dev.parent = &core->pci->dev;
|
||||
|
|
|
@ -583,6 +583,12 @@ int bttv_input_init(struct bttv *btv)
|
|||
btv->custom_irq = bttv_rc5_irq;
|
||||
ir->rc5_gpio = 1;
|
||||
break;
|
||||
case BTTV_BOARD_MACHTV_MAGICTV:
|
||||
ir_codes = ir_codes_apac_viewcomp;
|
||||
ir->mask_keycode = 0x001F00;
|
||||
ir->mask_keyup = 0x004000;
|
||||
ir->polling = 50; /* ms */
|
||||
break;
|
||||
}
|
||||
if (NULL == ir_codes) {
|
||||
dprintk(KERN_INFO "Ooops: IR config error [card=%d]\n",btv->c.type);
|
||||
|
|
|
@ -166,6 +166,7 @@
|
|||
#define BTTV_BOARD_ASOUND_SKYEYE 0x8d
|
||||
#define BTTV_BOARD_SABRENT_TVFM 0x8e
|
||||
#define BTTV_BOARD_HAUPPAUGE_IMPACTVCB 0x8f
|
||||
#define BTTV_BOARD_MACHTV_MAGICTV 0x90
|
||||
|
||||
/* i2c address list */
|
||||
#define I2C_TSA5522 0xc2
|
||||
|
|
|
@ -18,8 +18,11 @@
|
|||
#include <linux/videodev2.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <media/v4l2-common.h>
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
|
||||
|
||||
struct video_tuner32 {
|
||||
compat_int_t tuner;
|
||||
char name[32];
|
||||
|
@ -30,27 +33,29 @@ struct video_tuner32 {
|
|||
|
||||
static int get_video_tuner32(struct video_tuner *kp, struct video_tuner32 __user *up)
|
||||
{
|
||||
if(get_user(kp->tuner, &up->tuner))
|
||||
if(!access_ok(VERIFY_READ, up, sizeof(struct video_tuner32)) ||
|
||||
get_user(kp->tuner, &up->tuner) ||
|
||||
copy_from_user(kp->name, up->name, 32) ||
|
||||
get_user(kp->rangelow, &up->rangelow) ||
|
||||
get_user(kp->rangehigh, &up->rangehigh) ||
|
||||
get_user(kp->flags, &up->flags) ||
|
||||
get_user(kp->mode, &up->mode) ||
|
||||
get_user(kp->signal, &up->signal))
|
||||
return -EFAULT;
|
||||
__copy_from_user(kp->name, up->name, 32);
|
||||
__get_user(kp->rangelow, &up->rangelow);
|
||||
__get_user(kp->rangehigh, &up->rangehigh);
|
||||
__get_user(kp->flags, &up->flags);
|
||||
__get_user(kp->mode, &up->mode);
|
||||
__get_user(kp->signal, &up->signal);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int put_video_tuner32(struct video_tuner *kp, struct video_tuner32 __user *up)
|
||||
{
|
||||
if(put_user(kp->tuner, &up->tuner))
|
||||
if(!access_ok(VERIFY_WRITE, up, sizeof(struct video_tuner32)) ||
|
||||
put_user(kp->tuner, &up->tuner) ||
|
||||
copy_to_user(up->name, kp->name, 32) ||
|
||||
put_user(kp->rangelow, &up->rangelow) ||
|
||||
put_user(kp->rangehigh, &up->rangehigh) ||
|
||||
put_user(kp->flags, &up->flags) ||
|
||||
put_user(kp->mode, &up->mode) ||
|
||||
put_user(kp->signal, &up->signal))
|
||||
return -EFAULT;
|
||||
__copy_to_user(up->name, kp->name, 32);
|
||||
__put_user(kp->rangelow, &up->rangelow);
|
||||
__put_user(kp->rangehigh, &up->rangehigh);
|
||||
__put_user(kp->flags, &up->flags);
|
||||
__put_user(kp->mode, &up->mode);
|
||||
__put_user(kp->signal, &up->signal);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -63,7 +68,12 @@ static int get_video_buffer32(struct video_buffer *kp, struct video_buffer32 __u
|
|||
{
|
||||
u32 tmp;
|
||||
|
||||
if (get_user(tmp, &up->base))
|
||||
if (!access_ok(VERIFY_READ, up, sizeof(struct video_buffer32)) ||
|
||||
get_user(tmp, &up->base) ||
|
||||
get_user(kp->height, &up->height) ||
|
||||
get_user(kp->width, &up->width) ||
|
||||
get_user(kp->depth, &up->depth) ||
|
||||
get_user(kp->bytesperline, &up->bytesperline))
|
||||
return -EFAULT;
|
||||
|
||||
/* This is actually a physical address stored
|
||||
|
@ -71,10 +81,6 @@ static int get_video_buffer32(struct video_buffer *kp, struct video_buffer32 __u
|
|||
*/
|
||||
kp->base = (void *)(unsigned long) tmp;
|
||||
|
||||
__get_user(kp->height, &up->height);
|
||||
__get_user(kp->width, &up->width);
|
||||
__get_user(kp->depth, &up->depth);
|
||||
__get_user(kp->bytesperline, &up->bytesperline);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -82,12 +88,13 @@ static int put_video_buffer32(struct video_buffer *kp, struct video_buffer32 __u
|
|||
{
|
||||
u32 tmp = (u32)((unsigned long)kp->base);
|
||||
|
||||
if(put_user(tmp, &up->base))
|
||||
if(!access_ok(VERIFY_WRITE, up, sizeof(struct video_buffer32)) ||
|
||||
put_user(tmp, &up->base) ||
|
||||
put_user(kp->height, &up->height) ||
|
||||
put_user(kp->width, &up->width) ||
|
||||
put_user(kp->depth, &up->depth) ||
|
||||
put_user(kp->bytesperline, &up->bytesperline))
|
||||
return -EFAULT;
|
||||
__put_user(kp->height, &up->height);
|
||||
__put_user(kp->width, &up->width);
|
||||
__put_user(kp->depth, &up->depth);
|
||||
__put_user(kp->bytesperline, &up->bytesperline);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -121,14 +128,15 @@ static int native_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
|||
/* You get back everything except the clips... */
|
||||
static int put_video_window32(struct video_window *kp, struct video_window32 __user *up)
|
||||
{
|
||||
if(put_user(kp->x, &up->x))
|
||||
if(!access_ok(VERIFY_WRITE, up, sizeof(struct video_window32)) ||
|
||||
put_user(kp->x, &up->x) ||
|
||||
put_user(kp->y, &up->y) ||
|
||||
put_user(kp->width, &up->width) ||
|
||||
put_user(kp->height, &up->height) ||
|
||||
put_user(kp->chromakey, &up->chromakey) ||
|
||||
put_user(kp->flags, &up->flags) ||
|
||||
put_user(kp->clipcount, &up->clipcount))
|
||||
return -EFAULT;
|
||||
__put_user(kp->y, &up->y);
|
||||
__put_user(kp->width, &up->width);
|
||||
__put_user(kp->height, &up->height);
|
||||
__put_user(kp->chromakey, &up->chromakey);
|
||||
__put_user(kp->flags, &up->flags);
|
||||
__put_user(kp->clipcount, &up->clipcount);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -150,11 +158,12 @@ struct v4l2_window32
|
|||
|
||||
static int get_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user *up)
|
||||
{
|
||||
if (copy_from_user(&kp->w, &up->w, sizeof(up->w)))
|
||||
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_window32)) ||
|
||||
copy_from_user(&kp->w, &up->w, sizeof(up->w)) ||
|
||||
get_user(kp->field, &up->field) ||
|
||||
get_user(kp->chromakey, &up->chromakey) ||
|
||||
get_user(kp->clipcount, &up->clipcount))
|
||||
return -EFAULT;
|
||||
__get_user(kp->field, &up->field);
|
||||
__get_user(kp->chromakey, &up->chromakey);
|
||||
__get_user(kp->clipcount, &up->clipcount);
|
||||
if (kp->clipcount > 2048)
|
||||
return -EINVAL;
|
||||
if (kp->clipcount) {
|
||||
|
@ -165,7 +174,9 @@ static int get_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user
|
|||
kclips = compat_alloc_user_space(n * sizeof(struct v4l2_clip));
|
||||
kp->clips = kclips;
|
||||
while (--n >= 0) {
|
||||
copy_from_user(&kclips->c, &uclips->c, sizeof(uclips->c));
|
||||
if (!access_ok(VERIFY_READ, &uclips->c, sizeof(uclips->c)) ||
|
||||
copy_from_user(&kclips->c, &uclips->c, sizeof(uclips->c)))
|
||||
return -EFAULT;
|
||||
kclips->next = n ? kclips + 1 : 0;
|
||||
uclips += 1;
|
||||
kclips += 1;
|
||||
|
@ -177,32 +188,45 @@ static int get_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user
|
|||
|
||||
static int put_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user *up)
|
||||
{
|
||||
if (copy_to_user(&up->w, &kp->w, sizeof(up->w)))
|
||||
if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_window32)) ||
|
||||
copy_to_user(&up->w, &kp->w, sizeof(up->w)) ||
|
||||
put_user(kp->field, &up->field) ||
|
||||
put_user(kp->chromakey, &up->chromakey) ||
|
||||
put_user(kp->clipcount, &up->clipcount))
|
||||
return -EFAULT;
|
||||
__put_user(kp->field, &up->field);
|
||||
__put_user(kp->chromakey, &up->chromakey);
|
||||
__put_user(kp->clipcount, &up->clipcount);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int get_v4l2_pix_format(struct v4l2_pix_format *kp, struct v4l2_pix_format __user *up)
|
||||
{
|
||||
return copy_from_user(kp, up, sizeof(struct v4l2_pix_format));
|
||||
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_pix_format)) ||
|
||||
copy_from_user(kp, up, sizeof(struct v4l2_pix_format)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int put_v4l2_pix_format(struct v4l2_pix_format *kp, struct v4l2_pix_format __user *up)
|
||||
{
|
||||
return copy_to_user(up, kp, sizeof(struct v4l2_pix_format));
|
||||
if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_pix_format)) ||
|
||||
copy_to_user(up, kp, sizeof(struct v4l2_pix_format)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int get_v4l2_vbi_format(struct v4l2_vbi_format *kp, struct v4l2_vbi_format __user *up)
|
||||
{
|
||||
return copy_from_user(kp, up, sizeof(struct v4l2_vbi_format));
|
||||
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_vbi_format)) ||
|
||||
copy_from_user(kp, up, sizeof(struct v4l2_vbi_format)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int put_v4l2_vbi_format(struct v4l2_vbi_format *kp, struct v4l2_vbi_format __user *up)
|
||||
{
|
||||
return copy_to_user(up, kp, sizeof(struct v4l2_vbi_format));
|
||||
if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_vbi_format)) ||
|
||||
copy_to_user(up, kp, sizeof(struct v4l2_vbi_format)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct v4l2_format32
|
||||
|
@ -219,7 +243,8 @@ struct v4l2_format32
|
|||
|
||||
static int get_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __user *up)
|
||||
{
|
||||
if(get_user(kp->type, &up->type))
|
||||
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_format32)) ||
|
||||
get_user(kp->type, &up->type))
|
||||
return -EFAULT;
|
||||
switch (kp->type) {
|
||||
case V4L2_BUF_TYPE_VIDEO_CAPTURE:
|
||||
|
@ -237,7 +262,8 @@ static int get_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __user
|
|||
|
||||
static int put_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __user *up)
|
||||
{
|
||||
if(put_user(kp->type, &up->type))
|
||||
if(!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_format32)) ||
|
||||
put_user(kp->type, &up->type))
|
||||
return -EFAULT;
|
||||
switch (kp->type) {
|
||||
case V4L2_BUF_TYPE_VIDEO_CAPTURE:
|
||||
|
@ -251,6 +277,23 @@ static int put_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __user
|
|||
}
|
||||
}
|
||||
|
||||
static inline int get_v4l2_standard(struct v4l2_standard *kp, struct v4l2_standard __user *up)
|
||||
{
|
||||
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_standard)) ||
|
||||
copy_from_user(kp, up, sizeof(struct v4l2_standard)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
static inline int put_v4l2_standard(struct v4l2_standard *kp, struct v4l2_standard __user *up)
|
||||
{
|
||||
if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_standard)) ||
|
||||
copy_to_user(up, kp, sizeof(struct v4l2_standard)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct v4l2_standard32
|
||||
{
|
||||
__u32 index;
|
||||
|
@ -264,18 +307,39 @@ struct v4l2_standard32
|
|||
static int get_v4l2_standard32(struct v4l2_standard *kp, struct v4l2_standard32 __user *up)
|
||||
{
|
||||
/* other fields are not set by the user, nor used by the driver */
|
||||
return get_user(kp->index, &up->index);
|
||||
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_standard32)) ||
|
||||
get_user(kp->index, &up->index))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int put_v4l2_standard32(struct v4l2_standard *kp, struct v4l2_standard32 __user *up)
|
||||
{
|
||||
if(put_user(kp->index, &up->index))
|
||||
if(!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_standard32)) ||
|
||||
put_user(kp->index, &up->index) ||
|
||||
copy_to_user(up->id, &kp->id, sizeof(__u64)) ||
|
||||
copy_to_user(up->name, kp->name, 24) ||
|
||||
copy_to_user(&up->frameperiod, &kp->frameperiod, sizeof(kp->frameperiod)) ||
|
||||
put_user(kp->framelines, &up->framelines) ||
|
||||
copy_to_user(up->reserved, kp->reserved, 4 * sizeof(__u32)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int get_v4l2_tuner(struct v4l2_tuner *kp, struct v4l2_tuner __user *up)
|
||||
{
|
||||
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_tuner)) ||
|
||||
copy_from_user(kp, up, sizeof(struct v4l2_tuner)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
static inline int put_v4l2_tuner(struct v4l2_tuner *kp, struct v4l2_tuner __user *up)
|
||||
{
|
||||
if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_tuner)) ||
|
||||
copy_to_user(up, kp, sizeof(struct v4l2_tuner)))
|
||||
return -EFAULT;
|
||||
__copy_to_user(up->id, &kp->id, sizeof(__u64));
|
||||
__copy_to_user(up->name, kp->name, 24);
|
||||
__put_user(kp->frameperiod, &up->frameperiod);
|
||||
__put_user(kp->framelines, &up->framelines);
|
||||
__copy_to_user(up->reserved, kp->reserved, 4 * sizeof(__u32));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -304,12 +368,13 @@ struct v4l2_buffer32
|
|||
static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user *up)
|
||||
{
|
||||
|
||||
if (get_user(kp->index, &up->index))
|
||||
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_buffer32)) ||
|
||||
get_user(kp->index, &up->index) ||
|
||||
get_user(kp->type, &up->type) ||
|
||||
get_user(kp->flags, &up->flags) ||
|
||||
get_user(kp->memory, &up->memory) ||
|
||||
get_user(kp->input, &up->input))
|
||||
return -EFAULT;
|
||||
__get_user(kp->type, &up->type);
|
||||
__get_user(kp->flags, &up->flags);
|
||||
__get_user(kp->memory, &up->memory);
|
||||
__get_user(kp->input, &up->input);
|
||||
switch(kp->memory) {
|
||||
case V4L2_MEMORY_MMAP:
|
||||
break;
|
||||
|
@ -317,12 +382,14 @@ static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user
|
|||
{
|
||||
unsigned long tmp = (unsigned long)compat_ptr(up->m.userptr);
|
||||
|
||||
__get_user(kp->length, &up->length);
|
||||
__get_user(kp->m.userptr, &tmp);
|
||||
if(get_user(kp->length, &up->length) ||
|
||||
get_user(kp->m.userptr, &tmp))
|
||||
return -EFAULT;
|
||||
}
|
||||
break;
|
||||
case V4L2_MEMORY_OVERLAY:
|
||||
__get_user(kp->m.offset, &up->m.offset);
|
||||
if(get_user(kp->m.offset, &up->m.offset))
|
||||
return -EFAULT;
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
@ -330,32 +397,37 @@ static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user
|
|||
|
||||
static int put_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user *up)
|
||||
{
|
||||
if (put_user(kp->index, &up->index))
|
||||
if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_buffer32)) ||
|
||||
put_user(kp->index, &up->index) ||
|
||||
put_user(kp->type, &up->type) ||
|
||||
put_user(kp->flags, &up->flags) ||
|
||||
put_user(kp->memory, &up->memory) ||
|
||||
put_user(kp->input, &up->input))
|
||||
return -EFAULT;
|
||||
__put_user(kp->type, &up->type);
|
||||
__put_user(kp->flags, &up->flags);
|
||||
__put_user(kp->memory, &up->memory);
|
||||
__put_user(kp->input, &up->input);
|
||||
switch(kp->memory) {
|
||||
case V4L2_MEMORY_MMAP:
|
||||
__put_user(kp->length, &up->length);
|
||||
__put_user(kp->m.offset, &up->m.offset);
|
||||
if (put_user(kp->length, &up->length) ||
|
||||
put_user(kp->m.offset, &up->m.offset))
|
||||
return -EFAULT;
|
||||
break;
|
||||
case V4L2_MEMORY_USERPTR:
|
||||
__put_user(kp->length, &up->length);
|
||||
__put_user(kp->m.userptr, &up->m.userptr);
|
||||
if (put_user(kp->length, &up->length) ||
|
||||
put_user(kp->m.userptr, &up->m.userptr))
|
||||
return -EFAULT;
|
||||
break;
|
||||
case V4L2_MEMORY_OVERLAY:
|
||||
__put_user(kp->m.offset, &up->m.offset);
|
||||
if (put_user(kp->m.offset, &up->m.offset))
|
||||
return -EFAULT;
|
||||
break;
|
||||
}
|
||||
__put_user(kp->bytesused, &up->bytesused);
|
||||
__put_user(kp->field, &up->field);
|
||||
__put_user(kp->timestamp.tv_sec, &up->timestamp.tv_sec);
|
||||
__put_user(kp->timestamp.tv_usec, &up->timestamp.tv_usec);
|
||||
__copy_to_user(&up->timecode, &kp->timecode, sizeof(struct v4l2_timecode));
|
||||
__put_user(kp->sequence, &up->sequence);
|
||||
__put_user(kp->reserved, &up->reserved);
|
||||
if (put_user(kp->bytesused, &up->bytesused) ||
|
||||
put_user(kp->field, &up->field) ||
|
||||
put_user(kp->timestamp.tv_sec, &up->timestamp.tv_sec) ||
|
||||
put_user(kp->timestamp.tv_usec, &up->timestamp.tv_usec) ||
|
||||
copy_to_user(&up->timecode, &kp->timecode, sizeof(struct v4l2_timecode)) ||
|
||||
put_user(kp->sequence, &up->sequence) ||
|
||||
put_user(kp->reserved, &up->reserved))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -371,11 +443,12 @@ static int get_v4l2_framebuffer32(struct v4l2_framebuffer *kp, struct v4l2_frame
|
|||
{
|
||||
u32 tmp;
|
||||
|
||||
if (get_user(tmp, &up->base))
|
||||
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_framebuffer32)) ||
|
||||
get_user(tmp, &up->base) ||
|
||||
get_user(kp->capability, &up->capability) ||
|
||||
get_user(kp->flags, &up->flags))
|
||||
return -EFAULT;
|
||||
kp->base = compat_ptr(tmp);
|
||||
__get_user(kp->capability, &up->capability);
|
||||
__get_user(kp->flags, &up->flags);
|
||||
get_v4l2_pix_format(&kp->fmt, &up->fmt);
|
||||
return 0;
|
||||
}
|
||||
|
@ -384,25 +457,46 @@ static int put_v4l2_framebuffer32(struct v4l2_framebuffer *kp, struct v4l2_frame
|
|||
{
|
||||
u32 tmp = (u32)((unsigned long)kp->base);
|
||||
|
||||
if(put_user(tmp, &up->base))
|
||||
if(!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_framebuffer32)) ||
|
||||
put_user(tmp, &up->base) ||
|
||||
put_user(kp->capability, &up->capability) ||
|
||||
put_user(kp->flags, &up->flags))
|
||||
return -EFAULT;
|
||||
__put_user(kp->capability, &up->capability);
|
||||
__put_user(kp->flags, &up->flags);
|
||||
put_v4l2_pix_format(&kp->fmt, &up->fmt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct v4l2_input32 /* identical layout, but different size */
|
||||
static inline int get_v4l2_input32(struct v4l2_input *kp, struct v4l2_input __user *up)
|
||||
{
|
||||
__u32 index; /* Which input */
|
||||
__u8 name[32]; /* Label */
|
||||
__u32 type; /* Type of input */
|
||||
__u32 audioset; /* Associated audios (bitfield) */
|
||||
__u32 tuner; /* Associated tuner */
|
||||
__u32 std[2]; /* __u64 would get the padding wrong */
|
||||
__u32 status;
|
||||
__u32 reserved[4];
|
||||
};
|
||||
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_input) - 4) ||
|
||||
copy_from_user(kp, up, sizeof(struct v4l2_input) - 4))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int put_v4l2_input32(struct v4l2_input *kp, struct v4l2_input __user *up)
|
||||
{
|
||||
if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_input) - 4) ||
|
||||
copy_to_user(up, kp, sizeof(struct v4l2_input) - 4))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int get_v4l2_input(struct v4l2_input *kp, struct v4l2_input __user *up)
|
||||
{
|
||||
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_input)) ||
|
||||
copy_from_user(kp, up, sizeof(struct v4l2_input)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int put_v4l2_input(struct v4l2_input *kp, struct v4l2_input __user *up)
|
||||
{
|
||||
if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_input)) ||
|
||||
copy_to_user(up, kp, sizeof(struct v4l2_input)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define VIDIOCGTUNER32 _IOWR('v',4, struct video_tuner32)
|
||||
#define VIDIOCSTUNER32 _IOW('v',5, struct video_tuner32)
|
||||
|
@ -413,6 +507,8 @@ struct v4l2_input32 /* identical layout, but different size */
|
|||
#define VIDIOCGFREQ32 _IOR('v',14, u32)
|
||||
#define VIDIOCSFREQ32 _IOW('v',15, u32)
|
||||
|
||||
/* VIDIOC_ENUMINPUT32 is VIDIOC_ENUMINPUT minus 4 bytes of padding alignement */
|
||||
#define VIDIOC_ENUMINPUT32 VIDIOC_ENUMINPUT - _IOC(0, 0, 0, 4)
|
||||
#define VIDIOC_G_FMT32 _IOWR ('V', 4, struct v4l2_format32)
|
||||
#define VIDIOC_S_FMT32 _IOWR ('V', 5, struct v4l2_format32)
|
||||
#define VIDIOC_QUERYBUF32 _IOWR ('V', 9, struct v4l2_buffer32)
|
||||
|
@ -425,7 +521,6 @@ struct v4l2_input32 /* identical layout, but different size */
|
|||
#define VIDIOC_STREAMON32 _IOW ('V', 18, compat_int_t)
|
||||
#define VIDIOC_STREAMOFF32 _IOW ('V', 19, compat_int_t)
|
||||
#define VIDIOC_ENUMSTD32 _IOWR ('V', 25, struct v4l2_standard32)
|
||||
#define VIDIOC_ENUMINPUT32 _IOWR ('V', 26, struct v4l2_input32)
|
||||
/* VIDIOC_S_CTRL is now _IOWR, but was _IOW */
|
||||
#define VIDIOC_S_CTRL32 _IOW ('V', 28, struct v4l2_control)
|
||||
#define VIDIOC_G_INPUT32 _IOR ('V', 38, compat_int_t)
|
||||
|
@ -444,6 +539,9 @@ static int do_set_window(struct file *file, unsigned int cmd, unsigned long arg)
|
|||
int nclips;
|
||||
u32 n;
|
||||
|
||||
if (!access_ok(VERIFY_READ, up, sizeof(struct video_window32)))
|
||||
return -EFAULT;
|
||||
|
||||
if (get_user(nclips, &up->clipcount))
|
||||
return -EFAULT;
|
||||
|
||||
|
@ -476,7 +574,9 @@ static int do_set_window(struct file *file, unsigned int cmd, unsigned long arg)
|
|||
return -EINVAL;
|
||||
for (i = 0; i < nclips; i++, u++, p++) {
|
||||
s32 v;
|
||||
if (get_user(v, &u->x) ||
|
||||
if (!access_ok(VERIFY_READ, u, sizeof(struct video_clip32)) ||
|
||||
!access_ok(VERIFY_WRITE, p, sizeof(struct video_clip32)) ||
|
||||
get_user(v, &u->x) ||
|
||||
put_user(v, &p->x) ||
|
||||
get_user(v, &u->y) ||
|
||||
put_user(v, &p->y) ||
|
||||
|
@ -502,11 +602,14 @@ static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg
|
|||
struct v4l2_buffer v2b;
|
||||
struct v4l2_framebuffer v2fb;
|
||||
struct v4l2_standard v2s;
|
||||
struct v4l2_input v2i;
|
||||
struct v4l2_tuner v2t;
|
||||
unsigned long vx;
|
||||
} karg;
|
||||
void __user *up = compat_ptr(arg);
|
||||
int compatible_arg = 1;
|
||||
int err = 0;
|
||||
int realcmd = cmd;
|
||||
|
||||
/* First, convert the command. */
|
||||
switch(cmd) {
|
||||
|
@ -527,8 +630,8 @@ static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg
|
|||
case VIDIOC_G_FBUF32: cmd = VIDIOC_G_FBUF; break;
|
||||
case VIDIOC_S_FBUF32: cmd = VIDIOC_S_FBUF; break;
|
||||
case VIDIOC_OVERLAY32: cmd = VIDIOC_OVERLAY; break;
|
||||
case VIDIOC_ENUMSTD32: cmd = VIDIOC_ENUMSTD; break;
|
||||
case VIDIOC_ENUMINPUT32: cmd = VIDIOC_ENUMINPUT; break;
|
||||
case VIDIOC_ENUMSTD32: realcmd = VIDIOC_ENUMSTD; break;
|
||||
case VIDIOC_ENUMINPUT32: realcmd = VIDIOC_ENUMINPUT; break;
|
||||
case VIDIOC_S_CTRL32: cmd = VIDIOC_S_CTRL; break;
|
||||
case VIDIOC_G_INPUT32: cmd = VIDIOC_G_INPUT; break;
|
||||
case VIDIOC_S_INPUT32: cmd = VIDIOC_S_INPUT; break;
|
||||
|
@ -577,10 +680,31 @@ static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg
|
|||
break;
|
||||
|
||||
case VIDIOC_ENUMSTD:
|
||||
err = get_v4l2_standard(&karg.v2s, up);
|
||||
compatible_arg = 0;
|
||||
break;
|
||||
|
||||
case VIDIOC_ENUMSTD32:
|
||||
err = get_v4l2_standard32(&karg.v2s, up);
|
||||
compatible_arg = 0;
|
||||
break;
|
||||
|
||||
case VIDIOC_ENUMINPUT:
|
||||
err = get_v4l2_input(&karg.v2i, up);
|
||||
compatible_arg = 0;
|
||||
break;
|
||||
|
||||
case VIDIOC_ENUMINPUT32:
|
||||
err = get_v4l2_input32(&karg.v2i, up);
|
||||
compatible_arg = 0;
|
||||
break;
|
||||
|
||||
case VIDIOC_G_TUNER:
|
||||
case VIDIOC_S_TUNER:
|
||||
err = get_v4l2_tuner(&karg.v2t, up);
|
||||
compatible_arg = 0;
|
||||
break;
|
||||
|
||||
case VIDIOCGWIN:
|
||||
case VIDIOCGFBUF:
|
||||
case VIDIOCGFREQ:
|
||||
|
@ -593,12 +717,12 @@ static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg
|
|||
goto out;
|
||||
|
||||
if(compatible_arg)
|
||||
err = native_ioctl(file, cmd, (unsigned long)up);
|
||||
err = native_ioctl(file, realcmd, (unsigned long)up);
|
||||
else {
|
||||
mm_segment_t old_fs = get_fs();
|
||||
|
||||
set_fs(KERNEL_DS);
|
||||
err = native_ioctl(file, cmd, (unsigned long)&karg);
|
||||
err = native_ioctl(file, realcmd, (unsigned long)&karg);
|
||||
set_fs(old_fs);
|
||||
}
|
||||
if(err == 0) {
|
||||
|
@ -632,9 +756,26 @@ static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg
|
|||
break;
|
||||
|
||||
case VIDIOC_ENUMSTD:
|
||||
err = put_v4l2_standard(&karg.v2s, up);
|
||||
break;
|
||||
|
||||
case VIDIOC_ENUMSTD32:
|
||||
err = put_v4l2_standard32(&karg.v2s, up);
|
||||
break;
|
||||
|
||||
case VIDIOC_G_TUNER:
|
||||
case VIDIOC_S_TUNER:
|
||||
err = put_v4l2_tuner(&karg.v2t, up);
|
||||
break;
|
||||
|
||||
case VIDIOC_ENUMINPUT:
|
||||
err = put_v4l2_input(&karg.v2i, up);
|
||||
break;
|
||||
|
||||
case VIDIOC_ENUMINPUT32:
|
||||
err = put_v4l2_input32(&karg.v2i, up);
|
||||
break;
|
||||
|
||||
case VIDIOCGFREQ:
|
||||
case VIDIOC_G_INPUT:
|
||||
err = put_user(((u32)karg.vx), (u32 __user *)up);
|
||||
|
@ -679,7 +820,11 @@ long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
|
|||
case VIDIOC_G_PARM:
|
||||
case VIDIOC_G_STD:
|
||||
case VIDIOC_S_STD:
|
||||
case VIDIOC_G_TUNER:
|
||||
case VIDIOC_S_TUNER:
|
||||
case VIDIOC_ENUMSTD:
|
||||
case VIDIOC_ENUMSTD32:
|
||||
case VIDIOC_ENUMINPUT:
|
||||
case VIDIOC_ENUMINPUT32:
|
||||
case VIDIOC_G_CTRL:
|
||||
case VIDIOC_S_CTRL32:
|
||||
|
@ -718,6 +863,8 @@ long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
|
|||
case _IOR('v' , BASE_VIDIOCPRIVATE+7, int):
|
||||
ret = native_ioctl(file, cmd, (unsigned long)compat_ptr(arg));
|
||||
break;
|
||||
default:
|
||||
v4l_print_ioctl("compat_ioctl32", cmd);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -702,12 +702,11 @@ static int cpia_pp_register(struct parport *port)
|
|||
return -ENXIO;
|
||||
}
|
||||
|
||||
cam = kmalloc(sizeof(struct pp_cam_entry), GFP_KERNEL);
|
||||
cam = kzalloc(sizeof(struct pp_cam_entry), GFP_KERNEL);
|
||||
if (cam == NULL) {
|
||||
LOG("failed to allocate camera structure\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(cam,0,sizeof(struct pp_cam_entry));
|
||||
|
||||
pdev = parport_register_device(port, "cpia_pp", NULL, NULL,
|
||||
NULL, 0, cam);
|
||||
|
|
|
@ -499,14 +499,12 @@ static int cpia_probe(struct usb_interface *intf,
|
|||
|
||||
printk(KERN_INFO "USB CPiA camera found\n");
|
||||
|
||||
ucpia = kmalloc(sizeof(*ucpia), GFP_KERNEL);
|
||||
ucpia = kzalloc(sizeof(*ucpia), GFP_KERNEL);
|
||||
if (!ucpia) {
|
||||
printk(KERN_ERR "couldn't kmalloc cpia struct\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
memset(ucpia, 0, sizeof(*ucpia));
|
||||
|
||||
ucpia->dev = udev;
|
||||
ucpia->iface = interface->desc.bInterfaceNumber;
|
||||
init_waitqueue_head(&ucpia->wq_stream);
|
||||
|
|
|
@ -141,11 +141,10 @@ static int cs53l32a_attach(struct i2c_adapter *adapter, int address, int kind)
|
|||
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
|
||||
return 0;
|
||||
|
||||
client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
if (client == 0)
|
||||
return -ENOMEM;
|
||||
|
||||
memset(client, 0, sizeof(struct i2c_client));
|
||||
client->addr = address;
|
||||
client->adapter = adapter;
|
||||
client->driver = &i2c_driver;
|
||||
|
@ -156,7 +155,7 @@ static int cs53l32a_attach(struct i2c_adapter *adapter, int address, int kind)
|
|||
for (i = 1; i <= 7; i++) {
|
||||
u8 v = cs53l32a_read(client, i);
|
||||
|
||||
v4l_dbg(1, client, "Read Reg %d %02x\n", i, v);
|
||||
v4l_dbg(1, debug, client, "Read Reg %d %02x\n", i, v);
|
||||
}
|
||||
|
||||
/* Set cs53l32a internal register for Adaptec 2010/2410 setup */
|
||||
|
@ -174,7 +173,7 @@ static int cs53l32a_attach(struct i2c_adapter *adapter, int address, int kind)
|
|||
for (i = 1; i <= 7; i++) {
|
||||
u8 v = cs53l32a_read(client, i);
|
||||
|
||||
v4l_dbg(1, client, "Read Reg %d %02x\n", i, v);
|
||||
v4l_dbg(1, debug, client, "Read Reg %d %02x\n", i, v);
|
||||
}
|
||||
|
||||
i2c_attach_client(client);
|
||||
|
|
|
@ -43,9 +43,9 @@ MODULE_LICENSE("GPL");
|
|||
static unsigned short normal_i2c[] = { 0x88 >> 1, I2C_CLIENT_END };
|
||||
|
||||
|
||||
int debug = 0;
|
||||
int cx25840_debug = 0;
|
||||
|
||||
module_param(debug, bool, 0644);
|
||||
module_param_named(debug,cx25840_debug, int, 0644);
|
||||
|
||||
MODULE_PARM_DESC(debug, "Debugging messages [0=Off (default) 1=On]");
|
||||
|
||||
|
@ -265,7 +265,7 @@ static int set_input(struct i2c_client *client, enum cx25840_video_input vid_inp
|
|||
vid_input <= CX25840_COMPOSITE8);
|
||||
u8 reg;
|
||||
|
||||
v4l_dbg(1, client, "decoder set video input %d, audio input %d\n",
|
||||
v4l_dbg(1, cx25840_debug, client, "decoder set video input %d, audio input %d\n",
|
||||
vid_input, aud_input);
|
||||
|
||||
if (is_composite) {
|
||||
|
@ -533,7 +533,7 @@ static int set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt)
|
|||
else
|
||||
filter = 3;
|
||||
|
||||
v4l_dbg(1, client, "decoder set size %dx%d -> scale %ux%u\n",
|
||||
v4l_dbg(1, cx25840_debug, client, "decoder set size %dx%d -> scale %ux%u\n",
|
||||
pix->width, pix->height, HSC, VSC);
|
||||
|
||||
/* HSCALE=HSC */
|
||||
|
@ -687,13 +687,13 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd,
|
|||
return cx25840_audio(client, cmd, arg);
|
||||
|
||||
case VIDIOC_STREAMON:
|
||||
v4l_dbg(1, client, "enable output\n");
|
||||
v4l_dbg(1, cx25840_debug, client, "enable output\n");
|
||||
cx25840_write(client, 0x115, 0x8c);
|
||||
cx25840_write(client, 0x116, 0x07);
|
||||
break;
|
||||
|
||||
case VIDIOC_STREAMOFF:
|
||||
v4l_dbg(1, client, "disable output\n");
|
||||
v4l_dbg(1, cx25840_debug, client, "disable output\n");
|
||||
cx25840_write(client, 0x115, 0x00);
|
||||
cx25840_write(client, 0x116, 0x00);
|
||||
break;
|
||||
|
@ -862,17 +862,16 @@ static int cx25840_detect_client(struct i2c_adapter *adapter, int address,
|
|||
if (!i2c_check_functionality(adapter, I2C_FUNC_I2C))
|
||||
return 0;
|
||||
|
||||
client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
if (client == 0)
|
||||
return -ENOMEM;
|
||||
|
||||
memset(client, 0, sizeof(struct i2c_client));
|
||||
client->addr = address;
|
||||
client->adapter = adapter;
|
||||
client->driver = &i2c_driver_cx25840;
|
||||
snprintf(client->name, sizeof(client->name) - 1, "cx25840");
|
||||
|
||||
v4l_dbg(1, client, "detecting cx25840 client on address 0x%x\n", address << 1);
|
||||
v4l_dbg(1, cx25840_debug, client, "detecting cx25840 client on address 0x%x\n", address << 1);
|
||||
|
||||
device_id = cx25840_read(client, 0x101) << 8;
|
||||
device_id |= cx25840_read(client, 0x100);
|
||||
|
@ -880,7 +879,7 @@ static int cx25840_detect_client(struct i2c_adapter *adapter, int address,
|
|||
/* The high byte of the device ID should be
|
||||
* 0x84 if chip is present */
|
||||
if ((device_id & 0xff00) != 0x8400) {
|
||||
v4l_dbg(1, client, "cx25840 not found\n");
|
||||
v4l_dbg(1, cx25840_debug, client, "cx25840 not found\n");
|
||||
kfree(client);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1539,10 +1539,9 @@ static int mpeg_open(struct inode *inode, struct file *file)
|
|||
dprintk(1,"open minor=%d\n",minor);
|
||||
|
||||
/* allocate + initialize per filehandle data */
|
||||
fh = kmalloc(sizeof(*fh),GFP_KERNEL);
|
||||
fh = kzalloc(sizeof(*fh),GFP_KERNEL);
|
||||
if (NULL == fh)
|
||||
return -ENOMEM;
|
||||
memset(fh,0,sizeof(*fh));
|
||||
file->private_data = fh;
|
||||
fh->dev = dev;
|
||||
|
||||
|
@ -1678,10 +1677,9 @@ static int __devinit blackbird_probe(struct pci_dev *pci_dev,
|
|||
goto fail_core;
|
||||
|
||||
err = -ENOMEM;
|
||||
dev = kmalloc(sizeof(*dev),GFP_KERNEL);
|
||||
dev = kzalloc(sizeof(*dev),GFP_KERNEL);
|
||||
if (NULL == dev)
|
||||
goto fail_core;
|
||||
memset(dev,0,sizeof(*dev));
|
||||
dev->pci = pci_dev;
|
||||
dev->core = core;
|
||||
dev->width = 720;
|
||||
|
|
|
@ -1244,6 +1244,11 @@ struct cx88_subid cx88_subids[] = {
|
|||
.subvendor = 0x18ac,
|
||||
.subdevice = 0xdb50,
|
||||
.card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL,
|
||||
},{
|
||||
.subvendor = 0x18ac,
|
||||
.subdevice = 0xdb11,
|
||||
.card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS,
|
||||
/* Re-branded DViCO: UltraView DVB-T Plus */
|
||||
},
|
||||
};
|
||||
const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
|
||||
|
|
|
@ -1050,11 +1050,10 @@ struct cx88_core* cx88_core_get(struct pci_dev *pci)
|
|||
up(&devlist);
|
||||
return core;
|
||||
}
|
||||
core = kmalloc(sizeof(*core),GFP_KERNEL);
|
||||
core = kzalloc(sizeof(*core),GFP_KERNEL);
|
||||
if (NULL == core)
|
||||
goto fail_unlock;
|
||||
|
||||
memset(core,0,sizeof(*core));
|
||||
atomic_inc(&core->refcount);
|
||||
core->pci_bus = pci->bus->number;
|
||||
core->pci_slot = PCI_SLOT(pci->devfn);
|
||||
|
|
|
@ -657,10 +657,9 @@ static int __devinit dvb_probe(struct pci_dev *pci_dev,
|
|||
goto fail_core;
|
||||
|
||||
err = -ENOMEM;
|
||||
dev = kmalloc(sizeof(*dev),GFP_KERNEL);
|
||||
dev = kzalloc(sizeof(*dev),GFP_KERNEL);
|
||||
if (NULL == dev)
|
||||
goto fail_core;
|
||||
memset(dev,0,sizeof(*dev));
|
||||
dev->pci = pci_dev;
|
||||
dev->core = core;
|
||||
|
||||
|
|
|
@ -697,6 +697,7 @@ void cx88_ir_irq(struct cx88_core *core)
|
|||
case CX88_BOARD_HAUPPAUGE_DVB_T1:
|
||||
case CX88_BOARD_HAUPPAUGE_NOVASE2_S1:
|
||||
case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1:
|
||||
case CX88_BOARD_HAUPPAUGE_HVR1100:
|
||||
ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7);
|
||||
ir_dprintk("biphase decoded: %x\n", ircode);
|
||||
if ((ircode & 0xfffff000) != 0x3000)
|
||||
|
|
|
@ -750,10 +750,9 @@ static int video_open(struct inode *inode, struct file *file)
|
|||
minor,radio,v4l2_type_names[type]);
|
||||
|
||||
/* allocate + initialize per filehandle data */
|
||||
fh = kmalloc(sizeof(*fh),GFP_KERNEL);
|
||||
fh = kzalloc(sizeof(*fh),GFP_KERNEL);
|
||||
if (NULL == fh)
|
||||
return -ENOMEM;
|
||||
memset(fh,0,sizeof(*fh));
|
||||
file->private_data = fh;
|
||||
fh->dev = dev;
|
||||
fh->radio = radio;
|
||||
|
@ -1809,10 +1808,9 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
|
|||
struct cx88_core *core;
|
||||
int err;
|
||||
|
||||
dev = kmalloc(sizeof(*dev),GFP_KERNEL);
|
||||
dev = kzalloc(sizeof(*dev),GFP_KERNEL);
|
||||
if (NULL == dev)
|
||||
return -ENOMEM;
|
||||
memset(dev,0,sizeof(*dev));
|
||||
|
||||
/* pci init */
|
||||
dev->pci = pci_dev;
|
||||
|
|
|
@ -94,12 +94,11 @@ static int dpc_probe(struct saa7146_dev* dev)
|
|||
struct i2c_client *client;
|
||||
struct list_head *item;
|
||||
|
||||
dpc = (struct dpc*)kmalloc(sizeof(struct dpc), GFP_KERNEL);
|
||||
dpc = kzalloc(sizeof(struct dpc), GFP_KERNEL);
|
||||
if( NULL == dpc ) {
|
||||
printk("dpc_v4l2.o: dpc_probe: not enough kernel memory.\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(dpc, 0x0, sizeof(struct dpc));
|
||||
|
||||
/* FIXME: enable i2c-port pins, video-port-pins
|
||||
video port pins should be enabled here ?! */
|
||||
|
|
|
@ -1861,12 +1861,11 @@ static int em28xx_usb_probe(struct usb_interface *interface,
|
|||
}
|
||||
|
||||
/* allocate memory for our device state and initialize it */
|
||||
dev = kmalloc(sizeof(*dev), GFP_KERNEL);
|
||||
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
|
||||
if (dev == NULL) {
|
||||
em28xx_err(DRIVER_NAME ": out of memory!\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(dev, 0, sizeof(*dev));
|
||||
|
||||
/* compute alternate max packet sizes */
|
||||
uif = udev->actconfig->interface[0];
|
||||
|
|
|
@ -240,12 +240,11 @@ static int hexium_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_d
|
|||
|
||||
DEB_EE((".\n"));
|
||||
|
||||
hexium = (struct hexium *) kmalloc(sizeof(struct hexium), GFP_KERNEL);
|
||||
hexium = kzalloc(sizeof(struct hexium), GFP_KERNEL);
|
||||
if (NULL == hexium) {
|
||||
printk("hexium_gemini: not enough kernel memory in hexium_attach().\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(hexium, 0x0, sizeof(struct hexium));
|
||||
dev->ext_priv = hexium;
|
||||
|
||||
/* enable i2c-port pins */
|
||||
|
|
|
@ -224,12 +224,11 @@ static int hexium_probe(struct saa7146_dev *dev)
|
|||
return -EFAULT;
|
||||
}
|
||||
|
||||
hexium = (struct hexium *) kmalloc(sizeof(struct hexium), GFP_KERNEL);
|
||||
hexium = kzalloc(sizeof(struct hexium), GFP_KERNEL);
|
||||
if (NULL == hexium) {
|
||||
printk("hexium_orion: hexium_probe: not enough kernel memory.\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(hexium, 0x0, sizeof(struct hexium));
|
||||
|
||||
/* enable i2c-port pins */
|
||||
saa7146_write(dev, MC1, (MASK_08 | MASK_24 | MASK_10 | MASK_26));
|
||||
|
|
|
@ -289,18 +289,15 @@ static int indycam_attach(struct i2c_adapter *adap, int addr, int kind)
|
|||
printk(KERN_INFO "SGI IndyCam driver version %s\n",
|
||||
INDYCAM_MODULE_VERSION);
|
||||
|
||||
client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
if (!client)
|
||||
return -ENOMEM;
|
||||
camera = kmalloc(sizeof(struct indycam), GFP_KERNEL);
|
||||
camera = kzalloc(sizeof(struct indycam), GFP_KERNEL);
|
||||
if (!camera) {
|
||||
err = -ENOMEM;
|
||||
goto out_free_client;
|
||||
}
|
||||
|
||||
memset(client, 0, sizeof(struct i2c_client));
|
||||
memset(camera, 0, sizeof(struct indycam));
|
||||
|
||||
client->addr = addr;
|
||||
client->adapter = adap;
|
||||
client->driver = &i2c_driver_indycam;
|
||||
|
|
|
@ -66,26 +66,26 @@ MODULE_LICENSE("GPL");
|
|||
|
||||
/* module parameters */
|
||||
static int opmode = OPMODE_AUTO;
|
||||
int debug = 0; /* debug output */
|
||||
int once = 0; /* no continous stereo monitoring */
|
||||
int amsound = 0; /* hard-wire AM sound at 6.5 Hz (france),
|
||||
int msp_debug = 0; /* msp_debug output */
|
||||
int msp_once = 0; /* no continous stereo monitoring */
|
||||
int msp_amsound = 0; /* hard-wire AM sound at 6.5 Hz (france),
|
||||
the autoscan seems work well only with FM... */
|
||||
int standard = 1; /* Override auto detect of audio standard, if needed. */
|
||||
int dolby = 0;
|
||||
int msp_standard = 1; /* Override auto detect of audio msp_standard, if needed. */
|
||||
int msp_dolby = 0;
|
||||
|
||||
int stereo_threshold = 0x190; /* a2 threshold for stereo/bilingual
|
||||
int msp_stereo_thresh = 0x190; /* a2 threshold for stereo/bilingual
|
||||
(msp34xxg only) 0x00a0-0x03c0 */
|
||||
|
||||
/* read-only */
|
||||
module_param(opmode, int, 0444);
|
||||
|
||||
/* read-write */
|
||||
module_param(once, bool, 0644);
|
||||
module_param(debug, int, 0644);
|
||||
module_param(stereo_threshold, int, 0644);
|
||||
module_param(standard, int, 0644);
|
||||
module_param(amsound, bool, 0644);
|
||||
module_param(dolby, bool, 0644);
|
||||
module_param_named(once,msp_once, bool, 0644);
|
||||
module_param_named(debug,msp_debug, int, 0644);
|
||||
module_param_named(stereo_threshold,msp_stereo_thresh, int, 0644);
|
||||
module_param_named(standard,msp_standard, int, 0644);
|
||||
module_param_named(amsound,msp_amsound, bool, 0644);
|
||||
module_param_named(dolby,msp_dolby, bool, 0644);
|
||||
|
||||
MODULE_PARM_DESC(opmode, "Forces a MSP3400 opmode. 0=Manual, 1=Autodetect, 2=Autodetect and autoselect");
|
||||
MODULE_PARM_DESC(once, "No continuous stereo monitoring");
|
||||
|
@ -127,7 +127,7 @@ int msp_reset(struct i2c_client *client)
|
|||
{ client->addr, I2C_M_RD, 2, read },
|
||||
};
|
||||
|
||||
v4l_dbg(3, client, "msp_reset\n");
|
||||
v4l_dbg(3, msp_debug, client, "msp_reset\n");
|
||||
if (i2c_transfer(client->adapter, &reset[0], 1) != 1 ||
|
||||
i2c_transfer(client->adapter, &reset[1], 1) != 1 ||
|
||||
i2c_transfer(client->adapter, test, 2) != 2) {
|
||||
|
@ -165,7 +165,7 @@ static int msp_read(struct i2c_client *client, int dev, int addr)
|
|||
return -1;
|
||||
}
|
||||
retval = read[0] << 8 | read[1];
|
||||
v4l_dbg(3, client, "msp_read(0x%x, 0x%x): 0x%x\n", dev, addr, retval);
|
||||
v4l_dbg(3, msp_debug, client, "msp_read(0x%x, 0x%x): 0x%x\n", dev, addr, retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -190,7 +190,7 @@ static int msp_write(struct i2c_client *client, int dev, int addr, int val)
|
|||
buffer[3] = val >> 8;
|
||||
buffer[4] = val & 0xff;
|
||||
|
||||
v4l_dbg(3, client, "msp_write(0x%x, 0x%x, 0x%x)\n", dev, addr, val);
|
||||
v4l_dbg(3, msp_debug, client, "msp_write(0x%x, 0x%x, 0x%x)\n", dev, addr, val);
|
||||
for (err = 0; err < 3; err++) {
|
||||
if (i2c_master_send(client, buffer, 5) == 5)
|
||||
break;
|
||||
|
@ -273,7 +273,7 @@ void msp_set_scart(struct i2c_client *client, int in, int out)
|
|||
} else
|
||||
state->acb = 0xf60; /* Mute Input and SCART 1 Output */
|
||||
|
||||
v4l_dbg(1, client, "scart switch: %s => %d (ACB=0x%04x)\n",
|
||||
v4l_dbg(1, msp_debug, client, "scart switch: %s => %d (ACB=0x%04x)\n",
|
||||
scart_names[in], out, state->acb);
|
||||
msp_write_dsp(client, 0x13, state->acb);
|
||||
|
||||
|
@ -285,7 +285,7 @@ void msp_set_mute(struct i2c_client *client)
|
|||
{
|
||||
struct msp_state *state = i2c_get_clientdata(client);
|
||||
|
||||
v4l_dbg(1, client, "mute audio\n");
|
||||
v4l_dbg(1, msp_debug, client, "mute audio\n");
|
||||
msp_write_dsp(client, 0x0000, 0);
|
||||
msp_write_dsp(client, 0x0007, 1);
|
||||
if (state->has_scart2_out_volume)
|
||||
|
@ -303,7 +303,7 @@ void msp_set_audio(struct i2c_client *client)
|
|||
if (!state->muted)
|
||||
val = (state->volume * 0x7f / 65535) << 8;
|
||||
|
||||
v4l_dbg(1, client, "mute=%s volume=%d\n",
|
||||
v4l_dbg(1, msp_debug, client, "mute=%s volume=%d\n",
|
||||
state->muted ? "on" : "off", state->volume);
|
||||
|
||||
msp_write_dsp(client, 0x0000, val);
|
||||
|
@ -321,7 +321,7 @@ void msp_set_audio(struct i2c_client *client)
|
|||
treble = ((state->treble - 32768) * 0x60 / 65535) << 8;
|
||||
loudness = state->loudness ? ((5 * 4) << 8) : 0;
|
||||
|
||||
v4l_dbg(1, client, "balance=%d bass=%d treble=%d loudness=%d\n",
|
||||
v4l_dbg(1, msp_debug, client, "balance=%d bass=%d treble=%d loudness=%d\n",
|
||||
state->balance, state->bass, state->treble, state->loudness);
|
||||
|
||||
msp_write_dsp(client, 0x0001, bal << 8);
|
||||
|
@ -341,12 +341,12 @@ int msp_modus(struct i2c_client *client)
|
|||
struct msp_state *state = i2c_get_clientdata(client);
|
||||
|
||||
if (state->radio) {
|
||||
v4l_dbg(1, client, "video mode selected to Radio\n");
|
||||
v4l_dbg(1, msp_debug, client, "video mode selected to Radio\n");
|
||||
return 0x0003;
|
||||
}
|
||||
|
||||
if (state->v4l2_std & V4L2_STD_PAL) {
|
||||
v4l_dbg(1, client, "video mode selected to PAL\n");
|
||||
v4l_dbg(1, msp_debug, client, "video mode selected to PAL\n");
|
||||
|
||||
#if 1
|
||||
/* experimental: not sure this works with all chip versions */
|
||||
|
@ -357,11 +357,11 @@ int msp_modus(struct i2c_client *client)
|
|||
#endif
|
||||
}
|
||||
if (state->v4l2_std & V4L2_STD_NTSC) {
|
||||
v4l_dbg(1, client, "video mode selected to NTSC\n");
|
||||
v4l_dbg(1, msp_debug, client, "video mode selected to NTSC\n");
|
||||
return 0x2003;
|
||||
}
|
||||
if (state->v4l2_std & V4L2_STD_SECAM) {
|
||||
v4l_dbg(1, client, "video mode selected to SECAM\n");
|
||||
v4l_dbg(1, msp_debug, client, "video mode selected to SECAM\n");
|
||||
return 0x0003;
|
||||
}
|
||||
return 0x0003;
|
||||
|
@ -619,7 +619,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
|
|||
u16 *sarg = arg;
|
||||
int scart = 0;
|
||||
|
||||
if (debug >= 2)
|
||||
if (msp_debug >= 2)
|
||||
v4l_i2c_print_ioctl(client, cmd);
|
||||
|
||||
switch (cmd) {
|
||||
|
@ -666,7 +666,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
|
|||
if (state->radio)
|
||||
return 0;
|
||||
state->radio = 1;
|
||||
v4l_dbg(1, client, "switching to radio mode\n");
|
||||
v4l_dbg(1, msp_debug, client, "switching to radio mode\n");
|
||||
state->watch_stereo = 0;
|
||||
switch (state->opmode) {
|
||||
case OPMODE_MANUAL:
|
||||
|
@ -937,7 +937,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
|
|||
if (a->index < 0 || a->index > 2)
|
||||
return -EINVAL;
|
||||
|
||||
v4l_dbg(1, client, "Setting audio out on msp34xx to input %i\n", a->index);
|
||||
v4l_dbg(1, msp_debug, client, "Setting audio out on msp34xx to input %i\n", a->index);
|
||||
msp_set_scart(client, state->in_scart, a->index + 1);
|
||||
|
||||
break;
|
||||
|
@ -947,7 +947,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
|
|||
{
|
||||
u32 *a = (u32 *)arg;
|
||||
|
||||
v4l_dbg(1, client, "Setting I2S speed to %d\n", *a);
|
||||
v4l_dbg(1, msp_debug, client, "Setting I2S speed to %d\n", *a);
|
||||
|
||||
switch (*a) {
|
||||
case 1024000:
|
||||
|
@ -1041,7 +1041,7 @@ static int msp_suspend(struct device * dev, pm_message_t state)
|
|||
{
|
||||
struct i2c_client *client = container_of(dev, struct i2c_client, dev);
|
||||
|
||||
v4l_dbg(1, client, "suspend\n");
|
||||
v4l_dbg(1, msp_debug, client, "suspend\n");
|
||||
msp_reset(client);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1050,7 +1050,7 @@ static int msp_resume(struct device * dev)
|
|||
{
|
||||
struct i2c_client *client = container_of(dev, struct i2c_client, dev);
|
||||
|
||||
v4l_dbg(1, client, "resume\n");
|
||||
v4l_dbg(1, msp_debug, client, "resume\n");
|
||||
msp_wake_thread(client);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1080,7 +1080,7 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind)
|
|||
snprintf(client->name, sizeof(client->name) - 1, "msp3400");
|
||||
|
||||
if (msp_reset(client) == -1) {
|
||||
v4l_dbg(1, client, "msp3400 not found\n");
|
||||
v4l_dbg(1, msp_debug, client, "msp3400 not found\n");
|
||||
kfree(client);
|
||||
return -1;
|
||||
}
|
||||
|
@ -1107,9 +1107,9 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind)
|
|||
state->rev1 = msp_read_dsp(client, 0x1e);
|
||||
if (state->rev1 != -1)
|
||||
state->rev2 = msp_read_dsp(client, 0x1f);
|
||||
v4l_dbg(1, client, "rev1=0x%04x, rev2=0x%04x\n", state->rev1, state->rev2);
|
||||
v4l_dbg(1, msp_debug, client, "rev1=0x%04x, rev2=0x%04x\n", state->rev1, state->rev2);
|
||||
if (state->rev1 == -1 || (state->rev1 == 0 && state->rev2 == 0)) {
|
||||
v4l_dbg(1, client, "not an msp3400 (cannot read chip version)\n");
|
||||
v4l_dbg(1, msp_debug, client, "not an msp3400 (cannot read chip version)\n");
|
||||
kfree(state);
|
||||
kfree(client);
|
||||
return -1;
|
||||
|
|
|
@ -168,7 +168,7 @@ void msp3400c_setmode(struct i2c_client *client, int type)
|
|||
struct msp_state *state = i2c_get_clientdata(client);
|
||||
int i;
|
||||
|
||||
v4l_dbg(1, client, "setmode: %d\n", type);
|
||||
v4l_dbg(1, msp_debug, client, "setmode: %d\n", type);
|
||||
state->mode = type;
|
||||
state->audmode = V4L2_TUNER_MODE_MONO;
|
||||
state->rxsubchans = V4L2_TUNER_SUB_MONO;
|
||||
|
@ -191,7 +191,7 @@ void msp3400c_setmode(struct i2c_client *client, int type)
|
|||
|
||||
msp_write_dem(client, 0x0056, 0); /*LOAD_REG_1/2*/
|
||||
|
||||
if (dolby) {
|
||||
if (msp_dolby) {
|
||||
msp_write_dsp(client, 0x0008, 0x0520); /* I2S1 */
|
||||
msp_write_dsp(client, 0x0009, 0x0620); /* I2S2 */
|
||||
msp_write_dsp(client, 0x000b, msp3400c_init_data[type].dsp_src);
|
||||
|
@ -221,7 +221,7 @@ void msp3400c_setstereo(struct i2c_client *client, int mode)
|
|||
/* this method would break everything, let's make sure
|
||||
* it's never called
|
||||
*/
|
||||
v4l_dbg(1, client, "setstereo called with mode=%d instead of set_source (ignored)\n",
|
||||
v4l_dbg(1, msp_debug, client, "setstereo called with mode=%d instead of set_source (ignored)\n",
|
||||
mode);
|
||||
return;
|
||||
}
|
||||
|
@ -229,7 +229,7 @@ void msp3400c_setstereo(struct i2c_client *client, int mode)
|
|||
/* switch demodulator */
|
||||
switch (state->mode) {
|
||||
case MSP_MODE_FM_TERRA:
|
||||
v4l_dbg(1, client, "FM setstereo: %s\n", strmode[mode]);
|
||||
v4l_dbg(1, msp_debug, client, "FM setstereo: %s\n", strmode[mode]);
|
||||
msp3400c_setcarrier(client, state->second, state->main);
|
||||
switch (mode) {
|
||||
case V4L2_TUNER_MODE_STEREO:
|
||||
|
@ -243,7 +243,7 @@ void msp3400c_setstereo(struct i2c_client *client, int mode)
|
|||
}
|
||||
break;
|
||||
case MSP_MODE_FM_SAT:
|
||||
v4l_dbg(1, client, "SAT setstereo: %s\n", strmode[mode]);
|
||||
v4l_dbg(1, msp_debug, client, "SAT setstereo: %s\n", strmode[mode]);
|
||||
switch (mode) {
|
||||
case V4L2_TUNER_MODE_MONO:
|
||||
msp3400c_setcarrier(client, MSP_CARRIER(6.5), MSP_CARRIER(6.5));
|
||||
|
@ -262,24 +262,24 @@ void msp3400c_setstereo(struct i2c_client *client, int mode)
|
|||
case MSP_MODE_FM_NICAM1:
|
||||
case MSP_MODE_FM_NICAM2:
|
||||
case MSP_MODE_AM_NICAM:
|
||||
v4l_dbg(1, client, "NICAM setstereo: %s\n",strmode[mode]);
|
||||
v4l_dbg(1, msp_debug, client, "NICAM setstereo: %s\n",strmode[mode]);
|
||||
msp3400c_setcarrier(client,state->second,state->main);
|
||||
if (state->nicam_on)
|
||||
nicam=0x0100;
|
||||
break;
|
||||
case MSP_MODE_BTSC:
|
||||
v4l_dbg(1, client, "BTSC setstereo: %s\n",strmode[mode]);
|
||||
v4l_dbg(1, msp_debug, client, "BTSC setstereo: %s\n",strmode[mode]);
|
||||
nicam=0x0300;
|
||||
break;
|
||||
case MSP_MODE_EXTERN:
|
||||
v4l_dbg(1, client, "extern setstereo: %s\n",strmode[mode]);
|
||||
v4l_dbg(1, msp_debug, client, "extern setstereo: %s\n",strmode[mode]);
|
||||
nicam = 0x0200;
|
||||
break;
|
||||
case MSP_MODE_FM_RADIO:
|
||||
v4l_dbg(1, client, "FM-Radio setstereo: %s\n",strmode[mode]);
|
||||
v4l_dbg(1, msp_debug, client, "FM-Radio setstereo: %s\n",strmode[mode]);
|
||||
break;
|
||||
default:
|
||||
v4l_dbg(1, client, "mono setstereo\n");
|
||||
v4l_dbg(1, msp_debug, client, "mono setstereo\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -290,7 +290,7 @@ void msp3400c_setstereo(struct i2c_client *client, int mode)
|
|||
break;
|
||||
case V4L2_TUNER_MODE_MONO:
|
||||
if (state->mode == MSP_MODE_AM_NICAM) {
|
||||
v4l_dbg(1, client, "switching to AM mono\n");
|
||||
v4l_dbg(1, msp_debug, client, "switching to AM mono\n");
|
||||
/* AM mono decoding is handled by tuner, not MSP chip */
|
||||
/* SCART switching control register */
|
||||
msp_set_scart(client, SCART_MONO, 0);
|
||||
|
@ -304,9 +304,9 @@ void msp3400c_setstereo(struct i2c_client *client, int mode)
|
|||
src = 0x0010 | nicam;
|
||||
break;
|
||||
}
|
||||
v4l_dbg(1, client, "setstereo final source/matrix = 0x%x\n", src);
|
||||
v4l_dbg(1, msp_debug, client, "setstereo final source/matrix = 0x%x\n", src);
|
||||
|
||||
if (dolby) {
|
||||
if (msp_dolby) {
|
||||
msp_write_dsp(client, 0x0008, 0x0520);
|
||||
msp_write_dsp(client, 0x0009, 0x0620);
|
||||
msp_write_dsp(client, 0x000a, src);
|
||||
|
@ -327,20 +327,20 @@ static void msp3400c_print_mode(struct i2c_client *client)
|
|||
struct msp_state *state = i2c_get_clientdata(client);
|
||||
|
||||
if (state->main == state->second) {
|
||||
v4l_dbg(1, client, "mono sound carrier: %d.%03d MHz\n",
|
||||
v4l_dbg(1, msp_debug, client, "mono sound carrier: %d.%03d MHz\n",
|
||||
state->main / 910000, (state->main / 910) % 1000);
|
||||
} else {
|
||||
v4l_dbg(1, client, "main sound carrier: %d.%03d MHz\n",
|
||||
v4l_dbg(1, msp_debug, client, "main sound carrier: %d.%03d MHz\n",
|
||||
state->main / 910000, (state->main / 910) % 1000);
|
||||
}
|
||||
if (state->mode == MSP_MODE_FM_NICAM1 || state->mode == MSP_MODE_FM_NICAM2)
|
||||
v4l_dbg(1, client, "NICAM/FM carrier : %d.%03d MHz\n",
|
||||
v4l_dbg(1, msp_debug, client, "NICAM/FM carrier : %d.%03d MHz\n",
|
||||
state->second / 910000, (state->second/910) % 1000);
|
||||
if (state->mode == MSP_MODE_AM_NICAM)
|
||||
v4l_dbg(1, client, "NICAM/AM carrier : %d.%03d MHz\n",
|
||||
v4l_dbg(1, msp_debug, client, "NICAM/AM carrier : %d.%03d MHz\n",
|
||||
state->second / 910000, (state->second / 910) % 1000);
|
||||
if (state->mode == MSP_MODE_FM_TERRA && state->main != state->second) {
|
||||
v4l_dbg(1, client, "FM-stereo carrier : %d.%03d MHz\n",
|
||||
v4l_dbg(1, msp_debug, client, "FM-stereo carrier : %d.%03d MHz\n",
|
||||
state->second / 910000, (state->second / 910) % 1000);
|
||||
}
|
||||
}
|
||||
|
@ -360,7 +360,7 @@ int autodetect_stereo(struct i2c_client *client)
|
|||
val = msp_read_dsp(client, 0x18);
|
||||
if (val > 32767)
|
||||
val -= 65536;
|
||||
v4l_dbg(2, client, "stereo detect register: %d\n", val);
|
||||
v4l_dbg(2, msp_debug, client, "stereo detect register: %d\n", val);
|
||||
if (val > 4096) {
|
||||
rxsubchans = V4L2_TUNER_SUB_STEREO | V4L2_TUNER_SUB_MONO;
|
||||
} else if (val < -4096) {
|
||||
|
@ -374,7 +374,7 @@ int autodetect_stereo(struct i2c_client *client)
|
|||
case MSP_MODE_FM_NICAM2:
|
||||
case MSP_MODE_AM_NICAM:
|
||||
val = msp_read_dem(client, 0x23);
|
||||
v4l_dbg(2, client, "nicam sync=%d, mode=%d\n",
|
||||
v4l_dbg(2, msp_debug, client, "nicam sync=%d, mode=%d\n",
|
||||
val & 1, (val & 0x1e) >> 1);
|
||||
|
||||
if (val & 1) {
|
||||
|
@ -407,7 +407,7 @@ int autodetect_stereo(struct i2c_client *client)
|
|||
break;
|
||||
case MSP_MODE_BTSC:
|
||||
val = msp_read_dem(client, 0x200);
|
||||
v4l_dbg(2, client, "status=0x%x (pri=%s, sec=%s, %s%s%s)\n",
|
||||
v4l_dbg(2, msp_debug, client, "status=0x%x (pri=%s, sec=%s, %s%s%s)\n",
|
||||
val,
|
||||
(val & 0x0002) ? "no" : "yes",
|
||||
(val & 0x0004) ? "no" : "yes",
|
||||
|
@ -421,13 +421,13 @@ int autodetect_stereo(struct i2c_client *client)
|
|||
}
|
||||
if (rxsubchans != state->rxsubchans) {
|
||||
update = 1;
|
||||
v4l_dbg(1, client, "watch: rxsubchans %d => %d\n",
|
||||
v4l_dbg(1, msp_debug, client, "watch: rxsubchans %d => %d\n",
|
||||
state->rxsubchans,rxsubchans);
|
||||
state->rxsubchans = rxsubchans;
|
||||
}
|
||||
if (newnicam != state->nicam_on) {
|
||||
update = 1;
|
||||
v4l_dbg(1, client, "watch: nicam %d => %d\n",
|
||||
v4l_dbg(1, msp_debug, client, "watch: nicam %d => %d\n",
|
||||
state->nicam_on,newnicam);
|
||||
state->nicam_on = newnicam;
|
||||
}
|
||||
|
@ -452,7 +452,7 @@ static void watch_stereo(struct i2c_client *client)
|
|||
msp3400c_setstereo(client, V4L2_TUNER_MODE_MONO);
|
||||
}
|
||||
|
||||
if (once)
|
||||
if (msp_once)
|
||||
state->watch_stereo = 0;
|
||||
}
|
||||
|
||||
|
@ -464,21 +464,21 @@ int msp3400c_thread(void *data)
|
|||
int count, max1,max2,val1,val2, val,this;
|
||||
|
||||
|
||||
v4l_dbg(1, client, "msp3400 daemon started\n");
|
||||
v4l_dbg(1, msp_debug, client, "msp3400 daemon started\n");
|
||||
for (;;) {
|
||||
v4l_dbg(2, client, "msp3400 thread: sleep\n");
|
||||
v4l_dbg(2, msp_debug, client, "msp3400 thread: sleep\n");
|
||||
msp_sleep(state, -1);
|
||||
v4l_dbg(2, client, "msp3400 thread: wakeup\n");
|
||||
v4l_dbg(2, msp_debug, client, "msp3400 thread: wakeup\n");
|
||||
|
||||
restart:
|
||||
v4l_dbg(1, client, "thread: restart scan\n");
|
||||
v4l_dbg(1, msp_debug, client, "thread: restart scan\n");
|
||||
state->restart = 0;
|
||||
if (kthread_should_stop())
|
||||
break;
|
||||
|
||||
if (state->radio || MSP_MODE_EXTERN == state->mode) {
|
||||
/* no carrier scan, just unmute */
|
||||
v4l_dbg(1, client, "thread: no carrier scan\n");
|
||||
v4l_dbg(1, msp_debug, client, "thread: no carrier scan\n");
|
||||
msp_set_audio(client);
|
||||
continue;
|
||||
}
|
||||
|
@ -498,11 +498,11 @@ int msp3400c_thread(void *data)
|
|||
cd = msp3400c_carrier_detect_main;
|
||||
count = ARRAY_SIZE(msp3400c_carrier_detect_main);
|
||||
|
||||
if (amsound && (state->v4l2_std & V4L2_STD_SECAM)) {
|
||||
if (msp_amsound && (state->v4l2_std & V4L2_STD_SECAM)) {
|
||||
/* autodetect doesn't work well with AM ... */
|
||||
max1 = 3;
|
||||
count = 0;
|
||||
v4l_dbg(1, client, "AM sound override\n");
|
||||
v4l_dbg(1, msp_debug, client, "AM sound override\n");
|
||||
}
|
||||
|
||||
for (this = 0; this < count; this++) {
|
||||
|
@ -514,7 +514,7 @@ int msp3400c_thread(void *data)
|
|||
val -= 65536;
|
||||
if (val1 < val)
|
||||
val1 = val, max1 = this;
|
||||
v4l_dbg(1, client, "carrier1 val: %5d / %s\n", val,cd[this].name);
|
||||
v4l_dbg(1, msp_debug, client, "carrier1 val: %5d / %s\n", val,cd[this].name);
|
||||
}
|
||||
|
||||
/* carrier detect pass #2 -- second (stereo) carrier */
|
||||
|
@ -535,7 +535,7 @@ int msp3400c_thread(void *data)
|
|||
break;
|
||||
}
|
||||
|
||||
if (amsound && (state->v4l2_std & V4L2_STD_SECAM)) {
|
||||
if (msp_amsound && (state->v4l2_std & V4L2_STD_SECAM)) {
|
||||
/* autodetect doesn't work well with AM ... */
|
||||
cd = NULL;
|
||||
count = 0;
|
||||
|
@ -550,7 +550,7 @@ int msp3400c_thread(void *data)
|
|||
val -= 65536;
|
||||
if (val2 < val)
|
||||
val2 = val, max2 = this;
|
||||
v4l_dbg(1, client, "carrier2 val: %5d / %s\n", val,cd[this].name);
|
||||
v4l_dbg(1, msp_debug, client, "carrier2 val: %5d / %s\n", val,cd[this].name);
|
||||
}
|
||||
|
||||
/* program the msp3400 according to the results */
|
||||
|
@ -627,7 +627,7 @@ int msp3400c_thread(void *data)
|
|||
/* unmute */
|
||||
msp_set_audio(client);
|
||||
|
||||
if (debug)
|
||||
if (msp_debug)
|
||||
msp3400c_print_mode(client);
|
||||
|
||||
/* monitor tv audio mode */
|
||||
|
@ -637,7 +637,7 @@ int msp3400c_thread(void *data)
|
|||
watch_stereo(client);
|
||||
}
|
||||
}
|
||||
v4l_dbg(1, client, "thread: exit\n");
|
||||
v4l_dbg(1, msp_debug, client, "thread: exit\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -648,22 +648,22 @@ int msp3410d_thread(void *data)
|
|||
struct msp_state *state = i2c_get_clientdata(client);
|
||||
int val, i, std;
|
||||
|
||||
v4l_dbg(1, client, "msp3410 daemon started\n");
|
||||
v4l_dbg(1, msp_debug, client, "msp3410 daemon started\n");
|
||||
|
||||
for (;;) {
|
||||
v4l_dbg(2, client, "msp3410 thread: sleep\n");
|
||||
v4l_dbg(2, msp_debug, client, "msp3410 thread: sleep\n");
|
||||
msp_sleep(state,-1);
|
||||
v4l_dbg(2, client, "msp3410 thread: wakeup\n");
|
||||
v4l_dbg(2, msp_debug, client, "msp3410 thread: wakeup\n");
|
||||
|
||||
restart:
|
||||
v4l_dbg(1, client, "thread: restart scan\n");
|
||||
v4l_dbg(1, msp_debug, client, "thread: restart scan\n");
|
||||
state->restart = 0;
|
||||
if (kthread_should_stop())
|
||||
break;
|
||||
|
||||
if (state->mode == MSP_MODE_EXTERN) {
|
||||
/* no carrier scan needed, just unmute */
|
||||
v4l_dbg(1, client, "thread: no carrier scan\n");
|
||||
v4l_dbg(1, msp_debug, client, "thread: no carrier scan\n");
|
||||
msp_set_audio(client);
|
||||
continue;
|
||||
}
|
||||
|
@ -682,8 +682,8 @@ int msp3410d_thread(void *data)
|
|||
std = (state->v4l2_std & V4L2_STD_NTSC) ? 0x20 : 1;
|
||||
state->watch_stereo = 0;
|
||||
|
||||
if (debug)
|
||||
v4l_dbg(1, client, "setting standard: %s (0x%04x)\n",
|
||||
if (msp_debug)
|
||||
v4l_dbg(1, msp_debug, client, "setting standard: %s (0x%04x)\n",
|
||||
msp_standard_std_name(std), std);
|
||||
|
||||
if (std != 1) {
|
||||
|
@ -700,22 +700,22 @@ int msp3410d_thread(void *data)
|
|||
val = msp_read_dem(client, 0x7e);
|
||||
if (val < 0x07ff)
|
||||
break;
|
||||
v4l_dbg(1, client, "detection still in progress\n");
|
||||
v4l_dbg(1, msp_debug, client, "detection still in progress\n");
|
||||
}
|
||||
}
|
||||
for (i = 0; msp_stdlist[i].name != NULL; i++)
|
||||
if (msp_stdlist[i].retval == val)
|
||||
break;
|
||||
v4l_dbg(1, client, "current standard: %s (0x%04x)\n",
|
||||
v4l_dbg(1, msp_debug, client, "current standard: %s (0x%04x)\n",
|
||||
msp_standard_std_name(val), val);
|
||||
state->main = msp_stdlist[i].main;
|
||||
state->second = msp_stdlist[i].second;
|
||||
state->std = val;
|
||||
|
||||
if (amsound && !state->radio && (state->v4l2_std & V4L2_STD_SECAM) &&
|
||||
if (msp_amsound && !state->radio && (state->v4l2_std & V4L2_STD_SECAM) &&
|
||||
(val != 0x0009)) {
|
||||
/* autodetection has failed, let backup */
|
||||
v4l_dbg(1, client, "autodetection failed,"
|
||||
v4l_dbg(1, msp_debug, client, "autodetection failed,"
|
||||
" switching to backup standard: %s (0x%04x)\n",
|
||||
msp_stdlist[8].name ? msp_stdlist[8].name : "unknown",val);
|
||||
val = 0x0009;
|
||||
|
@ -798,7 +798,7 @@ int msp3410d_thread(void *data)
|
|||
watch_stereo(client);
|
||||
}
|
||||
}
|
||||
v4l_dbg(1, client, "thread: exit\n");
|
||||
v4l_dbg(1, msp_debug, client, "thread: exit\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -825,7 +825,7 @@ static void msp34xxg_set_source(struct i2c_client *client, int source)
|
|||
*/
|
||||
int value = (source & 0x07) << 8 | (source == 0 ? 0x30 : 0x20);
|
||||
|
||||
v4l_dbg(1, client, "set source to %d (0x%x)\n", source, value);
|
||||
v4l_dbg(1, msp_debug, client, "set source to %d (0x%x)\n", source, value);
|
||||
/* Loudspeaker Output */
|
||||
msp_write_dsp(client, 0x08, value);
|
||||
/* SCART1 DA Output */
|
||||
|
@ -840,7 +840,7 @@ static void msp34xxg_set_source(struct i2c_client *client, int source)
|
|||
* 0x7f0 = forced mono mode
|
||||
*/
|
||||
/* a2 threshold for stereo/bilingual */
|
||||
msp_write_dem(client, 0x22, stereo_threshold);
|
||||
msp_write_dem(client, 0x22, msp_stereo_thresh);
|
||||
state->source = source;
|
||||
}
|
||||
|
||||
|
@ -897,28 +897,28 @@ int msp34xxg_thread(void *data)
|
|||
struct msp_state *state = i2c_get_clientdata(client);
|
||||
int val, std, i;
|
||||
|
||||
v4l_dbg(1, client, "msp34xxg daemon started\n");
|
||||
v4l_dbg(1, msp_debug, client, "msp34xxg daemon started\n");
|
||||
|
||||
state->source = 1; /* default */
|
||||
for (;;) {
|
||||
v4l_dbg(2, client, "msp34xxg thread: sleep\n");
|
||||
v4l_dbg(2, msp_debug, client, "msp34xxg thread: sleep\n");
|
||||
msp_sleep(state, -1);
|
||||
v4l_dbg(2, client, "msp34xxg thread: wakeup\n");
|
||||
v4l_dbg(2, msp_debug, client, "msp34xxg thread: wakeup\n");
|
||||
|
||||
restart:
|
||||
v4l_dbg(1, client, "thread: restart scan\n");
|
||||
v4l_dbg(1, msp_debug, client, "thread: restart scan\n");
|
||||
state->restart = 0;
|
||||
if (kthread_should_stop())
|
||||
break;
|
||||
|
||||
/* setup the chip*/
|
||||
msp34xxg_reset(client);
|
||||
std = standard;
|
||||
std = msp_standard;
|
||||
if (std != 0x01)
|
||||
goto unmute;
|
||||
|
||||
/* watch autodetect */
|
||||
v4l_dbg(1, client, "triggered autodetect, waiting for result\n");
|
||||
v4l_dbg(1, msp_debug, client, "triggered autodetect, waiting for result\n");
|
||||
for (i = 0; i < 10; i++) {
|
||||
if (msp_sleep(state, 100))
|
||||
goto restart;
|
||||
|
@ -929,16 +929,16 @@ int msp34xxg_thread(void *data)
|
|||
std = val;
|
||||
break;
|
||||
}
|
||||
v4l_dbg(2, client, "detection still in progress\n");
|
||||
v4l_dbg(2, msp_debug, client, "detection still in progress\n");
|
||||
}
|
||||
if (std == 1) {
|
||||
v4l_dbg(1, client, "detection still in progress after 10 tries. giving up.\n");
|
||||
v4l_dbg(1, msp_debug, client, "detection still in progress after 10 tries. giving up.\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
unmute:
|
||||
state->std = std;
|
||||
v4l_dbg(1, client, "current standard: %s (0x%04x)\n",
|
||||
v4l_dbg(1, msp_debug, client, "current standard: %s (0x%04x)\n",
|
||||
msp_standard_std_name(std), std);
|
||||
|
||||
/* unmute: dispatch sound to scart output, set scart volume */
|
||||
|
@ -950,7 +950,7 @@ int msp34xxg_thread(void *data)
|
|||
|
||||
msp_write_dem(client, 0x40, state->i2s_mode);
|
||||
}
|
||||
v4l_dbg(1, client, "thread: exit\n");
|
||||
v4l_dbg(1, msp_debug, client, "thread: exit\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -976,7 +976,7 @@ void msp34xxg_detect_stereo(struct i2c_client *client)
|
|||
* this is a problem, I'll handle SAP just like lang1/lang2.
|
||||
*/
|
||||
}
|
||||
v4l_dbg(1, client, "status=0x%x, stereo=%d, bilingual=%d -> rxsubchans=%d\n",
|
||||
v4l_dbg(1, msp_debug, client, "status=0x%x, stereo=%d, bilingual=%d -> rxsubchans=%d\n",
|
||||
status, is_stereo, is_bilingual, state->rxsubchans);
|
||||
}
|
||||
|
||||
|
|
|
@ -48,12 +48,12 @@ struct msp_matrix {
|
|||
#define OPMODE_AUTOSELECT 2 /* use autodetect & autoselect (>= msp34xxG) */
|
||||
|
||||
/* module parameters */
|
||||
extern int debug;
|
||||
extern int once;
|
||||
extern int amsound;
|
||||
extern int standard;
|
||||
extern int dolby;
|
||||
extern int stereo_threshold;
|
||||
extern int msp_debug;
|
||||
extern int msp_once;
|
||||
extern int msp_amsound;
|
||||
extern int msp_standard;
|
||||
extern int msp_dolby;
|
||||
extern int msp_stereo_thresh;
|
||||
|
||||
struct msp_state {
|
||||
int rev1, rev2;
|
||||
|
|
|
@ -21,7 +21,7 @@ static unsigned int radio_antenna = 0;
|
|||
module_param(radio_antenna, int, 0644);
|
||||
|
||||
/* from tuner-core.c */
|
||||
extern int debug;
|
||||
extern int tuner_debug;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
|
@ -404,7 +404,7 @@ static void mt2050_set_if_freq(struct i2c_client *c,unsigned int freq, unsigned
|
|||
div2a=(lo2/8)-1;
|
||||
div2b=lo2-(div2a+1)*8;
|
||||
|
||||
if (debug > 1) {
|
||||
if (tuner_debug > 1) {
|
||||
tuner_dbg("lo1 lo2 = %d %d\n", lo1, lo2);
|
||||
tuner_dbg("num1 num2 div1a div1b div2a div2b= %x %x %x %x %x %x\n",
|
||||
num1,num2,div1a,div1b,div2a,div2b);
|
||||
|
@ -420,7 +420,7 @@ static void mt2050_set_if_freq(struct i2c_client *c,unsigned int freq, unsigned
|
|||
buf[5]=div2a;
|
||||
if(num2!=0) buf[5]=buf[5]|0x40;
|
||||
|
||||
if (debug > 1) {
|
||||
if (tuner_debug > 1) {
|
||||
int i;
|
||||
tuner_dbg("bufs is: ");
|
||||
for(i=0;i<6;i++)
|
||||
|
@ -508,7 +508,7 @@ int microtune_init(struct i2c_client *c)
|
|||
|
||||
i2c_master_send(c,buf,1);
|
||||
i2c_master_recv(c,buf,21);
|
||||
if (debug) {
|
||||
if (tuner_debug) {
|
||||
int i;
|
||||
tuner_dbg("MT20xx hexdump:");
|
||||
for(i=0;i<21;i++) {
|
||||
|
|
|
@ -177,12 +177,11 @@ static int mxb_probe(struct saa7146_dev* dev)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
mxb = (struct mxb*)kmalloc(sizeof(struct mxb), GFP_KERNEL);
|
||||
mxb = kzalloc(sizeof(struct mxb), GFP_KERNEL);
|
||||
if( NULL == mxb ) {
|
||||
DEB_D(("not enough kernel memory.\n"));
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(mxb, 0x0, sizeof(struct mxb));
|
||||
|
||||
mxb->i2c_adapter = (struct i2c_adapter) {
|
||||
.class = I2C_CLASS_TV_ANALOG,
|
||||
|
|
|
@ -178,10 +178,9 @@ static int ov6x20_init(struct i2c_client *c)
|
|||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
ov->spriv = s = kmalloc(sizeof *s, GFP_KERNEL);
|
||||
ov->spriv = s = kzalloc(sizeof *s, GFP_KERNEL);
|
||||
if (!s)
|
||||
return -ENOMEM;
|
||||
memset(s, 0, sizeof *s);
|
||||
|
||||
s->auto_brt = 1;
|
||||
s->auto_exp = 1;
|
||||
|
|
|
@ -141,10 +141,9 @@ static int ov6x30_init(struct i2c_client *c)
|
|||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
ov->spriv = s = kmalloc(sizeof *s, GFP_KERNEL);
|
||||
ov->spriv = s = kzalloc(sizeof *s, GFP_KERNEL);
|
||||
if (!s)
|
||||
return -ENOMEM;
|
||||
memset(s, 0, sizeof *s);
|
||||
|
||||
s->auto_brt = 1;
|
||||
s->auto_exp = 1;
|
||||
|
|
|
@ -105,10 +105,9 @@ static int ov76be_init(struct i2c_client *c)
|
|||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
ov->spriv = s = kmalloc(sizeof *s, GFP_KERNEL);
|
||||
ov->spriv = s = kzalloc(sizeof *s, GFP_KERNEL);
|
||||
if (!s)
|
||||
return -ENOMEM;
|
||||
memset(s, 0, sizeof *s);
|
||||
|
||||
s->auto_brt = 1;
|
||||
s->auto_exp = 1;
|
||||
|
|
|
@ -115,10 +115,9 @@ static int ov7x10_init(struct i2c_client *c)
|
|||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
ov->spriv = s = kmalloc(sizeof *s, GFP_KERNEL);
|
||||
ov->spriv = s = kzalloc(sizeof *s, GFP_KERNEL);
|
||||
if (!s)
|
||||
return -ENOMEM;
|
||||
memset(s, 0, sizeof *s);
|
||||
|
||||
s->auto_brt = 1;
|
||||
s->auto_exp = 1;
|
||||
|
|
|
@ -232,10 +232,9 @@ static int ov7x20_init(struct i2c_client *c)
|
|||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
ov->spriv = s = kmalloc(sizeof *s, GFP_KERNEL);
|
||||
ov->spriv = s = kzalloc(sizeof *s, GFP_KERNEL);
|
||||
if (!s)
|
||||
return -ENOMEM;
|
||||
memset(s, 0, sizeof *s);
|
||||
|
||||
s->auto_brt = 1;
|
||||
s->auto_exp = DFL_AUTO_EXP;
|
||||
|
|
|
@ -316,12 +316,11 @@ static int ovcamchip_attach(struct i2c_adapter *adap)
|
|||
c->adapter = adap;
|
||||
strcpy(c->name, "OV????");
|
||||
|
||||
ov = kmalloc(sizeof *ov, GFP_KERNEL);
|
||||
ov = kzalloc(sizeof *ov, GFP_KERNEL);
|
||||
if (!ov) {
|
||||
rc = -ENOMEM;
|
||||
goto no_ov;
|
||||
}
|
||||
memset(ov, 0, sizeof *ov);
|
||||
i2c_set_clientdata(c, ov);
|
||||
|
||||
rc = ovcamchip_detect(c);
|
||||
|
|
|
@ -83,13 +83,12 @@ static int saa5246a_attach(struct i2c_adapter *adap, int addr, int kind)
|
|||
client_template.adapter = adap;
|
||||
client_template.addr = addr;
|
||||
memcpy(client, &client_template, sizeof(*client));
|
||||
t = kmalloc(sizeof(*t), GFP_KERNEL);
|
||||
t = kzalloc(sizeof(*t), GFP_KERNEL);
|
||||
if(t==NULL)
|
||||
{
|
||||
kfree(client);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(t, 0, sizeof(*t));
|
||||
strlcpy(client->name, IF_NAME, I2C_NAME_SIZE);
|
||||
init_MUTEX(&t->lock);
|
||||
|
||||
|
|
|
@ -151,13 +151,12 @@ static int saa5249_attach(struct i2c_adapter *adap, int addr, int kind)
|
|||
client_template.adapter = adap;
|
||||
client_template.addr = addr;
|
||||
memcpy(client, &client_template, sizeof(*client));
|
||||
t = kmalloc(sizeof(*t), GFP_KERNEL);
|
||||
t = kzalloc(sizeof(*t), GFP_KERNEL);
|
||||
if(t==NULL)
|
||||
{
|
||||
kfree(client);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(t, 0, sizeof(*t));
|
||||
strlcpy(client->name, IF_NAME, I2C_NAME_SIZE);
|
||||
init_MUTEX(&t->lock);
|
||||
|
||||
|
@ -165,7 +164,7 @@ static int saa5249_attach(struct i2c_adapter *adap, int addr, int kind)
|
|||
* Now create a video4linux device
|
||||
*/
|
||||
|
||||
vd = (struct video_device *)kmalloc(sizeof(struct video_device), GFP_KERNEL);
|
||||
vd = kmalloc(sizeof(struct video_device), GFP_KERNEL);
|
||||
if(vd==NULL)
|
||||
{
|
||||
kfree(t);
|
||||
|
|
|
@ -494,21 +494,19 @@ saa7110_detect_client (struct i2c_adapter *adapter,
|
|||
I2C_FUNC_SMBUS_READ_BYTE | I2C_FUNC_SMBUS_WRITE_BYTE_DATA))
|
||||
return 0;
|
||||
|
||||
client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
if (client == 0)
|
||||
return -ENOMEM;
|
||||
memset(client, 0, sizeof(struct i2c_client));
|
||||
client->addr = address;
|
||||
client->adapter = adapter;
|
||||
client->driver = &i2c_driver_saa7110;
|
||||
strlcpy(I2C_NAME(client), "saa7110", sizeof(I2C_NAME(client)));
|
||||
|
||||
decoder = kmalloc(sizeof(struct saa7110), GFP_KERNEL);
|
||||
decoder = kzalloc(sizeof(struct saa7110), GFP_KERNEL);
|
||||
if (decoder == 0) {
|
||||
kfree(client);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(decoder, 0, sizeof(struct saa7110));
|
||||
decoder->norm = VIDEO_MODE_PAL;
|
||||
decoder->input = 0;
|
||||
decoder->enable = 1;
|
||||
|
|
|
@ -511,21 +511,19 @@ saa7111_detect_client (struct i2c_adapter *adapter,
|
|||
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
|
||||
return 0;
|
||||
|
||||
client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
if (client == 0)
|
||||
return -ENOMEM;
|
||||
memset(client, 0, sizeof(struct i2c_client));
|
||||
client->addr = address;
|
||||
client->adapter = adapter;
|
||||
client->driver = &i2c_driver_saa7111;
|
||||
strlcpy(I2C_NAME(client), "saa7111", sizeof(I2C_NAME(client)));
|
||||
|
||||
decoder = kmalloc(sizeof(struct saa7111), GFP_KERNEL);
|
||||
decoder = kzalloc(sizeof(struct saa7111), GFP_KERNEL);
|
||||
if (decoder == NULL) {
|
||||
kfree(client);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(decoder, 0, sizeof(struct saa7111));
|
||||
decoder->norm = VIDEO_MODE_NTSC;
|
||||
decoder->input = 0;
|
||||
decoder->enable = 1;
|
||||
|
|
|
@ -852,21 +852,19 @@ saa7114_detect_client (struct i2c_adapter *adapter,
|
|||
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
|
||||
return 0;
|
||||
|
||||
client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
if (client == 0)
|
||||
return -ENOMEM;
|
||||
memset(client, 0, sizeof(struct i2c_client));
|
||||
client->addr = address;
|
||||
client->adapter = adapter;
|
||||
client->driver = &i2c_driver_saa7114;
|
||||
strlcpy(I2C_NAME(client), "saa7114", sizeof(I2C_NAME(client)));
|
||||
|
||||
decoder = kmalloc(sizeof(struct saa7114), GFP_KERNEL);
|
||||
decoder = kzalloc(sizeof(struct saa7114), GFP_KERNEL);
|
||||
if (decoder == NULL) {
|
||||
kfree(client);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(decoder, 0, sizeof(struct saa7114));
|
||||
decoder->norm = VIDEO_MODE_NTSC;
|
||||
decoder->input = -1;
|
||||
decoder->enable = 1;
|
||||
|
|
|
@ -549,7 +549,7 @@ static int saa7115_set_audio_clock_freq(struct i2c_client *client, u32 freq)
|
|||
u32 hz;
|
||||
u64 f;
|
||||
|
||||
v4l_dbg(1, client, "set audio clock freq: %d\n", freq);
|
||||
v4l_dbg(1, debug, client, "set audio clock freq: %d\n", freq);
|
||||
|
||||
/* sanity check */
|
||||
if (freq < 32000 || freq > 48000)
|
||||
|
@ -670,10 +670,10 @@ static void saa7115_set_v4lstd(struct i2c_client *client, v4l2_std_id std)
|
|||
|
||||
// This works for NTSC-M, SECAM-L and the 50Hz PAL variants.
|
||||
if (std & V4L2_STD_525_60) {
|
||||
v4l_dbg(1, client, "decoder set standard 60 Hz\n");
|
||||
v4l_dbg(1, debug, client, "decoder set standard 60 Hz\n");
|
||||
saa7115_writeregs(client, saa7115_cfg_60hz_video);
|
||||
} else {
|
||||
v4l_dbg(1, client, "decoder set standard 50 Hz\n");
|
||||
v4l_dbg(1, debug, client, "decoder set standard 50 Hz\n");
|
||||
saa7115_writeregs(client, saa7115_cfg_50hz_video);
|
||||
}
|
||||
|
||||
|
@ -863,7 +863,7 @@ static int saa7115_set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt
|
|||
|
||||
pix = &(fmt->fmt.pix);
|
||||
|
||||
v4l_dbg(1, client, "decoder set size\n");
|
||||
v4l_dbg(1, debug, client, "decoder set size\n");
|
||||
|
||||
/* FIXME need better bounds checking here */
|
||||
if ((pix->width < 1) || (pix->width > 1440))
|
||||
|
@ -889,7 +889,7 @@ static int saa7115_set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt
|
|||
HPSC = HPSC ? HPSC : 1;
|
||||
HFSC = (int)((1024 * 720) / (HPSC * pix->width));
|
||||
|
||||
v4l_dbg(1, client, "Hpsc: 0x%05x, Hfsc: 0x%05x\n", HPSC, HFSC);
|
||||
v4l_dbg(1, debug, client, "Hpsc: 0x%05x, Hfsc: 0x%05x\n", HPSC, HFSC);
|
||||
/* FIXME hardcodes to "Task B"
|
||||
* write H prescaler integer */
|
||||
saa7115_write(client, 0xd0, (u8) (HPSC & 0x3f));
|
||||
|
@ -903,10 +903,10 @@ static int saa7115_set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt
|
|||
saa7115_write(client, 0xDD, (u8) ((HFSC >> 9) & 0xff));
|
||||
} else {
|
||||
if (is_50hz) {
|
||||
v4l_dbg(1, client, "Setting full 50hz width\n");
|
||||
v4l_dbg(1, debug, client, "Setting full 50hz width\n");
|
||||
saa7115_writeregs(client, saa7115_cfg_50hz_fullres_x);
|
||||
} else {
|
||||
v4l_dbg(1, client, "Setting full 60hz width\n");
|
||||
v4l_dbg(1, debug, client, "Setting full 60hz width\n");
|
||||
saa7115_writeregs(client, saa7115_cfg_60hz_fullres_x);
|
||||
}
|
||||
}
|
||||
|
@ -915,7 +915,7 @@ static int saa7115_set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt
|
|||
|
||||
if (pix->height != Vsrc) {
|
||||
VSCY = (int)((1024 * Vsrc) / pix->height);
|
||||
v4l_dbg(1, client, "Vsrc: %d, Vscy: 0x%05x\n", Vsrc, VSCY);
|
||||
v4l_dbg(1, debug, client, "Vsrc: %d, Vscy: 0x%05x\n", Vsrc, VSCY);
|
||||
|
||||
/* Correct Contrast and Luminance */
|
||||
saa7115_write(client, 0xd5, (u8) (64 * 1024 / VSCY));
|
||||
|
@ -929,10 +929,10 @@ static int saa7115_set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt
|
|||
saa7115_write(client, 0xe3, (u8) ((VSCY >> 8) & 0xff));
|
||||
} else {
|
||||
if (is_50hz) {
|
||||
v4l_dbg(1, client, "Setting full 50Hz height\n");
|
||||
v4l_dbg(1, debug, client, "Setting full 50Hz height\n");
|
||||
saa7115_writeregs(client, saa7115_cfg_50hz_fullres_y);
|
||||
} else {
|
||||
v4l_dbg(1, client, "Setting full 60hz height\n");
|
||||
v4l_dbg(1, debug, client, "Setting full 60hz height\n");
|
||||
saa7115_writeregs(client, saa7115_cfg_60hz_fullres_y);
|
||||
}
|
||||
}
|
||||
|
@ -1079,7 +1079,7 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar
|
|||
break;
|
||||
status = saa7115_read(client, 0x1f);
|
||||
|
||||
v4l_dbg(1, client, "status: 0x%02x\n", status);
|
||||
v4l_dbg(1, debug, client, "status: 0x%02x\n", status);
|
||||
vt->signal = ((status & (1 << 6)) == 0) ? 0xffff : 0x0;
|
||||
break;
|
||||
}
|
||||
|
@ -1125,7 +1125,7 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar
|
|||
break;
|
||||
|
||||
case VIDIOC_S_INPUT:
|
||||
v4l_dbg(1, client, "decoder set input %d\n", *iarg);
|
||||
v4l_dbg(1, debug, client, "decoder set input %d\n", *iarg);
|
||||
/* inputs from 0-9 are available */
|
||||
if (*iarg < 0 || *iarg > 9) {
|
||||
return -EINVAL;
|
||||
|
@ -1133,7 +1133,7 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar
|
|||
|
||||
if (state->input == *iarg)
|
||||
break;
|
||||
v4l_dbg(1, client, "now setting %s input\n",
|
||||
v4l_dbg(1, debug, client, "now setting %s input\n",
|
||||
*iarg >= 6 ? "S-Video" : "Composite");
|
||||
state->input = *iarg;
|
||||
|
||||
|
@ -1150,7 +1150,7 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar
|
|||
|
||||
case VIDIOC_STREAMON:
|
||||
case VIDIOC_STREAMOFF:
|
||||
v4l_dbg(1, client, "%s output\n",
|
||||
v4l_dbg(1, debug, client, "%s output\n",
|
||||
(cmd == VIDIOC_STREAMON) ? "enable" : "disable");
|
||||
|
||||
if (state->enable != (cmd == VIDIOC_STREAMON)) {
|
||||
|
@ -1164,7 +1164,7 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar
|
|||
break;
|
||||
|
||||
case VIDIOC_INT_RESET:
|
||||
v4l_dbg(1, client, "decoder RESET\n");
|
||||
v4l_dbg(1, debug, client, "decoder RESET\n");
|
||||
saa7115_writeregs(client, saa7115_cfg_reset_scaler);
|
||||
break;
|
||||
|
||||
|
@ -1249,21 +1249,20 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind)
|
|||
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
|
||||
return 0;
|
||||
|
||||
client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
if (client == 0)
|
||||
return -ENOMEM;
|
||||
memset(client, 0, sizeof(struct i2c_client));
|
||||
client->addr = address;
|
||||
client->adapter = adapter;
|
||||
client->driver = &i2c_driver_saa7115;
|
||||
snprintf(client->name, sizeof(client->name) - 1, "saa7115");
|
||||
|
||||
v4l_dbg(1, client, "detecting saa7115 client on address 0x%x\n", address << 1);
|
||||
v4l_dbg(1, debug, client, "detecting saa7115 client on address 0x%x\n", address << 1);
|
||||
|
||||
saa7115_write(client, 0, 5);
|
||||
chip_id = saa7115_read(client, 0) & 0x0f;
|
||||
if (chip_id != 4 && chip_id != 5) {
|
||||
v4l_dbg(1, client, "saa7115 not found\n");
|
||||
v4l_dbg(1, debug, client, "saa7115 not found\n");
|
||||
kfree(client);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1272,13 +1271,12 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind)
|
|||
}
|
||||
v4l_info(client, "saa711%d found @ 0x%x (%s)\n", chip_id, address << 1, adapter->name);
|
||||
|
||||
state = kmalloc(sizeof(struct saa7115_state), GFP_KERNEL);
|
||||
state = kzalloc(sizeof(struct saa7115_state), GFP_KERNEL);
|
||||
i2c_set_clientdata(client, state);
|
||||
if (state == NULL) {
|
||||
kfree(client);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(state, 0, sizeof(struct saa7115_state));
|
||||
state->std = V4L2_STD_NTSC;
|
||||
state->input = -1;
|
||||
state->enable = 1;
|
||||
|
@ -1290,7 +1288,7 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind)
|
|||
state->ident = (chip_id == 4) ? V4L2_IDENT_SAA7114 : V4L2_IDENT_SAA7115;
|
||||
state->audclk_freq = 48000;
|
||||
|
||||
v4l_dbg(1, client, "writing init values\n");
|
||||
v4l_dbg(1, debug, client, "writing init values\n");
|
||||
|
||||
/* init to 60hz/48khz */
|
||||
saa7115_writeregs(client, saa7115_init_auto_input);
|
||||
|
@ -1303,7 +1301,7 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind)
|
|||
|
||||
i2c_attach_client(client);
|
||||
|
||||
v4l_dbg(1, client, "status: (1E) 0x%02x, (1F) 0x%02x\n",
|
||||
v4l_dbg(1, debug, client, "status: (1E) 0x%02x, (1F) 0x%02x\n",
|
||||
saa7115_read(client, 0x1e), saa7115_read(client, 0x1f));
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -487,20 +487,18 @@ saa711x_detect_client (struct i2c_adapter *adapter,
|
|||
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
|
||||
return 0;
|
||||
|
||||
client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
if (client == 0)
|
||||
return -ENOMEM;
|
||||
memset(client, 0, sizeof(struct i2c_client));
|
||||
client->addr = address;
|
||||
client->adapter = adapter;
|
||||
client->driver = &i2c_driver_saa711x;
|
||||
strlcpy(I2C_NAME(client), "saa711x", sizeof(I2C_NAME(client)));
|
||||
decoder = kmalloc(sizeof(struct saa711x), GFP_KERNEL);
|
||||
decoder = kzalloc(sizeof(struct saa711x), GFP_KERNEL);
|
||||
if (decoder == NULL) {
|
||||
kfree(client);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(decoder, 0, sizeof(struct saa711x));
|
||||
decoder->norm = VIDEO_MODE_NTSC;
|
||||
decoder->input = 0;
|
||||
decoder->enable = 1;
|
||||
|
|
|
@ -338,7 +338,7 @@ static int saa7127_set_vps(struct i2c_client *client, struct v4l2_sliced_vbi_dat
|
|||
if (enable && (data->field != 0 || data->line != 16))
|
||||
return -EINVAL;
|
||||
if (state->vps_enable != enable) {
|
||||
v4l_dbg(1, client, "Turn VPS Signal %s\n", enable ? "on" : "off");
|
||||
v4l_dbg(1, debug, client, "Turn VPS Signal %s\n", enable ? "on" : "off");
|
||||
saa7127_write(client, 0x54, enable << 7);
|
||||
state->vps_enable = enable;
|
||||
}
|
||||
|
@ -350,7 +350,7 @@ static int saa7127_set_vps(struct i2c_client *client, struct v4l2_sliced_vbi_dat
|
|||
state->vps_data[2] = data->data[11];
|
||||
state->vps_data[3] = data->data[12];
|
||||
state->vps_data[4] = data->data[13];
|
||||
v4l_dbg(1, client, "Set VPS data %02x %02x %02x %02x %02x\n",
|
||||
v4l_dbg(1, debug, client, "Set VPS data %02x %02x %02x %02x %02x\n",
|
||||
state->vps_data[0], state->vps_data[1],
|
||||
state->vps_data[2], state->vps_data[3],
|
||||
state->vps_data[4]);
|
||||
|
@ -373,7 +373,7 @@ static int saa7127_set_cc(struct i2c_client *client, struct v4l2_sliced_vbi_data
|
|||
if (enable && (data->field != 0 || data->line != 21))
|
||||
return -EINVAL;
|
||||
if (state->cc_enable != enable) {
|
||||
v4l_dbg(1, client, "Turn CC %s\n", enable ? "on" : "off");
|
||||
v4l_dbg(1, debug, client, "Turn CC %s\n", enable ? "on" : "off");
|
||||
saa7127_write(client, SAA7127_REG_CLOSED_CAPTION,
|
||||
(state->xds_enable << 7) | (enable << 6) | 0x11);
|
||||
state->cc_enable = enable;
|
||||
|
@ -381,7 +381,7 @@ static int saa7127_set_cc(struct i2c_client *client, struct v4l2_sliced_vbi_data
|
|||
if (!enable)
|
||||
return 0;
|
||||
|
||||
v4l_dbg(2, client, "CC data: %04x\n", cc);
|
||||
v4l_dbg(2, debug, client, "CC data: %04x\n", cc);
|
||||
saa7127_write(client, SAA7127_REG_LINE_21_ODD_0, cc & 0xff);
|
||||
saa7127_write(client, SAA7127_REG_LINE_21_ODD_1, cc >> 8);
|
||||
state->cc_data = cc;
|
||||
|
@ -399,7 +399,7 @@ static int saa7127_set_xds(struct i2c_client *client, struct v4l2_sliced_vbi_dat
|
|||
if (enable && (data->field != 1 || data->line != 21))
|
||||
return -EINVAL;
|
||||
if (state->xds_enable != enable) {
|
||||
v4l_dbg(1, client, "Turn XDS %s\n", enable ? "on" : "off");
|
||||
v4l_dbg(1, debug, client, "Turn XDS %s\n", enable ? "on" : "off");
|
||||
saa7127_write(client, SAA7127_REG_CLOSED_CAPTION,
|
||||
(enable << 7) | (state->cc_enable << 6) | 0x11);
|
||||
state->xds_enable = enable;
|
||||
|
@ -407,7 +407,7 @@ static int saa7127_set_xds(struct i2c_client *client, struct v4l2_sliced_vbi_dat
|
|||
if (!enable)
|
||||
return 0;
|
||||
|
||||
v4l_dbg(2, client, "XDS data: %04x\n", xds);
|
||||
v4l_dbg(2, debug, client, "XDS data: %04x\n", xds);
|
||||
saa7127_write(client, SAA7127_REG_LINE_21_EVEN_0, xds & 0xff);
|
||||
saa7127_write(client, SAA7127_REG_LINE_21_EVEN_1, xds >> 8);
|
||||
state->xds_data = xds;
|
||||
|
@ -424,7 +424,7 @@ static int saa7127_set_wss(struct i2c_client *client, struct v4l2_sliced_vbi_dat
|
|||
if (enable && (data->field != 0 || data->line != 23))
|
||||
return -EINVAL;
|
||||
if (state->wss_enable != enable) {
|
||||
v4l_dbg(1, client, "Turn WSS %s\n", enable ? "on" : "off");
|
||||
v4l_dbg(1, debug, client, "Turn WSS %s\n", enable ? "on" : "off");
|
||||
saa7127_write(client, 0x27, enable << 7);
|
||||
state->wss_enable = enable;
|
||||
}
|
||||
|
@ -433,7 +433,7 @@ static int saa7127_set_wss(struct i2c_client *client, struct v4l2_sliced_vbi_dat
|
|||
|
||||
saa7127_write(client, 0x26, data->data[0]);
|
||||
saa7127_write(client, 0x27, 0x80 | (data->data[1] & 0x3f));
|
||||
v4l_dbg(1, client, "WSS mode: %s\n", wss_strs[data->data[0] & 0xf]);
|
||||
v4l_dbg(1, debug, client, "WSS mode: %s\n", wss_strs[data->data[0] & 0xf]);
|
||||
state->wss_mode = (data->data[1] & 0x3f) << 8 | data->data[0];
|
||||
return 0;
|
||||
}
|
||||
|
@ -445,11 +445,11 @@ static int saa7127_set_video_enable(struct i2c_client *client, int enable)
|
|||
struct saa7127_state *state = i2c_get_clientdata(client);
|
||||
|
||||
if (enable) {
|
||||
v4l_dbg(1, client, "Enable Video Output\n");
|
||||
v4l_dbg(1, debug, client, "Enable Video Output\n");
|
||||
saa7127_write(client, 0x2d, state->reg_2d);
|
||||
saa7127_write(client, 0x61, state->reg_61);
|
||||
} else {
|
||||
v4l_dbg(1, client, "Disable Video Output\n");
|
||||
v4l_dbg(1, debug, client, "Disable Video Output\n");
|
||||
saa7127_write(client, 0x2d, (state->reg_2d & 0xf0));
|
||||
saa7127_write(client, 0x61, (state->reg_61 | 0xc0));
|
||||
}
|
||||
|
@ -465,11 +465,11 @@ static int saa7127_set_std(struct i2c_client *client, v4l2_std_id std)
|
|||
const struct i2c_reg_value *inittab;
|
||||
|
||||
if (std & V4L2_STD_525_60) {
|
||||
v4l_dbg(1, client, "Selecting 60 Hz video Standard\n");
|
||||
v4l_dbg(1, debug, client, "Selecting 60 Hz video Standard\n");
|
||||
inittab = saa7127_init_config_60hz;
|
||||
state->reg_61 = SAA7127_60HZ_DAC_CONTROL;
|
||||
} else {
|
||||
v4l_dbg(1, client, "Selecting 50 Hz video Standard\n");
|
||||
v4l_dbg(1, debug, client, "Selecting 50 Hz video Standard\n");
|
||||
inittab = saa7127_init_config_50hz;
|
||||
state->reg_61 = SAA7127_50HZ_DAC_CONTROL;
|
||||
}
|
||||
|
@ -520,7 +520,7 @@ static int saa7127_set_output_type(struct i2c_client *client, int output)
|
|||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
v4l_dbg(1, client, "Selecting %s output type\n", output_strs[output]);
|
||||
v4l_dbg(1, debug, client, "Selecting %s output type\n", output_strs[output]);
|
||||
|
||||
/* Configure Encoder */
|
||||
saa7127_write(client, 0x2d, state->reg_2d);
|
||||
|
@ -537,12 +537,12 @@ static int saa7127_set_input_type(struct i2c_client *client, int input)
|
|||
|
||||
switch (input) {
|
||||
case SAA7127_INPUT_TYPE_NORMAL: /* avia */
|
||||
v4l_dbg(1, client, "Selecting Normal Encoder Input\n");
|
||||
v4l_dbg(1, debug, client, "Selecting Normal Encoder Input\n");
|
||||
state->reg_3a_cb = 0;
|
||||
break;
|
||||
|
||||
case SAA7127_INPUT_TYPE_TEST_IMAGE: /* color bar */
|
||||
v4l_dbg(1, client, "Selecting Color Bar generator\n");
|
||||
v4l_dbg(1, debug, client, "Selecting Color Bar generator\n");
|
||||
state->reg_3a_cb = 0x80;
|
||||
break;
|
||||
|
||||
|
@ -689,17 +689,16 @@ static int saa7127_attach(struct i2c_adapter *adapter, int address, int kind)
|
|||
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
|
||||
return 0;
|
||||
|
||||
client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
if (client == 0)
|
||||
return -ENOMEM;
|
||||
|
||||
memset(client, 0, sizeof(struct i2c_client));
|
||||
client->addr = address;
|
||||
client->adapter = adapter;
|
||||
client->driver = &i2c_driver_saa7127;
|
||||
snprintf(client->name, sizeof(client->name) - 1, "saa7127");
|
||||
|
||||
v4l_dbg(1, client, "detecting saa7127 client on address 0x%x\n", address << 1);
|
||||
v4l_dbg(1, debug, client, "detecting saa7127 client on address 0x%x\n", address << 1);
|
||||
|
||||
/* First test register 0: Bits 5-7 are a version ID (should be 0),
|
||||
and bit 2 should also be 0.
|
||||
|
@ -708,11 +707,11 @@ static int saa7127_attach(struct i2c_adapter *adapter, int address, int kind)
|
|||
0x1d after a reset and not expected to ever change. */
|
||||
if ((saa7127_read(client, 0) & 0xe4) != 0 ||
|
||||
(saa7127_read(client, 0x29) & 0x3f) != 0x1d) {
|
||||
v4l_dbg(1, client, "saa7127 not found\n");
|
||||
v4l_dbg(1, debug, client, "saa7127 not found\n");
|
||||
kfree(client);
|
||||
return 0;
|
||||
}
|
||||
state = kmalloc(sizeof(struct saa7127_state), GFP_KERNEL);
|
||||
state = kzalloc(sizeof(struct saa7127_state), GFP_KERNEL);
|
||||
|
||||
if (state == NULL) {
|
||||
kfree(client);
|
||||
|
@ -720,11 +719,10 @@ static int saa7127_attach(struct i2c_adapter *adapter, int address, int kind)
|
|||
}
|
||||
|
||||
i2c_set_clientdata(client, state);
|
||||
memset(state, 0, sizeof(struct saa7127_state));
|
||||
|
||||
/* Configure Encoder */
|
||||
|
||||
v4l_dbg(1, client, "Configuring encoder\n");
|
||||
v4l_dbg(1, debug, client, "Configuring encoder\n");
|
||||
saa7127_write_inittab(client, saa7127_init_config_common);
|
||||
saa7127_set_std(client, V4L2_STD_NTSC);
|
||||
saa7127_set_output_type(client, SAA7127_OUTPUT_TYPE_BOTH);
|
||||
|
|
|
@ -15,7 +15,7 @@ config VIDEO_SAA7134
|
|||
config VIDEO_SAA7134_ALSA
|
||||
tristate "Philips SAA7134 DMA audio support"
|
||||
depends on VIDEO_SAA7134 && SND
|
||||
select SND_PCM_OSS
|
||||
select SND_PCM
|
||||
---help---
|
||||
This is a video4linux driver for direct (DMA) audio in
|
||||
Philips SAA713x based TV cards using ALSA
|
||||
|
|
|
@ -511,9 +511,8 @@ static int saa6752hs_attach(struct i2c_adapter *adap, int addr, int kind)
|
|||
struct saa6752hs_state *h;
|
||||
|
||||
|
||||
if (NULL == (h = kmalloc(sizeof(*h), GFP_KERNEL)))
|
||||
if (NULL == (h = kzalloc(sizeof(*h), GFP_KERNEL)))
|
||||
return -ENOMEM;
|
||||
memset(h,0,sizeof(*h));
|
||||
h->client = client_template;
|
||||
h->params = param_defaults;
|
||||
h->client.adapter = adap;
|
||||
|
|
|
@ -1666,7 +1666,7 @@ struct saa7134_board saa7134_boards[] = {
|
|||
.radio_type = UNSET,
|
||||
.tuner_addr = ADDR_UNSET,
|
||||
.radio_addr = ADDR_UNSET,
|
||||
.tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER,
|
||||
.tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_ACTIVE,
|
||||
.mpeg = SAA7134_MPEG_DVB,
|
||||
.inputs = {{
|
||||
.name = name_tv,
|
||||
|
|
|
@ -803,10 +803,9 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
|
|||
struct saa7134_mpeg_ops *mops;
|
||||
int err;
|
||||
|
||||
dev = kmalloc(sizeof(*dev),GFP_KERNEL);
|
||||
dev = kzalloc(sizeof(*dev),GFP_KERNEL);
|
||||
if (NULL == dev)
|
||||
return -ENOMEM;
|
||||
memset(dev,0,sizeof(*dev));
|
||||
|
||||
/* pci init */
|
||||
dev->pci = pci_dev;
|
||||
|
|
|
@ -1264,10 +1264,9 @@ static int video_open(struct inode *inode, struct file *file)
|
|||
v4l2_type_names[type]);
|
||||
|
||||
/* allocate + initialize per filehandle data */
|
||||
fh = kmalloc(sizeof(*fh),GFP_KERNEL);
|
||||
fh = kzalloc(sizeof(*fh),GFP_KERNEL);
|
||||
if (NULL == fh)
|
||||
return -ENOMEM;
|
||||
memset(fh,0,sizeof(*fh));
|
||||
file->private_data = fh;
|
||||
fh->dev = dev;
|
||||
fh->radio = radio;
|
||||
|
|
|
@ -73,7 +73,6 @@ struct saa7146
|
|||
unsigned int nr;
|
||||
unsigned long irq; /* IRQ used by SAA7146 card */
|
||||
unsigned short id;
|
||||
struct pci_dev *dev;
|
||||
unsigned char revision;
|
||||
unsigned char boardcfg[64]; /* 64 bytes of config from eeprom */
|
||||
unsigned long saa7146_adr; /* bus address of IO mem from PCI BIOS */
|
||||
|
|
|
@ -408,21 +408,19 @@ saa7185_detect_client (struct i2c_adapter *adapter,
|
|||
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
|
||||
return 0;
|
||||
|
||||
client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
if (client == 0)
|
||||
return -ENOMEM;
|
||||
memset(client, 0, sizeof(struct i2c_client));
|
||||
client->addr = address;
|
||||
client->adapter = adapter;
|
||||
client->driver = &i2c_driver_saa7185;
|
||||
strlcpy(I2C_NAME(client), "saa7185", sizeof(I2C_NAME(client)));
|
||||
|
||||
encoder = kmalloc(sizeof(struct saa7185), GFP_KERNEL);
|
||||
encoder = kzalloc(sizeof(struct saa7185), GFP_KERNEL);
|
||||
if (encoder == NULL) {
|
||||
kfree(client);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(encoder, 0, sizeof(struct saa7185));
|
||||
encoder->norm = VIDEO_MODE_NTSC;
|
||||
encoder->enable = 1;
|
||||
i2c_set_clientdata(client, encoder);
|
||||
|
|
|
@ -571,18 +571,15 @@ static int saa7191_attach(struct i2c_adapter *adap, int addr, int kind)
|
|||
printk(KERN_INFO "Philips SAA7191 driver version %s\n",
|
||||
SAA7191_MODULE_VERSION);
|
||||
|
||||
client = kmalloc(sizeof(*client), GFP_KERNEL);
|
||||
client = kzalloc(sizeof(*client), GFP_KERNEL);
|
||||
if (!client)
|
||||
return -ENOMEM;
|
||||
decoder = kmalloc(sizeof(*decoder), GFP_KERNEL);
|
||||
decoder = kzalloc(sizeof(*decoder), GFP_KERNEL);
|
||||
if (!decoder) {
|
||||
err = -ENOMEM;
|
||||
goto out_free_client;
|
||||
}
|
||||
|
||||
memset(client, 0, sizeof(struct i2c_client));
|
||||
memset(decoder, 0, sizeof(struct saa7191));
|
||||
|
||||
client->addr = addr;
|
||||
client->adapter = adap;
|
||||
client->driver = &i2c_driver_saa7191;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -227,8 +227,8 @@ static struct i2c_client client_template;
|
|||
static int tda7432_write(struct i2c_client *client, int subaddr, int val)
|
||||
{
|
||||
unsigned char buffer[2];
|
||||
v4l_dbg(2,client,"In tda7432_write\n");
|
||||
v4l_dbg(1,client,"Writing %d 0x%x\n", subaddr, val);
|
||||
v4l_dbg(2, debug,client,"In tda7432_write\n");
|
||||
v4l_dbg(1, debug,client,"Writing %d 0x%x\n", subaddr, val);
|
||||
buffer[0] = subaddr;
|
||||
buffer[1] = val;
|
||||
if (2 != i2c_master_send(client,buffer,2)) {
|
||||
|
@ -245,9 +245,9 @@ static int tda7432_set(struct i2c_client *client)
|
|||
{
|
||||
struct tda7432 *t = i2c_get_clientdata(client);
|
||||
unsigned char buf[16];
|
||||
v4l_dbg(2,client,"In tda7432_set\n");
|
||||
v4l_dbg(2, debug,client,"In tda7432_set\n");
|
||||
|
||||
v4l_dbg(1,client,
|
||||
v4l_dbg(1, debug,client,
|
||||
"tda7432: 7432_set(0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x)\n",
|
||||
t->input,t->volume,t->bass,t->treble,t->lf,t->lr,t->rf,t->rr,t->loud);
|
||||
buf[0] = TDA7432_IN;
|
||||
|
@ -271,7 +271,7 @@ static int tda7432_set(struct i2c_client *client)
|
|||
static void do_tda7432_init(struct i2c_client *client)
|
||||
{
|
||||
struct tda7432 *t = i2c_get_clientdata(client);
|
||||
v4l_dbg(2,client,"In tda7432_init\n");
|
||||
v4l_dbg(2, debug,client,"In tda7432_init\n");
|
||||
|
||||
t->input = TDA7432_STEREO_IN | /* Main (stereo) input */
|
||||
TDA7432_BASS_SYM | /* Symmetric bass cut */
|
||||
|
@ -300,10 +300,9 @@ static int tda7432_attach(struct i2c_adapter *adap, int addr, int kind)
|
|||
struct tda7432 *t;
|
||||
struct i2c_client *client;
|
||||
|
||||
t = kmalloc(sizeof *t,GFP_KERNEL);
|
||||
t = kzalloc(sizeof *t,GFP_KERNEL);
|
||||
if (!t)
|
||||
return -ENOMEM;
|
||||
memset(t,0,sizeof *t);
|
||||
|
||||
client = &t->c;
|
||||
memcpy(client,&client_template,sizeof(struct i2c_client));
|
||||
|
@ -340,7 +339,7 @@ static int tda7432_command(struct i2c_client *client,
|
|||
unsigned int cmd, void *arg)
|
||||
{
|
||||
struct tda7432 *t = i2c_get_clientdata(client);
|
||||
v4l_dbg(2,client,"In tda7432_command\n");
|
||||
v4l_dbg(2, debug,client,"In tda7432_command\n");
|
||||
if (debug>1)
|
||||
v4l_i2c_print_ioctl(client,cmd);
|
||||
|
||||
|
|
|
@ -232,10 +232,9 @@ static int tda9875_attach(struct i2c_adapter *adap, int addr, int kind)
|
|||
struct i2c_client *client;
|
||||
dprintk("In tda9875_attach\n");
|
||||
|
||||
t = kmalloc(sizeof *t,GFP_KERNEL);
|
||||
t = kzalloc(sizeof *t,GFP_KERNEL);
|
||||
if (!t)
|
||||
return -ENOMEM;
|
||||
memset(t,0,sizeof *t);
|
||||
|
||||
client = &t->c;
|
||||
memcpy(client,&client_template,sizeof(struct i2c_client));
|
||||
|
|
|
@ -696,9 +696,8 @@ static int tda9887_attach(struct i2c_adapter *adap, int addr, int kind)
|
|||
client_template.adapter = adap;
|
||||
client_template.addr = addr;
|
||||
|
||||
if (NULL == (t = kmalloc(sizeof(*t), GFP_KERNEL)))
|
||||
if (NULL == (t = kzalloc(sizeof(*t), GFP_KERNEL)))
|
||||
return -ENOMEM;
|
||||
memset(t,0,sizeof(*t));
|
||||
|
||||
t->client = client_template;
|
||||
t->std = 0;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#define PREFIX "TEA5767 "
|
||||
|
||||
/* from tuner-core.c */
|
||||
extern int debug;
|
||||
extern int tuner_debug;
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
@ -249,7 +249,7 @@ static void set_radio_freq(struct i2c_client *c, unsigned int frq)
|
|||
if (5 != (rc = i2c_master_send(c, buffer, 5)))
|
||||
tuner_warn("i2c i/o error: rc == %d (should be 5)\n", rc);
|
||||
|
||||
if (debug) {
|
||||
if (tuner_debug) {
|
||||
if (5 != (rc = i2c_master_recv(c, buffer, 5)))
|
||||
tuner_warn("i2c i/o error: rc == %d (should be 5)\n", rc);
|
||||
else
|
||||
|
|
|
@ -99,11 +99,10 @@ static int tea6420_detect(struct i2c_adapter *adapter, int address, int kind)
|
|||
}
|
||||
|
||||
/* allocate memory for client structure */
|
||||
client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
if (0 == client) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(client, 0x0, sizeof(struct i2c_client));
|
||||
|
||||
/* fill client structure */
|
||||
memcpy(client, &client_template, sizeof(struct i2c_client));
|
||||
|
|
|
@ -193,8 +193,7 @@ static struct i2c_client client_template =
|
|||
static int __init
|
||||
tuner3036_init(void)
|
||||
{
|
||||
i2c_add_driver(&i2c_driver_tuner);
|
||||
return 0;
|
||||
return i2c_add_driver(&i2c_driver_tuner);
|
||||
}
|
||||
|
||||
static void __exit
|
||||
|
|
|
@ -41,8 +41,8 @@ static unsigned int no_autodetect = 0;
|
|||
static unsigned int show_i2c = 0;
|
||||
|
||||
/* insmod options used at runtime => read/write */
|
||||
static unsigned int tuner_debug = 0;
|
||||
int debug = 0;
|
||||
static unsigned int tuner_debug_old = 0;
|
||||
int tuner_debug = 0;
|
||||
|
||||
static unsigned int tv_range[2] = { 44, 958 };
|
||||
static unsigned int radio_range[2] = { 65, 108 };
|
||||
|
@ -51,13 +51,13 @@ static char pal[] = "--";
|
|||
static char secam[] = "--";
|
||||
static char ntsc[] = "-";
|
||||
|
||||
|
||||
module_param(addr, int, 0444);
|
||||
module_param(no_autodetect, int, 0444);
|
||||
module_param(show_i2c, int, 0444);
|
||||
/* Note: tuner_debug is deprecated and will be removed in 2.6.17 */
|
||||
module_param(tuner_debug, int, 0444);
|
||||
module_param(debug, int, 0644);
|
||||
|
||||
module_param_named(tuner_debug,tuner_debug_old, int, 0444);
|
||||
module_param_named(debug,tuner_debug, int, 0644);
|
||||
module_param_string(pal, pal, sizeof(pal), 0644);
|
||||
module_param_string(secam, secam, sizeof(secam), 0644);
|
||||
module_param_string(ntsc, ntsc, sizeof(ntsc), 0644);
|
||||
|
@ -410,18 +410,17 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind)
|
|||
client_template.adapter = adap;
|
||||
client_template.addr = addr;
|
||||
|
||||
t = kmalloc(sizeof(struct tuner), GFP_KERNEL);
|
||||
t = kzalloc(sizeof(struct tuner), GFP_KERNEL);
|
||||
if (NULL == t)
|
||||
return -ENOMEM;
|
||||
memset(t, 0, sizeof(struct tuner));
|
||||
memcpy(&t->i2c, &client_template, sizeof(struct i2c_client));
|
||||
i2c_set_clientdata(&t->i2c, t);
|
||||
t->type = UNSET;
|
||||
t->radio_if2 = 10700 * 1000; /* 10.7MHz - FM radio */
|
||||
t->audmode = V4L2_TUNER_MODE_STEREO;
|
||||
t->mode_mask = T_UNINITIALIZED;
|
||||
if (tuner_debug) {
|
||||
debug = tuner_debug;
|
||||
if (tuner_debug_old) {
|
||||
tuner_debug = tuner_debug_old;
|
||||
printk(KERN_ERR "tuner: tuner_debug is deprecated and will be removed in 2.6.17.\n");
|
||||
printk(KERN_ERR "tuner: use the debug option instead.\n");
|
||||
}
|
||||
|
@ -552,7 +551,7 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
|
|||
{
|
||||
struct tuner *t = i2c_get_clientdata(client);
|
||||
|
||||
if (debug>1)
|
||||
if (tuner_debug>1)
|
||||
v4l_i2c_print_ioctl(&(t->i2c),cmd);
|
||||
|
||||
switch (cmd) {
|
||||
|
|
|
@ -159,7 +159,7 @@ static int chip_write(struct CHIPSTATE *chip, int subaddr, int val)
|
|||
unsigned char buffer[2];
|
||||
|
||||
if (-1 == subaddr) {
|
||||
v4l_dbg(1, &chip->c, "%s: chip_write: 0x%x\n",
|
||||
v4l_dbg(1, debug, &chip->c, "%s: chip_write: 0x%x\n",
|
||||
chip->c.name, val);
|
||||
chip->shadow.bytes[1] = val;
|
||||
buffer[0] = val;
|
||||
|
@ -169,7 +169,7 @@ static int chip_write(struct CHIPSTATE *chip, int subaddr, int val)
|
|||
return -1;
|
||||
}
|
||||
} else {
|
||||
v4l_dbg(1, &chip->c, "%s: chip_write: reg%d=0x%x\n",
|
||||
v4l_dbg(1, debug, &chip->c, "%s: chip_write: reg%d=0x%x\n",
|
||||
chip->c.name, subaddr, val);
|
||||
chip->shadow.bytes[subaddr+1] = val;
|
||||
buffer[0] = subaddr;
|
||||
|
@ -204,7 +204,7 @@ static int chip_read(struct CHIPSTATE *chip)
|
|||
chip->c.name);
|
||||
return -1;
|
||||
}
|
||||
v4l_dbg(1, &chip->c, "%s: chip_read: 0x%x\n",chip->c.name, buffer);
|
||||
v4l_dbg(1, debug, &chip->c, "%s: chip_read: 0x%x\n",chip->c.name, buffer);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
@ -222,7 +222,7 @@ static int chip_read2(struct CHIPSTATE *chip, int subaddr)
|
|||
v4l_warn(&chip->c, "%s: I/O error (read2)\n", chip->c.name);
|
||||
return -1;
|
||||
}
|
||||
v4l_dbg(1, &chip->c, "%s: chip_read2: reg%d=0x%x\n",
|
||||
v4l_dbg(1, debug, &chip->c, "%s: chip_read2: reg%d=0x%x\n",
|
||||
chip->c.name, subaddr,read[0]);
|
||||
return read[0];
|
||||
}
|
||||
|
@ -235,7 +235,7 @@ static int chip_cmd(struct CHIPSTATE *chip, char *name, audiocmd *cmd)
|
|||
return 0;
|
||||
|
||||
/* update our shadow register set; print bytes if (debug > 0) */
|
||||
v4l_dbg(1, &chip->c, "%s: chip_cmd(%s): reg=%d, data:",
|
||||
v4l_dbg(1, debug, &chip->c, "%s: chip_cmd(%s): reg=%d, data:",
|
||||
chip->c.name, name,cmd->bytes[0]);
|
||||
for (i = 1; i < cmd->count; i++) {
|
||||
if (debug)
|
||||
|
@ -274,7 +274,7 @@ static int chip_thread(void *data)
|
|||
|
||||
daemonize("%s", chip->c.name);
|
||||
allow_signal(SIGTERM);
|
||||
v4l_dbg(1, &chip->c, "%s: thread started\n", chip->c.name);
|
||||
v4l_dbg(1, debug, &chip->c, "%s: thread started\n", chip->c.name);
|
||||
|
||||
for (;;) {
|
||||
add_wait_queue(&chip->wq, &wait);
|
||||
|
@ -286,7 +286,7 @@ static int chip_thread(void *data)
|
|||
try_to_freeze();
|
||||
if (chip->done || signal_pending(current))
|
||||
break;
|
||||
v4l_dbg(1, &chip->c, "%s: thread wakeup\n", chip->c.name);
|
||||
v4l_dbg(1, debug, &chip->c, "%s: thread wakeup\n", chip->c.name);
|
||||
|
||||
/* don't do anything for radio or if mode != auto */
|
||||
if (chip->radio || chip->mode != 0)
|
||||
|
@ -299,7 +299,7 @@ static int chip_thread(void *data)
|
|||
mod_timer(&chip->wt, jiffies+2*HZ);
|
||||
}
|
||||
|
||||
v4l_dbg(1, &chip->c, "%s: thread exiting\n", chip->c.name);
|
||||
v4l_dbg(1, debug, &chip->c, "%s: thread exiting\n", chip->c.name);
|
||||
complete_and_exit(&chip->texit, 0);
|
||||
return 0;
|
||||
}
|
||||
|
@ -312,7 +312,7 @@ static void generic_checkmode(struct CHIPSTATE *chip)
|
|||
if (mode == chip->prevmode)
|
||||
return;
|
||||
|
||||
v4l_dbg(1, &chip->c, "%s: thread checkmode\n", chip->c.name);
|
||||
v4l_dbg(1, debug, &chip->c, "%s: thread checkmode\n", chip->c.name);
|
||||
chip->prevmode = mode;
|
||||
|
||||
if (mode & VIDEO_SOUND_STEREO)
|
||||
|
@ -359,7 +359,7 @@ static int tda9840_getmode(struct CHIPSTATE *chip)
|
|||
if (val & TDA9840_ST_STEREO)
|
||||
mode |= VIDEO_SOUND_STEREO;
|
||||
|
||||
v4l_dbg(1, &chip->c, "tda9840_getmode(): raw chip read: %d, return: %d\n",
|
||||
v4l_dbg(1, debug, &chip->c, "tda9840_getmode(): raw chip read: %d, return: %d\n",
|
||||
val, mode);
|
||||
return mode;
|
||||
}
|
||||
|
@ -655,7 +655,7 @@ static int tda9873_getmode(struct CHIPSTATE *chip)
|
|||
mode |= VIDEO_SOUND_STEREO;
|
||||
if (val & TDA9873_DUAL)
|
||||
mode |= VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
|
||||
v4l_dbg(1, &chip->c, "tda9873_getmode(): raw chip read: %d, return: %d\n",
|
||||
v4l_dbg(1, debug, &chip->c, "tda9873_getmode(): raw chip read: %d, return: %d\n",
|
||||
val, mode);
|
||||
return mode;
|
||||
}
|
||||
|
@ -666,12 +666,12 @@ static void tda9873_setmode(struct CHIPSTATE *chip, int mode)
|
|||
/* int adj_data = chip->shadow.bytes[TDA9873_AD+1] ; */
|
||||
|
||||
if ((sw_data & TDA9873_INP_MASK) != TDA9873_INTERNAL) {
|
||||
v4l_dbg(1, &chip->c, "tda9873_setmode(): external input\n");
|
||||
v4l_dbg(1, debug, &chip->c, "tda9873_setmode(): external input\n");
|
||||
return;
|
||||
}
|
||||
|
||||
v4l_dbg(1, &chip->c, "tda9873_setmode(): chip->shadow.bytes[%d] = %d\n", TDA9873_SW+1, chip->shadow.bytes[TDA9873_SW+1]);
|
||||
v4l_dbg(1, &chip->c, "tda9873_setmode(): sw_data = %d\n", sw_data);
|
||||
v4l_dbg(1, debug, &chip->c, "tda9873_setmode(): chip->shadow.bytes[%d] = %d\n", TDA9873_SW+1, chip->shadow.bytes[TDA9873_SW+1]);
|
||||
v4l_dbg(1, debug, &chip->c, "tda9873_setmode(): sw_data = %d\n", sw_data);
|
||||
|
||||
switch (mode) {
|
||||
case VIDEO_SOUND_MONO:
|
||||
|
@ -692,7 +692,7 @@ static void tda9873_setmode(struct CHIPSTATE *chip, int mode)
|
|||
}
|
||||
|
||||
chip_write(chip, TDA9873_SW, sw_data);
|
||||
v4l_dbg(1, &chip->c, "tda9873_setmode(): req. mode %d; chip_write: %d\n",
|
||||
v4l_dbg(1, debug, &chip->c, "tda9873_setmode(): req. mode %d; chip_write: %d\n",
|
||||
mode, sw_data);
|
||||
}
|
||||
|
||||
|
@ -831,7 +831,7 @@ static int tda9874a_setup(struct CHIPSTATE *chip)
|
|||
chip_write(chip, TDA9874A_SDACOSR, (tda9874a_mode) ? 0x81:0x80);
|
||||
chip_write(chip, TDA9874A_AOSR, 0x00); /* or 0x10 */
|
||||
}
|
||||
v4l_dbg(1, &chip->c, "tda9874a_setup(): %s [0x%02X].\n",
|
||||
v4l_dbg(1, debug, &chip->c, "tda9874a_setup(): %s [0x%02X].\n",
|
||||
tda9874a_modelist[tda9874a_STD].name,tda9874a_STD);
|
||||
return 1;
|
||||
}
|
||||
|
@ -874,7 +874,7 @@ static int tda9874a_getmode(struct CHIPSTATE *chip)
|
|||
mode |= VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
|
||||
}
|
||||
|
||||
v4l_dbg(1, &chip->c, "tda9874a_getmode(): DSR=0x%X, NSR=0x%X, NECR=0x%X, return: %d.\n",
|
||||
v4l_dbg(1, debug, &chip->c, "tda9874a_getmode(): DSR=0x%X, NSR=0x%X, NECR=0x%X, return: %d.\n",
|
||||
dsr, nsr, necr, mode);
|
||||
return mode;
|
||||
}
|
||||
|
@ -920,7 +920,7 @@ static void tda9874a_setmode(struct CHIPSTATE *chip, int mode)
|
|||
chip_write(chip, TDA9874A_AOSR, aosr);
|
||||
chip_write(chip, TDA9874A_MDACOSR, mdacosr);
|
||||
|
||||
v4l_dbg(1, &chip->c, "tda9874a_setmode(): req. mode %d; AOSR=0x%X, MDACOSR=0x%X.\n",
|
||||
v4l_dbg(1, debug, &chip->c, "tda9874a_setmode(): req. mode %d; AOSR=0x%X, MDACOSR=0x%X.\n",
|
||||
mode, aosr, mdacosr);
|
||||
|
||||
} else { /* dic == 0x07 */
|
||||
|
@ -955,7 +955,7 @@ static void tda9874a_setmode(struct CHIPSTATE *chip, int mode)
|
|||
chip_write(chip, TDA9874A_FMMR, fmmr);
|
||||
chip_write(chip, TDA9874A_AOSR, aosr);
|
||||
|
||||
v4l_dbg(1, &chip->c, "tda9874a_setmode(): req. mode %d; FMMR=0x%X, AOSR=0x%X.\n",
|
||||
v4l_dbg(1, debug, &chip->c, "tda9874a_setmode(): req. mode %d; FMMR=0x%X, AOSR=0x%X.\n",
|
||||
mode, fmmr, aosr);
|
||||
}
|
||||
}
|
||||
|
@ -969,7 +969,7 @@ static int tda9874a_checkit(struct CHIPSTATE *chip)
|
|||
if(-1 == (sic = chip_read2(chip,TDA9874A_SIC)))
|
||||
return 0;
|
||||
|
||||
v4l_dbg(1, &chip->c, "tda9874a_checkit(): DIC=0x%X, SIC=0x%X.\n", dic, sic);
|
||||
v4l_dbg(1, debug, &chip->c, "tda9874a_checkit(): DIC=0x%X, SIC=0x%X.\n", dic, sic);
|
||||
|
||||
if((dic == 0x11)||(dic == 0x07)) {
|
||||
v4l_info(&chip->c, "found tda9874%s.\n", (dic == 0x11) ? "a":"h");
|
||||
|
@ -1184,7 +1184,7 @@ static int ta8874z_getmode(struct CHIPSTATE *chip)
|
|||
}else if (!(val & TA8874Z_B0)){
|
||||
mode |= VIDEO_SOUND_STEREO;
|
||||
}
|
||||
/* v4l_dbg(1, &chip->c, "ta8874z_getmode(): raw chip read: 0x%02x, return: 0x%02x\n", val, mode); */
|
||||
/* v4l_dbg(1, debug, &chip->c, "ta8874z_getmode(): raw chip read: 0x%02x, return: 0x%02x\n", val, mode); */
|
||||
return mode;
|
||||
}
|
||||
|
||||
|
@ -1197,7 +1197,7 @@ static void ta8874z_setmode(struct CHIPSTATE *chip, int mode)
|
|||
{
|
||||
int update = 1;
|
||||
audiocmd *t = NULL;
|
||||
v4l_dbg(1, &chip->c, "ta8874z_setmode(): mode: 0x%02x\n", mode);
|
||||
v4l_dbg(1, debug, &chip->c, "ta8874z_setmode(): mode: 0x%02x\n", mode);
|
||||
|
||||
switch(mode){
|
||||
case VIDEO_SOUND_MONO:
|
||||
|
@ -1468,17 +1468,16 @@ static int chip_attach(struct i2c_adapter *adap, int addr, int kind)
|
|||
struct CHIPSTATE *chip;
|
||||
struct CHIPDESC *desc;
|
||||
|
||||
chip = kmalloc(sizeof(*chip),GFP_KERNEL);
|
||||
chip = kzalloc(sizeof(*chip),GFP_KERNEL);
|
||||
if (!chip)
|
||||
return -ENOMEM;
|
||||
memset(chip,0,sizeof(*chip));
|
||||
memcpy(&chip->c,&client_template,sizeof(struct i2c_client));
|
||||
chip->c.adapter = adap;
|
||||
chip->c.addr = addr;
|
||||
i2c_set_clientdata(&chip->c, chip);
|
||||
|
||||
/* find description for the chip */
|
||||
v4l_dbg(1, &chip->c, "chip found @ 0x%x\n", addr<<1);
|
||||
v4l_dbg(1, debug, &chip->c, "chip found @ 0x%x\n", addr<<1);
|
||||
for (desc = chiplist; desc->name != NULL; desc++) {
|
||||
if (0 == *(desc->insmodopt))
|
||||
continue;
|
||||
|
@ -1490,12 +1489,12 @@ static int chip_attach(struct i2c_adapter *adap, int addr, int kind)
|
|||
break;
|
||||
}
|
||||
if (desc->name == NULL) {
|
||||
v4l_dbg(1, &chip->c, "no matching chip description found\n");
|
||||
v4l_dbg(1, debug, &chip->c, "no matching chip description found\n");
|
||||
return -EIO;
|
||||
}
|
||||
v4l_info(&chip->c, "%s found @ 0x%x (%s)\n", desc->name, addr<<1, adap->name);
|
||||
if (desc->flags) {
|
||||
v4l_dbg(1, &chip->c, "matches:%s%s%s.\n",
|
||||
v4l_dbg(1, debug, &chip->c, "matches:%s%s%s.\n",
|
||||
(desc->flags & CHIP_HAS_VOLUME) ? " volume" : "",
|
||||
(desc->flags & CHIP_HAS_BASSTREBLE) ? " bass/treble" : "",
|
||||
(desc->flags & CHIP_HAS_INPUTSEL) ? " audiomux" : "");
|
||||
|
@ -1583,7 +1582,7 @@ static int chip_command(struct i2c_client *client,
|
|||
struct CHIPSTATE *chip = i2c_get_clientdata(client);
|
||||
struct CHIPDESC *desc = chiplist + chip->type;
|
||||
|
||||
v4l_dbg(1, &chip->c, "%s: chip_command 0x%x\n", chip->c.name, cmd);
|
||||
v4l_dbg(1, debug, &chip->c, "%s: chip_command 0x%x\n", chip->c.name, cmd);
|
||||
|
||||
switch (cmd) {
|
||||
case AUDC_SET_INPUT:
|
||||
|
|
|
@ -719,8 +719,7 @@ tveeprom_command(struct i2c_client *client,
|
|||
|
||||
switch (cmd) {
|
||||
case 0:
|
||||
buf = kmalloc(256,GFP_KERNEL);
|
||||
memset(buf,0,256);
|
||||
buf = kzalloc(256,GFP_KERNEL);
|
||||
tveeprom_read(client,buf,256);
|
||||
tveeprom_hauppauge_analog(client, &eeprom,buf);
|
||||
kfree(buf);
|
||||
|
@ -743,10 +742,9 @@ tveeprom_detect_client(struct i2c_adapter *adapter,
|
|||
{
|
||||
struct i2c_client *client;
|
||||
|
||||
client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
if (NULL == client)
|
||||
return -ENOMEM;
|
||||
memset(client, 0, sizeof(struct i2c_client));
|
||||
client->addr = address;
|
||||
client->adapter = adapter;
|
||||
client->driver = &i2c_driver_tveeprom;
|
||||
|
|
|
@ -1074,12 +1074,11 @@ static int tvp5150_detect_client(struct i2c_adapter *adapter,
|
|||
return -ENOMEM;
|
||||
memcpy(c, &client_template, sizeof(struct i2c_client));
|
||||
|
||||
core = kmalloc(sizeof(struct tvp5150), GFP_KERNEL);
|
||||
core = kzalloc(sizeof(struct tvp5150), GFP_KERNEL);
|
||||
if (core == 0) {
|
||||
kfree(c);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(core, 0, sizeof(struct tvp5150));
|
||||
i2c_set_clientdata(c, core);
|
||||
|
||||
rv = i2c_attach_client(c);
|
||||
|
|
|
@ -305,9 +305,8 @@ v4l_compat_translate_ioctl(struct inode *inode,
|
|||
{
|
||||
struct video_capability *cap = arg;
|
||||
|
||||
cap2 = kmalloc(sizeof(*cap2),GFP_KERNEL);
|
||||
cap2 = kzalloc(sizeof(*cap2),GFP_KERNEL);
|
||||
memset(cap, 0, sizeof(*cap));
|
||||
memset(cap2, 0, sizeof(*cap2));
|
||||
memset(&fbuf2, 0, sizeof(fbuf2));
|
||||
|
||||
err = drv(inode, file, VIDIOC_QUERYCAP, cap2);
|
||||
|
@ -422,9 +421,8 @@ v4l_compat_translate_ioctl(struct inode *inode,
|
|||
{
|
||||
struct video_window *win = arg;
|
||||
|
||||
fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL);
|
||||
fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
|
||||
memset(win,0,sizeof(*win));
|
||||
memset(fmt2,0,sizeof(*fmt2));
|
||||
|
||||
fmt2->type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
|
||||
err = drv(inode, file, VIDIOC_G_FMT, fmt2);
|
||||
|
@ -461,8 +459,7 @@ v4l_compat_translate_ioctl(struct inode *inode,
|
|||
struct video_window *win = arg;
|
||||
int err1,err2;
|
||||
|
||||
fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL);
|
||||
memset(fmt2,0,sizeof(*fmt2));
|
||||
fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
|
||||
fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||
drv(inode, file, VIDIOC_STREAMOFF, &fmt2->type);
|
||||
err1 = drv(inode, file, VIDIOC_G_FMT, fmt2);
|
||||
|
@ -595,8 +592,7 @@ v4l_compat_translate_ioctl(struct inode *inode,
|
|||
pict->whiteness = get_v4l_control(inode, file,
|
||||
V4L2_CID_WHITENESS, drv);
|
||||
|
||||
fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL);
|
||||
memset(fmt2,0,sizeof(*fmt2));
|
||||
fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
|
||||
fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||
err = drv(inode, file, VIDIOC_G_FMT, fmt2);
|
||||
if (err < 0) {
|
||||
|
@ -622,8 +618,7 @@ v4l_compat_translate_ioctl(struct inode *inode,
|
|||
set_v4l_control(inode, file,
|
||||
V4L2_CID_WHITENESS, pict->whiteness, drv);
|
||||
|
||||
fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL);
|
||||
memset(fmt2,0,sizeof(*fmt2));
|
||||
fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
|
||||
fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||
err = drv(inode, file, VIDIOC_G_FMT, fmt2);
|
||||
if (err < 0)
|
||||
|
@ -846,9 +841,8 @@ v4l_compat_translate_ioctl(struct inode *inode,
|
|||
{
|
||||
struct video_mmap *mm = arg;
|
||||
|
||||
fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL);
|
||||
fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
|
||||
memset(&buf2,0,sizeof(buf2));
|
||||
memset(fmt2,0,sizeof(*fmt2));
|
||||
|
||||
fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||
err = drv(inode, file, VIDIOC_G_FMT, fmt2);
|
||||
|
@ -942,8 +936,7 @@ v4l_compat_translate_ioctl(struct inode *inode,
|
|||
{
|
||||
struct vbi_format *fmt = arg;
|
||||
|
||||
fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL);
|
||||
memset(fmt2, 0, sizeof(*fmt2));
|
||||
fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
|
||||
fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE;
|
||||
|
||||
err = drv(inode, file, VIDIOC_G_FMT, fmt2);
|
||||
|
@ -975,8 +968,7 @@ v4l_compat_translate_ioctl(struct inode *inode,
|
|||
break;
|
||||
}
|
||||
|
||||
fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL);
|
||||
memset(fmt2, 0, sizeof(*fmt2));
|
||||
fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
|
||||
|
||||
fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE;
|
||||
fmt2->fmt.vbi.samples_per_line = fmt->samples_per_line;
|
||||
|
|
|
@ -52,10 +52,9 @@ videobuf_vmalloc_to_sg(unsigned char *virt, int nr_pages)
|
|||
struct page *pg;
|
||||
int i;
|
||||
|
||||
sglist = kmalloc(sizeof(struct scatterlist)*nr_pages, GFP_KERNEL);
|
||||
sglist = kcalloc(nr_pages, sizeof(struct scatterlist), GFP_KERNEL);
|
||||
if (NULL == sglist)
|
||||
return NULL;
|
||||
memset(sglist,0,sizeof(struct scatterlist)*nr_pages);
|
||||
for (i = 0; i < nr_pages; i++, virt += PAGE_SIZE) {
|
||||
pg = vmalloc_to_page(virt);
|
||||
if (NULL == pg)
|
||||
|
@ -80,10 +79,9 @@ videobuf_pages_to_sg(struct page **pages, int nr_pages, int offset)
|
|||
|
||||
if (NULL == pages[0])
|
||||
return NULL;
|
||||
sglist = kmalloc(sizeof(*sglist) * nr_pages, GFP_KERNEL);
|
||||
sglist = kcalloc(nr_pages, sizeof(*sglist), GFP_KERNEL);
|
||||
if (NULL == sglist)
|
||||
return NULL;
|
||||
memset(sglist, 0, sizeof(*sglist) * nr_pages);
|
||||
|
||||
if (NULL == pages[0])
|
||||
goto nopage;
|
||||
|
@ -284,9 +282,8 @@ void* videobuf_alloc(unsigned int size)
|
|||
{
|
||||
struct videobuf_buffer *vb;
|
||||
|
||||
vb = kmalloc(size,GFP_KERNEL);
|
||||
vb = kzalloc(size,GFP_KERNEL);
|
||||
if (NULL != vb) {
|
||||
memset(vb,0,size);
|
||||
videobuf_dma_init(&vb->dma);
|
||||
init_waitqueue_head(&vb->done);
|
||||
vb->magic = MAGIC_BUFFER;
|
||||
|
|
|
@ -124,17 +124,13 @@ videocodec_attach (struct videocodec_master *master)
|
|||
if (res == 0) {
|
||||
dprintk(3, "videocodec_attach '%s'\n",
|
||||
codec->name);
|
||||
ptr = (struct attached_list *)
|
||||
kmalloc(sizeof(struct attached_list),
|
||||
GFP_KERNEL);
|
||||
ptr = kzalloc(sizeof(struct attached_list), GFP_KERNEL);
|
||||
if (!ptr) {
|
||||
dprintk(1,
|
||||
KERN_ERR
|
||||
"videocodec_attach: no memory\n");
|
||||
goto out_kfree;
|
||||
}
|
||||
memset(ptr, 0,
|
||||
sizeof(struct attached_list));
|
||||
ptr->codec = codec;
|
||||
|
||||
a = h->list;
|
||||
|
@ -249,14 +245,11 @@ videocodec_register (const struct videocodec *codec)
|
|||
"videocodec: register '%s', type: %x, flags %lx, magic %lx\n",
|
||||
codec->name, codec->type, codec->flags, codec->magic);
|
||||
|
||||
ptr =
|
||||
(struct codec_list *) kmalloc(sizeof(struct codec_list),
|
||||
GFP_KERNEL);
|
||||
ptr = kzalloc(sizeof(struct codec_list), GFP_KERNEL);
|
||||
if (!ptr) {
|
||||
dprintk(1, KERN_ERR "videocodec_register: no memory\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(ptr, 0, sizeof(struct codec_list));
|
||||
ptr->codec = codec;
|
||||
|
||||
if (!h) {
|
||||
|
|
|
@ -52,10 +52,7 @@ struct video_device *video_device_alloc(void)
|
|||
{
|
||||
struct video_device *vfd;
|
||||
|
||||
vfd = kmalloc(sizeof(*vfd),GFP_KERNEL);
|
||||
if (NULL == vfd)
|
||||
return NULL;
|
||||
memset(vfd,0,sizeof(*vfd));
|
||||
vfd = kzalloc(sizeof(*vfd),GFP_KERNEL);
|
||||
return vfd;
|
||||
}
|
||||
|
||||
|
|
|
@ -4499,13 +4499,11 @@ static int vino_init(void)
|
|||
dma_addr_t dma_dummy_address;
|
||||
int i;
|
||||
|
||||
vino_drvdata = (struct vino_settings *)
|
||||
kmalloc(sizeof(struct vino_settings), GFP_KERNEL);
|
||||
vino_drvdata = kzalloc(sizeof(struct vino_settings), GFP_KERNEL);
|
||||
if (!vino_drvdata) {
|
||||
vino_module_cleanup(vino_init_stage);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(vino_drvdata, 0, sizeof(struct vino_settings));
|
||||
vino_init_stage++;
|
||||
|
||||
/* create a dummy dma descriptor */
|
||||
|
|
|
@ -621,13 +621,11 @@ vpx3220_detect_client (struct i2c_adapter *adapter,
|
|||
(adapter, I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA))
|
||||
return 0;
|
||||
|
||||
client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
if (client == NULL) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
memset(client, 0, sizeof(struct i2c_client));
|
||||
|
||||
client->addr = address;
|
||||
client->adapter = adapter;
|
||||
client->driver = &vpx3220_i2c_driver;
|
||||
|
@ -675,12 +673,11 @@ vpx3220_detect_client (struct i2c_adapter *adapter,
|
|||
sizeof(I2C_NAME(client)));
|
||||
}
|
||||
|
||||
decoder = kmalloc(sizeof(struct vpx3220), GFP_KERNEL);
|
||||
decoder = kzalloc(sizeof(struct vpx3220), GFP_KERNEL);
|
||||
if (decoder == NULL) {
|
||||
kfree(client);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(decoder, 0, sizeof(struct vpx3220));
|
||||
decoder->norm = VIDEO_MODE_PAL;
|
||||
decoder->input = 0;
|
||||
decoder->enable = 1;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue