Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 33031
b: refs/heads/master
c: dba654d
h: refs/heads/master
i:
  33029: 47e6fe3
  33027: fd39205
  33023: 7fd7f20
v: v3
  • Loading branch information
Sam Ravnborg committed Aug 1, 2006
1 parent 4c32f13 commit c506728
Show file tree
Hide file tree
Showing 41 changed files with 146 additions and 355 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a205729e2cd8e51257cd0ea738524c64da99b9e0
refs/heads/master: dba654d1508e7060c7d79ab2f63a00325fd84270
15 changes: 6 additions & 9 deletions trunk/drivers/media/dvb/dvb-core/dvb_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,7 @@ static int dvb_frontend_thread(void *data)
fepriv->delay = 3*HZ;
fepriv->status = 0;
fepriv->wakeup = 0;
fepriv->reinitialise = 0;

dvb_frontend_init(fe);
fepriv->reinitialise = 1;

while (1) {
up(&fepriv->sem); /* is locked when we enter the thread... */
Expand Down Expand Up @@ -1015,18 +1013,17 @@ static int dvb_frontend_open(struct inode *inode, struct file *file)
return ret;

if ((file->f_flags & O_ACCMODE) != O_RDONLY) {

/* normal tune mode when opened R/W */
fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT;
fepriv->tone = -1;
fepriv->voltage = -1;

ret = dvb_frontend_start (fe);
if (ret)
dvb_generic_release (inode, file);

/* empty event queue */
fepriv->events.eventr = fepriv->events.eventw = 0;

/* normal tune mode when opened R/W */
fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT;
fepriv->tone = -1;
fepriv->voltage = -1;
}

return ret;
Expand Down
24 changes: 5 additions & 19 deletions trunk/drivers/media/dvb/frontends/dvb-pll.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ struct dvb_pll_desc dvb_pll_tda665x = {
{ 253834000, 36249333, 166667, 0xca, 0x62 /* 011 0 0 0 10 */ },
{ 383834000, 36249333, 166667, 0xca, 0xa2 /* 101 0 0 0 10 */ },
{ 443834000, 36249333, 166667, 0xca, 0xc2 /* 110 0 0 0 10 */ },
{ 444000000, 36249333, 166667, 0xca, 0xc4 /* 110 0 0 1 00 */ },
{ 583834000, 36249333, 166667, 0xca, 0x64 /* 011 0 0 1 00 */ },
{ 793834000, 36249333, 166667, 0xca, 0xa4 /* 101 0 0 1 00 */ },
{ 444834000, 36249333, 166667, 0xca, 0xc4 /* 110 0 0 1 00 */ },
{ 861000000, 36249333, 166667, 0xca, 0xe4 /* 111 0 0 1 00 */ },
{ 444000000, 36249333, 166667, 0xca, 0xc3 /* 110 0 0 0 11 */ },
{ 583834000, 36249333, 166667, 0xca, 0x63 /* 011 0 0 0 11 */ },
{ 793834000, 36249333, 166667, 0xca, 0xa3 /* 101 0 0 0 11 */ },
{ 444834000, 36249333, 166667, 0xca, 0xc3 /* 110 0 0 0 11 */ },
{ 861000000, 36249333, 166667, 0xca, 0xe3 /* 111 0 0 0 11 */ },
}
};
EXPORT_SYMBOL(dvb_pll_tda665x);
Expand Down Expand Up @@ -613,21 +613,7 @@ static struct dvb_tuner_ops dvb_pll_tuner_ops = {

int dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2c, struct dvb_pll_desc *desc)
{
u8 b1 [] = { 0 };
struct i2c_msg msg = { .addr = pll_addr, .flags = I2C_M_RD, .buf = b1, .len = 1 };
struct dvb_pll_priv *priv = NULL;
int ret;

if (i2c != NULL) {
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);

ret = i2c_transfer (i2c, &msg, 1);
if (ret != 1)
return -1;
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
}

priv = kzalloc(sizeof(struct dvb_pll_priv), GFP_KERNEL);
if (priv == NULL)
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/media/dvb/ttpci/av7110.c
Original file line number Diff line number Diff line change
Expand Up @@ -2203,8 +2203,8 @@ static int frontend_init(struct av7110 *av7110)
av7110->fe->ops.tuner_ops.set_params = nexusca_stv0297_tuner_set_params;

/* set TDA9819 into DVB mode */
saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9819 pin9(STD)
saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9819 pin30(VIF)
saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9198 pin9(STD)
saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9198 pin30(VIF)

/* tuner on this needs a slower i2c bus speed */
av7110->dev->i2c_bitrate = SAA7146_I2C_BUS_BIT_RATE_240;
Expand Down
12 changes: 6 additions & 6 deletions trunk/drivers/media/dvb/ttpci/av7110_v4l.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ static int av7110_dvb_c_switch(struct saa7146_fh *fh)
if (ves1820_writereg(dev, 0x09, 0x0f, 0x60))
dprintk(1, "setting band in demodulator failed.\n");
} else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) {
saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTHI); // TDA9819 pin9(STD)
saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI); // TDA9819 pin30(VIF)
saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTHI); // TDA9198 pin9(STD)
saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI); // TDA9198 pin30(VIF)
}
if (i2c_writereg(av7110, 0x48, 0x02, 0xd0) != 1)
dprintk(1, "saa7113 write failed @ card %d", av7110->dvb_adapter.num);
Expand Down Expand Up @@ -308,8 +308,8 @@ static int av7110_dvb_c_switch(struct saa7146_fh *fh)
if (ves1820_writereg(dev, 0x09, 0x0f, 0x20))
dprintk(1, "setting band in demodulator failed.\n");
} else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) {
saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTLO); // TDA9819 pin9(STD)
saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); // TDA9819 pin30(VIF)
saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTLO); // TDA9198 pin9(STD)
saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); // TDA9198 pin30(VIF)
}
}

Expand Down Expand Up @@ -750,8 +750,8 @@ int av7110_init_analog_module(struct av7110 *av7110)
if (ves1820_writereg(av7110->dev, 0x09, 0x0f, 0x20))
dprintk(1, "setting band in demodulator failed.\n");
} else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) {
saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9819 pin9(STD)
saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9819 pin30(VIF)
saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9198 pin9(STD)
saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9198 pin30(VIF)
}

/* init the saa7113 */
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/media/dvb/ttpci/budget-av.c
Original file line number Diff line number Diff line change
Expand Up @@ -1303,9 +1303,6 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio
budget_av->budget.dvb_adapter.priv = budget_av;
frontend_init(budget_av);
ciintf_init(budget_av);

ttpci_budget_init_hooks(&budget_av->budget);

return 0;
}

Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/media/dvb/ttpci/budget-ci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1101,8 +1101,6 @@ static int budget_ci_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio
budget_ci->budget.dvb_adapter.priv = budget_ci;
frontend_init(budget_ci);

ttpci_budget_init_hooks(&budget_ci->budget);

return 0;
}

Expand Down
57 changes: 13 additions & 44 deletions trunk/drivers/media/dvb/ttpci/budget-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ static int stop_ts_capture(struct budget *budget)
{
dprintk(2, "budget: %p\n", budget);

if (--budget->feeding)
return budget->feeding;

saa7146_write(budget->dev, MC1, MASK_20); // DMA3 off
SAA7146_IER_DISABLE(budget->dev, MASK_10);
return 0;
Expand All @@ -74,8 +77,8 @@ static int start_ts_capture(struct budget *budget)

dprintk(2, "budget: %p\n", budget);

if (!budget->feeding || !budget->fe_synced)
return 0;
if (budget->feeding)
return ++budget->feeding;

saa7146_write(dev, MC1, MASK_20); // DMA3 off

Expand Down Expand Up @@ -136,33 +139,7 @@ static int start_ts_capture(struct budget *budget)
SAA7146_IER_ENABLE(budget->dev, MASK_10); /* VPE */
saa7146_write(dev, MC1, (MASK_04 | MASK_20)); /* DMA3 on */

return 0;
}

static int budget_read_fe_status(struct dvb_frontend *fe, fe_status_t *status)
{
struct budget *budget = (struct budget *) fe->dvb->priv;
int synced;
int ret;

if (budget->read_fe_status)
ret = budget->read_fe_status(fe, status);
else
ret = -EINVAL;

if (!ret) {
synced = (*status & FE_HAS_LOCK);
if (synced != budget->fe_synced) {
budget->fe_synced = synced;
spin_lock(&budget->feedlock);
if (synced)
start_ts_capture(budget);
else
stop_ts_capture(budget);
spin_unlock(&budget->feedlock);
}
}
return ret;
return ++budget->feeding;
}

static void vpeirq(unsigned long data)
Expand Down Expand Up @@ -290,7 +267,7 @@ static int budget_start_feed(struct dvb_demux_feed *feed)
{
struct dvb_demux *demux = feed->demux;
struct budget *budget = (struct budget *) demux->priv;
int status = 0;
int status;

dprintk(2, "budget: %p\n", budget);

Expand All @@ -299,8 +276,7 @@ static int budget_start_feed(struct dvb_demux_feed *feed)

spin_lock(&budget->feedlock);
feed->pusi_seen = 0; /* have a clean section start */
if (budget->feeding++ == 0)
status = start_ts_capture(budget);
status = start_ts_capture(budget);
spin_unlock(&budget->feedlock);
return status;
}
Expand All @@ -309,13 +285,12 @@ static int budget_stop_feed(struct dvb_demux_feed *feed)
{
struct dvb_demux *demux = feed->demux;
struct budget *budget = (struct budget *) demux->priv;
int status = 0;
int status;

dprintk(2, "budget: %p\n", budget);

spin_lock(&budget->feedlock);
if (--budget->feeding == 0)
status = stop_ts_capture(budget);
status = stop_ts_capture(budget);
spin_unlock(&budget->feedlock);
return status;
}
Expand Down Expand Up @@ -495,14 +470,6 @@ int ttpci_budget_init(struct budget *budget, struct saa7146_dev *dev,
return ret;
}

void ttpci_budget_init_hooks(struct budget *budget)
{
if (budget->dvb_frontend && !budget->read_fe_status) {
budget->read_fe_status = budget->dvb_frontend->ops.read_status;
budget->dvb_frontend->ops.read_status = budget_read_fe_status;
}
}

int ttpci_budget_deinit(struct budget *budget)
{
struct saa7146_dev *dev = budget->dev;
Expand Down Expand Up @@ -541,16 +508,18 @@ void ttpci_budget_set_video_port(struct saa7146_dev *dev, int video_port)
spin_lock(&budget->feedlock);
budget->video_port = video_port;
if (budget->feeding) {
int oldfeeding = budget->feeding;
budget->feeding = 1;
stop_ts_capture(budget);
start_ts_capture(budget);
budget->feeding = oldfeeding;
}
spin_unlock(&budget->feedlock);
}

EXPORT_SYMBOL_GPL(ttpci_budget_debiread);
EXPORT_SYMBOL_GPL(ttpci_budget_debiwrite);
EXPORT_SYMBOL_GPL(ttpci_budget_init);
EXPORT_SYMBOL_GPL(ttpci_budget_init_hooks);
EXPORT_SYMBOL_GPL(ttpci_budget_deinit);
EXPORT_SYMBOL_GPL(ttpci_budget_irq10_handler);
EXPORT_SYMBOL_GPL(ttpci_budget_set_video_port);
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/media/dvb/ttpci/budget-patch.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,6 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte
budget->dvb_adapter.priv = budget;
frontend_init(budget);

ttpci_budget_init_hooks(budget);

return 0;
}

Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/media/dvb/ttpci/budget.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,9 @@ static void frontend_init(struct budget *budget)
if (budget->dvb_frontend) {
budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params;
budget->dvb_frontend->tuner_priv = &budget->i2c_adap;
budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_diseqc_send_master_cmd;
budget->dvb_frontend->ops.diseqc_send_burst = budget_diseqc_send_burst;
budget->dvb_frontend->ops.set_tone = budget_set_tone;
break;
}
break;
Expand Down Expand Up @@ -471,8 +474,6 @@ static int budget_attach (struct saa7146_dev* dev, struct saa7146_pci_extension_
budget->dvb_adapter.priv = budget;
frontend_init(budget);

ttpci_budget_init_hooks(budget);

return 0;
}

Expand Down
7 changes: 3 additions & 4 deletions trunk/drivers/media/dvb/ttpci/budget.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ struct budget {
struct dmx_frontend hw_frontend;
struct dmx_frontend mem_frontend;

int fe_synced;
struct mutex pid_mutex;

int ci_present;
int video_port;

Expand All @@ -71,9 +74,6 @@ struct budget {

struct dvb_adapter dvb_adapter;
struct dvb_frontend *dvb_frontend;
int (*read_fe_status)(struct dvb_frontend *fe, fe_status_t *status);
int fe_synced;

void *priv;
};

Expand Down Expand Up @@ -106,7 +106,6 @@ static struct saa7146_pci_extension_data x_var = { \
extern int ttpci_budget_init(struct budget *budget, struct saa7146_dev *dev,
struct saa7146_pci_extension_data *info,
struct module *owner);
extern void ttpci_budget_init_hooks(struct budget *budget);
extern int ttpci_budget_deinit(struct budget *budget);
extern void ttpci_budget_irq10_handler(struct saa7146_dev *dev, u32 * isr);
extern void ttpci_budget_set_video_port(struct saa7146_dev *dev, int video_port);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/media/video/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ config VIDEO_SAA5246A

config VIDEO_SAA5249
tristate "SAA5249 Teletext processor"
depends on VIDEO_DEV && I2C && VIDEO_V4L1
depends on VIDEO_DEV && I2C
help
Support for I2C bus based teletext using the SAA5249 chip. At the
moment this is only useful on some European WinTV cards.
Expand All @@ -155,7 +155,7 @@ config VIDEO_SAA5249

config TUNER_3036
tristate "SAB3036 tuner"
depends on VIDEO_DEV && I2C && VIDEO_V4L1
depends on VIDEO_DEV && I2C
help
Say Y here to include support for Philips SAB3036 compatible tuners.
If in doubt, say N.
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/bt8xx/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config VIDEO_BT848
tristate "BT848 Video For Linux"
depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L1
depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L2
select I2C_ALGOBIT
select FW_LOADER
select VIDEO_BTCX
Expand Down
15 changes: 2 additions & 13 deletions trunk/drivers/media/video/bt8xx/bttv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -3923,12 +3923,7 @@ static int __devinit bttv_register_video(struct bttv *btv)
goto err;
printk(KERN_INFO "bttv%d: registered device video%d\n",
btv->c.nr,btv->video_dev->minor & 0x1f);
if (class_device_create_file(&btv->video_dev->class_dev,
&class_device_attr_card)<0) {
printk(KERN_ERR "bttv%d: class_device_create_file 'card' "
"failed\n", btv->c.nr);
goto err;
}
video_device_create_file(btv->video_dev, &class_device_attr_card);

/* vbi */
btv->vbi_dev = vdev_init(btv, &bttv_vbi_template, "vbi");
Expand Down Expand Up @@ -4292,8 +4287,6 @@ static struct pci_driver bttv_pci_driver = {

static int bttv_init_module(void)
{
int ret;

bttv_num = 0;

printk(KERN_INFO "bttv: driver version %d.%d.%d loaded\n",
Expand All @@ -4315,11 +4308,7 @@ static int bttv_init_module(void)

bttv_check_chipset();

ret = bus_register(&bttv_sub_bus_type);
if (ret < 0) {
printk(KERN_WARNING "bttv: bus_register error: %d\n", ret);
return ret;
}
bus_register(&bttv_sub_bus_type);
return pci_register_driver(&bttv_pci_driver);
}

Expand Down
Loading

0 comments on commit c506728

Please sign in to comment.