Skip to content

Commit

Permalink
V4L/DVB (3984): Fix CI interface on KNC1 DVBT and DVBC cards
Browse files Browse the repository at this point in the history
These cards need special handling for CI - reinitialising the frontend
device when the CI module is reset. Additionally the tda10021 needs to be set
into a different transport stream mode when a CI module is present.

Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Andrew de Quincey authored and Mauro Carvalho Chehab committed Jun 25, 2006
1 parent 48c3575 commit 5c1208b
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 76 deletions.
25 changes: 23 additions & 2 deletions drivers/media/dvb/dvb-core/dvb_ca_en50221.c
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,18 @@ static int dvb_ca_en50221_thread(void *data)
break;

case DVB_CA_SLOTSTATE_VALIDATE:
if (dvb_ca_en50221_parse_attributes(ca, slot)
!= 0) {
if (dvb_ca_en50221_parse_attributes(ca, slot) != 0) {
/* we need this extra check for annoying interfaces like the budget-av */
if ((!(ca->flags & DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE)) &&
(ca->pub->poll_slot_status)) {
int status = ca->pub->poll_slot_status(ca->pub, slot, 0);
if (!(status & DVB_CA_EN50221_POLL_CAM_PRESENT)) {
ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_NONE;
dvb_ca_en50221_thread_update_delay(ca);
break;
}
}

printk("dvb_ca adapter %d: Invalid PC card inserted :(\n",
ca->dvbdev->adapter->num);
ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_INVALID;
Expand Down Expand Up @@ -1108,6 +1118,17 @@ static int dvb_ca_en50221_thread(void *data)

case DVB_CA_SLOTSTATE_LINKINIT:
if (dvb_ca_en50221_link_init(ca, slot) != 0) {
/* we need this extra check for annoying interfaces like the budget-av */
if ((!(ca->flags & DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE)) &&
(ca->pub->poll_slot_status)) {
int status = ca->pub->poll_slot_status(ca->pub, slot, 0);
if (!(status & DVB_CA_EN50221_POLL_CAM_PRESENT)) {
ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_NONE;
dvb_ca_en50221_thread_update_delay(ca);
break;
}
}

printk("dvb_ca adapter %d: DVB CAM link initialisation failed :(\n", ca->dvbdev->adapter->num);
ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_INVALID;
dvb_ca_en50221_thread_update_delay(ca);
Expand Down
8 changes: 8 additions & 0 deletions drivers/media/dvb/frontends/tda10021.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ static int tda10021_writereg (struct tda10021_state* state, u8 reg, u8 data)
return (ret != 1) ? -EREMOTEIO : 0;
}

int tda10021_write_byte(struct dvb_frontend* fe, int reg, int data)
{
struct tda10021_state* state = fe->demodulator_priv;

return tda10021_writereg(state, reg, data);
}
EXPORT_SYMBOL(tda10021_write_byte);

static u8 tda10021_readreg (struct tda10021_state* state, u8 reg)
{
u8 b0 [] = { reg };
Expand Down
2 changes: 2 additions & 0 deletions drivers/media/dvb/frontends/tda10021.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ struct tda10021_config
extern struct dvb_frontend* tda10021_attach(const struct tda10021_config* config,
struct i2c_adapter* i2c, u8 pwm);

extern int tda10021_write_byte(struct dvb_frontend* fe, int reg, int data);

#endif // TDA10021_H
Loading

0 comments on commit 5c1208b

Please sign in to comment.