Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 37343
b: refs/heads/master
c: 2bfe031
h: refs/heads/master
i:
  37341: a20e148
  37339: 3944e43
  37335: e331f4a
  37327: 40891d5
  37311: 618c8fc
v: v3
  • Loading branch information
Andrew de Quincey authored and Mauro Carvalho Chehab committed Sep 26, 2006
1 parent 232d71a commit 57ab01e
Show file tree
Hide file tree
Showing 22 changed files with 230 additions and 171 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: d995506062c974133ba66d0822e58a923d4d74d9
refs/heads/master: 2bfe031df6bd5e3b8e503eba8e3b6461d7c2c27e
26 changes: 15 additions & 11 deletions trunk/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ int flexcop_frontend_init(struct flexcop_device *fc)
struct dvb_frontend_ops *ops;

/* try the sky v2.6 (stv0299/Samsung tbmu24112(sl1935)) */
if ((fc->fe = stv0299_attach(&samsung_tbmu24112_config, &fc->i2c_adap)) != NULL) {
if ((fc->fe = dvb_attach(stv0299_attach, &samsung_tbmu24112_config, &fc->i2c_adap)) != NULL) {
ops = &fc->fe->ops;

ops->tuner_ops.set_params = samsung_tbmu24112_tuner_set_params;
Expand All @@ -519,36 +519,36 @@ int flexcop_frontend_init(struct flexcop_device *fc)
info("found the stv0299 at i2c address: 0x%02x",samsung_tbmu24112_config.demod_address);
} else
/* try the air dvb-t (mt352/Samsung tdtc9251dh0(??)) */
if ((fc->fe = mt352_attach(&samsung_tdtc9251dh0_config, &fc->i2c_adap)) != NULL ) {
if ((fc->fe = dvb_attach(mt352_attach, &samsung_tdtc9251dh0_config, &fc->i2c_adap)) != NULL ) {
fc->dev_type = FC_AIR_DVB;
fc->fe->ops.tuner_ops.calc_regs = samsung_tdtc9251dh0_calc_regs;
info("found the mt352 at i2c address: 0x%02x",samsung_tdtc9251dh0_config.demod_address);
} else
/* try the air atsc 2nd generation (nxt2002) */
if ((fc->fe = nxt200x_attach(&samsung_tbmv_config, &fc->i2c_adap)) != NULL) {
if ((fc->fe = dvb_attach(nxt200x_attach, &samsung_tbmv_config, &fc->i2c_adap)) != NULL) {
fc->dev_type = FC_AIR_ATSC2;
dvb_attach(dvb_pll_attach, fc->fe, 0x61, &fc->i2c_adap, &dvb_pll_samsung_tbmv);
info("found the nxt2002 at i2c address: 0x%02x",samsung_tbmv_config.demod_address);
} else
/* try the air atsc 3nd generation (lgdt3303) */
if ((fc->fe = lgdt330x_attach(&air2pc_atsc_hd5000_config, &fc->i2c_adap)) != NULL) {
if ((fc->fe = dvb_attach(lgdt330x_attach, &air2pc_atsc_hd5000_config, &fc->i2c_adap)) != NULL) {
fc->dev_type = FC_AIR_ATSC3;
fc->fe->ops.tuner_ops.set_params = lgdt3303_tuner_set_params;
info("found the lgdt3303 at i2c address: 0x%02x",air2pc_atsc_hd5000_config.demod_address);
} else
/* try the air atsc 1nd generation (bcm3510)/panasonic ct10s */
if ((fc->fe = bcm3510_attach(&air2pc_atsc_first_gen_config, &fc->i2c_adap)) != NULL) {
if ((fc->fe = dvb_attach(bcm3510_attach, &air2pc_atsc_first_gen_config, &fc->i2c_adap)) != NULL) {
fc->dev_type = FC_AIR_ATSC1;
info("found the bcm3510 at i2c address: 0x%02x",air2pc_atsc_first_gen_config.demod_address);
} else
/* try the cable dvb (stv0297) */
if ((fc->fe = stv0297_attach(&alps_tdee4_stv0297_config, &fc->i2c_adap)) != NULL) {
if ((fc->fe = dvb_attach(stv0297_attach, &alps_tdee4_stv0297_config, &fc->i2c_adap)) != NULL) {
fc->dev_type = FC_CABLE;
fc->fe->ops.tuner_ops.set_params = alps_tdee4_stv0297_tuner_set_params;
info("found the stv0297 at i2c address: 0x%02x",alps_tdee4_stv0297_config.demod_address);
} else
/* try the sky v2.3 (vp310/Samsung tbdu18132(tsa5059)) */
if ((fc->fe = vp310_mt312_attach(&skystar23_samsung_tbdu18132_config, &fc->i2c_adap)) != NULL) {
if ((fc->fe = dvb_attach(vp310_mt312_attach, &skystar23_samsung_tbdu18132_config, &fc->i2c_adap)) != NULL) {
ops = &fc->fe->ops;

ops->tuner_ops.set_params = skystar23_samsung_tbdu18132_tuner_set_params;
Expand All @@ -571,9 +571,9 @@ int flexcop_frontend_init(struct flexcop_device *fc)
} else {
if (dvb_register_frontend(&fc->dvb_adapter, fc->fe)) {
err("frontend registration failed!");
ops = &fc->fe->ops;
if (ops->release != NULL)
ops->release(fc->fe);
dvb_detach(fc->fe->ops.release_sec, fc->fe);
dvb_detach(fc->fe->ops.tuner_ops.release, fc->fe);
dvb_detach(fc->fe->ops.release, fc->fe);
fc->fe = NULL;
return -EINVAL;
}
Expand All @@ -584,8 +584,12 @@ int flexcop_frontend_init(struct flexcop_device *fc)

void flexcop_frontend_exit(struct flexcop_device *fc)
{
if (fc->init_state & FC_STATE_FE_INIT)
if (fc->init_state & FC_STATE_FE_INIT) {
dvb_unregister_frontend(fc->fe);
dvb_detach(fc->fe->ops.release_sec, fc->fe);
dvb_detach(fc->fe->ops.tuner_ops.release, fc->fe);
dvb_detach(fc->fe->ops.release, fc->fe);
}

fc->init_state &= ~FC_STATE_FE_INIT;
}
4 changes: 4 additions & 0 deletions trunk/drivers/media/dvb/bt8xx/dst.c
Original file line number Diff line number Diff line change
Expand Up @@ -1715,6 +1715,10 @@ static int dst_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_paramet
static void dst_release(struct dvb_frontend *fe)
{
struct dst_state *state = fe->demodulator_priv;

if (state->dst_hw_cap & DST_TYPE_HAS_CA)
symbol_put(dst_ca_attach);

kfree(state);
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/media/dvb/bt8xx/dst_ca.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,12 +699,12 @@ static struct dvb_device dvbdev_ca = {
.fops = &dst_ca_fops
};

int dst_ca_attach(struct dst_state *dst, struct dvb_adapter *dvb_adapter)
ssize_t dst_ca_attach(struct dst_state *dst, struct dvb_adapter *dvb_adapter)
{
struct dvb_device *dvbdev;
dprintk(verbose, DST_CA_ERROR, 1, "registering DST-CA device");
dvb_register_device(dvb_adapter, &dvbdev, &dvbdev_ca, dst, DVB_DEVICE_CA);
return 0;
return 1; // must return non-zero for dvb_attach() to work
}

EXPORT_SYMBOL(dst_ca_attach);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/dvb/bt8xx/dst_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ int write_dst(struct dst_state *state, u8 * data, u8 len);
int read_dst(struct dst_state *state, u8 * ret, u8 len);
u8 dst_check_sum(u8 * buf, u32 len);
struct dst_state* dst_attach(struct dst_state* state, struct dvb_adapter *dvb_adapter);
int dst_ca_attach(struct dst_state *state, struct dvb_adapter *dvb_adapter);
ssize_t dst_ca_attach(struct dst_state *state, struct dvb_adapter *dvb_adapter);
int dst_gpio_outb(struct dst_state* state, u32 mask, u32 enbb, u32 outhigh, int delay);

int dst_command(struct dst_state* state, u8 * data, u8 len);
Expand Down
36 changes: 20 additions & 16 deletions trunk/drivers/media/dvb/bt8xx/dvb-bt8xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static void dvb_bt8xx_task(unsigned long data)

static int dvb_bt8xx_start_feed(struct dvb_demux_feed *dvbdmxfeed)
{
struct dvb_demux *dvbdmx = dvbdmxfeed->demux;
struct dvb_demux*dvbdmx = dvbdmxfeed->demux;
struct dvb_bt8xx_card *card = dvbdmx->priv;
int rc;

Expand Down Expand Up @@ -595,15 +595,14 @@ static void lgdt330x_reset(struct dvb_bt8xx_card *bt)

static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
{
int ret;
struct dst_state* state = NULL;

switch(type) {
case BTTV_BOARD_DVICO_DVBT_LITE:
card->fe = mt352_attach(&thomson_dtt7579_config, card->i2c_adapter);
card->fe = dvb_attach(mt352_attach, &thomson_dtt7579_config, card->i2c_adapter);

if (card->fe == NULL)
card->fe = zl10353_attach(&thomson_dtt7579_zl10353_config,
card->fe = dvb_attach(zl10353_attach, &thomson_dtt7579_zl10353_config,
card->i2c_adapter);

if (card->fe != NULL) {
Expand All @@ -615,7 +614,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)

case BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE:
lgdt330x_reset(card);
card->fe = lgdt330x_attach(&tdvs_tua6034_config, card->i2c_adapter);
card->fe = dvb_attach(lgdt330x_attach, &tdvs_tua6034_config, card->i2c_adapter);
if (card->fe != NULL) {
card->fe->ops.tuner_ops.set_params = tdvs_tua6034_tuner_set_params;
dprintk ("dvb_bt8xx: lgdt330x detected\n");
Expand All @@ -630,7 +629,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)

/* Old Nebula (marked (c)2003 on high profile pci card) has nxt6000 demod */
digitv_alps_tded4_reset(card);
card->fe = nxt6000_attach(&vp3021_alps_tded4_config, card->i2c_adapter);
card->fe = dvb_attach(nxt6000_attach, &vp3021_alps_tded4_config, card->i2c_adapter);
if (card->fe != NULL) {
card->fe->ops.tuner_ops.set_params = vp3021_alps_tded4_tuner_set_params;
dprintk ("dvb_bt8xx: an nxt6000 was detected on your digitv card\n");
Expand All @@ -639,7 +638,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)

/* New Nebula (marked (c)2005 on low profile pci card) has mt352 demod */
digitv_alps_tded4_reset(card);
card->fe = mt352_attach(&digitv_alps_tded4_config, card->i2c_adapter);
card->fe = dvb_attach(mt352_attach, &digitv_alps_tded4_config, card->i2c_adapter);

if (card->fe != NULL) {
card->fe->ops.tuner_ops.calc_regs = digitv_alps_tded4_tuner_calc_regs;
Expand All @@ -648,14 +647,14 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
break;

case BTTV_BOARD_AVDVBT_761:
card->fe = sp887x_attach(&microtune_mt7202dtf_config, card->i2c_adapter);
card->fe = dvb_attach(sp887x_attach, &microtune_mt7202dtf_config, card->i2c_adapter);
if (card->fe) {
card->fe->ops.tuner_ops.set_params = microtune_mt7202dtf_tuner_set_params;
}
break;

case BTTV_BOARD_AVDVBT_771:
card->fe = mt352_attach(&advbt771_samsung_tdtc9251dh0_config, card->i2c_adapter);
card->fe = dvb_attach(mt352_attach, &advbt771_samsung_tdtc9251dh0_config, card->i2c_adapter);
if (card->fe != NULL) {
card->fe->ops.tuner_ops.calc_regs = advbt771_samsung_tdtc9251dh0_tuner_calc_regs;
card->fe->ops.info.frequency_min = 174000000;
Expand All @@ -672,7 +671,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
state->bt = card->bt;

/* DST is not a frontend, attaching the ASIC */
if ((dst_attach(state, &card->dvb_adapter)) == NULL) {
if (dvb_attach(dst_attach, state, &card->dvb_adapter) == NULL) {
printk("%s: Could not find a Twinhan DST.\n", __FUNCTION__);
break;
}
Expand All @@ -681,11 +680,11 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
/* Attach other DST peripherals if any */
/* Conditional Access device */
if (state->dst_hw_cap & DST_TYPE_HAS_CA)
ret = dst_ca_attach(state, &card->dvb_adapter);
dvb_attach(dst_ca_attach, state, &card->dvb_adapter);
break;

case BTTV_BOARD_PINNACLESAT:
card->fe = cx24110_attach(&pctvsat_config, card->i2c_adapter);
card->fe = dvb_attach(cx24110_attach, &pctvsat_config, card->i2c_adapter);
if (card->fe) {
card->fe->ops.tuner_ops.init = pinnsat_tuner_init;
card->fe->ops.tuner_ops.sleep = pinnsat_tuner_sleep;
Expand All @@ -694,7 +693,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
break;

case BTTV_BOARD_PC_HDTV:
card->fe = or51211_attach(&or51211_config, card->i2c_adapter);
card->fe = dvb_attach(or51211_attach, &or51211_config, card->i2c_adapter);
break;
}

Expand All @@ -707,8 +706,9 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
else
if (dvb_register_frontend(&card->dvb_adapter, card->fe)) {
printk("dvb-bt8xx: Frontend registration failed!\n");
if (card->fe->ops.release)
card->fe->ops.release(card->fe);
dvb_detach(card->fe->ops.release_sec, card->fe);
dvb_detach(card->fe->ops.tuner_ops.release, card->fe);
dvb_detach(card->fe->ops.release, card->fe);
card->fe = NULL;
}
}
Expand Down Expand Up @@ -925,8 +925,12 @@ static void dvb_bt8xx_remove(struct bttv_sub_device *sub)
card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_hw);
dvb_dmxdev_release(&card->dmxdev);
dvb_dmx_release(&card->demux);
if (card->fe)
if (card->fe) {
dvb_unregister_frontend(card->fe);
dvb_detach(card->fe->ops.release_sec, card->fe);
dvb_detach(card->fe->ops.tuner_ops.release, card->fe);
dvb_detach(card->fe->ops.release, card->fe);
}
dvb_unregister_adapter(&card->dvb_adapter);

kfree(card);
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/media/dvb/dvb-usb/cxusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d)

cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, &b, 1);

if ((d->fe = cx22702_attach(&cxusb_cx22702_config, &d->i2c_adap)) != NULL)
if ((d->fe = dvb_attach(cx22702_attach, &cxusb_cx22702_config, &d->i2c_adap)) != NULL)
return 0;

return -EIO;
Expand All @@ -422,7 +422,7 @@ static int cxusb_lgdt3303_frontend_attach(struct dvb_usb_device *d)

cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);

if ((d->fe = lgdt330x_attach(&cxusb_lgdt3303_config, &d->i2c_adap)) != NULL)
if ((d->fe = dvb_attach(lgdt330x_attach, &cxusb_lgdt3303_config, &d->i2c_adap)) != NULL)
return 0;

return -EIO;
Expand All @@ -435,7 +435,7 @@ static int cxusb_mt352_frontend_attach(struct dvb_usb_device *d)

cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);

if ((d->fe = mt352_attach(&cxusb_mt352_config, &d->i2c_adap)) != NULL)
if ((d->fe = dvb_attach(mt352_attach, &cxusb_mt352_config, &d->i2c_adap)) != NULL)
return 0;

return -EIO;
Expand All @@ -448,8 +448,8 @@ static int cxusb_dee1601_frontend_attach(struct dvb_usb_device *d)

cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);

if (((d->fe = mt352_attach(&cxusb_dee1601_config, &d->i2c_adap)) != NULL) ||
((d->fe = zl10353_attach(&cxusb_zl10353_dee1601_config, &d->i2c_adap)) != NULL))
if (((d->fe = dvb_attach(mt352_attach, &cxusb_dee1601_config, &d->i2c_adap)) != NULL) ||
((d->fe = dvb_attach(zl10353_attach, &cxusb_zl10353_dee1601_config, &d->i2c_adap)) != NULL))
return 0;

return -EIO;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/media/dvb/dvb-usb/digitv.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ static struct nxt6000_config digitv_nxt6000_config = {

static int digitv_frontend_attach(struct dvb_usb_device *d)
{
if ((d->fe = mt352_attach(&digitv_mt352_config, &d->i2c_adap)) != NULL) {
if ((d->fe = dvb_attach(mt352_attach, &digitv_mt352_config, &d->i2c_adap)) != NULL) {
d->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs;
return 0;
}
if ((d->fe = nxt6000_attach(&digitv_nxt6000_config, &d->i2c_adap)) != NULL) {
if ((d->fe = dvb_attach(nxt6000_attach, &digitv_nxt6000_config, &d->i2c_adap)) != NULL) {
d->fe->ops.tuner_ops.set_params = digitv_nxt6000_tuner_set_params;
return 0;
}
Expand Down
11 changes: 8 additions & 3 deletions trunk/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,9 @@ int dvb_usb_fe_init(struct dvb_usb_device* d)

if (dvb_register_frontend(&d->dvb_adap, d->fe)) {
err("Frontend registration failed.");
if (d->fe->ops.release)
d->fe->ops.release(d->fe);
dvb_detach(d->fe->ops.release_sec, d->fe);
dvb_detach(d->fe->ops.tuner_ops.release, d->fe);
dvb_detach(d->fe->ops.release, d->fe);
d->fe = NULL;
return -ENODEV;
}
Expand All @@ -204,7 +205,11 @@ int dvb_usb_fe_init(struct dvb_usb_device* d)

int dvb_usb_fe_exit(struct dvb_usb_device *d)
{
if (d->fe != NULL)
if (d->fe != NULL) {
dvb_unregister_frontend(d->fe);
dvb_detach(d->fe->ops.release_sec, d->fe);
dvb_detach(d->fe->ops.tuner_ops.release, d->fe);
dvb_detach(d->fe->ops.release, d->fe);
}
return 0;
}
2 changes: 1 addition & 1 deletion trunk/drivers/media/dvb/dvb-usb/umt-010.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static int umt_mt352_frontend_attach(struct dvb_usb_device *d)
umt_config.demod_init = umt_mt352_demod_init;
umt_config.demod_address = 0xf;

d->fe = mt352_attach(&umt_config, &d->i2c_adap);
d->fe = dvb_attach(mt352_attach, &umt_config, &d->i2c_adap);

return 0;
}
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/media/dvb/frontends/dvb-pll.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ static struct dvb_tuner_ops dvb_pll_tuner_ops = {
.get_bandwidth = dvb_pll_get_bandwidth,
};

int dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2c, struct dvb_pll_desc *desc)
struct dvb_frontend *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 };
Expand All @@ -624,14 +624,14 @@ int dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2

ret = i2c_transfer (i2c, &msg, 1);
if (ret != 1)
return -1;
return NULL;
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)
return -ENOMEM;
return NULL;

priv->pll_i2c_address = pll_addr;
priv->i2c = i2c;
Expand All @@ -643,7 +643,7 @@ int dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2
fe->ops.tuner_ops.info.frequency_min = desc->max;

fe->tuner_priv = priv;
return 0;
return fe;
}
EXPORT_SYMBOL(dvb_pll_attach);

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/media/dvb/frontends/dvb-pll.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ extern int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf,
* @param pll_addr i2c address of the PLL (if used).
* @param i2c i2c adapter to use (set to NULL if not used).
* @param desc dvb_pll_desc to use.
* @return 0 on success, nonzero on failure.
* @return Frontend pointer on success, NULL on failure
*/
extern int dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2c, struct dvb_pll_desc *desc);
extern struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2c, struct dvb_pll_desc *desc);

#endif
Loading

0 comments on commit 57ab01e

Please sign in to comment.