aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/dvb/bt8xx/dst.c14
-rw-r--r--drivers/media/dvb/bt8xx/dst_ca.c10
-rw-r--r--drivers/media/dvb/bt8xx/dst_common.h3
-rw-r--r--drivers/media/dvb/bt8xx/dvb-bt8xx.c6
4 files changed, 24 insertions, 9 deletions
diff --git a/drivers/media/dvb/bt8xx/dst.c b/drivers/media/dvb/bt8xx/dst.c
index 52b6fb2455f9..9f72b7000c08 100644
--- a/drivers/media/dvb/bt8xx/dst.c
+++ b/drivers/media/dvb/bt8xx/dst.c
@@ -1715,6 +1715,15 @@ static int dst_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_paramet
1715static void dst_release(struct dvb_frontend *fe) 1715static void dst_release(struct dvb_frontend *fe)
1716{ 1716{
1717 struct dst_state *state = fe->demodulator_priv; 1717 struct dst_state *state = fe->demodulator_priv;
1718 if (state->dst_ca) {
1719 dvb_unregister_device(state->dst_ca);
1720#ifdef CONFIG_DVB_CORE_ATTACH
1721 symbol_put(dst_ca_attach);
1722#endif
1723 }
1724#ifdef CONFIG_DVB_CORE_ATTACH
1725 symbol_put(dst_attach);
1726#endif
1718 kfree(state); 1727 kfree(state);
1719} 1728}
1720 1729
@@ -1752,11 +1761,6 @@ struct dst_state *dst_attach(struct dst_state *state, struct dvb_adapter *dvb_ad
1752 } 1761 }
1753 state->frontend.demodulator_priv = state; 1762 state->frontend.demodulator_priv = state;
1754 1763
1755 /* Attach other DST peripherals if any */
1756 /* Conditional Access device */
1757 if (state->dst_hw_cap & DST_TYPE_HAS_CA)
1758 dst_ca_attach(state, dvb_adapter);
1759
1760 return state; /* Manu (DST is a card not a frontend) */ 1764 return state; /* Manu (DST is a card not a frontend) */
1761} 1765}
1762 1766
diff --git a/drivers/media/dvb/bt8xx/dst_ca.c b/drivers/media/dvb/bt8xx/dst_ca.c
index df0f68fbf24b..240ad084fa78 100644
--- a/drivers/media/dvb/bt8xx/dst_ca.c
+++ b/drivers/media/dvb/bt8xx/dst_ca.c
@@ -699,11 +699,17 @@ static struct dvb_device dvbdev_ca = {
699 .fops = &dst_ca_fops 699 .fops = &dst_ca_fops
700}; 700};
701 701
702void dst_ca_attach(struct dst_state *dst, struct dvb_adapter *dvb_adapter) 702struct dvb_device *dst_ca_attach(struct dst_state *dst, struct dvb_adapter *dvb_adapter)
703{ 703{
704 struct dvb_device *dvbdev; 704 struct dvb_device *dvbdev;
705
705 dprintk(verbose, DST_CA_ERROR, 1, "registering DST-CA device"); 706 dprintk(verbose, DST_CA_ERROR, 1, "registering DST-CA device");
706 dvb_register_device(dvb_adapter, &dvbdev, &dvbdev_ca, dst, DVB_DEVICE_CA); 707 if (dvb_register_device(dvb_adapter, &dvbdev, &dvbdev_ca, dst, DVB_DEVICE_CA) == 0) {
708 dst->dst_ca = dvbdev;
709 return dst->dst_ca;
710 }
711
712 return NULL;
707} 713}
708 714
709EXPORT_SYMBOL(dst_ca_attach); 715EXPORT_SYMBOL(dst_ca_attach);
diff --git a/drivers/media/dvb/bt8xx/dst_common.h b/drivers/media/dvb/bt8xx/dst_common.h
index 66bc082824ad..3bf084f2e522 100644
--- a/drivers/media/dvb/bt8xx/dst_common.h
+++ b/drivers/media/dvb/bt8xx/dst_common.h
@@ -140,6 +140,7 @@ struct dst_state {
140 char *tuner_name; 140 char *tuner_name;
141 struct mutex dst_mutex; 141 struct mutex dst_mutex;
142 u8 fw_name[8]; 142 u8 fw_name[8];
143 struct dvb_device *dst_ca;
143}; 144};
144 145
145struct tuner_types { 146struct tuner_types {
@@ -178,7 +179,7 @@ int write_dst(struct dst_state *state, u8 * data, u8 len);
178int read_dst(struct dst_state *state, u8 * ret, u8 len); 179int read_dst(struct dst_state *state, u8 * ret, u8 len);
179u8 dst_check_sum(u8 * buf, u32 len); 180u8 dst_check_sum(u8 * buf, u32 len);
180struct dst_state* dst_attach(struct dst_state* state, struct dvb_adapter *dvb_adapter); 181struct dst_state* dst_attach(struct dst_state* state, struct dvb_adapter *dvb_adapter);
181void dst_ca_attach(struct dst_state *state, struct dvb_adapter *dvb_adapter); 182struct dvb_device *dst_ca_attach(struct dst_state *state, struct dvb_adapter *dvb_adapter);
182int dst_gpio_outb(struct dst_state* state, u32 mask, u32 enbb, u32 outhigh, int delay); 183int dst_gpio_outb(struct dst_state* state, u32 mask, u32 enbb, u32 outhigh, int delay);
183 184
184int dst_command(struct dst_state* state, u8 * data, u8 len); 185int dst_command(struct dst_state* state, u8 * data, u8 len);
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index a19991f7af47..fb6c4cc8477d 100644
--- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -669,13 +669,17 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
669 state->config = &dst_config; 669 state->config = &dst_config;
670 state->i2c = card->i2c_adapter; 670 state->i2c = card->i2c_adapter;
671 state->bt = card->bt; 671 state->bt = card->bt;
672 672 state->dst_ca = NULL;
673 /* DST is not a frontend, attaching the ASIC */ 673 /* DST is not a frontend, attaching the ASIC */
674 if (dvb_attach(dst_attach, state, &card->dvb_adapter) == NULL) { 674 if (dvb_attach(dst_attach, state, &card->dvb_adapter) == NULL) {
675 printk("%s: Could not find a Twinhan DST.\n", __FUNCTION__); 675 printk("%s: Could not find a Twinhan DST.\n", __FUNCTION__);
676 break; 676 break;
677 } 677 }
678 /* Attach other DST peripherals if any */
679 /* Conditional Access device */
678 card->fe = &state->frontend; 680 card->fe = &state->frontend;
681 if (state->dst_hw_cap & DST_TYPE_HAS_CA)
682 dvb_attach(dst_ca_attach, state, &card->dvb_adapter);
679 break; 683 break;
680 684
681 case BTTV_BOARD_PINNACLESAT: 685 case BTTV_BOARD_PINNACLESAT: