DVB updates for 2.6.12-rc4
Subsystems (2)
cover DVB updates for 2.6.12-rc4
Hi Andrew,
here are a bunch of patches from linuxtv.org CVS. Nothing exciting, just bugfixes, cleanups and support for a number of new card variants.
One hunk from my previous patchset didn't make it into 2.6.12-rc4, but still lingers somewhere in rc3-mm3, thus the "make dvb_class static" patch will be rejected when applying to -rc3-mm3:dvb-core/dvbdev.c from http://lkml.org/lkml/2005/3/21/321
Please apply.
Thanks,
Johannes
PATCH 1/37 support for TT/Hauppauge Nexus-S Rev 2.3
Support for TT/Hauppauge Nexus-S Rev 2.3 (Oliver Endriss)
---
drivers/media/dvb/ttpci/av7110.c | 116 +++++++++++++++++++++++++++++++++++++-- 1 files changed, 113 insertions(+), 3 deletions(-)
drivers/media/dvb/ttpci/av7110.c +113 -3
@@ -1673,6 +1673,106 @@ static struct stv0299_config alps_bsru6_ }; +static u8 alps_bsbe1_inittab[] = { +0x01 ,0x15 , +0x02 ,0x30 , +0x03 ,0x00 , +0x04 ,0x7d ,/* F22FR = 0x7d, F22 = f_VCO / 128 / 0x7d = 22 kHz */ +0x05 ,0x35 ,/* I2CT = 0, SCLT = 1, SDAT = 1 */ +0x06 ,0x40 ,/* DAC not used, set to high impendance mode */ +0x07 ,0x00 ,/* DAC LSB */ +0x08 ,0x40 ,/* DiSEqC off, LNB power on OP2/LOCK pin on */ +0x09 ,0x00 ,/* FIFO */ +0x0c ,0x51 ,/* OP1 ctl = Normal, OP1 val = 1 (LNB Power ON) */ +0x0d ,0x82 ,/* DC offset compensation = ON, beta_agc1 = 2 */ +0x0e ,0x23 ,/* alpha_tmg = 2, beta_tmg = 3 */ +0x10 ,0x3f ,// AGC2 0x3d +0x11 ,0x84 , +0x12 ,0xb5 ,// Lock detect: -64 Carrier freq detect:on +0x15 ,0xc9 ,// lock detector threshold +0x16 ,0x00 , +0x17 ,0x00 , +0x18 ,0x00 , +0x19 ,0x00 , +0x1a ,0x00 , +0x1f ,0x50 , +0x20 ,0x00 , +0x21 ,0x00 , +0x22 ,0x00 , +0x23 ,0x00 , +0x28 ,0x00 ,// out imp: normal out type: parallel FEC mode:0 +0x29 ,0x1e ,// 1/2 threshold +0x2a ,0x14 ,// 2/3 threshold +0x2b ,0x0f ,// 3/4 threshold +0x2c ,0x09 ,// 5/6 threshold +0x2d ,0x05 ,// 7/8 threshold +0x2e ,0x01 , +0x31 ,0x1f ,// test all FECs +0x32 ,0x19 ,// viterbi and synchro search +0x33 ,0xfc ,// rs control +0x34 ,0x93 ,// error control +0x0f ,0x92 , +0xff ,0xff +}; + +static int alps_bsbe1_pll_set (struct dvb_frontend * fe,struct dvb_frontend_parameters * params) +{ +struct av7110 * av7110 = (struct av7110 *) fe->dvb->priv; +int ret; +u8 data[4 ]; +u32 div; +struct i2c_msg msg = { .addr =0x61 , .flags =0 , .buf = data, .len =sizeof (data) }; + +if ((params->frequency <950000 ) || (params->frequency >2150000 )) +return -EINVAL ; + + div = (params->frequency + (125 -1 )) /125 ;// round correctly + data[0 ] = (div >>8 ) &0x7f ; + data[1 ] = div &0xff ; + data[2 ] =0x80 | ((div &0x18000 ) >>10 ) |4 ; + data[3 ] = (params->frequency >1530000 ) ?0xE0 :0xE4 ; + + ret =i2c_transfer (&av7110->i2c_adap, &msg,1 ); +return (ret !=1 ) ? -EIO :0 ; +} + +static struct stv0299_config alps_bsbe1_config = { + .demod_address =0x68 , + .inittab = alps_bsbe1_inittab, + .mclk =88000000UL , + .invert =1 , + .enhanced_tuning =0 , + .skip_reinit =0 , + .min_delay_ms =100 , + .set_symbol_rate = alps_bsru6_set_symbol_rate, + .pll_set = alps_bsbe1_pll_set, +}; + +static int lnbp21_set_voltage (struct dvb_frontend * fe,fe_sec_voltage_t voltage) +{ +struct av7110 * av7110 = (struct av7110 *) fe->dvb->priv; +int ret; +u8 data[1 ]; +struct i2c_msg msg = { .addr =0x08 , .flags =0 , .buf = data, .len =sizeof (data) }; + +switch (voltage) { +case SEC_VOLTAGE_OFF : + data[0 ] =0x00 ; +break ; +case SEC_VOLTAGE_13 : + data[0 ] =0x44 ; +break ; +case SEC_VOLTAGE_18 : + data[0 ] =0x4c ; +break ; +default : +return -EINVAL ; + }; + + ret =i2c_transfer (&av7110->i2c_adap, &msg,1 ); +return (ret !=1 ) ? -EIO :0 ; +} +static int alps_tdbe2_pll_set (struct dvb_frontend * fe,struct dvb_frontend_parameters * params) {
@@ -2116,6 +2216,14 @@ static int frontend_init(struct av7110 * av7110->dev->i2c_bitrate =SAA7146_I2C_BUS_BIT_RATE_240 ;break ; } +break ; + +case 0x000E :/* Hauppauge/TT Nexus-S rev 2.3 */ +/* ALPS BSBE1 */ + av7110->fe =stv0299_attach (&alps_bsbe1_config, &av7110->i2c_adap); +if (av7110->fe) + av7110->fe->ops->set_voltage = lnbp21_set_voltage; +break ; } }
@@ -2672,21 +2780,23 @@ MAKE_AV7110_INFO(ttt_1_X, "TechnotrenMAKE_AV7110_INFO (ttc_1_X,"Technotrend/Hauppauge WinTV Nexus-CA rev1.X" );MAKE_AV7110_INFO (ttc_2_X,"Technotrend/Hauppauge WinTV DVB-C rev2.X" );MAKE_AV7110_INFO (tts_2_X,"Technotrend/Hauppauge WinTV Nexus-S rev2.X" ); +MAKE_AV7110_INFO (tts_2_3,"Technotrend/Hauppauge WinTV Nexus-S rev2.3" );MAKE_AV7110_INFO (tts_1_3se,"Technotrend/Hauppauge WinTV DVB-S rev1.3 SE" );MAKE_AV7110_INFO (ttt,"Technotrend/Hauppauge DVB-T" );MAKE_AV7110_INFO (fsc,"Fujitsu Siemens DVB-C" );MAKE_AV7110_INFO (fss,"Fujitsu Siemens DVB-S rev1.6" );static struct pci_device_id pci_tbl[] = { +MAKE_EXTENSION_PCI (fsc,0x110a ,0x0000 ),MAKE_EXTENSION_PCI (tts_1_X,0x13c2 ,0x0000 ),MAKE_EXTENSION_PCI (ttt_1_X,0x13c2 ,0x0001 ),MAKE_EXTENSION_PCI (ttc_2_X,0x13c2 ,0x0002 ),MAKE_EXTENSION_PCI (tts_2_X,0x13c2 ,0x0003 ), -MAKE_EXTENSION_PCI (tts_1_3se,0x13c2 ,0x1002 ), -MAKE_EXTENSION_PCI (fsc,0x110a ,0x0000 ), -MAKE_EXTENSION_PCI (ttc_1_X,0x13c2 ,0x000a ),MAKE_EXTENSION_PCI (fss,0x13c2 ,0x0006 ),MAKE_EXTENSION_PCI (ttt,0x13c2 ,0x0008 ), +MAKE_EXTENSION_PCI (ttc_1_X,0x13c2 ,0x000a ), +MAKE_EXTENSION_PCI (tts_2_3,0x13c2 ,0x000e ), +MAKE_EXTENSION_PCI (tts_1_3se,0x13c2 ,0x1002 ),/* MAKE_EXTENSION_PCI(???, 0x13c2, 0x0004), UNDEFINED CARD */ // Galaxis DVB PC-Sat-Carte /* MAKE_EXTENSION_PCI(???, 0x13c2, 0x0005), UNDEFINED CARD */ // Technisat SkyStar1
--
PATCH 2/37 saa7146: no need to initialize static/global variables to 0
In reply to Johannes Stezenbachno need to initialize static/global variables to 0
---
drivers/media/common/saa7146_core.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/media/common/saa7146_core.c +2 -2
@@ -23,9 +23,9 @@LIST_HEAD (saa7146_devices);DECLARE_MUTEX (saa7146_devices_lock); -static int saa7146_num =0 ; +static int saa7146_num; -unsigned int saa7146_debug =0 ; +unsigned int saa7146_debug;module_param (saa7146_debug, int,0644 );MODULE_PARM_DESC (saa7146_debug,"debug level (default: 0)" );
--
PATCH 3/37 dvb_frontend: fix module param
In reply to Johannes StezenbachRemove incorrect "dvb_"-prefix from parameter description. Error detected with section2text.rb, see autoparam patch.
---
drivers/media/dvb/dvb-core/dvb_frontend.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/media/dvb/dvb-core/dvb_frontend.c +1 -1
@@ -48,7 +48,7 @@ static int dvb_override_tune_delay;static int dvb_powerdown_on_sleep =1 ;module_param_named (frontend_debug, dvb_frontend_debug, int,0644 ); -MODULE_PARM_DESC (dvb_frontend_debug,"Turn on/off frontend core debugging (default:off)." ); +MODULE_PARM_DESC (frontend_debug,"Turn on/off frontend core debugging (default:off)." );module_param (dvb_shutdown_timeout, int,0444 );MODULE_PARM_DESC (dvb_shutdown_timeout,"wait <shutdown_timeout> seconds after close() before suspending hardware" );module_param (dvb_force_auto_inversion, int,0444 );
--
PATCH 4/37 av7110: audio out fix
In reply to Johannes StezenbachSwitch analog output of the Crystal sound chip to left/stereo/right mode. This will fix problems with some (most?) channels which do not encode 2-channel audio correctly. (Oliver Endriss)
---
drivers/media/dvb/ttpci/av7110_av.c | 6 ++++++ 1 files changed, 6 insertions(+)
drivers/media/dvb/ttpci/av7110_av.c +6 -0
@@ -1230,14 +1230,20 @@ static int dvb_audio_ioctl(struct inodeswitch (av7110->audiostate.channel_select) {case AUDIO_STEREO :audcom (av7110,AUDIO_CMD_STEREO ); +if (av7110->adac_type ==DVB_ADAC_CRYSTAL ) +i2c_writereg (av7110,0x20 ,0x02 ,0x49 );break ;case AUDIO_MONO_LEFT :audcom (av7110,AUDIO_CMD_MONO_L ); +if (av7110->adac_type ==DVB_ADAC_CRYSTAL ) +i2c_writereg (av7110,0x20 ,0x02 ,0x4a );break ;case AUDIO_MONO_RIGHT :audcom (av7110,AUDIO_CMD_MONO_R ); +if (av7110->adac_type ==DVB_ADAC_CRYSTAL ) +i2c_writereg (av7110,0x20 ,0x02 ,0x45 );break ;default :
--
PATCH 5/37 add support for KNC-1 cards
In reply to Johannes StezenbachSupport KNC-1 Plus DVB-T and similar KNC-1 cards (Alexander Riedel)
---
drivers/media/dvb/ttpci/budget-av.c | 14 ++++++++++++++ drivers/media/dvb/ttpci/budget.h | 3 +++ 2 files changed, 17 insertions(+)
drivers/media/dvb/ttpci/budget-av.c +14 -0
@@ -701,7 +701,10 @@ static u8 read_pwm(struct budget_av *budstatic void frontend_init (struct budget_av *budget_av) {switch (budget_av->budget.dev->pci->subsystem_device) { +case 0x0011 :// KNC1 DVB-S Plus budget with AV IN (stv0299/Philips SU1278(tsa5059)) +saa7146_write (budget_av->budget.dev,GPIO_CTRL ,0x50000000 );// Enable / PowerON Frontend case 0x4f56 :// Typhoon/KNC1 DVB-S budget (stv0299/Philips SU1278(tsa5059)) +case 0x0010 :// KNC1 DVB-S budget (stv0299/Philips SU1278(tsa5059)) budget_av->budget.dvb_frontend =stv0299_attach (&typhoon_config, &budget_av->budget.i2c_adap);if (budget_av->budget.dvb_frontend !=NULL ) {
@@ -709,6 +712,8 @@ static void frontend_init(struct budget_ }break ; +case 0x0021 :// KNC1 DVB-C Plus budget with AV IN (tda10021/Philips CU1216(tua6034)) +saa7146_write (budget_av->budget.dev,GPIO_CTRL ,0x50000000 );// Enable / PowerON Frontend case 0x0020 :// KNC1 DVB-C budget (tda10021/Philips CU1216(tua6034)) budget_av->budget.dvb_frontend = tda10021_attach(&philips_cu1216_config,
@@ -718,6 +723,8 @@ static void frontend_init(struct budget_ }break ; +case 0x0031 :// KNC1 DVB-T Plus budget with AV IN (tda10046/Philips TU1216(tda6651tt)) +saa7146_write (budget_av->budget.dev,GPIO_CTRL ,0x50000000 );// Enable / PowerON Frontend case 0x0030 :// KNC1 DVB-T budget (tda10046/Philips TU1216(tda6651tt)) budget_av->budget.dvb_frontend =tda10046_attach (&philips_tu1216_config, &budget_av->budget.i2c_adap);
@@ -963,14 +970,21 @@ static struct saa7146_extension budget_eMAKE_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 (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 (cin1200c,"Terratec Cinergy 1200 DVB-C" ,BUDGET_CIN1200C );MAKE_BUDGET_INFO (cin1200t,"Terratec Cinergy 1200 DVB-T" ,BUDGET_CIN1200T );static struct pci_device_id pci_tbl[] = {MAKE_EXTENSION_PCI (knc1s,0x1131 ,0x4f56 ), +MAKE_EXTENSION_PCI (knc1s,0x1131 ,0x0010 ), +MAKE_EXTENSION_PCI (knc1sp,0x1131 ,0x0011 ),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 (cin1200c,0x153b ,0x1156 ),MAKE_EXTENSION_PCI (cin1200t,0x153b ,0x1157 ),
drivers/media/dvb/ttpci/budget.h +3 -0
@@ -92,6 +92,9 @@ static struct saa7146_pci_extension_data#define BUDGET_KNC1S 8#define BUDGET_KNC1C 9#define BUDGET_KNC1T 10 +#define BUDGET_KNC1SP 11 +#define BUDGET_KNC1CP 12 +#define BUDGET_KNC1TP 13#define BUDGET_VIDEO_PORTA 0#define BUDGET_VIDEO_PORTB 1
--
PATCH 6/37 remove unnecessary casts in dvb-core
In reply to Johannes Stezenbachremove unnecessary casts in dvb-core (Kenneth Aafloy)
---
drivers/media/dvb/dvb-core/dmxdev.c | 32 +++++++++++----------- drivers/media/dvb/dvb-core/dvb_ca_en50221.c | 38 +++++++++++++------------- drivers/media/dvb/dvb-core/dvb_frontend.c | 34 +++++++++++------------ drivers/media/dvb/dvb-core/dvb_net.c | 40 ++++++++++++++-------------- 4 files changed, 72 insertions(+), 72 deletions(-)
drivers/media/dvb/dvb-core/dmxdev.c +16 -16
@@ -175,8 +175,8 @@ static inline void dvb_dmxdev_dvr_state_static int dvb_dvr_open (struct inode *inode,struct file *file) { -struct dvb_device *dvbdev=(struct dvb_device *) file->private_data; -struct dmxdev *dmxdev=(struct dmxdev *) dvbdev->priv; +struct dvb_device *dvbdev = file->private_data; +struct dmxdev *dmxdev = dvbdev->priv;struct dmx_frontend *front;dprintk ("function : %s\n" , __FUNCTION__);
@@ -224,8 +224,8 @@ static int dvb_dvr_open(struct inode *instatic int dvb_dvr_release (struct inode *inode,struct file *file) { -struct dvb_device *dvbdev=(struct dvb_device *) file->private_data; -struct dmxdev *dmxdev=(struct dmxdev *) dvbdev->priv; +struct dvb_device *dvbdev = file->private_data; +struct dmxdev *dmxdev = dvbdev->priv;if (down_interruptible (&dmxdev->mutex))return -ERESTARTSYS ;
@@ -252,8 +252,8 @@ static int dvb_dvr_release(struct inodestatic ssize_t dvb_dvr_write (struct file *file,const char __user *buf,size_t count,loff_t *ppos) { -struct dvb_device *dvbdev=(struct dvb_device *) file->private_data; -struct dmxdev *dmxdev=(struct dmxdev *) dvbdev->priv; +struct dvb_device *dvbdev = file->private_data; +struct dmxdev *dmxdev = dvbdev->priv;int ret;if (!dmxdev->demux->write)
@@ -270,8 +270,8 @@ static ssize_t dvb_dvr_write(struct filestatic ssize_t dvb_dvr_read (struct file *file,char __user *buf,size_t count,loff_t *ppos) { -struct dvb_device *dvbdev=(struct dvb_device *) file->private_data; -struct dmxdev *dmxdev=(struct dmxdev *) dvbdev->priv; +struct dvb_device *dvbdev = file->private_data; +struct dmxdev *dmxdev = dvbdev->priv;int ret;//down(&dmxdev->mutex);
@@ -345,7 +345,7 @@ static int dvb_dmxdev_section_callback(c const u8 *buffer2, size_t buffer2_len, struct dmx_section_filter *filter, enum dmx_success success) { - struct dmxdev_filter *dmxdevfilter=(struct dmxdev_filter *) filter->priv; + struct dmxdev_filter *dmxdevfilter = filter->priv;int ret;if (dmxdevfilter->buffer.error) {
@@ -381,7 +381,7 @@ static int dvb_dmxdev_ts_callback(const const u8 *buffer2, size_t buffer2_len, struct dmx_ts_feed *feed, enum dmx_success success) { - struct dmxdev_filter *dmxdevfilter=(struct dmxdev_filter *) feed->priv; + struct dmxdev_filter *dmxdevfilter = feed->priv;struct dmxdev_buffer *buffer;int ret;
@@ -684,8 +684,8 @@ static int dvb_dmxdev_filter_start(strucstatic int dvb_demux_open (struct inode *inode,struct file *file) { -struct dvb_device *dvbdev=(struct dvb_device *) file->private_data; -struct dmxdev *dmxdev=(struct dmxdev *) dvbdev->priv; +struct dvb_device *dvbdev = file->private_data; +struct dmxdev *dmxdev = dvbdev->priv;int i;struct dmxdev_filter *dmxdevfilter;
@@ -1013,8 +1013,8 @@ static struct dvb_device dvbdev_demux =static int dvb_dvr_do_ioctl (struct inode *inode,struct file *file,unsigned int cmd,void *parg) { -struct dvb_device *dvbdev=(struct dvb_device *) file->private_data; -struct dmxdev *dmxdev=(struct dmxdev *) dvbdev->priv; +struct dvb_device *dvbdev = file->private_data; +struct dmxdev *dmxdev = dvbdev->priv;int ret=0 ;
@@ -1044,8 +1044,8 @@ static int dvb_dvr_ioctl(struct inode *istatic unsigned int dvb_dvr_poll (struct file *file,poll_table *wait) { -struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; -struct dmxdev *dmxdev = (struct dmxdev *) dvbdev->priv; +struct dvb_device *dvbdev = file->private_data; +struct dmxdev *dmxdev = dvbdev->priv;unsigned int mask =0 ;dprintk ("function : %s\n" , __FUNCTION__);
drivers/media/dvb/dvb-core/dvb_ca_en50221.c +19 -19
@@ -829,7 +829,7 @@ EXPORT_SYMBOL(dvb_ca_en50221_camready_ir*/ void dvb_ca_en50221_camchange_irq (struct dvb_ca_en50221 *pubca,int slot,int change_type) { -struct dvb_ca_private *ca = (struct dvb_ca_private *) pubca->private; +struct dvb_ca_private *ca = pubca->private;dprintk ("CAMCHANGE IRQ slot:%i change_type:%i\n" , slot, change_type);
@@ -857,7 +857,7 @@ EXPORT_SYMBOL(dvb_ca_en50221_frda_irq);*/ void dvb_ca_en50221_camready_irq (struct dvb_ca_en50221 *pubca,int slot) { -struct dvb_ca_private *ca = (struct dvb_ca_private *) pubca->private; +struct dvb_ca_private *ca = pubca->private;dprintk ("CAMREADY IRQ slot:%i\n" , slot);
@@ -876,7 +876,7 @@ void dvb_ca_en50221_camready_irq(struct*/ void dvb_ca_en50221_frda_irq (struct dvb_ca_en50221 *pubca,int slot) { -struct dvb_ca_private *ca = (struct dvb_ca_private *) pubca->private; +struct dvb_ca_private *ca = pubca->private;int flags;dprintk ("FR/DA IRQ slot:%i\n" , slot);
@@ -993,7 +993,7 @@ static void dvb_ca_en50221_thread_update*/ static int dvb_ca_en50221_thread (void *data) { -struct dvb_ca_private *ca = (struct dvb_ca_private *) data; +struct dvb_ca_private *ca = data;char name[15 ];int slot;int flags;
@@ -1202,8 +1202,8 @@ static int dvb_ca_en50221_thread(void *dstatic int dvb_ca_en50221_io_do_ioctl (struct inode *inode,struct file *file,unsigned int cmd,void *parg) { -struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; -struct dvb_ca_private *ca = (struct dvb_ca_private *) dvbdev->priv; +struct dvb_device *dvbdev = file->private_data; +struct dvb_ca_private *ca = dvbdev->priv;int err =0 ;int slot;
@@ -1225,7 +1225,7 @@ static int dvb_ca_en50221_io_do_ioctl(stbreak ;case CA_GET_CAP : { -struct ca_caps *caps = (struct ca_caps *) parg; +struct ca_caps *caps = parg; caps->slot_num = ca->slot_count; caps->slot_type =CA_CI_LINK ;
@@ -1235,7 +1235,7 @@ static int dvb_ca_en50221_io_do_ioctl(st }case CA_GET_SLOT_INFO : { -struct ca_slot_info *info = (struct ca_slot_info *) parg; +struct ca_slot_info *info = parg;if ((info->num > ca->slot_count) || (info->num <0 ))return -EINVAL ;
@@ -1291,8 +1291,8 @@ static int dvb_ca_en50221_io_ioctl(strucstatic ssize_t dvb_ca_en50221_io_write (struct file *file,const char __user * buf,size_t count,loff_t * ppos) { -struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; -struct dvb_ca_private *ca = (struct dvb_ca_private *) dvbdev->priv; +struct dvb_device *dvbdev = file->private_data; +struct dvb_ca_private *ca = dvbdev->priv;u8 slot, connection_id;int status;char fragbuf[HOST_LINK_BUF_SIZE ];
@@ -1428,8 +1428,8 @@ static int dvb_ca_en50221_io_read_conditstatic ssize_t dvb_ca_en50221_io_read (struct file *file,char __user * buf,size_t count,loff_t * ppos) { -struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; -struct dvb_ca_private *ca = (struct dvb_ca_private *) dvbdev->priv; +struct dvb_device *dvbdev = file->private_data; +struct dvb_ca_private *ca = dvbdev->priv;int status;int result =0 ;u8 hdr[2 ];
@@ -1526,8 +1526,8 @@ static ssize_t dvb_ca_en50221_io_read(st*/ static int dvb_ca_en50221_io_open (struct inode *inode,struct file *file) { -struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; -struct dvb_ca_private *ca = (struct dvb_ca_private *) dvbdev->priv; +struct dvb_device *dvbdev = file->private_data; +struct dvb_ca_private *ca = dvbdev->priv;int err;int i;
@@ -1569,8 +1569,8 @@ static int dvb_ca_en50221_io_open(struct*/ static int dvb_ca_en50221_io_release (struct inode *inode,struct file *file) { -struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; -struct dvb_ca_private *ca = (struct dvb_ca_private *) dvbdev->priv; +struct dvb_device *dvbdev = file->private_data; +struct dvb_ca_private *ca = dvbdev->priv;int err =0 ;dprintk ("%s\n" , __FUNCTION__);
@@ -1597,8 +1597,8 @@ static int dvb_ca_en50221_io_release(str*/ static unsigned int dvb_ca_en50221_io_poll (struct file *file,poll_table * wait) { -struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; -struct dvb_ca_private *ca = (struct dvb_ca_private *) dvbdev->priv; +struct dvb_device *dvbdev = file->private_data; +struct dvb_ca_private *ca = dvbdev->priv;unsigned int mask =0 ;int slot;int result =0 ;
@@ -1750,7 +1750,7 @@ EXPORT_SYMBOL(dvb_ca_en50221_release);*/ void dvb_ca_en50221_release (struct dvb_ca_en50221 *pubca) { -struct dvb_ca_private *ca = (struct dvb_ca_private *) pubca->private; +struct dvb_ca_private *ca = pubca->private;int i;dprintk ("%s\n" , __FUNCTION__);
drivers/media/dvb/dvb-core/dvb_frontend.c +17 -17
@@ -117,7 +117,7 @@ struct dvb_frontend_private {static void dvb_frontend_add_event (struct dvb_frontend *fe,fe_status_t status) { -struct dvb_frontend_private *fepriv = (struct dvb_frontend_private *) fe->frontend_priv; +struct dvb_frontend_private *fepriv = fe->frontend_priv;struct dvb_fe_events *events = &fepriv->events;struct dvb_frontend_event *e;int wp;
@@ -155,7 +155,7 @@ static void dvb_frontend_add_event(strucstatic int dvb_frontend_get_event (struct dvb_frontend *fe,struct dvb_frontend_event *event,int flags) { -struct dvb_frontend_private *fepriv = (struct dvb_frontend_private *) fe->frontend_priv; +struct dvb_frontend_private *fepriv = fe->frontend_priv;struct dvb_fe_events *events = &fepriv->events;dprintk ("%s\n" , __FUNCTION__);
@@ -234,7 +234,7 @@ static int dvb_frontend_autotune(struct {int autoinversion;int ready =0 ; -struct dvb_frontend_private *fepriv = (struct dvb_frontend_private *) fe->frontend_priv; +struct dvb_frontend_private *fepriv = fe->frontend_priv;int original_inversion = fepriv->parameters.inversion;u32 original_frequency = fepriv->parameters.frequency;
@@ -321,7 +321,7 @@ static int dvb_frontend_autotune(structstatic int dvb_frontend_is_exiting (struct dvb_frontend *fe) { -struct dvb_frontend_private *fepriv = (struct dvb_frontend_private *) fe->frontend_priv; +struct dvb_frontend_private *fepriv = fe->frontend_priv;if (fepriv->exit)return 1 ;
@@ -335,7 +335,7 @@ static int dvb_frontend_is_exiting(strucstatic int dvb_frontend_should_wakeup (struct dvb_frontend *fe) { -struct dvb_frontend_private *fepriv = (struct dvb_frontend_private *) fe->frontend_priv; +struct dvb_frontend_private *fepriv = fe->frontend_priv;if (fepriv->wakeup) { fepriv->wakeup =0 ;
@@ -346,7 +346,7 @@ static int dvb_frontend_should_wakeup(ststatic void dvb_frontend_wakeup (struct dvb_frontend *fe) { -struct dvb_frontend_private *fepriv = (struct dvb_frontend_private *) fe->frontend_priv; +struct dvb_frontend_private *fepriv = fe->frontend_priv; fepriv->wakeup =1 ;wake_up_interruptible (&fepriv->wait_queue);
@@ -357,8 +357,8 @@ static void dvb_frontend_wakeup(struct d*/ static int dvb_frontend_thread (void *data) { -struct dvb_frontend *fe = (struct dvb_frontend *) data; -struct dvb_frontend_private *fepriv = (struct dvb_frontend_private *) fe->frontend_priv; +struct dvb_frontend *fe = data; +struct dvb_frontend_private *fepriv = fe->frontend_priv;unsigned long timeout;char name [15 ];int quality =0 , delay =3 *HZ ;
@@ -520,7 +520,7 @@ static int dvb_frontend_thread(void *datstatic void dvb_frontend_stop (struct dvb_frontend *fe) {unsigned long ret; -struct dvb_frontend_private *fepriv = (struct dvb_frontend_private *) fe->frontend_priv; +struct dvb_frontend_private *fepriv = fe->frontend_priv;dprintk ("%s\n" , __FUNCTION__);
@@ -559,7 +559,7 @@ static void dvb_frontend_stop(struct dvbstatic int dvb_frontend_start (struct dvb_frontend *fe) {int ret; -struct dvb_frontend_private *fepriv = (struct dvb_frontend_private *) fe->frontend_priv; +struct dvb_frontend_private *fepriv = fe->frontend_priv;dprintk ("%s\n" , __FUNCTION__);
@@ -597,7 +597,7 @@ static int dvb_frontend_ioctl(struct ino {struct dvb_device *dvbdev = file->private_data;struct dvb_frontend *fe = dvbdev->priv; -struct dvb_frontend_private *fepriv = (struct dvb_frontend_private *) fe->frontend_priv; +struct dvb_frontend_private *fepriv = fe->frontend_priv;int err = -EOPNOTSUPP ;dprintk ("%s\n" , __FUNCTION__);
@@ -615,7 +615,7 @@ static int dvb_frontend_ioctl(struct inoswitch (cmd) {case FE_GET_INFO : { -struct dvb_frontend_info * info = (struct dvb_frontend_info *) parg; +struct dvb_frontend_info * info = parg;memcpy (info, &fe->ops->info,sizeof (struct dvb_frontend_info ));/* Force the CAN_INVERSION_AUTO bit on. If the frontend doesn't
@@ -793,7 +793,7 @@ static unsigned int dvb_frontend_poll(st {struct dvb_device *dvbdev = file->private_data;struct dvb_frontend *fe = dvbdev->priv; -struct dvb_frontend_private *fepriv = (struct dvb_frontend_private *) fe->frontend_priv; +struct dvb_frontend_private *fepriv = fe->frontend_priv;dprintk ("%s\n" , __FUNCTION__);
@@ -809,7 +809,7 @@ static int dvb_frontend_open(struct inod {struct dvb_device *dvbdev = file->private_data;struct dvb_frontend *fe = dvbdev->priv; -struct dvb_frontend_private *fepriv = (struct dvb_frontend_private *) fe->frontend_priv; +struct dvb_frontend_private *fepriv = fe->frontend_priv;int ret;dprintk ("%s\n" , __FUNCTION__);
@@ -833,7 +833,7 @@ static int dvb_frontend_release(struct i {struct dvb_device *dvbdev = file->private_data;struct dvb_frontend *fe = dvbdev->priv; -struct dvb_frontend_private *fepriv = (struct dvb_frontend_private *) fe->frontend_priv; +struct dvb_frontend_private *fepriv = fe->frontend_priv;dprintk ("%s\n" , __FUNCTION__);
@@ -873,7 +873,7 @@ int dvb_register_frontend(struct dvb_adaup (&frontend_mutex);return -ENOMEM ; } - fepriv = (struct dvb_frontend_private *) fe->frontend_priv; + fepriv = fe->frontend_priv;memset (fe->frontend_priv,0 ,sizeof (struct dvb_frontend_private ));init_MUTEX (&fepriv->sem);
@@ -897,7 +897,7 @@ EXPORT_SYMBOL(dvb_register_frontend);int dvb_unregister_frontend (struct dvb_frontend * fe) { -struct dvb_frontend_private *fepriv = (struct dvb_frontend_private *) fe->frontend_priv; +struct dvb_frontend_private *fepriv = fe->frontend_priv;dprintk ("%s\n" , __FUNCTION__);down (&frontend_mutex);
drivers/media/dvb/dvb-core/dvb_net.c +20 -20
@@ -315,7 +315,7 @@ static inline void reset_ule( struct dvb*/ static void dvb_net_ule (struct net_device *dev,const u8 *buf,size_t buf_len ) { -struct dvb_net_priv *priv = (struct dvb_net_priv *)dev->priv; +struct dvb_net_priv *priv = dev->priv;unsigned long skipped =0L ;u8 *ts, *ts_end, *from_where =NULL , ts_remain =0 , how_much =0 , new_ts =1 ;struct ethhdr *ethh =NULL ;
@@ -709,7 +709,7 @@ static int dvb_net_ts_callback(const u8 const u8 *buffer2, size_t buffer2_len, struct dmx_ts_feed *feed, enum dmx_success success) { - struct net_device *dev = (struct net_device *)feed->priv; + struct net_device *dev = feed->priv;if (buffer2 !=0 )printk (KERN_WARNING "buffer2 not 0: %p.\n" , buffer2);
@@ -801,7 +801,7 @@ static int dvb_net_sec_callback(const u8struct dmx_section_filter *filter, enum dmx_success success) { - struct net_device *dev=(struct net_device *) filter->priv; + struct net_device *dev = filter->priv;/** * we rely on the DVB API definition where exactly one complete
@@ -826,7 +826,7 @@ static int dvb_net_filter_sec_set(structstruct dmx_section_filter **secfilter, u8 *mac, u8 *mac_mask) { - struct dvb_net_priv *priv = (struct dvb_net_priv*) dev->priv; + struct dvb_net_priv *priv = dev->priv;int ret; *secfilter=NULL ;
@@ -870,7 +870,7 @@ static int dvb_net_filter_sec_set(structstatic int dvb_net_feed_start (struct net_device *dev) {int ret, i; -struct dvb_net_priv *priv = (struct dvb_net_priv *) dev->priv; +struct dvb_net_priv *priv = dev->priv;struct dmx_demux *demux = priv->demux;unsigned char *mac = (unsigned char *) dev->dev_addr;
@@ -965,7 +965,7 @@ static int dvb_net_feed_start(struct netstatic int dvb_net_feed_stop (struct net_device *dev) { -struct dvb_net_priv *priv = (struct dvb_net_priv *) dev->priv; +struct dvb_net_priv *priv = dev->priv;int i;dprintk ("%s\n" , __FUNCTION__);
@@ -1016,7 +1016,7 @@ static int dvb_net_feed_stop(struct net_static int dvb_set_mc_filter (struct net_device *dev,struct dev_mc_list *mc) { -struct dvb_net_priv *priv = (struct dvb_net_priv *) dev->priv; +struct dvb_net_priv *priv = dev->priv;if (priv->multi_num ==DVB_NET_MULTICAST_MAX )return -ENOMEM ;
@@ -1031,7 +1031,7 @@ static int dvb_set_mc_filter (struct netstatic void wq_set_multicast_list (void *data) {struct net_device *dev = data; -struct dvb_net_priv *priv = (struct dvb_net_priv *) dev->priv; +struct dvb_net_priv *priv = dev->priv;dvb_net_feed_stop (dev);
@@ -1066,7 +1066,7 @@ static void wq_set_multicast_list (voidstatic void dvb_net_set_multicast_list (struct net_device *dev) { -struct dvb_net_priv *priv = (struct dvb_net_priv *) dev->priv; +struct dvb_net_priv *priv = dev->priv;schedule_work (&priv->set_multicast_list_wq); }
@@ -1084,7 +1084,7 @@ static void wq_restart_net_feed (void *dstatic int dvb_net_set_mac (struct net_device *dev,void *p) { -struct dvb_net_priv *priv = (struct dvb_net_priv *) dev->priv; +struct dvb_net_priv *priv = dev->priv;struct sockaddr *addr=p;memcpy (dev->dev_addr, addr->sa_data, dev->addr_len);
@@ -1098,7 +1098,7 @@ static int dvb_net_set_mac (struct net_dstatic int dvb_net_open (struct net_device *dev) { -struct dvb_net_priv *priv = (struct dvb_net_priv *) dev->priv; +struct dvb_net_priv *priv = dev->priv; priv->in_use++;dvb_net_feed_start (dev);
@@ -1108,7 +1108,7 @@ static int dvb_net_open(struct net_devicstatic int dvb_net_stop (struct net_device *dev) { -struct dvb_net_priv *priv = (struct dvb_net_priv *) dev->priv; +struct dvb_net_priv *priv = dev->priv; priv->in_use--;return dvb_net_feed_stop (dev);
@@ -1228,8 +1228,8 @@ static int dvb_net_remove_if(struct dvb_static int dvb_net_do_ioctl (struct inode *inode,struct file *file,unsigned int cmd,void *parg) { -struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; -struct dvb_net *dvbnet = (struct dvb_net *) dvbdev->priv; +struct dvb_device *dvbdev = file->private_data; +struct dvb_net *dvbnet = dvbdev->priv;if (((file->f_flags&O_ACCMODE )==O_RDONLY ))return -EPERM ;
@@ -1237,7 +1237,7 @@ static int dvb_net_do_ioctl(struct inodeswitch (cmd) {case NET_ADD_IF : { -struct dvb_net_if *dvbnetif=(struct dvb_net_if *)parg; +struct dvb_net_if *dvbnetif = parg;int result;if (!capable (CAP_SYS_ADMIN ))
@@ -1258,7 +1258,7 @@ static int dvb_net_do_ioctl(struct inode {struct net_device *netdev;struct dvb_net_priv *priv_data; -struct dvb_net_if *dvbnetif=(struct dvb_net_if *)parg; +struct dvb_net_if *dvbnetif = parg;if (dvbnetif->if_num >=DVB_NET_DEVICES_MAX || !dvbnet->state[dvbnetif->if_num])
@@ -1266,7 +1266,7 @@ static int dvb_net_do_ioctl(struct inode netdev = dvbnet->device[dvbnetif->if_num]; - priv_data=(struct dvb_net_priv *)netdev->priv; + priv_data = netdev->priv; dvbnetif->pid=priv_data->pid; dvbnetif->feedtype=priv_data->feedtype;break ;
@@ -1288,7 +1288,7 @@ static int dvb_net_do_ioctl(struct inode/* binary compatiblity cruft */ case __NET_ADD_IF_OLD: { -struct __dvb_net_if_old *dvbnetif=(struct __dvb_net_if_old *)parg; +struct __dvb_net_if_old *dvbnetif = parg;int result;if (!capable (CAP_SYS_ADMIN ))
@@ -1309,7 +1309,7 @@ static int dvb_net_do_ioctl(struct inode {struct net_device *netdev;struct dvb_net_priv *priv_data; -struct __dvb_net_if_old *dvbnetif=(struct __dvb_net_if_old *)parg; +struct __dvb_net_if_old *dvbnetif = parg;if (dvbnetif->if_num >=DVB_NET_DEVICES_MAX || !dvbnet->state[dvbnetif->if_num])
@@ -1317,7 +1317,7 @@ static int dvb_net_do_ioctl(struct inode netdev = dvbnet->device[dvbnetif->if_num]; - priv_data=(struct dvb_net_priv *)netdev->priv; + priv_data = netdev->priv; dvbnetif->pid=priv_data->pid;break ; }
--
PATCH 7/37 make dvb_class static
In reply to Johannes Stezenbachunexport dvb_class and make it static
---
drivers/media/dvb/dvb-core/dvbdev.c | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-)
drivers/media/dvb/dvb-core/dvbdev.c +1 -2
@@ -56,8 +56,7 @@ static const char * const dnames[] = {#define nums2minor (num,type,id) ((num << 6) | (id << 4) | type)#define MAX_DVB_MINORS (DVB_MAX_ADAPTERS*64) -struct class_simple *dvb_class; -EXPORT_SYMBOL (dvb_class); +static struct class_simple *dvb_class;static struct dvb_device *dvbdev_find_device (int minor) {
--
PATCH 8/37 dvb_net: handle IPv6 and LLC/SNAP
In reply to Johannes Stezenbachhandle IPv6 and LLC/SNAP (Bertrand Mazieres, Matthieu Castet, Johannes Stezenbach)
---
drivers/media/dvb/dvb-core/dvb_net.c | 35 ++++++++++++++++++++++++++--------- 1 files changed, 26 insertions(+), 9 deletions(-)
drivers/media/dvb/dvb-core/dvb_net.c +26 -9
@@ -727,6 +727,7 @@ static void dvb_net_sec(struct net_devicu8 *eth;struct sk_buff *skb;struct net_device_stats *stats = &(((struct dvb_net_priv *) dev->priv)->stats); +int snap =0 ;/* note: pkt_len includes a 32bit checksum */ if (pkt_len <16 ) {
@@ -750,9 +751,12 @@ static void dvb_net_sec(struct net_devicreturn ; }if (pkt[5 ] &0x02 ) { -//FIXME: handle LLC/SNAP - stats->rx_dropped++; -return ; +/* handle LLC/SNAP, see rfc-1042 */ +if (pkt_len <24 ||memcmp (&pkt[12 ],"\xaa\xaa\x03\0\0\0" ,6 )) { + stats->rx_dropped++; +return ; + } + snap =8 ; }if (pkt[7 ]) {/* FIXME: assemble datagram from multiple sections */
@@ -762,9 +766,9 @@ static void dvb_net_sec(struct net_devic }/* we have 14 byte ethernet header (ip header follows); -* 12 byte MPE header; 4 byte checksum; + 2 byte alignment +* 12 byte MPE header; 4 byte checksum; + 2 byte alignment, 8 byte LLC/SNAP */ -if (!(skb =dev_alloc_skb (pkt_len -4 -12 +14 +2 ))) { +if (!(skb =dev_alloc_skb (pkt_len -4 -12 +14 +2 - snap))) {//printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n", dev->name); stats->rx_dropped++;return ;
@@ -773,8 +777,8 @@ static void dvb_net_sec(struct net_devic skb->dev = dev;/* copy L3 payload */ - eth = (u8 *)skb_put (skb, pkt_len -12 -4 +14 ); -memcpy (eth +14 , pkt +12 , pkt_len -12 -4 ); + eth = (u8 *)skb_put (skb, pkt_len -12 -4 +14 - snap); +memcpy (eth +14 , pkt +12 + snap, pkt_len -12 -4 - snap);/* create ethernet header: */ eth[0 ]=pkt[0x0b ];
@@ -786,8 +790,21 @@ static void dvb_net_sec(struct net_devic eth[6 ]=eth[7 ]=eth[8 ]=eth[9 ]=eth[10 ]=eth[11 ]=0 ; - eth[12 ] =0x08 ;/* ETH_P_IP */ - eth[13 ] =0x00 ; +if (snap) { + eth[12 ] = pkt[18 ]; + eth[13 ] = pkt[19 ]; + }else { +/* protocol numbers are from rfc-1700 or +* http://www.iana.org/assignments/ethernet-numbers +*/ +if (pkt[12 ] >>4 ==6 ) {/* version field from IP header */ + eth[12 ] =0x86 ;/* IPv6 */ + eth[13 ] =0xdd ; + }else { + eth[12 ] =0x08 ;/* IPv4 */ + eth[13 ] =0x00 ; + } + } skb->protocol =dvb_net_eth_type_trans (skb, dev);
--
PATCH 9/37 av7110: fix VIDEO_SET_DISPLAY_FORMAT
In reply to Johannes StezenbachVIDEO_SET_DISPLAY_FORMAT ioctl fixed:
set videostate.display_format, not videostate.video_format (Oliver Endriss)
---
drivers/media/dvb/ttpci/av7110_av.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/media/dvb/ttpci/av7110_av.c +1 -1
@@ -1075,7 +1075,7 @@ static int dvb_video_ioctl(struct inode }if (ret <0 )break ; - av7110->videostate.video_format = format; + av7110->videostate.display_format = format; ret =av7110_fw_cmd (av7110,COMTYPE_ENCODER , SetPanScanType,1 , (u16 ) val);break ;
--
PATCH 10/37 av7110: fix NTSC/PAL switching
In reply to Johannes Stezenbachfix NTSC -> PAL switching (std->id is a bitmap!) (Oliver Endriss)
---
drivers/media/dvb/ttpci/av7110_v4l.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/media/dvb/ttpci/av7110_v4l.c +2 -2
@@ -726,11 +726,11 @@ static int std_callback(struct saa7146_d {struct av7110 *av7110 = (struct av7110 *) dev->ext_priv; -if (std->id ==V4L2_STD_PAL ) { +if (std->id &V4L2_STD_PAL ) { av7110->vidmode =VIDEO_MODE_PAL ;av7110_set_vidmode (av7110, av7110->vidmode); } -else if (std->id ==V4L2_STD_NTSC ) { +else if (std->id &V4L2_STD_NTSC ) { av7110->vidmode =VIDEO_MODE_NTSC ;av7110_set_vidmode (av7110, av7110->vidmode); }
--
PATCH 11/37 av7110: fix comment
In reply to Johannes Stezenbachfixed debugging instructions: av7110_debug -> debug (Oliver Endirss)
---
drivers/media/dvb/ttpci/av7110_ir.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/media/dvb/ttpci/av7110_ir.c +1 -1
@@ -10,7 +10,7 @@#define UP_TIMEOUT (HZ/4) -/* enable ir debugging by or'ing av7110_debug with 16 */ +/* enable ir debugging by or'ing debug with 16 */ static int ir_initialized;static struct input_dev input_dev;
--
PATCH 12/37 av7110: fix indentation
In reply to Johannes Stezenbachfix indentation
---
drivers/media/dvb/ttpci/av7110_ca.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/media/dvb/ttpci/av7110_ca.c +1 -1
@@ -123,7 +123,7 @@ static void ci_ll_release(struct dvb_rin }static int ci_ll_reset (struct dvb_ringbuffer *cibuf,struct file *file, -int slots,ca_slot_info_t *slot) +int slots,ca_slot_info_t *slot) {int i;int len =0 ;
--
PATCH 13/37 nxt6000: support frontend status reads
In reply to Johannes Stezenbachadd support for read_ber, read_signal_strength and read_status (Greg Wickham)
---
drivers/media/dvb/frontends/nxt6000.c | 44 ++++++++++++++++++++++++++++- drivers/media/dvb/frontends/nxt6000_priv.h | 21 +++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-)
drivers/media/dvb/frontends/nxt6000.c +43 -1
@@ -180,7 +180,12 @@ static void nxt6000_setup(struct dvb_fronxt6000_writereg (state,RS_COR_SYNC_PARAM ,SYNC_PARAM );nxt6000_writereg (state,BER_CTRL ,/*(1 << 2) | */ (0x01 <<1 ) |0x01 ); -nxt6000_writereg (state,VIT_COR_CTL ,VIT_COR_RESYNC ); +nxt6000_writereg (state,VIT_BERTIME_2 ,0x00 );// BER Timer = 0x000200 * 256 = 131072 bits +nxt6000_writereg (state,VIT_BERTIME_1 ,0x02 );// +nxt6000_writereg (state,VIT_BERTIME_0 ,0x00 );// +nxt6000_writereg (state,VIT_COR_INTEN ,0x98 );// Enable BER interrupts +nxt6000_writereg (state,VIT_COR_CTL ,0x82 );// Enable BER measurement +nxt6000_writereg (state,VIT_COR_CTL ,VIT_COR_RESYNC |0x02 );nxt6000_writereg (state,OFDM_COR_CTL , (0x01 <<5 ) | (nxt6000_readreg (state,OFDM_COR_CTL ) &0x0F ));nxt6000_writereg (state,OFDM_COR_MODEGUARD ,FORCEMODE8K |0x02 );nxt6000_writereg (state,OFDM_AGC_CTL ,AGCLAST |INITIAL_AGC_BW );
@@ -486,6 +491,40 @@ static void nxt6000_release(struct dvb_fkfree (state); } +static int nxt6000_read_snr (struct dvb_frontend * fe,u16 * snr) +{ +struct nxt6000_state * state = (struct nxt6000_state *) fe->demodulator_priv; + + *snr =nxt6000_readreg ( state,OFDM_CHC_SNR ) /8 ; + +return 0 ; +} + +static int nxt6000_read_ber (struct dvb_frontend * fe,u32 * ber) +{ +struct nxt6000_state * state = (struct nxt6000_state *) fe->demodulator_priv; + +nxt6000_writereg ( state,VIT_COR_INTSTAT ,0x18 ); + + *ber = (nxt6000_readreg ( state,VIT_BER_1 ) <<8 ) | +nxt6000_readreg ( state,VIT_BER_0 ); + +nxt6000_writereg ( state,VIT_COR_INTSTAT ,0x18 );// Clear BER Done interrupts + +return 0 ; +} + +static int nxt6000_read_signal_strength (struct dvb_frontend * fe,u16 * signal_strength) +{ +struct nxt6000_state * state = (struct nxt6000_state *) fe->demodulator_priv; + + *signal_strength = (short ) (511 - + (nxt6000_readreg (state,AGC_GAIN_1 ) + + ((nxt6000_readreg (state,AGC_GAIN_2 ) &0x03 ) <<8 ))); + +return 0 ; +} +static struct dvb_frontend_ops nxt6000_ops; struct dvb_frontend* nxt6000_attach(const struct nxt6000_config* config,
@@ -542,6 +581,9 @@ static struct dvb_frontend_ops nxt6000_o .set_frontend = nxt6000_set_frontend, .read_status = nxt6000_read_status, + .read_ber = nxt6000_read_ber, + .read_signal_strength = nxt6000_read_signal_strength, + .read_snr = nxt6000_read_snr, };module_param (debug, int,0644 );
drivers/media/dvb/frontends/nxt6000_priv.h +21 -0
@@ -65,12 +65,27 @@#define BER_DONE (0x08)#define BER_OVERFLOW (0x10) +/* 0x38 VIT_BERTIME_2 */ +#define VIT_BERTIME_2 (0x38) + +/* 0x39 VIT_BERTIME_1 */ +#define VIT_BERTIME_1 (0x39) + +/* 0x3A VIT_BERTIME_0 */ +#define VIT_BERTIME_0 (0x3a) +/* 0x38 OFDM_BERTimer *//* Use the alias registers */ #define A_VIT_BER_TIMER_0 (0x1D)/* 0x3A VIT_BER_TIMER_0 *//* Use the alias registers */ #define A_VIT_BER_0 (0x1B) +/* 0x3B VIT_BER_1 */ +#define VIT_BER_1 (0x3b) + +/* 0x3C VIT_BER_0 */ +#define VIT_BER_0 (0x3c) +/* 0x40 OFDM_COR_CTL */ #define OFDM_COR_CTL (0x40)#define COREACT (0x20)
@@ -117,6 +132,12 @@#define OFDM_ITB_CTL (0x4B)#define ITBINV (0x01) +/* 0x49 AGC_GAIN_1 */ +#define AGC_GAIN_1 (0x49) + +/* 0x4A AGC_GAIN_2 */ +#define AGC_GAIN_2 (0x4A) +/* 0x4C OFDM_ITB_FREQ_1 */ #define OFDM_ITB_FREQ_1 (0x4C)
--
PATCH 14/37 tda1004x: formatting cleanups
In reply to Johannes Stezenbachmostly formatting cleanups, no functional change (Andreas Oberritter)
---
drivers/media/dvb/frontends/tda1004x.c | 246 ++++++++++++++++----------------- 1 files changed, 125 insertions(+), 121 deletions(-)
drivers/media/dvb/frontends/tda1004x.c +125 -121
@@ -35,9 +35,10 @@#include "dvb_frontend.h" #include "tda1004x.h" -#define TDA1004X_DEMOD_TDA10045 0 -#define TDA1004X_DEMOD_TDA10046 1 - +enum tda1004x_demod { +TDA1004X_DEMOD_TDA10045 , +TDA1004X_DEMOD_TDA10046 , +};struct tda1004x_state {struct i2c_adapter * i2c;
@@ -46,8 +47,8 @@ struct tda1004x_state {struct dvb_frontend frontend;/* private demod data */ - u8 initialised:1; -u8 demod_type; +u8 initialised; +enum tda1004x_demod demod_type; };
@@ -139,7 +140,7 @@ static int tda1004x_write_byteI(struct t {int ret;u8 buf[] = { reg, data }; -struct i2c_msg msg = { .addr=0 , .flags=0 , .buf=buf, .len=2 }; +struct i2c_msg msg = { .flags =0 , .buf = buf, .len =2 };dprintk ("%s: reg=0x%x, data=0x%x\n" , __FUNCTION__, reg, data);
@@ -160,8 +161,8 @@ static int tda1004x_read_byte(struct tdaint ret;u8 b0[] = { reg };u8 b1[] = {0 }; -struct i2c_msg msg[] = {{ .addr=0 , .flags=0 , .buf=b0, .len=1 }, - { .addr=0 , .flags=I2C_M_RD , .buf=b1, .len =1 }}; +struct i2c_msg msg[] = {{ .flags =0 , .buf = b0, .len =1 }, + { .flags =I2C_M_RD , .buf = b1, .len =1 }};dprintk ("%s: reg=0x%x\n" , __FUNCTION__, reg);
@@ -294,7 +295,7 @@ static int tda1004x_do_upload(struct tda u8 dspCodeCounterReg, u8 dspCodeInReg) {u8 buf[65 ]; -struct i2c_msg fw_msg = {.addr =0 ,.flags =0 ,.buf = buf,.len =0 }; +struct i2c_msg fw_msg = { .flags =0 , .buf = buf, .len =0 };int tx_size;int pos =0 ;
@@ -304,12 +305,10 @@ static int tda1004x_do_upload(struct tda buf[0 ] = dspCodeInReg;while (pos != len) { -// work out how much to send this time tx_size = len - pos; -if (tx_size >0x10 ) { +if (tx_size >0x10 ) tx_size =0x10 ; - }// send the chunk memcpy (buf +1 , mem + pos, tx_size);
@@ -322,6 +321,7 @@ static int tda1004x_do_upload(struct tdadprintk ("%s: fw_pos=0x%x\n" , __FUNCTION__, pos); } +return 0 ; }
@@ -335,9 +335,8 @@ static int tda1004x_check_upload_ok(stru data1 =tda1004x_read_byte (state,TDA1004X_DSP_DATA1 ); data2 =tda1004x_read_byte (state,TDA1004X_DSP_DATA2 ); -if (data1 !=0x67 || data2 != dspVersion) { +if ((data1 !=0x67 ) || (data2 != dspVersion))return -EIO ; - }return 0 ; }
@@ -348,9 +347,9 @@ static int tda10045_fwupload(struct dvb_int ret;const struct firmware *fw; -/* don't re-upload unless necessary */ -if (tda1004x_check_upload_ok (state,0x2c ) ==0 )return 0 ; +if (tda1004x_check_upload_ok (state,0x2c ) ==0 ) +return 0 ;/* request the firmware, this will block until someone uploads it */ printk ("tda1004x: waiting for firmware upload (%s)...\n" ,TDA10045_DEFAULT_FIRMWARE );
@@ -394,7 +393,8 @@ static int tda10046_fwupload(struct dvb_msleep (100 );/* don't re-upload unless necessary */ -if (tda1004x_check_upload_ok (state,0x20 ) ==0 )return 0 ; +if (tda1004x_check_upload_ok (state,0x20 ) ==0 ) +return 0 ;/* request the firmware, this will block until someone uploads it */ printk ("tda1004x: waiting for firmware upload (%s)...\n" ,TDA10046_DEFAULT_FIRMWARE );
@@ -419,7 +419,7 @@ static int tda10046_fwupload(struct dvb_/* wait for DSP to initialise */ timeout = jiffies +HZ ; -while (!(tda1004x_read_byte (state,TDA1004X_STATUS_CD ) &0x20 )) { +while (!(tda1004x_read_byte (state,TDA1004X_STATUS_CD ) &0x20 )) {if (time_after (jiffies, timeout)) {printk ("tda1004x: DSP failed to initialised.\n" );return -EIO ;
@@ -483,7 +483,8 @@ static int tda10045_init(struct dvb_frondprintk ("%s\n" , __FUNCTION__); -if (state->initialised)return 0 ; +if (state->initialised) +return 0 ;if (tda10045_fwupload (fe)) {printk ("tda1004x: firmware upload failed\n" );
@@ -523,7 +524,8 @@ static int tda10046_init(struct dvb_fronstruct tda1004x_state * state = fe->demodulator_priv;dprintk ("%s\n" , __FUNCTION__); -if (state->initialised)return 0 ; +if (state->initialised) +return 0 ;if (tda10046_fwupload (fe)) {printk ("tda1004x: firmware upload failed\n" );
@@ -621,12 +623,14 @@ static int tda1004x_set_fe(struct dvb_fr// set HP FEC tmp =tda1004x_encode_fec (fe_params->u.ofdm.code_rate_HP); -if (tmp <0 )return tmp; +if (tmp <0 ) +return tmp;tda1004x_write_mask (state,TDA1004X_IN_CONF2 ,7 , tmp);// set LP FEC tmp =tda1004x_encode_fec (fe_params->u.ofdm.code_rate_LP); -if (tmp <0 )return tmp; +if (tmp <0 ) +return tmp;tda1004x_write_mask (state,TDA1004X_IN_CONF2 ,0x38 , tmp <<3 );// set constellation
@@ -671,7 +675,7 @@ static int tda1004x_set_fe(struct dvb_fr }// set bandwidth -switch (state->demod_type) { +switch (state->demod_type) {case TDA1004X_DEMOD_TDA10045 :tda10045h_set_bandwidth (state, fe_params->u.ofdm.bandwidth);break ;
@@ -683,7 +687,8 @@ static int tda1004x_set_fe(struct dvb_fr// set inversion inversion = fe_params->inversion; -if (state->config->invert) inversion = inversion ?INVERSION_OFF :INVERSION_ON ; +if (state->config->invert) + inversion = inversion ?INVERSION_OFF :INVERSION_ON ;switch (inversion) {case INVERSION_OFF :tda1004x_write_mask (state,TDA1004X_CONFC1 ,0x20 ,0 );
@@ -750,19 +755,19 @@ static int tda1004x_set_fe(struct dvb_fr }// start the lock -switch (state->demod_type) { +switch (state->demod_type) {case TDA1004X_DEMOD_TDA10045 :tda1004x_write_mask (state,TDA1004X_CONFC4 ,8 ,8 );tda1004x_write_mask (state,TDA1004X_CONFC4 ,8 ,0 ); -msleep (10 );break ;case TDA1004X_DEMOD_TDA10046 :tda1004x_write_mask (state,TDA1004X_AUTO ,0x40 ,0x40 ); -msleep (10 );break ; } +msleep (10 ); +return 0 ; }
@@ -773,13 +778,13 @@ static int tda1004x_get_fe(struct dvb_fr// inversion status fe_params->inversion =INVERSION_OFF ; -if (tda1004x_read_byte (state,TDA1004X_CONFC1 ) &0x20 ) { +if (tda1004x_read_byte (state,TDA1004X_CONFC1 ) &0x20 ) fe_params->inversion =INVERSION_ON ; - } -if (state->config->invert) fe_params->inversion = fe_params->inversion ?INVERSION_OFF :INVERSION_ON ; +if (state->config->invert) + fe_params->inversion = fe_params->inversion ?INVERSION_OFF :INVERSION_ON ;// bandwidth -switch (state->demod_type) { +switch (state->demod_type) {case TDA1004X_DEMOD_TDA10045 :switch (tda1004x_read_byte (state,TDA10045H_WREF_LSB )) {case 0x14 :
@@ -830,9 +835,8 @@ static int tda1004x_get_fe(struct dvb_fr// transmission mode fe_params->u.ofdm.transmission_mode =TRANSMISSION_MODE_2K ; -if (tda1004x_read_byte (state,TDA1004X_OUT_CONF1 ) &0x10 ) { +if (tda1004x_read_byte (state,TDA1004X_OUT_CONF1 ) &0x10 ) fe_params->u.ofdm.transmission_mode =TRANSMISSION_MODE_8K ; - }// guard interval switch ((tda1004x_read_byte (state,TDA1004X_OUT_CONF1 ) &0x0c ) >>2 ) {
@@ -880,30 +884,33 @@ static int tda1004x_read_status(struct d// read status status =tda1004x_read_byte (state,TDA1004X_STATUS_CD ); -if (status ==-1 ) { +if (status ==-1 )return -EIO ; - }// decode *fe_status =0 ; -if (status &4 ) *fe_status |=FE_HAS_SIGNAL ; -if (status &2 ) *fe_status |=FE_HAS_CARRIER ; -if (status &8 ) *fe_status |=FE_HAS_VITERBI |FE_HAS_SYNC |FE_HAS_LOCK ; +if (status &4 ) + *fe_status |=FE_HAS_SIGNAL ; +if (status &2 ) + *fe_status |=FE_HAS_CARRIER ; +if (status &8 ) + *fe_status |=FE_HAS_VITERBI |FE_HAS_SYNC |FE_HAS_LOCK ;// if we don't already have VITERBI (i.e. not LOCKED), see if the viterbi // is getting anything valid if (!(*fe_status &FE_HAS_VITERBI )) {// read the CBER cber =tda1004x_read_byte (state,TDA1004X_CBER_LSB ); -if (cber ==-1 )return -EIO ; +if (cber ==-1 ) +return -EIO ; status =tda1004x_read_byte (state,TDA1004X_CBER_MSB ); -if (status ==-1 )return -EIO ; +if (status ==-1 ) +return -EIO ; cber |= (status <<8 );tda1004x_read_byte (state,TDA1004X_CBER_RESET ); -if (cber !=65535 ) { +if (cber !=65535 ) *fe_status |=FE_HAS_VITERBI ; - } }// if we DO have some valid VITERBI output, but don't already have SYNC
@@ -911,20 +918,22 @@ static int tda1004x_read_status(struct dif ((*fe_status &FE_HAS_VITERBI ) && (!(*fe_status &FE_HAS_SYNC ))) {// read the VBER vber =tda1004x_read_byte (state,TDA1004X_VBER_LSB ); -if (vber ==-1 )return -EIO ; +if (vber ==-1 ) +return -EIO ; status =tda1004x_read_byte (state,TDA1004X_VBER_MID ); -if (status ==-1 )return -EIO ; +if (status ==-1 ) +return -EIO ; vber |= (status <<8 ); status =tda1004x_read_byte (state,TDA1004X_VBER_MSB ); -if (status ==-1 )return -EIO ; +if (status ==-1 ) +return -EIO ; vber |= ((status <<16 ) &0x0f );tda1004x_read_byte (state,TDA1004X_CVBER_LUT );// if RS has passed some valid TS packets, then we must be // getting some SYNC bytes -if (vber <16632 ) { +if (vber <16632 ) *fe_status |=FE_HAS_SYNC ; - } }// success
@@ -941,7 +950,7 @@ static int tda1004x_read_signal_strengthdprintk ("%s\n" , __FUNCTION__);// determine the register to use -switch (state->demod_type) { +switch (state->demod_type) {case TDA1004X_DEMOD_TDA10045 : reg =TDA10045H_S_AGC ;break ;
@@ -972,9 +981,8 @@ static int tda1004x_read_snr(struct dvb_ tmp =tda1004x_read_byte (state,TDA1004X_SNR );if (tmp <0 )return -EIO ; -if (tmp) { +if (tmp) tmp =255 - tmp; - } *snr = ((tmp <<8 ) | tmp);dprintk ("%s: snr=0x%x\n" , __FUNCTION__, *snr);
@@ -1009,11 +1017,11 @@ static int tda1004x_read_ucblocks(structbreak ; } -if (tmp !=0x7f ) { +if (tmp !=0x7f ) *ucblocks = tmp; - }else { +else *ucblocks =0xffffffff ; - } +dprintk ("%s: ucblocks=0x%x\n" , __FUNCTION__, *ucblocks);return 0 ; }
@@ -1027,10 +1035,12 @@ static int tda1004x_read_ber(struct dvb_// read it in tmp =tda1004x_read_byte (state,TDA1004X_CBER_LSB ); -if (tmp <0 )return -EIO ; +if (tmp <0 ) +return -EIO ; *ber = tmp <<1 ; tmp =tda1004x_read_byte (state,TDA1004X_CBER_MSB ); -if (tmp <0 )return -EIO ; +if (tmp <0 ) +return -EIO ; *ber |= (tmp <<9 );tda1004x_read_byte (state,TDA1004X_CBER_RESET );
@@ -1042,7 +1052,7 @@ static int tda1004x_sleep(struct dvb_fro {struct tda1004x_state * state = fe->demodulator_priv; -switch (state->demod_type) { +switch (state->demod_type) {case TDA1004X_DEMOD_TDA10045 :tda1004x_write_mask (state,TDA1004X_CONFADC1 ,0x10 ,0x10 );break ;
@@ -1066,74 +1076,11 @@ static int tda1004x_get_tune_settings(ststatic void tda1004x_release (struct dvb_frontend * fe) { -struct tda1004x_state * state = (struct tda1004x_state *) fe->demodulator_priv; +struct tda1004x_state *state = fe->demodulator_priv;kfree (state); } -static struct dvb_frontend_ops tda10045_ops; - -struct dvb_frontend *tda10045_attach (const struct tda1004x_config * config, -struct i2c_adapter * i2c) -{ -struct tda1004x_state * state =NULL ; - -/* allocate memory for the internal state */ - state = (struct tda1004x_state *)kmalloc (sizeof (struct tda1004x_state ),GFP_KERNEL ); -if (state ==NULL ) goto error; - -/* setup the state */ - state->config = config; - state->i2c = i2c; -memcpy (&state->ops, &tda10045_ops,sizeof (struct dvb_frontend_ops )); - state->initialised =0 ; - state->demod_type =TDA1004X_DEMOD_TDA10045 ; - -/* check if the demod is there */ -if (tda1004x_read_byte (state,TDA1004X_CHIPID ) !=0x25 ) goto error; - -/* create dvb_frontend */ - state->frontend.ops = &state->ops; - state->frontend.demodulator_priv = state; -return &state->frontend; - -error: -kfree (state); -return NULL ; -} - -static struct dvb_frontend_ops tda10046_ops; - -struct dvb_frontend *tda10046_attach (const struct tda1004x_config * config, -struct i2c_adapter * i2c) -{ -struct tda1004x_state * state =NULL ; - -/* allocate memory for the internal state */ - state = (struct tda1004x_state *)kmalloc (sizeof (struct tda1004x_state ),GFP_KERNEL ); -if (state ==NULL ) goto error; - -/* setup the state */ - state->config = config; - state->i2c = i2c; -memcpy (&state->ops, &tda10046_ops,sizeof (struct dvb_frontend_ops )); - state->initialised =0 ; - state->demod_type =TDA1004X_DEMOD_TDA10046 ; - -/* check if the demod is there */ -if (tda1004x_read_byte (state,TDA1004X_CHIPID ) !=0x46 ) goto error; - -/* create dvb_frontend */ - state->frontend.ops = &state->ops; - state->frontend.demodulator_priv = state; -return &state->frontend; - -error: -if (state)kfree (state); -return NULL ; -} -static struct dvb_frontend_ops tda10045_ops = { - .info = { .name ="Philips TDA10045H DVB-T" , .type =FE_OFDM ,
@@ -1163,8 +1110,36 @@ static struct dvb_frontend_ops tda10045_ .read_ucblocks = tda1004x_read_ucblocks, }; -static struct dvb_frontend_ops tda10046_ops = { +struct dvb_frontend *tda10045_attach (const struct tda1004x_config * config, +struct i2c_adapter * i2c) +{ +struct tda1004x_state *state; + +/* allocate memory for the internal state */ + state =kmalloc (sizeof (struct tda1004x_state ),GFP_KERNEL ); +if (!state) +return NULL ; + +/* setup the state */ + state->config = config; + state->i2c = i2c; +memcpy (&state->ops, &tda10045_ops,sizeof (struct dvb_frontend_ops )); + state->initialised =0 ; + state->demod_type =TDA1004X_DEMOD_TDA10045 ; + +/* check if the demod is there */ +if (tda1004x_read_byte (state,TDA1004X_CHIPID ) !=0x25 ) { +kfree (state); +return NULL ; + } + +/* create dvb_frontend */ + state->frontend.ops = &state->ops; + state->frontend.demodulator_priv = state; +return &state->frontend; +} +static struct dvb_frontend_ops tda10046_ops = { .info = { .name ="Philips TDA10046H DVB-T" , .type =FE_OFDM ,
@@ -1194,6 +1169,35 @@ static struct dvb_frontend_ops tda10046_ .read_ucblocks = tda1004x_read_ucblocks, }; +struct dvb_frontend *tda10046_attach (const struct tda1004x_config * config, +struct i2c_adapter * i2c) +{ +struct tda1004x_state *state; + +/* allocate memory for the internal state */ + state =kmalloc (sizeof (struct tda1004x_state ),GFP_KERNEL ); +if (!state) +return NULL ; + +/* setup the state */ + state->config = config; + state->i2c = i2c; +memcpy (&state->ops, &tda10046_ops,sizeof (struct dvb_frontend_ops )); + state->initialised =0 ; + state->demod_type =TDA1004X_DEMOD_TDA10046 ; + +/* check if the demod is there */ +if (tda1004x_read_byte (state,TDA1004X_CHIPID ) !=0x46 ) { +kfree (state); +return NULL ; + } + +/* create dvb_frontend */ + state->frontend.ops = &state->ops; + state->frontend.demodulator_priv = state; +return &state->frontend; +} +module_param (debug, int,0644 );MODULE_PARM_DESC (debug,"Turn on/off frontend debugging (default:off)." );
--
PATCH 15/37 stv0299: fix FE_DISHNETWORK_SEND_LEGACY_CMD
In reply to Johannes Stezenbachfix the current stv0299 code that handles FE_DISHNETWORK_SEND_LEGACY_CMD. (supports the legacy SW21, SW44, and SW64 switches)
---
drivers/media/dvb/frontends/stv0299.c | 78 ++++++++++++++++++++++++++++------ 1 files changed, 66 insertions(+), 12 deletions(-)
drivers/media/dvb/frontends/stv0299.c +66 -12
@@ -70,6 +70,7 @@ struct stv0299_state {#define STATUS_UCBLOCKS 1static int debug; +static int debug_legacy_dish_switch; #define dprintk(args...) \ do { \ if (debug) printk(KERN_DEBUG "stv0299: " args); \
@@ -385,34 +386,84 @@ static int stv0299_set_voltage (struct d }; } -static int stv0299_send_legacy_dish_cmd (struct dvb_frontend * fe,u32 cmd) +static inline s32 stv0299_calc_usec_delay (struct timeval lasttime,struct timeval curtime) { +return ((curtime.tv_usec < lasttime.tv_usec) ? +1000000 - lasttime.tv_usec + curtime.tv_usec : + curtime.tv_usec - lasttime.tv_usec); +} + +static void stv0299_sleep_until (struct timeval *waketime,u32 add_usec) +{ +struct timeval lasttime; +s32 delta, newdelta; + + waketime->tv_usec += add_usec; +if (waketime->tv_usec >=1000000 ) { + waketime->tv_usec -=1000000 ; + waketime->tv_sec++; + } + +do_gettimeofday (&lasttime); + delta =stv0299_calc_usec_delay (lasttime, *waketime); +if (delta >2500 ) { +msleep ((delta -1500 ) /1000 ); +do_gettimeofday (&lasttime); + newdelta =stv0299_calc_usec_delay (lasttime, *waketime); + delta = (newdelta > delta) ?0 : newdelta; + } +if (delta >0 ) +udelay (delta); +} + +static int stv0299_send_legacy_dish_cmd (struct dvb_frontend * fe,u32 cmd) +{ +struct stv0299_state * state = fe->demodulator_priv; +u8 reg0x08; +u8 reg0x0c; +u8 lv_mask =0x40 ;u8 last =1 ;int i; +struct timeval nexttime; +struct timeval tv[10 ]; -/* reset voltage at the end -if((0x50 & stv0299_readreg (i2c, 0x0c)) == 0x50) -cmd |= 0x80; -else -cmd &= 0x7F; -*/ + reg0x08 =stv0299_readreg (state,0x08 ); + reg0x0c =stv0299_readreg (state,0x0c ); + reg0x0c &=0x0f ; +stv0299_writeregI (state,0x08 , (reg0x08 &0x3f ) | (state->config->lock_output <<6 )); +if (state->config->volt13_op0_op1 ==STV0299_VOLT13_OP0 ) + lv_mask =0x10 ; cmd = cmd <<1 ; -dprintk ("%s switch command: 0x%04x\n" ,__FUNCTION__, cmd); +if (debug_legacy_dish_switch) +printk ("%s switch command: 0x%04x\n" ,__FUNCTION__, cmd); + +do_gettimeofday (&nexttime); +if (debug_legacy_dish_switch) +memcpy (&tv[0 ], &nexttime,sizeof (struct timeval )); +stv0299_writeregI (state,0x0c , reg0x0c |0x50 );/* set LNB to 18V */ -stv0299_set_voltage (fe,SEC_VOLTAGE_18 ); -msleep (32 ); +stv0299_sleep_until (&nexttime,32000 );for (i=0 ; i<9 ; i++) { +if (debug_legacy_dish_switch) +do_gettimeofday (&tv[i+1 ]);if ((cmd &0x01 ) != last) { -stv0299_set_voltage (fe, last ?SEC_VOLTAGE_13 :SEC_VOLTAGE_18 ); +/* set voltage to (last ? 13V : 18V) */ +stv0299_writeregI (state,0x0c , reg0x0c | (last ? lv_mask :0x50 )); last = (last) ?0 :1 ; } cmd = cmd >>1 ;if (i !=8 ) -msleep (8 ); +stv0299_sleep_until (&nexttime,8000 ); + } +if (debug_legacy_dish_switch) { +printk ("%s(%d): switch delay (should be 32k followed by all 8k\n" , + __FUNCTION__, fe->dvb->num); +for (i=1 ; i <10 ; i++) +printk ("%d: %d\n" , i,stv0299_calc_usec_delay (tv[i-1 ] , tv[i])); }return 0 ;
@@ -719,6 +770,9 @@ static struct dvb_frontend_ops stv0299_o .dishnetwork_send_legacy_command = stv0299_send_legacy_dish_cmd, }; +module_param (debug_legacy_dish_switch, int,0444 ); +MODULE_PARM_DESC (debug_legacy_dish_switch,"Enable timing analysis for Dish Network legacy switches" ); +module_param (debug, int,0644 );MODULE_PARM_DESC (debug,"Turn on/off frontend debugging (default:off)." );
--
PATCH 16/37 remove unnecessary casts in frontends
In reply to Johannes Stezenbachremove unnecessary casts in frontends (Kenneth Aafloy)
---
drivers/media/dvb/frontends/at76c651.c | 18 +++++++------- drivers/media/dvb/frontends/cx22700.c | 20 ++++++++-------- drivers/media/dvb/frontends/cx22702.c | 20 ++++++++-------- drivers/media/dvb/frontends/cx24110.c | 31 ++++++++++++------------ drivers/media/dvb/frontends/dib3000mb.c | 26 ++++++++++---------- drivers/media/dvb/frontends/dib3000mc.c | 24 +++++++++---------- drivers/media/dvb/frontends/dvb_dummy_fe.c | 8 +++--- drivers/media/dvb/frontends/l64781.c | 22 ++++++++--------- drivers/media/dvb/frontends/mt312.c | 32 ++++++++++++------------- drivers/media/dvb/frontends/nxt2002.c | 20 ++++++++-------- drivers/media/dvb/frontends/nxt6000.c | 18 +++++++------- drivers/media/dvb/frontends/or51132.c | 14 +++++------ drivers/media/dvb/frontends/sp8870.c | 20 ++++++++-------- drivers/media/dvb/frontends/sp887x.c | 22 ++++++++--------- drivers/media/dvb/frontends/stv0297.c | 24 +++++++++---------- drivers/media/dvb/frontends/stv0299.c | 36 ++++++++++++++--------------- drivers/media/dvb/frontends/tda10021.c | 22 ++++++++--------- drivers/media/dvb/frontends/tda8083.c | 26 ++++++++++---------- drivers/media/dvb/frontends/tda80xx.c | 34 +++++++++++++-------------- drivers/media/dvb/frontends/ves1820.c | 22 ++++++++--------- drivers/media/dvb/frontends/ves1x93.c | 24 +++++++++---------- 21 files changed, 241 insertions(+), 242 deletions(-)
drivers/media/dvb/frontends/at76c651.c +9 -9
@@ -259,7 +259,7 @@ static int at76c651_set_parameters(struc struct dvb_frontend_parameters *p) {int ret; -struct at76c651_state * state = (struct at76c651_state *) fe->demodulator_priv; +struct at76c651_state * state = fe->demodulator_priv;at76c651_writereg (state,0x0c ,0xc3 ); state->config->pll_set (fe, p);
@@ -276,7 +276,7 @@ static int at76c651_set_parameters(strucstatic int at76c651_set_defaults (struct dvb_frontend * fe) { -struct at76c651_state * state = (struct at76c651_state *) fe->demodulator_priv; +struct at76c651_state * state = fe->demodulator_priv;at76c651_set_symbol_rate (state,6900000 );at76c651_set_qam (state,QAM_64 );
@@ -294,7 +294,7 @@ static int at76c651_set_defaults(structstatic int at76c651_read_status (struct dvb_frontend * fe,fe_status_t * status) { -struct at76c651_state * state = (struct at76c651_state *) fe->demodulator_priv; +struct at76c651_state * state = fe->demodulator_priv;u8 sync;/*
@@ -319,7 +319,7 @@ static int at76c651_read_status(struct dstatic int at76c651_read_ber (struct dvb_frontend * fe,u32 * ber) { -struct at76c651_state * state = (struct at76c651_state *) fe->demodulator_priv; +struct at76c651_state * state = fe->demodulator_priv; *ber = (at76c651_readreg (state,0x81 ) &0x0F ) <<16 ; *ber |=at76c651_readreg (state,0x82 ) <<8 ;
@@ -331,7 +331,7 @@ static int at76c651_read_ber(struct dvb_static int at76c651_read_signal_strength (struct dvb_frontend * fe,u16 * strength) { -struct at76c651_state * state = (struct at76c651_state *) fe->demodulator_priv; +struct at76c651_state * state = fe->demodulator_priv;u8 gain = ~at76c651_readreg (state,0x91 ); *strength = (gain <<8 ) | gain;
@@ -341,7 +341,7 @@ static int at76c651_read_signal_strengthstatic int at76c651_read_snr (struct dvb_frontend * fe,u16 * snr) { -struct at76c651_state * state = (struct at76c651_state *) fe->demodulator_priv; +struct at76c651_state * state = fe->demodulator_priv; *snr = 0xFFFF - ((at76c651_readreg(state, 0x8F) << 8) |
@@ -352,7 +352,7 @@ static int at76c651_read_snr(struct dvb_static int at76c651_read_ucblocks (struct dvb_frontend * fe,u32 * ucblocks) { -struct at76c651_state * state = (struct at76c651_state *) fe->demodulator_priv; +struct at76c651_state * state = fe->demodulator_priv; *ucblocks =at76c651_readreg (state,0x82 );
@@ -369,7 +369,7 @@ static int at76c651_get_tune_settings(ststatic void at76c651_release (struct dvb_frontend * fe) { -struct at76c651_state * state = (struct at76c651_state *) fe->demodulator_priv; +struct at76c651_state * state = fe->demodulator_priv;kfree (state); }
@@ -381,7 +381,7 @@ struct dvb_frontend* at76c651_attach(construct at76c651_state * state =NULL ;/* allocate memory for the internal state */ - state = (struct at76c651_state *)kmalloc (sizeof (struct at76c651_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct at76c651_state ),GFP_KERNEL );if (state ==NULL ) goto error;/* setup the state */
drivers/media/dvb/frontends/cx22700.c +10 -10
@@ -232,7 +232,7 @@ static int cx22700_get_tps (struct cx227static int cx22700_init (struct dvb_frontend * fe) -{struct cx22700_state * state = (struct cx22700_state *) fe->demodulator_priv; +{struct cx22700_state * state = fe->demodulator_priv;int i;dprintk ("cx22700_init: init chip\n" );
@@ -258,7 +258,7 @@ static int cx22700_init (struct dvb_fronstatic int cx22700_read_status (struct dvb_frontend * fe,fe_status_t * status) { -struct cx22700_state * state = (struct cx22700_state *) fe->demodulator_priv; +struct cx22700_state * state = fe->demodulator_priv;u16 rs_ber = (cx22700_readreg (state,0x0d ) <<9 ) | (cx22700_readreg (state,0x0e ) <<1 );
@@ -286,7 +286,7 @@ static int cx22700_read_status(struct dvstatic int cx22700_read_ber (struct dvb_frontend * fe,u32 * ber) { -struct cx22700_state * state = (struct cx22700_state *) fe->demodulator_priv; +struct cx22700_state * state = fe->demodulator_priv; *ber =cx22700_readreg (state,0x0c ) &0x7f ;cx22700_writereg (state,0x0c ,0x00 );
@@ -296,7 +296,7 @@ static int cx22700_read_ber(struct dvb_fstatic int cx22700_read_signal_strength (struct dvb_frontend * fe,u16 * signal_strength) { -struct cx22700_state * state = (struct cx22700_state *) fe->demodulator_priv; +struct cx22700_state * state = fe->demodulator_priv;u16 rs_ber = (cx22700_readreg (state,0x0d ) <<9 ) | (cx22700_readreg (state,0x0e ) <<1 );
@@ -307,7 +307,7 @@ static int cx22700_read_signal_strength(static int cx22700_read_snr (struct dvb_frontend * fe,u16 * snr) { -struct cx22700_state * state = (struct cx22700_state *) fe->demodulator_priv; +struct cx22700_state * state = fe->demodulator_priv;u16 rs_ber = (cx22700_readreg (state,0x0d ) <<9 ) | (cx22700_readreg (state,0x0e ) <<1 );
@@ -318,7 +318,7 @@ static int cx22700_read_snr(struct dvb_fstatic int cx22700_read_ucblocks (struct dvb_frontend * fe,u32 * ucblocks) { -struct cx22700_state * state = (struct cx22700_state *) fe->demodulator_priv; +struct cx22700_state * state = fe->demodulator_priv; *ucblocks =cx22700_readreg (state,0x0f );cx22700_writereg (state,0x0f ,0x00 );
@@ -328,7 +328,7 @@ static int cx22700_read_ucblocks(structstatic int cx22700_set_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters *p) { -struct cx22700_state * state = (struct cx22700_state *) fe->demodulator_priv; +struct cx22700_state * state = fe->demodulator_priv;cx22700_writereg (state,0x00 ,0x02 );/* XXX CHECKME: soft reset*/ cx22700_writereg (state,0x00 ,0x00 );
@@ -346,7 +346,7 @@ static int cx22700_set_frontend(struct dstatic int cx22700_get_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters *p) { -struct cx22700_state * state = (struct cx22700_state *) fe->demodulator_priv; +struct cx22700_state * state = fe->demodulator_priv;u8 reg09 =cx22700_readreg (state,0x09 ); p->inversion = reg09 &0x1 ?INVERSION_ON :INVERSION_OFF ;
@@ -363,7 +363,7 @@ static int cx22700_get_tune_settings(strstatic void cx22700_release (struct dvb_frontend * fe) { -struct cx22700_state * state = (struct cx22700_state *) fe->demodulator_priv; +struct cx22700_state * state = fe->demodulator_priv;kfree (state); }
@@ -375,7 +375,7 @@ struct dvb_frontend* cx22700_attach(consstruct cx22700_state * state =NULL ;/* allocate memory for the internal state */ - state = (struct cx22700_state *)kmalloc (sizeof (struct cx22700_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct cx22700_state ),GFP_KERNEL );if (state ==NULL ) goto error;/* setup the state */
drivers/media/dvb/frontends/cx22702.c +10 -10
@@ -200,7 +200,7 @@ static int cx22702_get_tps (struct cx227static int cx22702_set_tps (struct dvb_frontend * fe,struct dvb_frontend_parameters *p) {u8 val; -struct cx22702_state * state = (struct cx22702_state *) fe->demodulator_priv; +struct cx22702_state * state = fe->demodulator_priv;/* set PLL */ cx22702_writereg (state,0x0D ,cx22702_readreg (state,0x0D ) &0xfe );
@@ -338,7 +338,7 @@ static int cx22702_set_tps (struct dvb_fstatic int cx22702_init (struct dvb_frontend * fe) {int i; -struct cx22702_state * state = (struct cx22702_state *) fe->demodulator_priv; +struct cx22702_state * state = fe->demodulator_priv;cx22702_writereg (state,0x00 ,0x02 );
@@ -360,7 +360,7 @@ static int cx22702_init (struct dvb_fronstatic int cx22702_read_status (struct dvb_frontend * fe,fe_status_t * status) { -struct cx22702_state * state = (struct cx22702_state *) fe->demodulator_priv; +struct cx22702_state * state = fe->demodulator_priv;u8 reg0A;u8 reg23;
@@ -389,7 +389,7 @@ static int cx22702_read_status(struct dvstatic int cx22702_read_ber (struct dvb_frontend * fe,u32 * ber) { -struct cx22702_state * state = (struct cx22702_state *) fe->demodulator_priv; +struct cx22702_state * state = fe->demodulator_priv;if (cx22702_readreg (state,0xE4 ) &0x02 ) {/* Realtime statistics */
@@ -406,7 +406,7 @@ static int cx22702_read_ber(struct dvb_fstatic int cx22702_read_signal_strength (struct dvb_frontend * fe,u16 * signal_strength) { -struct cx22702_state * state = (struct cx22702_state *) fe->demodulator_priv; +struct cx22702_state * state = fe->demodulator_priv; *signal_strength =cx22702_readreg (state,0x23 );
@@ -415,7 +415,7 @@ static int cx22702_read_signal_strength(static int cx22702_read_snr (struct dvb_frontend * fe,u16 * snr) { -struct cx22702_state * state = (struct cx22702_state *) fe->demodulator_priv; +struct cx22702_state * state = fe->demodulator_priv;u16 rs_ber=0 ;if (cx22702_readreg (state,0xE4 ) &0x02 ) {
@@ -434,7 +434,7 @@ static int cx22702_read_snr(struct dvb_fstatic int cx22702_read_ucblocks (struct dvb_frontend * fe,u32 * ucblocks) { -struct cx22702_state * state = (struct cx22702_state *) fe->demodulator_priv; +struct cx22702_state * state = fe->demodulator_priv;u8 _ucblocks;
@@ -449,7 +449,7 @@ static int cx22702_read_ucblocks(structstatic int cx22702_get_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters *p) { -struct cx22702_state * state = (struct cx22702_state *) fe->demodulator_priv; +struct cx22702_state * state = fe->demodulator_priv;u8 reg0C =cx22702_readreg (state,0x0C );
@@ -459,7 +459,7 @@ static int cx22702_get_frontend(struct dstatic void cx22702_release (struct dvb_frontend * fe) { -struct cx22702_state * state = (struct cx22702_state *) fe->demodulator_priv; +struct cx22702_state * state = fe->demodulator_priv;kfree (state); }
@@ -471,7 +471,7 @@ struct dvb_frontend* cx22702_attach(consstruct cx22702_state * state =NULL ;/* allocate memory for the internal state */ - state = (struct cx22702_state *)kmalloc (sizeof (struct cx22702_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct cx22702_state ),GFP_KERNEL );if (state ==NULL ) goto error;/* setup the state */
drivers/media/dvb/frontends/cx24110.c +15 -16
@@ -315,7 +315,7 @@ dprintk("cx24110 debug: entering %s(%d)\int cx24110_pll_write (struct dvb_frontend * fe,u32 data) { -struct cx24110_state *state = (struct cx24110_state *) fe->demodulator_priv; +struct cx24110_state *state = fe->demodulator_priv;/* tuner data is 21 bits long, must be left-aligned in data */ /* tuner cx24108 is written through a dedicated 3wire interface on the demod chip */
@@ -356,7 +356,7 @@ int cx24110_pll_write (struct dvb_frontestatic int cx24110_initfe (struct dvb_frontend * fe) { -struct cx24110_state *state = (struct cx24110_state *) fe->demodulator_priv; +struct cx24110_state *state = fe->demodulator_priv;/* fixme (low): error handling */ int i;
@@ -373,7 +373,7 @@ static int cx24110_initfe(struct dvb_frostatic int cx24110_set_voltage (struct dvb_frontend * fe,fe_sec_voltage_t voltage) { -struct cx24110_state *state = (struct cx24110_state *) fe->demodulator_priv; +struct cx24110_state *state = fe->demodulator_priv;switch (voltage) {case SEC_VOLTAGE_13 :
@@ -385,8 +385,7 @@ static int cx24110_set_voltage (struct d }; } -static int cx24110_diseqc_send_burst (struct dvb_frontend * fe, -fe_sec_mini_cmd_t burst) +static int cx24110_diseqc_send_burst (struct dvb_frontend * fe,fe_sec_mini_cmd_t burst) {int rv, bit, i;struct cx24110_state *state = fe->demodulator_priv;
@@ -413,7 +412,7 @@ static int cx24110_send_diseqc_msg(struc struct dvb_diseqc_master_cmd *cmd) {int i, rv; -struct cx24110_state *state = (struct cx24110_state *) fe->demodulator_priv; +struct cx24110_state *state = fe->demodulator_priv;for (i =0 ; i < cmd->msg_len; i++)cx24110_writereg (state,0x79 + i, cmd->msg[i]);
@@ -432,7 +431,7 @@ static int cx24110_send_diseqc_msg(strucstatic int cx24110_read_status (struct dvb_frontend * fe,fe_status_t * status) { -struct cx24110_state *state = (struct cx24110_state *) fe->demodulator_priv; +struct cx24110_state *state = fe->demodulator_priv;int sync =cx24110_readreg (state,0x55 );
@@ -460,7 +459,7 @@ static int cx24110_read_status(struct dvstatic int cx24110_read_ber (struct dvb_frontend * fe,u32 * ber) { -struct cx24110_state *state = (struct cx24110_state *) fe->demodulator_priv; +struct cx24110_state *state = fe->demodulator_priv;/* fixme (maybe): value range is 16 bit. Scale? */ if (cx24110_readreg (state,0x24 )&0x10 ) {
@@ -478,7 +477,7 @@ static int cx24110_read_ber(struct dvb_fstatic int cx24110_read_signal_strength (struct dvb_frontend * fe,u16 * signal_strength) { -struct cx24110_state *state = (struct cx24110_state *) fe->demodulator_priv; +struct cx24110_state *state = fe->demodulator_priv;/* no provision in hardware. Read the frontend AGC accumulator. No idea how to scale this, but I know it is 2s complement */ u8 signal =cx24110_readreg (state,0x27 )+128 ;
@@ -489,7 +488,7 @@ static int cx24110_read_signal_strength(static int cx24110_read_snr (struct dvb_frontend * fe,u16 * snr) { -struct cx24110_state *state = (struct cx24110_state *) fe->demodulator_priv; +struct cx24110_state *state = fe->demodulator_priv;/* no provision in hardware. Can be computed from the Es/N0 estimator, but I don't know how. */ if (cx24110_readreg (state,0x6a )&0x80 ) {
@@ -505,7 +504,7 @@ static int cx24110_read_snr(struct dvb_fstatic int cx24110_read_ucblocks (struct dvb_frontend * fe,u32 * ucblocks) { -struct cx24110_state *state = (struct cx24110_state *) fe->demodulator_priv; +struct cx24110_state *state = fe->demodulator_priv;u32 lastbyer;if (cx24110_readreg (state,0x10 )&0x40 ) {
@@ -527,7 +526,7 @@ static int cx24110_read_ucblocks(structstatic int cx24110_set_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters *p) { -struct cx24110_state *state = (struct cx24110_state *) fe->demodulator_priv; +struct cx24110_state *state = fe->demodulator_priv; state->config->pll_set (fe, p);cx24110_set_inversion (state, p->inversion);
@@ -540,7 +539,7 @@ static int cx24110_set_frontend(struct dstatic int cx24110_get_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters *p) { -struct cx24110_state *state = (struct cx24110_state *) fe->demodulator_priv; +struct cx24110_state *state = fe->demodulator_priv;s32 afc;unsigned sclk;/* cannot read back tuner settings (freq). Need to have some private storage */
@@ -567,14 +566,14 @@ static int cx24110_get_frontend(struct dstatic int cx24110_set_tone (struct dvb_frontend * fe,fe_sec_tone_mode_t tone) { -struct cx24110_state *state = (struct cx24110_state *) fe->demodulator_priv; +struct cx24110_state *state = fe->demodulator_priv;return cx24110_writereg (state,0x76 ,(cx24110_readreg (state,0x76 )&~0x10 )|(((tone==SEC_TONE_ON ))?0x10 :0 )); }static void cx24110_release (struct dvb_frontend * fe) { -struct cx24110_state * state = (struct cx24110_state *) fe->demodulator_priv; +struct cx24110_state * state = fe->demodulator_priv;kfree (state); }
@@ -587,7 +586,7 @@ struct dvb_frontend* cx24110_attach(consint ret;/* allocate memory for the internal state */ - state = (struct cx24110_state *)kmalloc (sizeof (struct cx24110_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct cx24110_state ),GFP_KERNEL );if (state ==NULL ) goto error;/* setup the state */
drivers/media/dvb/frontends/dib3000mb.c +13 -13
@@ -56,7 +56,7 @@ static int dib3000mb_get_frontend(structstatic int dib3000mb_set_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters *fep,int tuner) { -struct dib3000_state * state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state * state = fe->demodulator_priv;struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm;fe_code_rate_t fe_cr =FEC_NONE ;int search_state, seq;
@@ -317,7 +317,7 @@ static int dib3000mb_set_frontend(structstatic int dib3000mb_fe_init (struct dvb_frontend * fe,int mobile_mode) { -struct dib3000_state * state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state * state = fe->demodulator_priv;deb_info ("dib3000mb is getting up.\n" );wr (DIB3000MB_REG_POWER_CONTROL ,DIB3000MB_POWER_UP );
@@ -401,7 +401,7 @@ static int dib3000mb_fe_init(struct dvb_static int dib3000mb_get_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters *fep) { -struct dib3000_state * state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state * state = fe->demodulator_priv;struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm;fe_code_rate_t *cr;u16 tps_val;
@@ -562,7 +562,7 @@ static int dib3000mb_get_frontend(structstatic int dib3000mb_read_status (struct dvb_frontend * fe,fe_status_t *stat) { -struct dib3000_state * state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state * state = fe->demodulator_priv; *stat =0 ;
@@ -594,7 +594,7 @@ static int dib3000mb_read_status(structstatic int dib3000mb_read_ber (struct dvb_frontend * fe,u32 *ber) { -struct dib3000_state * state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state * state = fe->demodulator_priv; *ber = ((rd (DIB3000MB_REG_BER_MSB ) <<16 ) |rd (DIB3000MB_REG_BER_LSB ));return 0 ;
@@ -603,7 +603,7 @@ static int dib3000mb_read_ber(struct dvb/* see dib3000-watch dvb-apps for exact calcuations of signal_strength and snr */ static int dib3000mb_read_signal_strength (struct dvb_frontend * fe,u16 *strength) { -struct dib3000_state * state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state * state = fe->demodulator_priv; *strength =rd (DIB3000MB_REG_SIGNAL_POWER ) *0xffff /0x170 ;return 0 ;
@@ -611,7 +611,7 @@ static int dib3000mb_read_signal_strengtstatic int dib3000mb_read_snr (struct dvb_frontend * fe,u16 *snr) { -struct dib3000_state * state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state * state = fe->demodulator_priv;short sigpow =rd (DIB3000MB_REG_SIGNAL_POWER );int icipow = ((rd (DIB3000MB_REG_NOISE_POWER_MSB ) &0xff ) <<16 ) |rd (DIB3000MB_REG_NOISE_POWER_LSB );
@@ -621,7 +621,7 @@ static int dib3000mb_read_snr(struct dvbstatic int dib3000mb_read_unc_blocks (struct dvb_frontend * fe,u32 *unc) { -struct dib3000_state * state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state * state = fe->demodulator_priv; *unc =rd (DIB3000MB_REG_UNC );return 0 ;
@@ -629,7 +629,7 @@ static int dib3000mb_read_unc_blocks(strstatic int dib3000mb_sleep (struct dvb_frontend * fe) { -struct dib3000_state * state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state * state = fe->demodulator_priv;deb_info ("dib3000mb is going to bed.\n" );wr (DIB3000MB_REG_POWER_CONTROL ,DIB3000MB_POWER_DOWN );return 0 ;
@@ -656,7 +656,7 @@ static int dib3000mb_set_frontend_and_tustatic void dib3000mb_release (struct dvb_frontend * fe) { -struct dib3000_state *state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state *state = fe->demodulator_priv;kfree (state); }
@@ -671,7 +671,7 @@ static int dib3000mb_pid_control(structstatic int dib3000mb_fifo_control (struct dvb_frontend *fe,int onoff) { -struct dib3000_state *state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state *state = fe->demodulator_priv;deb_xfer ("%s fifo\n" ,onoff ?"enabling" :"disabling" );if (onoff) {
@@ -692,7 +692,7 @@ static int dib3000mb_pid_parse(struct dvstatic int dib3000mb_tuner_pass_ctrl (struct dvb_frontend *fe,int onoff,u8 pll_addr) { -struct dib3000_state *state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state *state = fe->demodulator_priv;if (onoff) {wr (DIB3000MB_REG_TUNER ,DIB3000_TUNER_WRITE_ENABLE (pll_addr)); }else {
@@ -709,7 +709,7 @@ struct dvb_frontend* dib3000mb_attach(costruct dib3000_state * state =NULL ;/* allocate memory for the internal state */ - state = (struct dib3000_state *)kmalloc (sizeof (struct dib3000_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct dib3000_state ),GFP_KERNEL );if (state ==NULL ) goto error;memset (state,0 ,sizeof (struct dib3000_state ));
drivers/media/dvb/frontends/dib3000mc.c +12 -12
@@ -297,7 +297,7 @@ static int dib3000mc_set_general_cfg(strstatic int dib3000mc_get_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters *fep) { -struct dib3000_state * state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state * state = fe->demodulator_priv;struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm;fe_code_rate_t *cr;u16 tps_val,cr_val;
@@ -458,7 +458,7 @@ static int dib3000mc_get_frontend(structstatic int dib3000mc_set_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters *fep,int tuner) { -struct dib3000_state * state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state * state = fe->demodulator_priv;struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm;int search_state,auto_val;u16 val;
@@ -659,7 +659,7 @@ static int dib3000mc_fe_init(struct dvb_ }static int dib3000mc_read_status (struct dvb_frontend * fe,fe_status_t *stat) { -struct dib3000_state * state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state * state = fe->demodulator_priv;u16 lock =rd (DIB3000MC_REG_LOCKING ); *stat =0 ;
@@ -679,14 +679,14 @@ static int dib3000mc_read_status(structstatic int dib3000mc_read_ber (struct dvb_frontend * fe,u32 *ber) { -struct dib3000_state * state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state * state = fe->demodulator_priv; *ber = ((rd (DIB3000MC_REG_BER_MSB ) <<16 ) |rd (DIB3000MC_REG_BER_LSB ));return 0 ; }static int dib3000mc_read_unc_blocks (struct dvb_frontend * fe,u32 *unc) { -struct dib3000_state * state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state * state = fe->demodulator_priv; *unc =rd (DIB3000MC_REG_PACKET_ERROR_COUNT );return 0 ;
@@ -695,7 +695,7 @@ static int dib3000mc_read_unc_blocks(str/* see dib3000mb.c for calculation comments */ static int dib3000mc_read_signal_strength (struct dvb_frontend * fe,u16 *strength) { -struct dib3000_state * state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state * state = fe->demodulator_priv;u16 val =rd (DIB3000MC_REG_SIGNAL_NOISE_LSB ); *strength = (((val >>6 ) &0xff ) <<8 ) + (val &0x3f );
@@ -706,7 +706,7 @@ static int dib3000mc_read_signal_strengt/* see dib3000mb.c for calculation comments */ static int dib3000mc_read_snr (struct dvb_frontend * fe,u16 *snr) { -struct dib3000_state * state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state * state = fe->demodulator_priv;u16 val =rd (DIB3000MC_REG_SIGNAL_NOISE_LSB ), val2 =rd (DIB3000MC_REG_SIGNAL_NOISE_MSB );u16 sig,noise;
@@ -726,7 +726,7 @@ static int dib3000mc_read_snr(struct dvbstatic int dib3000mc_sleep (struct dvb_frontend * fe) { -struct dib3000_state * state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state * state = fe->demodulator_priv;set_or (DIB3000MC_REG_CLK_CFG_7 ,DIB3000MC_CLK_CFG_7_PWR_DOWN );wr (DIB3000MC_REG_CLK_CFG_1 ,DIB3000MC_CLK_CFG_1_POWER_DOWN );
@@ -756,7 +756,7 @@ static int dib3000mc_set_frontend_and_tustatic void dib3000mc_release (struct dvb_frontend * fe) { -struct dib3000_state *state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state *state = fe->demodulator_priv;kfree (state); }
@@ -771,7 +771,7 @@ static int dib3000mc_pid_control(structstatic int dib3000mc_fifo_control (struct dvb_frontend *fe,int onoff) { -struct dib3000_state *state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state *state = fe->demodulator_priv;u16 tmp =rd (DIB3000MC_REG_SMO_MODE );deb_xfer ("%s fifo\n" ,onoff ?"enabling" :"disabling" );
@@ -803,7 +803,7 @@ static int dib3000mc_pid_parse(struct dvstatic int dib3000mc_tuner_pass_ctrl (struct dvb_frontend *fe,int onoff,u8 pll_addr) { -struct dib3000_state *state = (struct dib3000_state *) fe->demodulator_priv; +struct dib3000_state *state = fe->demodulator_priv;if (onoff) {wr (DIB3000MC_REG_TUNER ,DIB3000_TUNER_WRITE_ENABLE (pll_addr)); }else {
@@ -844,7 +844,7 @@ struct dvb_frontend* dib3000mc_attach(cou16 devid;/* allocate memory for the internal state */ - state = (struct dib3000_state *)kmalloc (sizeof (struct dib3000_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct dib3000_state ),GFP_KERNEL );if (state ==NULL ) goto error;memset (state,0 ,sizeof (struct dib3000_state ));
drivers/media/dvb/frontends/dvb_dummy_fe.c +4 -4
@@ -100,7 +100,7 @@ static int dvb_dummy_fe_set_voltage(strustatic void dvb_dummy_fe_release (struct dvb_frontend * fe) { -struct dvb_dummy_fe_state * state = (struct dvb_dummy_fe_state *) fe->demodulator_priv; +struct dvb_dummy_fe_state * state = fe->demodulator_priv;kfree (state); }
@@ -111,7 +111,7 @@ struct dvb_frontend* dvb_dummy_fe_ofdm_astruct dvb_dummy_fe_state * state =NULL ;/* allocate memory for the internal state */ - state = (struct dvb_dummy_fe_state *)kmalloc (sizeof (struct dvb_dummy_fe_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct dvb_dummy_fe_state ),GFP_KERNEL );if (state ==NULL ) goto error;/* setup the state */
@@ -134,7 +134,7 @@ struct dvb_frontend* dvb_dummy_fe_qpsk_astruct dvb_dummy_fe_state * state =NULL ;/* allocate memory for the internal state */ - state = (struct dvb_dummy_fe_state *)kmalloc (sizeof (struct dvb_dummy_fe_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct dvb_dummy_fe_state ),GFP_KERNEL );if (state ==NULL ) goto error;/* setup the state */
@@ -157,7 +157,7 @@ struct dvb_frontend* dvb_dummy_fe_qam_atstruct dvb_dummy_fe_state * state =NULL ;/* allocate memory for the internal state */ - state = (struct dvb_dummy_fe_state *)kmalloc (sizeof (struct dvb_dummy_fe_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct dvb_dummy_fe_state ),GFP_KERNEL );if (state ==NULL ) goto error;/* setup the state */
drivers/media/dvb/frontends/l64781.c +11 -11
@@ -121,7 +121,7 @@ static int reset_and_configure (struct lstatic int apply_frontend_param (struct dvb_frontend * fe,struct dvb_frontend_parameters *param) { -struct l64781_state * state = (struct l64781_state *) fe->demodulator_priv; +struct l64781_state * state = fe->demodulator_priv;/* The coderates for FEC_NONE, FEC_4_5 and FEC_FEC_6_7 are arbitrary */ static const u8 fec_tab[] = {7 ,0 ,1 ,2 ,9 ,3 ,10 ,4 };/* QPSK, QAM_16, QAM_64 */
@@ -234,7 +234,7 @@ static int apply_frontend_param (structstatic int get_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters * param) { -struct l64781_state * state = (struct l64781_state *) fe->demodulator_priv; +struct l64781_state * state = fe->demodulator_priv;int tmp;
@@ -352,7 +352,7 @@ static int get_frontend(struct dvb_frontstatic int l64781_read_status (struct dvb_frontend * fe,fe_status_t * status) { -struct l64781_state * state = (struct l64781_state *) fe->demodulator_priv; +struct l64781_state * state = fe->demodulator_priv;int sync =l64781_readreg (state,0x32 );int gain =l64781_readreg (state,0x0e );
@@ -381,7 +381,7 @@ static int l64781_read_status(struct dvbstatic int l64781_read_ber (struct dvb_frontend * fe,u32 * ber) { -struct l64781_state * state = (struct l64781_state *) fe->demodulator_priv; +struct l64781_state * state = fe->demodulator_priv;/* XXX FIXME: set up counting period (reg 0x26...0x28) */
@@ -393,7 +393,7 @@ static int l64781_read_ber(struct dvb_frstatic int l64781_read_signal_strength (struct dvb_frontend * fe,u16 * signal_strength) { -struct l64781_state * state = (struct l64781_state *) fe->demodulator_priv; +struct l64781_state * state = fe->demodulator_priv;u8 gain =l64781_readreg (state,0x0e ); *signal_strength = (gain <<8 ) | gain;
@@ -403,7 +403,7 @@ static int l64781_read_signal_strength(sstatic int l64781_read_snr (struct dvb_frontend * fe,u16 * snr) { -struct l64781_state * state = (struct l64781_state *) fe->demodulator_priv; +struct l64781_state * state = fe->demodulator_priv;u8 avg_quality =0xff -l64781_readreg (state,0x33 ); *snr = (avg_quality <<8 ) | avg_quality;/* not exact, but...*/
@@ -413,7 +413,7 @@ static int l64781_read_snr(struct dvb_frstatic int l64781_read_ucblocks (struct dvb_frontend * fe,u32 * ucblocks) { -struct l64781_state * state = (struct l64781_state *) fe->demodulator_priv; +struct l64781_state * state = fe->demodulator_priv; *ucblocks =l64781_readreg (state,0x37 ) | (l64781_readreg (state,0x38 ) <<8 );
@@ -423,7 +423,7 @@ static int l64781_read_ucblocks(struct dstatic int l64781_sleep (struct dvb_frontend * fe) { -struct l64781_state * state = (struct l64781_state *) fe->demodulator_priv; +struct l64781_state * state = fe->demodulator_priv;/* Power down */ return l64781_writereg (state,0x3e ,0x5a );
@@ -431,7 +431,7 @@ static int l64781_sleep(struct dvb_frontstatic int l64781_init (struct dvb_frontend * fe) { -struct l64781_state * state = (struct l64781_state *) fe->demodulator_priv; +struct l64781_state * state = fe->demodulator_priv;reset_and_configure (state);
@@ -484,7 +484,7 @@ static int l64781_get_tune_settings(strustatic void l64781_release (struct dvb_frontend * fe) { -struct l64781_state * state = (struct l64781_state *) fe->demodulator_priv; +struct l64781_state * state = fe->demodulator_priv;kfree (state); }
@@ -501,7 +501,7 @@ struct dvb_frontend* l64781_attach(const { .addr = config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 1 } };/* allocate memory for the internal state */ - state = (struct l64781_state *)kmalloc (sizeof (struct l64781_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct l64781_state ),GFP_KERNEL );if (state ==NULL ) goto error;/* setup the state */
drivers/media/dvb/frontends/mt312.c +16 -16
@@ -226,7 +226,7 @@ static int mt312_get_code_rate(struct mtstatic int mt312_initfe (struct dvb_frontend * fe) { -struct mt312_state *state = (struct mt312_state *) fe->demodulator_priv; +struct mt312_state *state = fe->demodulator_priv;int ret;u8 buf[2 ];
@@ -287,7 +287,7 @@ static int mt312_initfe(struct dvb_frontstatic int mt312_send_master_cmd (struct dvb_frontend * fe,struct dvb_diseqc_master_cmd *c) { -struct mt312_state *state = (struct mt312_state *) fe->demodulator_priv; +struct mt312_state *state = fe->demodulator_priv;int ret;u8 diseqc_mode;
@@ -318,7 +318,7 @@ static int mt312_send_master_cmd(structstatic int mt312_send_burst (struct dvb_frontend * fe,const fe_sec_mini_cmd_t c) { -struct mt312_state *state = (struct mt312_state *) fe->demodulator_priv; +struct mt312_state *state = fe->demodulator_priv;const u8 mini_tab[2 ] = {0x02 ,0x03 };int ret;
@@ -340,7 +340,7 @@ static int mt312_send_burst(struct dvb_fstatic int mt312_set_tone (struct dvb_frontend * fe,const fe_sec_tone_mode_t t) { -struct mt312_state *state = (struct mt312_state *) fe->demodulator_priv; +struct mt312_state *state = fe->demodulator_priv;const u8 tone_tab[2 ] = {0x01 ,0x00 };int ret;
@@ -362,7 +362,7 @@ static int mt312_set_tone(struct dvb_frostatic int mt312_set_voltage (struct dvb_frontend * fe,const fe_sec_voltage_t v) { -struct mt312_state *state = (struct mt312_state *) fe->demodulator_priv; +struct mt312_state *state = fe->demodulator_priv;const u8 volt_tab[3 ] = {0x00 ,0x40 ,0x00 };if (v >SEC_VOLTAGE_OFF )
@@ -373,7 +373,7 @@ static int mt312_set_voltage(struct dvb_static int mt312_read_status (struct dvb_frontend * fe,fe_status_t *s) { -struct mt312_state *state = (struct mt312_state *) fe->demodulator_priv; +struct mt312_state *state = fe->demodulator_priv;int ret;u8 status[3 ];
@@ -400,7 +400,7 @@ static int mt312_read_status(struct dvb_static int mt312_read_ber (struct dvb_frontend * fe,u32 *ber) { -struct mt312_state *state = (struct mt312_state *) fe->demodulator_priv; +struct mt312_state *state = fe->demodulator_priv;int ret;u8 buf[3 ];
@@ -414,7 +414,7 @@ static int mt312_read_ber(struct dvb_frostatic int mt312_read_signal_strength (struct dvb_frontend * fe,u16 *signal_strength) { -struct mt312_state *state = (struct mt312_state *) fe->demodulator_priv; +struct mt312_state *state = fe->demodulator_priv;int ret;u8 buf[3 ];u16 agc;
@@ -435,7 +435,7 @@ static int mt312_read_signal_strength(ststatic int mt312_read_snr (struct dvb_frontend * fe,u16 *snr) { -struct mt312_state *state = (struct mt312_state *) fe->demodulator_priv; +struct mt312_state *state = fe->demodulator_priv;int ret;u8 buf[2 ];
@@ -449,7 +449,7 @@ static int mt312_read_snr(struct dvb_frostatic int mt312_read_ucblocks (struct dvb_frontend * fe,u32 *ubc) { -struct mt312_state *state = (struct mt312_state *) fe->demodulator_priv; +struct mt312_state *state = fe->demodulator_priv;int ret;u8 buf[2 ];
@@ -464,7 +464,7 @@ static int mt312_read_ucblocks(struct dvstatic int mt312_set_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters *p) { -struct mt312_state *state = (struct mt312_state *) fe->demodulator_priv; +struct mt312_state *state = fe->demodulator_priv;int ret;u8 buf[5 ], config_val;u16 sr;
@@ -560,7 +560,7 @@ static int mt312_set_frontend(struct dvbstatic int mt312_get_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters *p) { -struct mt312_state *state = (struct mt312_state *) fe->demodulator_priv; +struct mt312_state *state = fe->demodulator_priv;int ret;if ((ret =mt312_get_inversion (state, &p->inversion)) <0 )
@@ -577,7 +577,7 @@ static int mt312_get_frontend(struct dvbstatic int mt312_sleep (struct dvb_frontend * fe) { -struct mt312_state *state = (struct mt312_state *) fe->demodulator_priv; +struct mt312_state *state = fe->demodulator_priv;int ret;u8 config;
@@ -605,7 +605,7 @@ static int mt312_get_tune_settings(strucstatic void mt312_release (struct dvb_frontend * fe) { -struct mt312_state * state = (struct mt312_state *) fe->demodulator_priv; +struct mt312_state * state = fe->demodulator_priv;kfree (state); }
@@ -617,7 +617,7 @@ struct dvb_frontend* vp310_attach(conststruct mt312_state * state =NULL ;/* allocate memory for the internal state */ - state = (struct mt312_state *)kmalloc (sizeof (struct mt312_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct mt312_state ),GFP_KERNEL );if (state ==NULL ) goto error;
@@ -651,7 +651,7 @@ struct dvb_frontend* mt312_attach(conststruct mt312_state * state =NULL ;/* allocate memory for the internal state */ - state = (struct mt312_state *)kmalloc (sizeof (struct mt312_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct mt312_state ),GFP_KERNEL );if (state ==NULL ) goto error;
drivers/media/dvb/frontends/nxt2002.c +10 -10
@@ -241,7 +241,7 @@ static void nxt2002_agc_reset(struct nxtstatic int nxt2002_load_firmware (struct dvb_frontend * fe,const struct firmware *fw) { -struct nxt2002_state * state = (struct nxt2002_state *) fe->demodulator_priv; +struct nxt2002_state * state = fe->demodulator_priv;u8 buf[256 ],written =0 ,chunkpos =0 ;u16 rambase,position,crc =0 ;
@@ -309,7 +309,7 @@ static int nxt2002_load_firmware (structstatic int nxt2002_setup_frontend_parameters (struct dvb_frontend * fe,struct dvb_frontend_parameters *p) { -struct nxt2002_state * state = (struct nxt2002_state *) fe->demodulator_priv; +struct nxt2002_state * state = fe->demodulator_priv;u32 freq =0 ;u16 tunerfreq =0 ;u8 buf[4 ];
@@ -453,7 +453,7 @@ static int nxt2002_setup_frontend_paramestatic int nxt2002_read_status (struct dvb_frontend * fe,fe_status_t * status) { -struct nxt2002_state * state = (struct nxt2002_state *) fe->demodulator_priv; +struct nxt2002_state * state = fe->demodulator_priv;u8 lock;i2c_readbytes (state,0x31 ,&lock,1 );
@@ -470,7 +470,7 @@ static int nxt2002_read_status(struct dvstatic int nxt2002_read_ber (struct dvb_frontend * fe,u32 * ber) { -struct nxt2002_state * state = (struct nxt2002_state *) fe->demodulator_priv; +struct nxt2002_state * state = fe->demodulator_priv;u8 b[3 ];nxt2002_readreg_multibyte (state,0xE6 ,b,3 );
@@ -482,7 +482,7 @@ static int nxt2002_read_ber(struct dvb_fstatic int nxt2002_read_signal_strength (struct dvb_frontend * fe,u16 * strength) { -struct nxt2002_state * state = (struct nxt2002_state *) fe->demodulator_priv; +struct nxt2002_state * state = fe->demodulator_priv;u8 b[2 ];u16 temp =0 ;
@@ -502,7 +502,7 @@ static int nxt2002_read_signal_strength(static int nxt2002_read_snr (struct dvb_frontend * fe,u16 * snr) { -struct nxt2002_state * state = (struct nxt2002_state *) fe->demodulator_priv; +struct nxt2002_state * state = fe->demodulator_priv;u8 b[2 ];u16 temp =0 , temp2;u32 snrdb =0 ;
@@ -536,7 +536,7 @@ static int nxt2002_read_snr(struct dvb_fstatic int nxt2002_read_ucblocks (struct dvb_frontend * fe,u32 * ucblocks) { -struct nxt2002_state * state = (struct nxt2002_state *) fe->demodulator_priv; +struct nxt2002_state * state = fe->demodulator_priv;u8 b[3 ];nxt2002_readreg_multibyte (state,0xE6 ,b,3 );
@@ -552,7 +552,7 @@ static int nxt2002_sleep(struct dvb_fronstatic int nxt2002_init (struct dvb_frontend * fe) { -struct nxt2002_state * state = (struct nxt2002_state *) fe->demodulator_priv; +struct nxt2002_state * state = fe->demodulator_priv;const struct firmware *fw;int ret;u8 buf[2 ];
@@ -624,7 +624,7 @@ static int nxt2002_get_tune_settings(strstatic void nxt2002_release (struct dvb_frontend * fe) { -struct nxt2002_state * state = (struct nxt2002_state *) fe->demodulator_priv; +struct nxt2002_state * state = fe->demodulator_priv;kfree (state); }
@@ -637,7 +637,7 @@ struct dvb_frontend* nxt2002_attach(consu8 buf [] = {0 ,0 ,0 ,0 ,0 };/* allocate memory for the internal state */ - state = (struct nxt2002_state *)kmalloc (sizeof (struct nxt2002_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct nxt2002_state ),GFP_KERNEL );if (state ==NULL ) goto error;/* setup the state */
drivers/media/dvb/frontends/nxt6000.c +9 -9
@@ -176,7 +176,7 @@ static int nxt6000_set_transmission_modestatic void nxt6000_setup (struct dvb_frontend * fe) { -struct nxt6000_state * state = (struct nxt6000_state *) fe->demodulator_priv; +struct nxt6000_state * state = fe->demodulator_priv;nxt6000_writereg (state,RS_COR_SYNC_PARAM ,SYNC_PARAM );nxt6000_writereg (state,BER_CTRL ,/*(1 << 2) | */ (0x01 <<1 ) |0x01 );
@@ -427,7 +427,7 @@ static void nxt6000_dump_status(struct nstatic int nxt6000_read_status (struct dvb_frontend * fe,fe_status_t * status) {u8 core_status; -struct nxt6000_state * state = (struct nxt6000_state *) fe->demodulator_priv; +struct nxt6000_state * state = fe->demodulator_priv; *status =0 ;
@@ -456,7 +456,7 @@ static int nxt6000_read_status(struct dvstatic int nxt6000_init (struct dvb_frontend * fe) { -struct nxt6000_state * state = (struct nxt6000_state *) fe->demodulator_priv; +struct nxt6000_state * state = fe->demodulator_priv;nxt6000_reset (state);nxt6000_setup (fe);
@@ -466,7 +466,7 @@ static int nxt6000_init(struct dvb_frontstatic int nxt6000_set_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters *param) { -struct nxt6000_state * state = (struct nxt6000_state *) fe->demodulator_priv; +struct nxt6000_state * state = fe->demodulator_priv;int result;nxt6000_writereg (state,ENABLE_TUNER_IIC ,0x01 );/* open i2c bus switch */
@@ -487,13 +487,13 @@ static int nxt6000_set_frontend(struct dstatic void nxt6000_release (struct dvb_frontend * fe) { -struct nxt6000_state * state = (struct nxt6000_state *) fe->demodulator_priv; +struct nxt6000_state * state = fe->demodulator_priv;kfree (state); }static int nxt6000_read_snr (struct dvb_frontend * fe,u16 * snr) { -struct nxt6000_state * state = (struct nxt6000_state *) fe->demodulator_priv; +struct nxt6000_state * state = fe->demodulator_priv; *snr =nxt6000_readreg ( state,OFDM_CHC_SNR ) /8 ;
@@ -502,7 +502,7 @@ static int nxt6000_read_snr(struct dvb_fstatic int nxt6000_read_ber (struct dvb_frontend * fe,u32 * ber) { -struct nxt6000_state * state = (struct nxt6000_state *) fe->demodulator_priv; +struct nxt6000_state * state = fe->demodulator_priv;nxt6000_writereg ( state,VIT_COR_INTSTAT ,0x18 );
@@ -516,7 +516,7 @@ static int nxt6000_read_ber(struct dvb_fstatic int nxt6000_read_signal_strength (struct dvb_frontend * fe,u16 * signal_strength) { -struct nxt6000_state * state = (struct nxt6000_state *) fe->demodulator_priv; +struct nxt6000_state * state = fe->demodulator_priv; *signal_strength = (short) (511 - (nxt6000_readreg(state, AGC_GAIN_1) +
@@ -533,7 +533,7 @@ struct dvb_frontend* nxt6000_attach(consstruct nxt6000_state * state =NULL ;/* allocate memory for the internal state */ - state = (struct nxt6000_state *)kmalloc (sizeof (struct nxt6000_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct nxt6000_state ),GFP_KERNEL );if (state ==NULL ) goto error;/* setup the state */
drivers/media/dvb/frontends/or51132.c +7 -7
@@ -102,7 +102,7 @@ static u8 i2c_readbytes (struct or51132_static int or51132_load_firmware (struct dvb_frontend * fe,const struct firmware *fw) { -struct or51132_state * state = (struct or51132_state *) fe->demodulator_priv; +struct or51132_state * state = fe->demodulator_priv;static u8 run_buf[] = {0x7F ,0x01 };static u8 get_ver_buf[] = {0x04 ,0x00 ,0x30 ,0x00 ,0x00 };u8 rec_buf[14 ];
@@ -240,7 +240,7 @@ static int or51132_sleep(struct dvb_fronstatic int or51132_setmode (struct dvb_frontend * fe) { -struct or51132_state * state = (struct or51132_state *) fe->demodulator_priv; +struct or51132_state * state = fe->demodulator_priv;unsigned char cmd_buf[4 ];dprintk ("setmode %d\n" ,(int )state->current_modulation);
@@ -316,7 +316,7 @@ static int or51132_set_parameters(struct {int ret;u8 buf[4 ]; -struct or51132_state * state = (struct or51132_state *) fe->demodulator_priv; +struct or51132_state * state = fe->demodulator_priv;const struct firmware *fw;/* Change only if we are actually changing the modulation */
@@ -391,7 +391,7 @@ static int or51132_set_parameters(structstatic int or51132_read_status (struct dvb_frontend * fe,fe_status_t * status) { -struct or51132_state * state = (struct or51132_state *) fe->demodulator_priv; +struct or51132_state * state = fe->demodulator_priv;unsigned char rec_buf[2 ];unsigned char snd_buf[2 ]; *status =0 ;
@@ -464,7 +464,7 @@ static unsigned int i20Log10(unsigned shstatic int or51132_read_signal_strength (struct dvb_frontend * fe,u16 * strength) { -struct or51132_state * state = (struct or51132_state *) fe->demodulator_priv; +struct or51132_state * state = fe->demodulator_priv;unsigned char rec_buf[2 ];unsigned char snd_buf[2 ];u8 rcvr_stat;
@@ -512,7 +512,7 @@ static int or51132_read_signal_strength(static int or51132_read_snr (struct dvb_frontend * fe,u16 * snr) { -struct or51132_state * state = (struct or51132_state *) fe->demodulator_priv; +struct or51132_state * state = fe->demodulator_priv;unsigned char rec_buf[2 ];unsigned char snd_buf[2 ];u16 snr_equ;
@@ -549,7 +549,7 @@ static int or51132_get_tune_settings(strstatic void or51132_release (struct dvb_frontend * fe) { -struct or51132_state * state = (struct or51132_state *) fe->demodulator_priv; +struct or51132_state * state = fe->demodulator_priv;kfree (state); }
drivers/media/dvb/frontends/sp8870.c +10 -10
@@ -248,7 +248,7 @@ static int sp8870_wake_up(struct sp8870_static int sp8870_set_frontend_parameters (struct dvb_frontend * fe,struct dvb_frontend_parameters *p) { -struct sp8870_state * state = (struct sp8870_state *) fe->demodulator_priv; +struct sp8870_state * state = fe->demodulator_priv;int err;u16 reg0xc05;
@@ -302,7 +302,7 @@ static int sp8870_set_frontend_parameterstatic int sp8870_init (struct dvb_frontend * fe) { -struct sp8870_state * state = (struct sp8870_state *) fe->demodulator_priv; +struct sp8870_state * state = fe->demodulator_priv;const struct firmware *fw =NULL ;sp8870_wake_up (state);
@@ -358,7 +358,7 @@ static int sp8870_init (struct dvb_frontstatic int sp8870_read_status (struct dvb_frontend * fe,fe_status_t * fe_status) { -struct sp8870_state * state = (struct sp8870_state *) fe->demodulator_priv; +struct sp8870_state * state = fe->demodulator_priv;int status;int signal;
@@ -384,7 +384,7 @@ static int sp8870_read_status (struct dvstatic int sp8870_read_ber (struct dvb_frontend * fe,u32 * ber) { -struct sp8870_state * state = (struct sp8870_state *) fe->demodulator_priv; +struct sp8870_state * state = fe->demodulator_priv;int ret;u32 tmp;
@@ -412,7 +412,7 @@ static int sp8870_read_ber (struct dvb_fstatic int sp8870_read_signal_strength (struct dvb_frontend * fe,u16 * signal) { -struct sp8870_state * state = (struct sp8870_state *) fe->demodulator_priv; +struct sp8870_state * state = fe->demodulator_priv;int ret;u16 tmp;
@@ -438,7 +438,7 @@ static int sp8870_read_signal_strength(sstatic int sp8870_read_uncorrected_blocks (struct dvb_frontend * fe,u32 * ublocks) { -struct sp8870_state * state = (struct sp8870_state *) fe->demodulator_priv; +struct sp8870_state * state = fe->demodulator_priv;int ret; *ublocks =0 ;
@@ -467,7 +467,7 @@ static int switches = 0;static int sp8870_set_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters *p) { -struct sp8870_state * state = (struct sp8870_state *) fe->demodulator_priv; +struct sp8870_state * state = fe->demodulator_priv;/* The firmware of the sp8870 sometimes locks up after setting frontend parameters.
@@ -524,7 +524,7 @@ static int sp8870_set_frontend (struct dstatic int sp8870_sleep (struct dvb_frontend * fe) { -struct sp8870_state * state = (struct sp8870_state *) fe->demodulator_priv; +struct sp8870_state * state = fe->demodulator_priv;// tristate TS output and disable interface pins return sp8870_writereg (state,0xC18 ,0x000 );
@@ -540,7 +540,7 @@ static int sp8870_get_tune_settings(strustatic void sp8870_release (struct dvb_frontend * fe) { -struct sp8870_state * state = (struct sp8870_state *) fe->demodulator_priv; +struct sp8870_state * state = fe->demodulator_priv;kfree (state); }
@@ -552,7 +552,7 @@ struct dvb_frontend* sp8870_attach(conststruct sp8870_state * state =NULL ;/* allocate memory for the internal state */ - state = (struct sp8870_state *)kmalloc (sizeof (struct sp8870_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct sp8870_state ),GFP_KERNEL );if (state ==NULL ) goto error;/* setup the state */
drivers/media/dvb/frontends/sp887x.c +11 -11
@@ -135,7 +135,7 @@ static void sp887x_setup_agc (struct sp8*/ static int sp887x_initial_setup (struct dvb_frontend * fe,const struct firmware *fw) { -struct sp887x_state * state = (struct sp887x_state *) fe->demodulator_priv; +struct sp887x_state * state = fe->demodulator_priv;u8 buf [BLOCKSIZE +2 ];int i;int fw_size = fw->size;
@@ -344,7 +344,7 @@ static void sp887x_correct_offsets (strustatic int sp887x_setup_frontend_parameters (struct dvb_frontend * fe,struct dvb_frontend_parameters *p) { -struct sp887x_state * state = (struct sp887x_state *) fe->demodulator_priv; +struct sp887x_state * state = fe->demodulator_priv;int actual_freq, err;u16 val, reg0xc05;
@@ -405,7 +405,7 @@ static int sp887x_setup_frontend_parametstatic int sp887x_read_status (struct dvb_frontend * fe,fe_status_t * status) { -struct sp887x_state * state = (struct sp887x_state *) fe->demodulator_priv; +struct sp887x_state * state = fe->demodulator_priv;u16 snr12 =sp887x_readreg (state,0xf16 );u16 sync0x200 =sp887x_readreg (state,0x200 );u16 sync0xf17 =sp887x_readreg (state,0xf17 );
@@ -439,7 +439,7 @@ static int sp887x_read_status(struct dvbstatic int sp887x_read_ber (struct dvb_frontend * fe,u32 * ber) { -struct sp887x_state * state = (struct sp887x_state *) fe->demodulator_priv; +struct sp887x_state * state = fe->demodulator_priv; *ber = (sp887x_readreg (state,0xc08 ) &0x3f ) | (sp887x_readreg (state,0xc07 ) <<6 );
@@ -453,7 +453,7 @@ static int sp887x_read_ber(struct dvb_frstatic int sp887x_read_signal_strength (struct dvb_frontend * fe,u16 * strength) { -struct sp887x_state * state = (struct sp887x_state *) fe->demodulator_priv; +struct sp887x_state * state = fe->demodulator_priv;u16 snr12 =sp887x_readreg (state,0xf16 );u32 signal =3 * (snr12 <<4 );
@@ -464,7 +464,7 @@ static int sp887x_read_signal_strength(sstatic int sp887x_read_snr (struct dvb_frontend * fe,u16 * snr) { -struct sp887x_state * state = (struct sp887x_state *) fe->demodulator_priv; +struct sp887x_state * state = fe->demodulator_priv;u16 snr12 =sp887x_readreg (state,0xf16 ); *snr = (snr12 <<4 ) | (snr12 >>8 );
@@ -474,7 +474,7 @@ static int sp887x_read_snr(struct dvb_frstatic int sp887x_read_ucblocks (struct dvb_frontend * fe,u32 * ucblocks) { -struct sp887x_state * state = (struct sp887x_state *) fe->demodulator_priv; +struct sp887x_state * state = fe->demodulator_priv; *ucblocks =sp887x_readreg (state,0xc0c );if (*ucblocks ==0xfff )
@@ -485,7 +485,7 @@ static int sp887x_read_ucblocks(struct dstatic int sp887x_sleep (struct dvb_frontend * fe) { -struct sp887x_state * state = (struct sp887x_state *) fe->demodulator_priv; +struct sp887x_state * state = fe->demodulator_priv;/* tristate TS output and disable interface pins */ sp887x_writereg (state,0xc18 ,0x000 );
@@ -495,7 +495,7 @@ static int sp887x_sleep(struct dvb_frontstatic int sp887x_init (struct dvb_frontend * fe) { -struct sp887x_state * state = (struct sp887x_state *) fe->demodulator_priv; +struct sp887x_state * state = fe->demodulator_priv;const struct firmware *fw =NULL ;int ret;
@@ -534,7 +534,7 @@ static int sp887x_get_tune_settings(strustatic void sp887x_release (struct dvb_frontend * fe) { -struct sp887x_state * state = (struct sp887x_state *) fe->demodulator_priv; +struct sp887x_state * state = fe->demodulator_priv;kfree (state); }
@@ -546,7 +546,7 @@ struct dvb_frontend* sp887x_attach(conststruct sp887x_state * state =NULL ;/* allocate memory for the internal state */ - state = (struct sp887x_state *)kmalloc (sizeof (struct sp887x_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct sp887x_state ),GFP_KERNEL );if (state ==NULL ) goto error;/* setup the state */
drivers/media/dvb/frontends/stv0297.c +12 -12
@@ -365,7 +365,7 @@ static int stv0297_set_inversion(structint stv0297_enable_plli2c (struct dvb_frontend *fe) { -struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; +struct stv0297_state *state = fe->demodulator_priv;stv0297_writereg (state,0x87 ,0x78 );stv0297_writereg (state,0x86 ,0xc8 );
@@ -375,7 +375,7 @@ int stv0297_enable_plli2c(struct dvb_frostatic int stv0297_init (struct dvb_frontend *fe) { -struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; +struct stv0297_state *state = fe->demodulator_priv;int i;/* soft reset */
@@ -416,7 +416,7 @@ static int stv0297_init(struct dvb_frontstatic int stv0297_sleep (struct dvb_frontend *fe) { -struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; +struct stv0297_state *state = fe->demodulator_priv;stv0297_writereg_mask (state,0x80 ,1 ,1 );
@@ -425,7 +425,7 @@ static int stv0297_sleep(struct dvb_fronstatic int stv0297_read_status (struct dvb_frontend *fe,fe_status_t * status) { -struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; +struct stv0297_state *state = fe->demodulator_priv;u8 sync =stv0297_readreg (state,0xDF );
@@ -438,7 +438,7 @@ static int stv0297_read_status(struct dvstatic int stv0297_read_ber (struct dvb_frontend *fe,u32 * ber) { -struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; +struct stv0297_state *state = fe->demodulator_priv;u8 BER [3 ];stv0297_writereg (state,0xA0 ,0x80 );// Start Counting bit errors for 4096 Bytes
@@ -453,7 +453,7 @@ static int stv0297_read_ber(struct dvb_fstatic int stv0297_read_signal_strength (struct dvb_frontend *fe,u16 * strength) { -struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; +struct stv0297_state *state = fe->demodulator_priv;u8 STRENGTH [2 ];stv0297_readregs (state,0x41 ,STRENGTH ,2 );
@@ -464,7 +464,7 @@ static int stv0297_read_signal_strength(static int stv0297_read_snr (struct dvb_frontend *fe,u16 * snr) { -struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; +struct stv0297_state *state = fe->demodulator_priv;u8 SNR [2 ];stv0297_readregs (state,0x07 ,SNR ,2 );
@@ -475,7 +475,7 @@ static int stv0297_read_snr(struct dvb_fstatic int stv0297_read_ucblocks (struct dvb_frontend *fe,u32 * ucblocks) { -struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; +struct stv0297_state *state = fe->demodulator_priv; *ucblocks = (stv0297_readreg (state,0xD5 ) <<8 ) |stv0297_readreg (state,0xD4 );
@@ -485,7 +485,7 @@ static int stv0297_read_ucblocks(structstatic int stv0297_set_frontend (struct dvb_frontend *fe,struct dvb_frontend_parameters *p) { -struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; +struct stv0297_state *state = fe->demodulator_priv;int u_threshold;int initial_u;int blind_u;
@@ -689,7 +689,7 @@ timeout:static int stv0297_get_frontend (struct dvb_frontend *fe,struct dvb_frontend_parameters *p) { -struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; +struct stv0297_state *state = fe->demodulator_priv;int reg_00, reg_83; reg_00 =stv0297_readreg (state,0x00 );
@@ -725,7 +725,7 @@ static int stv0297_get_frontend(struct dstatic void stv0297_release (struct dvb_frontend *fe) { -struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; +struct stv0297_state *state = fe->demodulator_priv;kfree (state); }
@@ -737,7 +737,7 @@ struct dvb_frontend *stv0297_attach(consstruct stv0297_state *state =NULL ;/* allocate memory for the internal state */ - state = (struct stv0297_state *)kmalloc (sizeof (struct stv0297_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct stv0297_state ),GFP_KERNEL );if (state ==NULL ) goto error;
drivers/media/dvb/frontends/stv0299.c +18 -18
@@ -94,7 +94,7 @@ static int stv0299_writeregI (struct stvint stv0299_writereg (struct dvb_frontend * fe,u8 reg,u8 data) { -struct stv0299_state * state = (struct stv0299_state *) fe->demodulator_priv; +struct stv0299_state * state = fe->demodulator_priv;return stv0299_writeregI (state, reg, data); }
@@ -219,7 +219,7 @@ static int stv0299_wait_diseqc_idle (strstatic int stv0299_set_symbolrate (struct dvb_frontend * fe,u32 srate) { -struct stv0299_state * state = (struct stv0299_state *) fe->demodulator_priv; +struct stv0299_state * state = fe->demodulator_priv;u64 big = srate;u32 ratio;
@@ -270,7 +270,7 @@ static int stv0299_get_symbolrate (strucstatic int stv0299_send_diseqc_msg (struct dvb_frontend * fe,struct dvb_diseqc_master_cmd *m) { -struct stv0299_state * state = (struct stv0299_state *) fe->demodulator_priv; +struct stv0299_state * state = fe->demodulator_priv;u8 val;int i;
@@ -300,7 +300,7 @@ static int stv0299_send_diseqc_msg (strustatic int stv0299_send_diseqc_burst (struct dvb_frontend * fe,fe_sec_mini_cmd_t burst) { -struct stv0299_state * state = (struct stv0299_state *) fe->demodulator_priv; +struct stv0299_state * state = fe->demodulator_priv;u8 val;dprintk ("%s\n" , __FUNCTION__);
@@ -327,7 +327,7 @@ static int stv0299_send_diseqc_burst (ststatic int stv0299_set_tone (struct dvb_frontend * fe,fe_sec_tone_mode_t tone) { -struct stv0299_state * state = (struct stv0299_state *) fe->demodulator_priv; +struct stv0299_state * state = fe->demodulator_priv;u8 val;if (stv0299_wait_diseqc_idle (state,100 ) <0 )
@@ -349,7 +349,7 @@ static int stv0299_set_tone (struct dvb_static int stv0299_set_voltage (struct dvb_frontend * fe,fe_sec_voltage_t voltage) { -struct stv0299_state * state = (struct stv0299_state *) fe->demodulator_priv; +struct stv0299_state * state = fe->demodulator_priv;u8 reg0x08;u8 reg0x0c;
@@ -471,7 +471,7 @@ static int stv0299_send_legacy_dish_cmdstatic int stv0299_init (struct dvb_frontend * fe) { -struct stv0299_state * state = (struct stv0299_state *) fe->demodulator_priv; +struct stv0299_state * state = fe->demodulator_priv;int i;dprintk ("stv0299: init chip\n" );
@@ -490,7 +490,7 @@ static int stv0299_init (struct dvb_fronstatic int stv0299_read_status (struct dvb_frontend * fe,fe_status_t * status) { -struct stv0299_state * state = (struct stv0299_state *) fe->demodulator_priv; +struct stv0299_state * state = fe->demodulator_priv;u8 signal =0xff -stv0299_readreg (state,0x18 );u8 sync =stv0299_readreg (state,0x1b );
@@ -518,7 +518,7 @@ static int stv0299_read_status(struct dvstatic int stv0299_read_ber (struct dvb_frontend * fe,u32 * ber) { -struct stv0299_state * state = (struct stv0299_state *) fe->demodulator_priv; +struct stv0299_state * state = fe->demodulator_priv;if (state->errmode !=STATUS_BER )return 0 ; *ber = (stv0299_readreg (state,0x1d ) <<8 ) |stv0299_readreg (state,0x1e );
@@ -528,7 +528,7 @@ static int stv0299_read_ber(struct dvb_fstatic int stv0299_read_signal_strength (struct dvb_frontend * fe,u16 * strength) { -struct stv0299_state * state = (struct stv0299_state *) fe->demodulator_priv; +struct stv0299_state * state = fe->demodulator_priv;s32 signal =0xffff - ((stv0299_readreg (state,0x18 ) <<8 ) |stv0299_readreg (state,0x19 ));
@@ -545,7 +545,7 @@ static int stv0299_read_signal_strength(static int stv0299_read_snr (struct dvb_frontend * fe,u16 * snr) { -struct stv0299_state * state = (struct stv0299_state *) fe->demodulator_priv; +struct stv0299_state * state = fe->demodulator_priv;s32 xsnr =0xffff - ((stv0299_readreg (state,0x24 ) <<8 ) |stv0299_readreg (state,0x25 ));
@@ -557,7 +557,7 @@ static int stv0299_read_snr(struct dvb_fstatic int stv0299_read_ucblocks (struct dvb_frontend * fe,u32 * ucblocks) { -struct stv0299_state * state = (struct stv0299_state *) fe->demodulator_priv; +struct stv0299_state * state = fe->demodulator_priv;if (state->errmode !=STATUS_UCBLOCKS ) *ucblocks =0 ;else *ucblocks = (stv0299_readreg (state,0x1d ) <<8 ) |stv0299_readreg (state,0x1e );
@@ -567,7 +567,7 @@ static int stv0299_read_ucblocks(structstatic int stv0299_set_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters * p) { -struct stv0299_state * state = (struct stv0299_state *) fe->demodulator_priv; +struct stv0299_state * state = fe->demodulator_priv;int invval =0 ;dprintk ("%s : FE_SET_FRONTEND\n" , __FUNCTION__);
@@ -635,7 +635,7 @@ static int stv0299_set_frontend(struct dstatic int stv0299_get_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters * p) { -struct stv0299_state * state = (struct stv0299_state *) fe->demodulator_priv; +struct stv0299_state * state = fe->demodulator_priv;s32 derot_freq;int invval;
@@ -660,7 +660,7 @@ static int stv0299_get_frontend(struct dstatic int stv0299_sleep (struct dvb_frontend * fe) { -struct stv0299_state * state = (struct stv0299_state *) fe->demodulator_priv; +struct stv0299_state * state = fe->demodulator_priv;stv0299_writeregI (state,0x02 ,0x80 ); state->initialised =0 ;
@@ -670,7 +670,7 @@ static int stv0299_sleep(struct dvb_fronstatic int stv0299_get_tune_settings (struct dvb_frontend * fe,struct dvb_frontend_tune_settings * fesettings) { -struct stv0299_state * state = (struct stv0299_state *) fe->demodulator_priv; +struct stv0299_state * state = fe->demodulator_priv; fesettings->min_delay_ms = state->config->min_delay_ms;if (fesettings->parameters.u.qpsk.symbol_rate <10000000 ) {
@@ -685,7 +685,7 @@ static int stv0299_get_tune_settings(strstatic void stv0299_release (struct dvb_frontend * fe) { -struct stv0299_state * state = (struct stv0299_state *) fe->demodulator_priv; +struct stv0299_state * state = fe->demodulator_priv;kfree (state); }
@@ -698,7 +698,7 @@ struct dvb_frontend* stv0299_attach(consint id;/* allocate memory for the internal state */ - state = (struct stv0299_state *)kmalloc (sizeof (struct stv0299_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct stv0299_state ),GFP_KERNEL );if (state ==NULL ) goto error;/* setup the state */
drivers/media/dvb/frontends/tda10021.c +11 -11
@@ -205,7 +205,7 @@ static int tda10021_set_symbolrate (strustatic int tda10021_init (struct dvb_frontend *fe) { -struct tda10021_state * state = (struct tda10021_state *) fe->demodulator_priv; +struct tda10021_state * state = fe->demodulator_priv;int i;dprintk ("DVB: TDA10021(%d): init chip\n" , fe->adapter->num);
@@ -238,7 +238,7 @@ static int tda10021_init (struct dvb_frostatic int tda10021_set_parameters (struct dvb_frontend *fe,struct dvb_frontend_parameters *p) { -struct tda10021_state * state = (struct tda10021_state *) fe->demodulator_priv; +struct tda10021_state * state = fe->demodulator_priv;//table for QAM4-QAM256 ready QAM4 QAM16 QAM32 QAM64 QAM128 QAM256 //CONF
@@ -278,7 +278,7 @@ static int tda10021_set_parameters (strustatic int tda10021_read_status (struct dvb_frontend * fe,fe_status_t * status) { -struct tda10021_state * state = (struct tda10021_state *) fe->demodulator_priv; +struct tda10021_state * state = fe->demodulator_priv;int sync; *status =0 ;
@@ -303,7 +303,7 @@ static int tda10021_read_status(struct dstatic int tda10021_read_ber (struct dvb_frontend * fe,u32 * ber) { -struct tda10021_state * state = (struct tda10021_state *) fe->demodulator_priv; +struct tda10021_state * state = fe->demodulator_priv;u32 _ber =tda10021_readreg (state,0x14 ) | (tda10021_readreg(state, 0x15) << 8) |
@@ -315,7 +315,7 @@ static int tda10021_read_ber(struct dvb_static int tda10021_read_signal_strength (struct dvb_frontend * fe,u16 * strength) { -struct tda10021_state * state = (struct tda10021_state *) fe->demodulator_priv; +struct tda10021_state * state = fe->demodulator_priv;u8 gain =tda10021_readreg (state,0x17 ); *strength = (gain <<8 ) | gain;
@@ -325,7 +325,7 @@ static int tda10021_read_signal_strengthstatic int tda10021_read_snr (struct dvb_frontend * fe,u16 * snr) { -struct tda10021_state * state = (struct tda10021_state *) fe->demodulator_priv; +struct tda10021_state * state = fe->demodulator_priv;u8 quality = ~tda10021_readreg (state,0x18 ); *snr = (quality <<8 ) | quality;
@@ -335,7 +335,7 @@ static int tda10021_read_snr(struct dvb_static int tda10021_read_ucblocks (struct dvb_frontend * fe,u32 * ucblocks) { -struct tda10021_state * state = (struct tda10021_state *) fe->demodulator_priv; +struct tda10021_state * state = fe->demodulator_priv; *ucblocks =tda10021_readreg (state,0x13 ) &0x7f ;if (*ucblocks ==0x7f )
@@ -350,7 +350,7 @@ static int tda10021_read_ucblocks(structstatic int tda10021_get_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters *p) { -struct tda10021_state * state = (struct tda10021_state *) fe->demodulator_priv; +struct tda10021_state * state = fe->demodulator_priv;int sync;s8 afc =0 ;
@@ -378,7 +378,7 @@ static int tda10021_get_frontend(structstatic int tda10021_sleep (struct dvb_frontend * fe) { -struct tda10021_state * state = (struct tda10021_state *) fe->demodulator_priv; +struct tda10021_state * state = fe->demodulator_priv;tda10021_writereg (state,0x1b ,0x02 );/* pdown ADC */ tda10021_writereg (state,0x00 ,0x80 );/* standby */
@@ -388,7 +388,7 @@ static int tda10021_sleep(struct dvb_frostatic void tda10021_release (struct dvb_frontend * fe) { -struct tda10021_state * state = (struct tda10021_state *) fe->demodulator_priv; +struct tda10021_state * state = fe->demodulator_priv;kfree (state); }
@@ -401,7 +401,7 @@ struct dvb_frontend* tda10021_attach(construct tda10021_state * state =NULL ;/* allocate memory for the internal state */ - state = (struct tda10021_state *)kmalloc (sizeof (struct tda10021_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct tda10021_state ),GFP_KERNEL );if (state ==NULL ) goto error;/* setup the state */
drivers/media/dvb/frontends/tda8083.c +13 -13
@@ -226,7 +226,7 @@ static int tda8083_send_diseqc_burst (ststatic int tda8083_send_diseqc_msg (struct dvb_frontend * fe,struct dvb_diseqc_master_cmd *m) { -struct tda8083_state * state = (struct tda8083_state *) fe->demodulator_priv; +struct tda8083_state * state = fe->demodulator_priv;int i;tda8083_writereg (state,0x29 , (m->msg_len -3 ) | (1 <<2 ));/* enable */
@@ -243,7 +243,7 @@ static int tda8083_send_diseqc_msg (strustatic int tda8083_read_status (struct dvb_frontend * fe,fe_status_t * status) { -struct tda8083_state * state = (struct tda8083_state *) fe->demodulator_priv; +struct tda8083_state * state = fe->demodulator_priv;u8 signal = ~tda8083_readreg (state,0x01 );u8 sync =tda8083_readreg (state,0x02 );
@@ -270,7 +270,7 @@ static int tda8083_read_status(struct dvstatic int tda8083_read_signal_strength (struct dvb_frontend * fe,u16 * strength) { -struct tda8083_state * state = (struct tda8083_state *) fe->demodulator_priv; +struct tda8083_state * state = fe->demodulator_priv;u8 signal = ~tda8083_readreg (state,0x01 ); *strength = (signal <<8 ) | signal;
@@ -280,7 +280,7 @@ static int tda8083_read_signal_strength(static int tda8083_read_snr (struct dvb_frontend * fe,u16 * snr) { -struct tda8083_state * state = (struct tda8083_state *) fe->demodulator_priv; +struct tda8083_state * state = fe->demodulator_priv;u8 _snr =tda8083_readreg (state,0x08 ); *snr = (_snr <<8 ) | _snr;
@@ -290,7 +290,7 @@ static int tda8083_read_snr(struct dvb_fstatic int tda8083_set_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters *p) { -struct tda8083_state * state = (struct tda8083_state *) fe->demodulator_priv; +struct tda8083_state * state = fe->demodulator_priv; state->config->pll_set (fe, p);tda8083_set_inversion (state, p->inversion);
@@ -305,7 +305,7 @@ static int tda8083_set_frontend(struct dstatic int tda8083_get_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters *p) { -struct tda8083_state * state = (struct tda8083_state *) fe->demodulator_priv; +struct tda8083_state * state = fe->demodulator_priv;/* FIXME: get symbolrate & frequency offset...*/ /*p->frequency = ???;*/
@@ -319,7 +319,7 @@ static int tda8083_get_frontend(struct dstatic int tda8083_sleep (struct dvb_frontend * fe) { -struct tda8083_state * state = (struct tda8083_state *) fe->demodulator_priv; +struct tda8083_state * state = fe->demodulator_priv;tda8083_writereg (state,0x00 ,0x02 );return 0 ;
@@ -327,7 +327,7 @@ static int tda8083_sleep(struct dvb_fronstatic int tda8083_init (struct dvb_frontend * fe) { -struct tda8083_state * state = (struct tda8083_state *) fe->demodulator_priv; +struct tda8083_state * state = fe->demodulator_priv;int i;for (i=0 ; i<44 ; i++)
@@ -343,7 +343,7 @@ static int tda8083_init(struct dvb_frontstatic int tda8083_diseqc_send_burst (struct dvb_frontend * fe,fe_sec_mini_cmd_t burst) { -struct tda8083_state * state = (struct tda8083_state *) fe->demodulator_priv; +struct tda8083_state * state = fe->demodulator_priv;tda8083_send_diseqc_burst (state, burst);tda8083_writereg (state,0x00 ,0x3c );
@@ -354,7 +354,7 @@ static int tda8083_diseqc_send_burst(strstatic int tda8083_diseqc_set_tone (struct dvb_frontend * fe,fe_sec_tone_mode_t tone) { -struct tda8083_state * state = (struct tda8083_state *) fe->demodulator_priv; +struct tda8083_state * state = fe->demodulator_priv;tda8083_set_tone (state, tone);tda8083_writereg (state,0x00 ,0x3c );
@@ -365,7 +365,7 @@ static int tda8083_diseqc_set_tone(strucstatic int tda8083_diseqc_set_voltage (struct dvb_frontend * fe,fe_sec_voltage_t voltage) { -struct tda8083_state * state = (struct tda8083_state *) fe->demodulator_priv; +struct tda8083_state * state = fe->demodulator_priv;tda8083_set_voltage (state, voltage);tda8083_writereg (state,0x00 ,0x3c );
@@ -376,7 +376,7 @@ static int tda8083_diseqc_set_voltage(ststatic void tda8083_release (struct dvb_frontend * fe) { -struct tda8083_state * state = (struct tda8083_state *) fe->demodulator_priv; +struct tda8083_state * state = fe->demodulator_priv;kfree (state); }
@@ -388,7 +388,7 @@ struct dvb_frontend* tda8083_attach(consstruct tda8083_state * state =NULL ;/* allocate memory for the internal state */ - state = (struct tda8083_state *)kmalloc (sizeof (struct tda8083_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct tda8083_state ),GFP_KERNEL );if (state ==NULL ) goto error;/* setup the state */
drivers/media/dvb/frontends/tda80xx.c +17 -17
@@ -400,7 +400,7 @@ static void tda80xx_wait_diseqc_fifo(strstatic int tda8044_init (struct dvb_frontend * fe) { -struct tda80xx_state * state = (struct tda80xx_state *) fe->demodulator_priv; +struct tda80xx_state * state = fe->demodulator_priv;int ret;/*
@@ -432,7 +432,7 @@ static int tda8044_init(struct dvb_frontstatic int tda8083_init (struct dvb_frontend * fe) { -struct tda80xx_state * state = (struct tda80xx_state *) fe->demodulator_priv; +struct tda80xx_state * state = fe->demodulator_priv;tda80xx_write (state,0x00 , tda8083_inittab,sizeof (tda8083_inittab));
@@ -447,7 +447,7 @@ static int tda8083_init(struct dvb_frontstatic int tda80xx_set_voltage (struct dvb_frontend * fe,fe_sec_voltage_t voltage) { -struct tda80xx_state * state = (struct tda80xx_state *) fe->demodulator_priv; +struct tda80xx_state * state = fe->demodulator_priv;switch (voltage) {case SEC_VOLTAGE_13 :
@@ -463,7 +463,7 @@ static int tda80xx_set_voltage(struct dvstatic int tda80xx_set_tone (struct dvb_frontend * fe,fe_sec_tone_mode_t tone) { -struct tda80xx_state * state = (struct tda80xx_state *) fe->demodulator_priv; +struct tda80xx_state * state = fe->demodulator_priv;switch (tone) {case SEC_TONE_OFF :
@@ -477,7 +477,7 @@ static int tda80xx_set_tone(struct dvb_fstatic int tda80xx_send_diseqc_msg (struct dvb_frontend * fe,struct dvb_diseqc_master_cmd *cmd) { -struct tda80xx_state * state = (struct tda80xx_state *) fe->demodulator_priv; +struct tda80xx_state * state = fe->demodulator_priv;if (cmd->msg_len >6 )return -EINVAL ;
@@ -492,7 +492,7 @@ static int tda80xx_send_diseqc_msg(strucstatic int tda80xx_send_diseqc_burst (struct dvb_frontend * fe,fe_sec_mini_cmd_t cmd) { -struct tda80xx_state * state = (struct tda80xx_state *) fe->demodulator_priv; +struct tda80xx_state * state = fe->demodulator_priv;switch (cmd) {case SEC_MINI_A :
@@ -512,7 +512,7 @@ static int tda80xx_send_diseqc_burst(strstatic int tda80xx_sleep (struct dvb_frontend * fe) { -struct tda80xx_state * state = (struct tda80xx_state *) fe->demodulator_priv; +struct tda80xx_state * state = fe->demodulator_priv;tda80xx_writereg (state,0x00 ,0x02 );/* enter standby */
@@ -521,7 +521,7 @@ static int tda80xx_sleep(struct dvb_fronstatic int tda80xx_set_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters *p) { -struct tda80xx_state * state = (struct tda80xx_state *) fe->demodulator_priv; +struct tda80xx_state * state = fe->demodulator_priv;tda80xx_writereg (state,0x1c ,0x80 ); state->config->pll_set (fe, p);
@@ -537,7 +537,7 @@ static int tda80xx_set_frontend(struct dstatic int tda80xx_get_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters *p) { -struct tda80xx_state * state = (struct tda80xx_state *) fe->demodulator_priv; +struct tda80xx_state * state = fe->demodulator_priv;if (!state->config->irq)tda80xx_read_status_int (state);
@@ -550,7 +550,7 @@ static int tda80xx_get_frontend(struct dstatic int tda80xx_read_status (struct dvb_frontend * fe,fe_status_t * status) { -struct tda80xx_state * state = (struct tda80xx_state *) fe->demodulator_priv; +struct tda80xx_state * state = fe->demodulator_priv;if (!state->config->irq)tda80xx_read_status_int (state);
@@ -561,7 +561,7 @@ static int tda80xx_read_status(struct dvstatic int tda80xx_read_ber (struct dvb_frontend * fe,u32 * ber) { -struct tda80xx_state * state = (struct tda80xx_state *) fe->demodulator_priv; +struct tda80xx_state * state = fe->demodulator_priv;int ret;u8 buf[3 ];
@@ -575,7 +575,7 @@ static int tda80xx_read_ber(struct dvb_fstatic int tda80xx_read_signal_strength (struct dvb_frontend * fe,u16 * strength) { -struct tda80xx_state * state = (struct tda80xx_state *) fe->demodulator_priv; +struct tda80xx_state * state = fe->demodulator_priv;u8 gain = ~tda80xx_readreg (state,0x01 ); *strength = (gain <<8 ) | gain;
@@ -585,7 +585,7 @@ static int tda80xx_read_signal_strength(static int tda80xx_read_snr (struct dvb_frontend * fe,u16 * snr) { -struct tda80xx_state * state = (struct tda80xx_state *) fe->demodulator_priv; +struct tda80xx_state * state = fe->demodulator_priv;u8 quality =tda80xx_readreg (state,0x08 ); *snr = (quality <<8 ) | quality;
@@ -595,7 +595,7 @@ static int tda80xx_read_snr(struct dvb_fstatic int tda80xx_read_ucblocks (struct dvb_frontend * fe,u32 * ucblocks) { -struct tda80xx_state * state = (struct tda80xx_state *) fe->demodulator_priv; +struct tda80xx_state * state = fe->demodulator_priv; *ucblocks =tda80xx_readreg (state,0x0f );if (*ucblocks ==0xff )
@@ -606,7 +606,7 @@ static int tda80xx_read_ucblocks(structstatic int tda80xx_init (struct dvb_frontend * fe) { -struct tda80xx_state * state = (struct tda80xx_state *) fe->demodulator_priv; +struct tda80xx_state * state = fe->demodulator_priv;switch (state->id) {case ID_TDA8044 :
@@ -620,7 +620,7 @@ static int tda80xx_init(struct dvb_frontstatic void tda80xx_release (struct dvb_frontend * fe) { -struct tda80xx_state * state = (struct tda80xx_state *) fe->demodulator_priv; +struct tda80xx_state * state = fe->demodulator_priv;if (state->config->irq)free_irq (state->config->irq, &state->worklet);
@@ -637,7 +637,7 @@ struct dvb_frontend* tda80xx_attach(consint ret;/* allocate memory for the internal state */ - state = (struct tda80xx_state *)kmalloc (sizeof (struct tda80xx_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct tda80xx_state ),GFP_KERNEL );if (state ==NULL ) goto error;/* setup the state */
drivers/media/dvb/frontends/ves1820.c +11 -11
@@ -193,7 +193,7 @@ static int ves1820_set_symbolrate(structstatic int ves1820_init (struct dvb_frontend * fe) { -struct ves1820_state * state = (struct ves1820_state *) fe->demodulator_priv; +struct ves1820_state * state = fe->demodulator_priv;int i;int val;
@@ -214,7 +214,7 @@ static int ves1820_init(struct dvb_frontstatic int ves1820_set_parameters (struct dvb_frontend * fe,struct dvb_frontend_parameters *p) { -struct ves1820_state * state = (struct ves1820_state *) fe->demodulator_priv; +struct ves1820_state * state = fe->demodulator_priv;static const u8 reg0x00[] = {0x00 ,0x04 ,0x08 ,0x0c ,0x10 };static const u8 reg0x01[] = {140 ,140 ,106 ,100 ,92 };static const u8 reg0x05[] = {135 ,100 ,70 ,54 ,38 };
@@ -241,7 +241,7 @@ static int ves1820_set_parameters(structstatic int ves1820_read_status (struct dvb_frontend * fe,fe_status_t * status) { -struct ves1820_state * state = (struct ves1820_state *) fe->demodulator_priv; +struct ves1820_state * state = fe->demodulator_priv;int sync; *status =0 ;
@@ -267,7 +267,7 @@ static int ves1820_read_status(struct dvstatic int ves1820_read_ber (struct dvb_frontend * fe,u32 * ber) { -struct ves1820_state * state = (struct ves1820_state *) fe->demodulator_priv; +struct ves1820_state * state = fe->demodulator_priv;u32 _ber =ves1820_readreg (state,0x14 ) | (ves1820_readreg(state, 0x15) << 8) |
@@ -279,7 +279,7 @@ static int ves1820_read_ber(struct dvb_fstatic int ves1820_read_signal_strength (struct dvb_frontend * fe,u16 * strength) { -struct ves1820_state * state = (struct ves1820_state *) fe->demodulator_priv; +struct ves1820_state * state = fe->demodulator_priv;u8 gain =ves1820_readreg (state,0x17 ); *strength = (gain <<8 ) | gain;
@@ -289,7 +289,7 @@ static int ves1820_read_signal_strength(static int ves1820_read_snr (struct dvb_frontend * fe,u16 * snr) { -struct ves1820_state * state = (struct ves1820_state *) fe->demodulator_priv; +struct ves1820_state * state = fe->demodulator_priv;u8 quality = ~ves1820_readreg (state,0x18 ); *snr = (quality <<8 ) | quality;
@@ -299,7 +299,7 @@ static int ves1820_read_snr(struct dvb_fstatic int ves1820_read_ucblocks (struct dvb_frontend * fe,u32 * ucblocks) { -struct ves1820_state * state = (struct ves1820_state *) fe->demodulator_priv; +struct ves1820_state * state = fe->demodulator_priv; *ucblocks =ves1820_readreg (state,0x13 ) &0x7f ;if (*ucblocks ==0x7f )
@@ -314,7 +314,7 @@ static int ves1820_read_ucblocks(structstatic int ves1820_get_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters *p) { -struct ves1820_state * state = (struct ves1820_state *) fe->demodulator_priv; +struct ves1820_state * state = fe->demodulator_priv;int sync;s8 afc =0 ;
@@ -345,7 +345,7 @@ static int ves1820_get_frontend(struct dstatic int ves1820_sleep (struct dvb_frontend * fe) { -struct ves1820_state * state = (struct ves1820_state *) fe->demodulator_priv; +struct ves1820_state * state = fe->demodulator_priv;ves1820_writereg (state,0x1b ,0x02 );/* pdown ADC */ ves1820_writereg (state,0x00 ,0x80 );/* standby */
@@ -364,7 +364,7 @@ static int ves1820_get_tune_settings(strstatic void ves1820_release (struct dvb_frontend * fe) { -struct ves1820_state * state = (struct ves1820_state *) fe->demodulator_priv; +struct ves1820_state * state = fe->demodulator_priv;kfree (state); }
@@ -377,7 +377,7 @@ struct dvb_frontend* ves1820_attach(consstruct ves1820_state * state =NULL ;/* allocate memory for the internal state */ - state = (struct ves1820_state *)kmalloc (sizeof (struct ves1820_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct ves1820_state ),GFP_KERNEL );if (state ==NULL ) goto error;
drivers/media/dvb/frontends/ves1x93.c +12 -12
@@ -263,7 +263,7 @@ static int ves1x93_set_symbolrate (strucstatic int ves1x93_init (struct dvb_frontend * fe) { -struct ves1x93_state * state = (struct ves1x93_state *) fe->demodulator_priv; +struct ves1x93_state * state = fe->demodulator_priv;int i;int val;
@@ -289,7 +289,7 @@ static int ves1x93_init (struct dvb_fronstatic int ves1x93_set_voltage (struct dvb_frontend * fe,fe_sec_voltage_t voltage) { -struct ves1x93_state * state = (struct ves1x93_state *) fe->demodulator_priv; +struct ves1x93_state * state = fe->demodulator_priv;switch (voltage) {case SEC_VOLTAGE_13 :
@@ -305,7 +305,7 @@ static int ves1x93_set_voltage (struct dstatic int ves1x93_read_status (struct dvb_frontend * fe,fe_status_t * status) { -struct ves1x93_state * state = (struct ves1x93_state *) fe->demodulator_priv; +struct ves1x93_state * state = fe->demodulator_priv;u8 sync =ves1x93_readreg (state,0x0e );
@@ -346,7 +346,7 @@ static int ves1x93_read_status(struct dvstatic int ves1x93_read_ber (struct dvb_frontend * fe,u32 * ber) { -struct ves1x93_state * state = (struct ves1x93_state *) fe->demodulator_priv; +struct ves1x93_state * state = fe->demodulator_priv; *ber =ves1x93_readreg (state,0x15 ); *ber |= (ves1x93_readreg (state,0x16 ) <<8 );
@@ -358,7 +358,7 @@ static int ves1x93_read_ber(struct dvb_fstatic int ves1x93_read_signal_strength (struct dvb_frontend * fe,u16 * strength) { -struct ves1x93_state * state = (struct ves1x93_state *) fe->demodulator_priv; +struct ves1x93_state * state = fe->demodulator_priv;u8 signal = ~ves1x93_readreg (state,0x0b ); *strength = (signal <<8 ) | signal;
@@ -368,7 +368,7 @@ static int ves1x93_read_signal_strength(static int ves1x93_read_snr (struct dvb_frontend * fe,u16 * snr) { -struct ves1x93_state * state = (struct ves1x93_state *) fe->demodulator_priv; +struct ves1x93_state * state = fe->demodulator_priv;u8 _snr = ~ves1x93_readreg (state,0x1c ); *snr = (_snr <<8 ) | _snr;
@@ -378,7 +378,7 @@ static int ves1x93_read_snr(struct dvb_fstatic int ves1x93_read_ucblocks (struct dvb_frontend * fe,u32 * ucblocks) { -struct ves1x93_state * state = (struct ves1x93_state *) fe->demodulator_priv; +struct ves1x93_state * state = fe->demodulator_priv; *ucblocks =ves1x93_readreg (state,0x18 ) &0x7f ;
@@ -393,7 +393,7 @@ static int ves1x93_read_ucblocks(structstatic int ves1x93_set_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters *p) { -struct ves1x93_state * state = (struct ves1x93_state *) fe->demodulator_priv; +struct ves1x93_state * state = fe->demodulator_priv;ves1x93_writereg (state,0x00 ,0x11 ); state->config->pll_set (fe, p);
@@ -408,7 +408,7 @@ static int ves1x93_set_frontend(struct dstatic int ves1x93_get_frontend (struct dvb_frontend * fe,struct dvb_frontend_parameters *p) { -struct ves1x93_state * state = (struct ves1x93_state *) fe->demodulator_priv; +struct ves1x93_state * state = fe->demodulator_priv;int afc; afc = ((int )((char )(ves1x93_readreg (state,0x0a ) <<1 )))/2 ;
@@ -431,14 +431,14 @@ static int ves1x93_get_frontend(struct dstatic int ves1x93_sleep (struct dvb_frontend * fe) { -struct ves1x93_state * state = (struct ves1x93_state *) fe->demodulator_priv; +struct ves1x93_state * state = fe->demodulator_priv;return ves1x93_writereg (state,0x00 ,0x08 ); }static void ves1x93_release (struct dvb_frontend * fe) { -struct ves1x93_state * state = (struct ves1x93_state *) fe->demodulator_priv; +struct ves1x93_state * state = fe->demodulator_priv;kfree (state); }
@@ -451,7 +451,7 @@ struct dvb_frontend* ves1x93_attach(consu8 identity;/* allocate memory for the internal state */ - state = (struct ves1x93_state *)kmalloc (sizeof (struct ves1x93_state ),GFP_KERNEL ); + state =kmalloc (sizeof (struct ves1x93_state ),GFP_KERNEL );if (state ==NULL ) goto error;/* setup the state */
--
PATCH 17/37 dib3000: add NULL pointer check
In reply to Johannes Stezenbachprevent NULL pointer related Oopses (Patrick Boettcher)
---
drivers/media/dvb/frontends/dib3000mb.c | 2 +- drivers/media/dvb/frontends/dib3000mc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/media/dvb/frontends/dib3000mb.c +1 -1
@@ -61,7 +61,7 @@ static int dib3000mb_set_frontend(structfe_code_rate_t fe_cr =FEC_NONE ;int search_state, seq; -if (tuner) { +if (tuner && state->config.pll_addr && state->config.pll_set) {dib3000mb_tuner_pass_ctrl (fe,1 ,state->config.pll_addr (fe)); state->config.pll_set (fe, fep,NULL );dib3000mb_tuner_pass_ctrl (fe,0 ,state->config.pll_addr (fe));
drivers/media/dvb/frontends/dib3000mc.c +1 -1
@@ -463,7 +463,7 @@ static int dib3000mc_set_frontend(structint search_state,auto_val;u16 val; -if (tuner) {/* initial call from dvb */ +if (tuner && state->config.pll_addr && state->config.pll_set) {/* initial call from dvb */ dib3000mc_tuner_pass_ctrl (fe,1 ,state->config.pll_addr (fe)); state->config.pll_set (fe,fep,NULL );dib3000mc_tuner_pass_ctrl (fe,0 ,state->config.pll_addr (fe));
--
PATCH 18/37 ves1820: remove unnecessary msleep
In reply to Johannes Stezenbachremove unnecessary msleep(10) in writereg (Tony Glader)
---
drivers/media/dvb/frontends/ves1820.c | 1 - 1 files changed, 1 deletion(-)
drivers/media/dvb/frontends/ves1820.c +0 -1
@@ -70,7 +70,6 @@ static int ves1820_writereg(struct ves18printk ("ves1820: %s(): writereg error (reg == 0x%02x," "val == 0x%02x, ret == %i)\n" , __FUNCTION__, reg, data, ret); -msleep (10 );return (ret !=1 ) ? -EREMOTEIO :0 ; }
--
PATCH 19/37 mt352: embed struct mt352_config in mt352_state
In reply to Johannes Stezenbachcopying the mt352_config-struct to mt352_state instead of storing just the pointer to it (Patrick Boettcher)
---
drivers/media/dvb/frontends/mt352.c | 28 ++++++++++++++-------------- 1 files changed, 14 insertions(+), 14 deletions(-)
drivers/media/dvb/frontends/mt352.c +14 -14
@@ -46,7 +46,7 @@ struct mt352_state {struct dvb_frontend_ops ops;/* configuration settings */ -const struct mt352_config * config; +struct mt352_config config; };static int debug;
@@ -59,7 +59,7 @@ static int mt352_single_write(struct dvb {struct mt352_state * state = fe->demodulator_priv;u8 buf[2 ] = { reg, val }; -struct i2c_msg msg = { .addr = state->config->demod_address, .flags =0 , +struct i2c_msg msg = { .addr = state->config.demod_address, .flags =0 , .buf = buf, .len =2 };int err =i2c_transfer (state->i2c, &msg,1 );if (err !=1 ) {
@@ -84,10 +84,10 @@ static int mt352_read_register(struct mtint ret;u8 b0 [] = { reg };u8 b1 [] = {0 }; -struct i2c_msg msg [] = { { .addr = state->config->demod_address, +struct i2c_msg msg [] = { { .addr = state->config.demod_address, .flags =0 , .buf = b0, .len =1 }, - { .addr = state->config->demod_address, + { .addr = state->config.demod_address, .flags =I2C_M_RD , .buf = b1, .len =1 } };
@@ -134,8 +134,8 @@ static void mt352_calc_nominal_rate(stru bw =8 ;break ; } -if (state->config->adc_clock) - adc_clock = state->config->adc_clock; +if (state->config.adc_clock) + adc_clock = state->config.adc_clock; value =64 * bw * (1 <<16 ) / (7 *8 ); value = value *1000 / adc_clock;
@@ -152,10 +152,10 @@ static void mt352_calc_input_freq(structint if2 =36167 ;/* 36.166667 MHz */ int ife,value; -if (state->config->adc_clock) - adc_clock = state->config->adc_clock; -if (state->config->if2) - if2 = state->config->if2; +if (state->config.adc_clock) + adc_clock = state->config.adc_clock; +if (state->config.if2) + if2 = state->config.if2; ife = (2 *adc_clock - if2); value =-16374 * ife / adc_clock;
@@ -289,10 +289,10 @@ static int mt352_set_parameters(struct dmt352_calc_nominal_rate (state, op->bandwidth, buf+4 );mt352_calc_input_freq (state, buf+6 ); - state->config->pll_set (fe, param, buf+8 ); + state->config.pll_set (fe, param, buf+8 );mt352_write (fe, buf,sizeof (buf)); -if (state->config->no_tuner) { +if (state->config.no_tuner) {/* start decoding */ mt352_write (fe, fsm_go,2 ); }else {
@@ -516,7 +516,7 @@ static int mt352_init(struct dvb_fronten/* Do a "hard" reset */ mt352_write (fe, mt352_reset_attach,sizeof (mt352_reset_attach)); -return state->config->demod_init (fe); +return state->config.demod_init (fe); }return 0 ;
@@ -541,8 +541,8 @@ struct dvb_frontend* mt352_attach(constmemset (state,0 ,sizeof (*state));/* setup the state */ - state->config = config; state->i2c = i2c; +memcpy (&state->config,config,sizeof (struct mt352_config ));memcpy (&state->ops, &mt352_ops,sizeof (struct dvb_frontend_ops ));/* check if the demod is there */
--
PATCH 20/37 tda1004x: dont use bitfields
In reply to Johannes Stezenbachuse simple u8 instead of bitfields (Andreas Oberritter)
---
drivers/media/dvb/frontends/tda1004x.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/media/dvb/frontends/tda1004x.h +2 -2
@@ -32,10 +32,10 @@ struct tda1004x_configu8 demod_address;/* does the "inversion" need inverted? */ - u8 invert:1; +u8 invert;/* Does the OCLK signal need inverted? */ - u8 invert_oclk:1; +u8 invert_oclk;/* PLL maintenance */ int (*pll_init)(struct dvb_frontend * fe);
--
PATCH 21/37 tda1004x: allow N_I2C to be overridden by the card driver
In reply to Johannes Stezenbachallow N_I2C to be overridden by the card driver (Andreas Oberritter)
---
drivers/media/dvb/frontends/tda1004x.c | 4 ++-- drivers/media/dvb/frontends/tda1004x.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/media/dvb/frontends/tda1004x.c +2 -2
@@ -406,7 +406,7 @@ static int tda10046_fwupload(struct dvb_/* set parameters */ tda1004x_write_byteI (state,TDA10046H_CONFPLL2 ,10 ); -tda1004x_write_byteI (state,TDA10046H_CONFPLL3 ,0 ); +tda1004x_write_byteI (state,TDA10046H_CONFPLL3 , state->config->n_i2c);tda1004x_write_byteI (state,TDA10046H_FREQ_OFFSET ,99 );tda1004x_write_byteI (state,TDA10046H_FREQ_PHY2_MSB ,0xd4 );tda1004x_write_byteI (state,TDA10046H_FREQ_PHY2_LSB ,0x2c );
@@ -547,7 +547,7 @@ static int tda10046_init(struct dvb_frontda1004x_write_mask (state,TDA1004X_AUTO ,8 ,0 );// select HP stream tda1004x_write_mask (state,TDA1004X_CONFC1 ,0x80 ,0 );// disable pulse killer tda1004x_write_byteI (state,TDA10046H_CONFPLL2 ,10 );// PLL M = 10 -tda1004x_write_byteI (state,TDA10046H_CONFPLL3 ,0 );// PLL P = N = 0 +tda1004x_write_byteI (state,TDA10046H_CONFPLL3 , state->config->n_i2c);// PLL P = N = 0 tda1004x_write_byteI (state,TDA10046H_FREQ_OFFSET ,99 );// FREQOFFS = 99 tda1004x_write_byteI (state,TDA10046H_FREQ_PHY2_MSB ,0xd4 );// } PHY2 = -11221 tda1004x_write_byteI (state,TDA10046H_FREQ_PHY2_LSB ,0x2c );// }
drivers/media/dvb/frontends/tda1004x.h +3 -0
@@ -37,6 +37,9 @@ struct tda1004x_config/* Does the OCLK signal need inverted? */ u8 invert_oclk; +/* value of N_I2C of the CONF_PLL3 register */ +u8 n_i2c; +/* PLL maintenance */ int (*pll_init)(struct dvb_frontend * fe);int (*pll_set)(struct dvb_frontend * fe,struct dvb_frontend_parameters * params);
--
PATCH 22/37 tda10046: support for different firmware versions
In reply to Johannes Stezenbachadded support for different tda10046 firmware versions. tested with v20, v21 and v25. (Andreas Oberritter)
---
Documentation/dvb/get_dvb_firmware | 4 +-- drivers/media/dvb/frontends/tda1004x.c | 36 +++++++++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 4 deletions(-)
drivers/media/dvb/frontends/tda1004x.c +34 -2
@@ -49,6 +49,7 @@ struct tda1004x_state {/* private demod data */ u8 initialised;enum tda1004x_demod demod_type; +u8 fw_version; };
@@ -380,6 +381,25 @@ static int tda10045_fwupload(struct dvb_return tda1004x_check_upload_ok (state,0x2c ); } +static int tda10046_get_fw_version (struct tda1004x_state *state, +const struct firmware *fw) +{ +const unsigned char pattern[] = {0x67 ,0x00 ,0x50 ,0x62 ,0x5e ,0x18 ,0x67 }; +unsigned int i; + +/* area guessed from firmware v20, v21 and v25 */ +for (i =0x660 ; i <0x700 ; i++) { +if (!memcmp (&fw->data[i], pattern,sizeof (pattern))) { + state->fw_version = fw->data[i +sizeof (pattern)]; +printk (KERN_INFO "tda1004x: using firmware v%02x\n" , + state->fw_version); +return 0 ; + } + } + +return -EINVAL ; +} +static int tda10046_fwupload (struct dvb_frontend * fe) {struct tda1004x_state * state = fe->demodulator_priv;
@@ -393,7 +413,7 @@ static int tda10046_fwupload(struct dvb_msleep (100 );/* don't re-upload unless necessary */ -if (tda1004x_check_upload_ok (state,0x20 ) ==0 ) +if (tda1004x_check_upload_ok (state, state->fw_version) ==0 )return 0 ;/* request the firmware, this will block until someone uploads it */
@@ -404,6 +424,17 @@ static int tda10046_fwupload(struct dvb_return ret; } +if (fw->size <24478 ) {/* size of firmware v20, which is the smallest of v20, v21 and v25 */ +printk ("tda1004x: firmware file seems to be too small (%d bytes)\n" , fw->size); +return -EINVAL ; + } + + ret =tda10046_get_fw_version (state, fw); +if (ret <0 ) { +printk ("tda1004x: unable to find firmware version\n" ); +return ret; + } +/* set parameters */ tda1004x_write_byteI (state,TDA10046H_CONFPLL2 ,10 );tda1004x_write_byteI (state,TDA10046H_CONFPLL3 , state->config->n_i2c);
@@ -427,7 +458,7 @@ static int tda10046_fwupload(struct dvb_msleep (1 ); } -return tda1004x_check_upload_ok (state,0x20 ); +return tda1004x_check_upload_ok (state, state->fw_version); }static int tda1004x_encode_fec (int fec)
@@ -1185,6 +1216,7 @@ struct dvb_frontend* tda10046_attach(conmemcpy (&state->ops, &tda10046_ops,sizeof (struct dvb_frontend_ops )); state->initialised =0 ; state->demod_type =TDA1004X_DEMOD_TDA10046 ; + state->fw_version =0x20 ;/* dummy default value */ /* check if the demod is there */ if (tda1004x_read_byte (state,TDA1004X_CHIPID ) !=0x46 ) {
Documentation/dvb/get_dvb_firmware +2 -2
@@ -107,7 +107,7 @@ sub tda10045 { sub tda10046 { my $sourcefile = "tt_budget_217g.zip"; my $url = "http://www.technotrend.de/new/217g/$sourcefile"; - my $hash = "a25b579e37109af60f4a36c37893957c"; + my $hash = "6a7e1e2f2644b162ff0502367553c72d"; my $outfile = "dvb-fe-tda10046.fw"; my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1);
@@ -115,7 +115,7 @@ sub tda10046 { wgetfile($sourcefile, $url); unzip($sourcefile, $tmpdir); - extract("$tmpdir/software/OEM/PCI/App/ttlcdacc.dll", 0x3f731, 24479, "$tmpdir/fwtmp"); + extract("$tmpdir/software/OEM/PCI/App/ttlcdacc.dll", 0x3f731, 24478, "$tmpdir/fwtmp"); verify("$tmpdir/fwtmp", $hash); copy("$tmpdir/fwtmp", $outfile);
--
PATCH 23/37 dvb-pll.h: prevent multiple inclusion
In reply to Johannes Stezenbachadded missing #ifndef and #define to inhibit multiple inclusions (Patrick Boettcher)
---
drivers/media/dvb/frontends/dvb-pll.h | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-)
drivers/media/dvb/frontends/dvb-pll.h +4 -6
@@ -2,6 +2,9 @@* $Id: dvb-pll.h,v 1.2 2005/02/10 11:43:41 kraxel Exp $ */ +#ifndef __DVB_PLL_H__ +#define __DVB_PLL_H__ + struct dvb_pll_desc { char *name; u32 min;
@@ -26,9 +29,4 @@ extern struct dvb_pll_desc dvb_pll_unknoint dvb_pll_configure (struct dvb_pll_desc *desc,u8 *buf,u32 freq,int bandwidth); -/* -* Local variables: -* c-basic-offset: 8 -* compile-command: "make DVB=1" -* End: -*/ +#endif
--
PATCH 24/37 make needlessly global code static or drop it
In reply to Johannes Stezenbach- make needlessly global code static
- #if 0 the following unused global functions:
- ttpci/av7110_hw.c: av7110_reset_arm
- ttpci/av7110_hw.c: av7110_send_ci_cmd
- frontends/mt352.[ch]: drop mt352_read
---
drivers/media/dvb/frontends/mt352.c | 12 ------------ drivers/media/dvb/frontends/mt352.h | 1 - drivers/media/dvb/ttpci/av7110.h | 1 - drivers/media/dvb/ttpci/av7110_hw.c | 12 +++++++----- drivers/media/dvb/ttpci/av7110_hw.h | 5 ----- drivers/media/dvb/ttpci/av7110_v4l.c | 2 +- drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 2 +- drivers/media/dvb/ttusb-dec/ttusb_dec.c | 8 ++++---- 8 files changed, 13 insertions(+), 30 deletions(-)
drivers/media/dvb/frontends/mt352.c +0 -12
@@ -102,11 +102,6 @@ static int mt352_read_register(struct mtreturn b1[0 ]; } -int mt352_read (struct dvb_frontend *fe,u8 reg) -{ -return mt352_read_register (fe->demodulator_priv,reg); -} -static int mt352_sleep (struct dvb_frontend * fe) {static u8 mt352_softdown[] = {CLOCK_CTL ,0x20 ,0x08 };
@@ -601,10 +596,3 @@ MODULE_LICENSE("GPL");EXPORT_SYMBOL (mt352_attach);EXPORT_SYMBOL (mt352_write); -EXPORT_SYMBOL (mt352_read); -/* -* Local variables: -* c-basic-offset: 8 -* compile-command: "make DVB=1" -* End: -*/
drivers/media/dvb/frontends/mt352.h +0 -1
@@ -61,7 +61,6 @@ extern struct dvb_frontend* mt352_attach struct i2c_adapter* i2c);extern int mt352_write (struct dvb_frontend * fe,u8 * ibuf,int ilen); -extern int mt352_read (struct dvb_frontend *fe,u8 reg);#endif // MT352_H
drivers/media/dvb/ttpci/av7110.h +0 -1
@@ -274,7 +274,6 @@ extern void av7110_ir_exit (void);extern int i2c_writereg (struct av7110 *av7110,u8 id,u8 reg,u8 val);extern u8 i2c_readreg (struct av7110 *av7110,u8 id,u8 reg);extern int msp_writereg (struct av7110 *av7110,u8 dev,u16 reg,u16 val); -extern int msp_readreg (struct av7110 *av7110,u8 dev,u16 reg,u16 *val);extern int av7110_init_analog_module (struct av7110 *av7110);
drivers/media/dvb/ttpci/av7110_hw.c +7 -5
@@ -104,7 +104,7 @@ u32 av7110_debiread(struct av7110 *av711/* av7110 ARM core boot stuff */ - +#if 0 void av7110_reset_arm (struct av7110 *av7110) {saa7146_setgpio (av7110->dev,RESET_LINE ,SAA7146_GPIO_OUTLO );
@@ -124,7 +124,7 @@ void av7110_reset_arm(struct av7110 *av7 av7110->arm_ready =1 ; dprintk(1, "reset ARM\n"); } - +#endif /* 0 */ static int waitdebi (struct av7110 *av7110,int adr,int state) {
@@ -335,7 +335,7 @@ int av7110_wait_msgstate(struct av7110 *return 0 ; } -int __av7110_send_fw_cmd (struct av7110 *av7110,u16 * buf,int length) +static int __av7110_send_fw_cmd (struct av7110 *av7110,u16 * buf,int length) {int i;unsigned long start;
@@ -455,7 +455,7 @@ int __av7110_send_fw_cmd(struct av7110 *return 0 ; } -int av7110_send_fw_cmd (struct av7110 *av7110,u16 * buf,int length) +static int av7110_send_fw_cmd (struct av7110 *av7110,u16 * buf,int length) {int ret;
@@ -500,6 +500,7 @@ int av7110_fw_cmd(struct av7110 *av7110,return ret; } +#if 0 int av7110_send_ci_cmd (struct av7110 *av7110,u8 subcom,u8 *buf,u8 len) {int i, ret;
@@ -521,6 +522,7 @@ int av7110_send_ci_cmd(struct av7110 *avprintk (KERN_ERR "dvb-ttpci: av7110_send_ci_cmd error %d\n" , ret); return ret; } +#endif /* 0 */ int av7110_fw_request (struct av7110 *av7110,u16 *request_buf,int request_buf_len,u16 *reply_buf,int reply_buf_len)
@@ -593,7 +595,7 @@ int av7110_fw_request(struct av7110 *av7return 0 ; } -int av7110_fw_query (struct av7110 *av7110,u16 tag,u16 * buf,s16 length) +static int av7110_fw_query (struct av7110 *av7110,u16 tag,u16 * buf,s16 length) {int ret; ret =av7110_fw_request (av7110, &tag,0 , buf, length);
drivers/media/dvb/ttpci/av7110_hw.h +0 -5
@@ -364,7 +364,6 @@ enum av7110_command_type { -extern void av7110_reset_arm (struct av7110 *av7110);extern int av7110_bootarm (struct av7110 *av7110);extern int av7110_firmversion (struct av7110 *av7110);#define FW_CI_LL_SUPPORT (arm_app) ((arm_app) & 0x80000000)
@@ -373,12 +372,8 @@ extern int av7110_firmversion(struct av7extern int av7110_wait_msgstate (struct av7110 *av7110,u16 flags);extern int av7110_fw_cmd (struct av7110 *av7110,int type,int com,int num, ...); -extern int __av7110_send_fw_cmd (struct av7110 *av7110,u16 * buf,int length); -extern int av7110_send_fw_cmd (struct av7110 *av7110,u16 * buf,int length); -extern int av7110_send_ci_cmd (struct av7110 *av7110,u8 subcom,u8 *buf,u8 len);extern int av7110_fw_request (struct av7110 *av7110,u16 *request_buf,int request_buf_len,u16 *reply_buf,int reply_buf_len); -extern int av7110_fw_query (struct av7110 *av7110,u16 tag,u16 * Buff,s16 length);/* DEBI (saa7146 data extension bus interface) access */
drivers/media/dvb/ttpci/av7110_v4l.c +1 -1
@@ -52,7 +52,7 @@ int msp_writereg(struct av7110 *av7110,return 0 ; } -int msp_readreg (struct av7110 *av7110,u8 dev,u16 reg,u16 *val) +static int msp_readreg (struct av7110 *av7110,u8 dev,u16 reg,u16 *val) {u8 msg1[3 ] = { dev, reg >>8 , reg &0xff };u8 msg2[2 ];
drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c +1 -1
@@ -1065,7 +1065,7 @@ static int alps_tdmb7_pll_set(struct dvbreturn 0 ; } -struct cx22700_config alps_tdmb7_config = { +static struct cx22700_config alps_tdmb7_config = { .demod_address =0x43 , .pll_set = alps_tdmb7_pll_set, };
drivers/media/dvb/ttusb-dec/ttusb_dec.c +4 -4
@@ -1565,15 +1565,15 @@ static void ttusb_dec_exit_filters(struc } } -int fe_send_command (struct dvb_frontend * fe,const u8 command, -int param_length,const u8 params[], -int *result_length,u8 cmd_result[]) +static int fe_send_command (struct dvb_frontend * fe,const u8 command, +int param_length,const u8 params[], +int *result_length,u8 cmd_result[]) {struct ttusb_dec * dec = (struct ttusb_dec *) fe->dvb->priv;return ttusb_dec_send_command (dec, command, param_length, params, result_length, cmd_result); } -struct ttusbdecfe_config fe_config = { +static struct ttusbdecfe_config fe_config = { .send_command = fe_send_command };
--
PATCH 25/37 frontends: misc. minor cleanups
In reply to Johannes Stezenbachmisc. minor cleanups, select FW_LOADER and add a help text to DVB_OR51132
---
drivers/media/dvb/frontends/Kconfig | 22 +++++++++++++--------- drivers/media/dvb/frontends/mt352.h | 6 ------ drivers/media/dvb/frontends/nxt2002.c | 2 -- drivers/media/dvb/frontends/tda80xx.c | 2 +- 4 files changed, 14 insertions(+), 18 deletions(-)
drivers/media/dvb/frontends/Kconfig +13 -9
@@ -12,10 +12,10 @@ config DVB_STV0299 config DVB_CX24110 tristate "Conexant CX24110 based" - depends on DVB_CORE - help + depends on DVB_CORE + help A DVB-S tuner module. Say Y when you want to support this frontend. - + config DVB_TDA8083 tristate "Philips TDA8083 based" depends on DVB_CORE
@@ -127,8 +127,8 @@ comment "DVB-C (cable) frontends" config DVB_ATMEL_AT76C651 tristate "Atmel AT76C651 based" depends on DVB_CORE - help - A DVB-C tuner module. Say Y when you want to support this frontend. + help + A DVB-C tuner module. Say Y when you want to support this frontend. config DVB_VES1820 tristate "VLSI VES1820 based"
@@ -158,10 +158,6 @@ config DVB_NXT2002 help An ATSC 8VSB tuner module. Say Y when you want to support this frontend. -config DVB_OR51132 - tristate "OR51132 based (pcHDTV)" - depends on DVB_CORE - config DVB_OR51211 tristate "or51211 based (pcHDTV HD2000 card)" depends on DVB_CORE
@@ -169,4 +165,12 @@ config DVB_OR51211 help An ATSC 8VSB tuner module. Say Y when you want to support this frontend. +config DVB_OR51132 + tristate "OR51132 based (pcHDTV HD3000 card)" + depends on DVB_CORE + select FW_LOADER + help + An ATSC 8VSB and QAM64/256 tuner module. Say Y when you want + to support this frontend. + endmenu
drivers/media/dvb/frontends/mt352.h +0 -6
@@ -63,9 +63,3 @@ extern struct dvb_frontend* mt352_attachextern int mt352_write (struct dvb_frontend * fe,u8 * ibuf,int ilen);#endif // MT352_H - -/* -* Local variables: -* c-basic-offset: 8 -* End: -*/
drivers/media/dvb/frontends/tda80xx.c +1 -1
@@ -27,7 +27,7 @@#include <linux/spinlock.h> #include <linux/threads.h> #include <linux/interrupt.h> -#include <asm/irq.h> +#include <linux/irq.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/slab.h>
drivers/media/dvb/frontends/nxt2002.c +0 -2
@@ -343,8 +343,6 @@ static int nxt2002_setup_frontend_parame/* reset the agc now that tuning has been completed */ nxt2002_agc_reset (state); - -/* set target power level */ switch (p->u.vsb.modulation) {case QAM_64 :
--
PATCH 26/37 modified dvb_register_adapter() to avoid kmalloc/kfree
In reply to Johannes StezenbachModified dvb_register_adapter() to avoid kmalloc/kfree. Drivers have to embed struct dvb_adapter into their private data struct from now on. (Andreas Oberritter)
---
drivers/media/dvb/b2c2/skystar2.c | 20 +++++++-------- drivers/media/dvb/bt8xx/dvb-bt8xx.c | 20 +++++++-------- drivers/media/dvb/bt8xx/dvb-bt8xx.h | 2 - drivers/media/dvb/cinergyT2/cinergyT2.c | 12 ++++----- drivers/media/dvb/dibusb/dvb-dibusb-dvb.c | 10 +++---- drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c | 4 +-- drivers/media/dvb/dibusb/dvb-dibusb.h | 2 - drivers/media/dvb/dvb-core/dvbdev.c | 9 ------- drivers/media/dvb/dvb-core/dvbdev.h | 2 - drivers/media/dvb/ttpci/av7110.c | 28 +++++++++++----------- drivers/media/dvb/ttpci/av7110.h | 2 - drivers/media/dvb/ttpci/av7110_av.c | 4 +-- drivers/media/dvb/ttpci/av7110_ca.c | 2 - drivers/media/dvb/ttpci/av7110_hw.c | 8 +++--- drivers/media/dvb/ttpci/av7110_v4l.c | 10 +++---- drivers/media/dvb/ttpci/budget-av.c | 12 ++++----- drivers/media/dvb/ttpci/budget-ci.c | 6 ++-- drivers/media/dvb/ttpci/budget-core.c | 12 ++++----- drivers/media/dvb/ttpci/budget-patch.c | 4 +-- drivers/media/dvb/ttpci/budget.c | 4 +-- drivers/media/dvb/ttpci/budget.h | 2 - drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 20 +++++++-------- drivers/media/dvb/ttusb-dec/ttusb_dec.c | 20 +++++++-------- drivers/media/video/video-buf-dvb.c | 12 ++++----- include/media/video-buf-dvb.h | 2 - 25 files changed, 111 insertions(+), 118 deletions(-)
drivers/media/dvb/dvb-core/dvbdev.c +1 -8
@@ -285,9 +285,8 @@ skip: } -int dvb_register_adapter (struct dvb_adapter **padap,const char *name,struct module *module) +int dvb_register_adapter (struct dvb_adapter *adap,const char *name,struct module *module) { -struct dvb_adapter *adap;int num;if (down_interruptible (&dvbdev_register_lock))
@@ -298,11 +297,6 @@ int dvb_register_adapter(struct dvb_adapreturn -ENFILE ; } -if (!(*padap = adap =kmalloc (sizeof (struct dvb_adapter ),GFP_KERNEL ))) { -up (&dvbdev_register_lock); -return -ENOMEM ; - } -memset (adap,0 ,sizeof (struct dvb_adapter ));INIT_LIST_HEAD (&adap->device_list);
@@ -330,7 +324,6 @@ int dvb_unregister_adapter(struct dvb_adreturn -ERESTARTSYS ;list_del (&adap->list_head);up (&dvbdev_register_lock); -kfree (adap);return 0 ; }EXPORT_SYMBOL (dvb_unregister_adapter);
drivers/media/dvb/dvb-core/dvbdev.h +1 -1
@@ -76,7 +76,7 @@ struct dvb_device { }; -extern int dvb_register_adapter (struct dvb_adapter **padap,const char *name,struct module *module); +extern int dvb_register_adapter (struct dvb_adapter *adap,const char *name,struct module *module);extern int dvb_unregister_adapter (struct dvb_adapter *adap); extern int dvb_register_device (struct dvb_adapter *adap,
drivers/media/dvb/b2c2/skystar2.c +10 -10
@@ -97,7 +97,7 @@ struct adapter {u8 mac_addr[8 ];u32 dw_sram_type; -struct dvb_adapter *dvb_adapter; +struct dvb_adapter dvb_adapter;struct dvb_demux demux;struct dmxdev dmxdev;struct dmx_frontend hw_frontend;
@@ -2461,7 +2461,7 @@ static void frontend_init(struct adapter skystar2->pdev->subsystem_vendor, skystar2->pdev->subsystem_device); }else { -if (dvb_register_frontend (skystar2->dvb_adapter, skystar2->fe)) { +if (dvb_register_frontend (&skystar2->dvb_adapter, skystar2->fe)) {printk ("skystar2: Frontend registration failed!\n" );if (skystar2->fe->ops->release) skystar2->fe->ops->release (skystar2->fe);
@@ -2486,17 +2486,17 @@ static int skystar2_probe(struct pci_devif (ret <0 ) goto out; - ret =dvb_register_adapter (&dvb_adapter, skystar2_pci_driver.name, + adapter =pci_get_drvdata (pdev); + dvb_adapter = &adapter->dvb_adapter; + + ret =dvb_register_adapter (dvb_adapter, skystar2_pci_driver.name,THIS_MODULE );if (ret <0 ) {printk ("%s: Error registering DVB adapter\n" , __FUNCTION__); goto err_halt; } - adapter =pci_get_drvdata (pdev); - dvb_adapter->priv = adapter; - adapter->dvb_adapter = dvb_adapter;init_MUTEX (&adapter->i2c_sem);
@@ -2541,7 +2541,7 @@ static int skystar2_probe(struct pci_dev adapter->dmxdev.demux = dmx; adapter->dmxdev.capabilities =0 ; - ret =dvb_dmxdev_init (&adapter->dmxdev, adapter->dvb_adapter); + ret =dvb_dmxdev_init (&adapter->dmxdev, &adapter->dvb_adapter);if (ret <0 ) goto err_dmx_release;
@@ -2559,7 +2559,7 @@ static int skystar2_probe(struct pci_devif (ret <0 ) goto err_remove_mem_frontend; -dvb_net_init (adapter->dvb_adapter, &adapter->dvbnet, &dvbdemux->dmx); +dvb_net_init (&adapter->dvb_adapter, &adapter->dvbnet, &dvbdemux->dmx);frontend_init (adapter); out:
@@ -2576,7 +2576,7 @@ err_dmx_release: err_i2c_del:i2c_del_adapter (&adapter->i2c_adap); err_dvb_unregister: -dvb_unregister_adapter (adapter->dvb_adapter); +dvb_unregister_adapter (&adapter->dvb_adapter); err_halt:driver_halt (pdev); goto out;
@@ -2605,7 +2605,7 @@ static void skystar2_remove(struct pci_dif (adapter->fe !=NULL )dvb_unregister_frontend (adapter->fe); -dvb_unregister_adapter (adapter->dvb_adapter); +dvb_unregister_adapter (&adapter->dvb_adapter);i2c_del_adapter (&adapter->i2c_adap);
drivers/media/dvb/cinergyT2/cinergyT2.c +6 -6
@@ -119,7 +119,7 @@ struct cinergyt2 {struct dvb_demux demux;struct usb_device *udev;struct semaphore sem; -struct dvb_adapter *adapter; +struct dvb_adapter adapter;struct dvb_device *fedev;struct dmxdev dmxdev;struct dvb_net dvbnet;
@@ -813,15 +813,15 @@ static int cinergyt2_probe (struct usb_i cinergyt2->dmxdev.demux = &cinergyt2->demux.dmx; cinergyt2->dmxdev.capabilities =0 ; -if ((err =dvb_dmxdev_init (&cinergyt2->dmxdev, cinergyt2->adapter)) <0 ) { +if ((err =dvb_dmxdev_init (&cinergyt2->dmxdev, &cinergyt2->adapter)) <0 ) {dprintk (1 ,"dvb_dmxdev_init() failed (err = %d)\n" , err); goto bailout; } -if (dvb_net_init (cinergyt2->adapter, &cinergyt2->dvbnet, &cinergyt2->demux.dmx)) +if (dvb_net_init (&cinergyt2->adapter, &cinergyt2->dvbnet, &cinergyt2->demux.dmx))dprintk (1 ,"dvb_net_init() failed!\n" ); -dvb_register_device (cinergyt2->adapter, &cinergyt2->fedev, +dvb_register_device (&cinergyt2->adapter, &cinergyt2->fedev, &cinergyt2_fe_template, cinergyt2,DVB_DEVICE_FRONTEND );
@@ -848,7 +848,7 @@ static int cinergyt2_probe (struct usb_i bailout:dvb_dmxdev_release (&cinergyt2->dmxdev);dvb_dmx_release (&cinergyt2->demux); -dvb_unregister_adapter (cinergyt2->adapter); +dvb_unregister_adapter (&cinergyt2->adapter);cinergyt2_free_stream_urbs (cinergyt2);kfree (cinergyt2);return -ENOMEM ;
@@ -872,7 +872,7 @@ static void cinergyt2_disconnect (structdvb_dmxdev_release (&cinergyt2->dmxdev);dvb_dmx_release (&cinergyt2->demux);dvb_unregister_device (cinergyt2->fedev); -dvb_unregister_adapter (cinergyt2->adapter); +dvb_unregister_adapter (&cinergyt2->adapter);cinergyt2_free_stream_urbs (cinergyt2);up (&cinergyt2->sem);
drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c +2 -2
@@ -183,7 +183,7 @@ int dibusb_fe_init(struct usb_dibusb* di dib->dibdev->name);return -ENODEV ; }else { -if (dvb_register_frontend (dib->adapter, dib->fe)) { +if (dvb_register_frontend (&dib->adapter, dib->fe)) {err ("Frontend registration failed." );if (dib->fe->ops->release) dib->fe->ops->release (dib->fe);
@@ -206,7 +206,7 @@ int dibusb_i2c_init(struct usb_dibusb *d {int ret =0 ; - dib->adapter->priv = dib; + dib->adapter.priv = dib;strncpy (dib->i2c_adap.name,dib->dibdev->name,I2C_NAME_SIZE );#ifdef I2C_ADAP_CLASS_TV_DIGITAL
drivers/media/dvb/dibusb/dvb-dibusb.h +1 -1
@@ -181,7 +181,7 @@ struct usb_dibusb {struct semaphore i2c_sem;/* dvb */ -struct dvb_adapter *adapter; +struct dvb_adapter adapter;struct dmxdev dmxdev;struct dvb_demux demux;struct dvb_net dvb_net;
drivers/media/dvb/dibusb/dvb-dibusb-dvb.c +5 -5
@@ -131,7 +131,7 @@ int dibusb_dvb_init(struct usb_dibusb *ddeb_info ("dvb_register_adapter failed: error %d" , ret); goto err; } - dib->adapter->priv = dib; + dib->adapter.priv = dib;/* i2c is done in dibusb_i2c_init */
@@ -151,18 +151,18 @@ int dibusb_dvb_init(struct usb_dibusb *d dib->dmxdev.filternum = dib->demux.filternum; dib->dmxdev.demux = &dib->demux.dmx; dib->dmxdev.capabilities =0 ; -if ((ret =dvb_dmxdev_init (&dib->dmxdev, dib->adapter)) <0 ) { +if ((ret =dvb_dmxdev_init (&dib->dmxdev, &dib->adapter)) <0 ) {err ("dvb_dmxdev_init failed: error %d" ,ret); goto err_dmx_dev; } -dvb_net_init (dib->adapter, &dib->dvb_net, &dib->demux.dmx); +dvb_net_init (&dib->adapter, &dib->dvb_net, &dib->demux.dmx); goto success; err_dmx_dev:dvb_dmx_release (&dib->demux); err_dmx: -dvb_unregister_adapter (dib->adapter); +dvb_unregister_adapter (&dib->adapter); err:return ret; success:
@@ -179,7 +179,7 @@ int dibusb_dvb_exit(struct usb_dibusb *d dib->demux.dmx.close (&dib->demux.dmx);dvb_dmxdev_release (&dib->dmxdev);dvb_dmx_release (&dib->demux); -dvb_unregister_adapter (dib->adapter); +dvb_unregister_adapter (&dib->adapter); }return 0 ; }
drivers/media/dvb/ttpci/budget.c +2 -2
@@ -468,7 +468,7 @@ static void frontend_init(struct budget budget->dev->pci->subsystem_vendor, budget->dev->pci->subsystem_device); }else { -if (dvb_register_frontend (budget->dvb_adapter, budget->dvb_frontend)) { +if (dvb_register_frontend (&budget->dvb_adapter, budget->dvb_frontend)) {printk ("budget: Frontend registration failed!\n" );if (budget->dvb_frontend->ops->release) budget->dvb_frontend->ops->release (budget->dvb_frontend);
@@ -497,7 +497,7 @@ static int budget_attach (struct saa7146return err; } - budget->dvb_adapter->priv = budget; + budget->dvb_adapter.priv = budget;frontend_init (budget);return 0 ;
drivers/media/dvb/ttpci/av7110_v4l.c +5 -5
@@ -46,7 +46,7 @@ int msp_writereg(struct av7110 *av7110,if (i2c_transfer (&av7110->i2c_adap, &msgs,1 ) !=1 ) {dprintk (1 ,"dvb-ttpci: failed @ card %d, %u = %u\n" , - av7110->dvb_adapter->num, reg, val); + av7110->dvb_adapter.num, reg, val);return -EIO ; }return 0 ;
@@ -63,7 +63,7 @@ static int msp_readreg(struct av7110 *avif (i2c_transfer (&av7110->i2c_adap, &msgs[0 ],2 ) !=2 ) {dprintk (1 ,"dvb-ttpci: failed @ card %d, %u\n" , - av7110->dvb_adapter->num, reg); + av7110->dvb_adapter.num, reg);return -EIO ; } *val = (msg2[0 ] <<8 ) | msg2[1 ];
@@ -552,13 +552,13 @@ int av7110_init_analog_module(struct av7return -ENODEV ;printk ("dvb-ttpci: DVB-C analog module @ card %d detected, initializing MSP3400\n" , - av7110->dvb_adapter->num); + av7110->dvb_adapter.num); av7110->adac_type =DVB_ADAC_MSP ;msleep (100 );// the probing above resets the msp... msp_readreg (av7110,MSP_RD_DSP ,0x001e , &version1);msp_readreg (av7110,MSP_RD_DSP ,0x001f , &version2);dprintk (1 ,"dvb-ttpci: @ card %d MSP3400 version 0x%04x 0x%04x\n" , - av7110->dvb_adapter->num, version1, version2); + av7110->dvb_adapter.num, version1, version2);msp_writereg (av7110,MSP_WR_DSP ,0x0013 ,0x0c00 );msp_writereg (av7110,MSP_WR_DSP ,0x0000 ,0x7f00 );// loudspeaker + headphone msp_writereg (av7110,MSP_WR_DSP ,0x0008 ,0x0220 );// loudspeaker source
@@ -596,7 +596,7 @@ int av7110_init_analog_module(struct av7/* init the saa7113 */ while (*i !=0xff ) {if (i2c_writereg (av7110,0x48 , i[0 ], i[1 ]) !=1 ) { -dprintk (1 ,"saa7113 initialization failed @ card %d" , av7110->dvb_adapter->num); +dprintk (1 ,"saa7113 initialization failed @ card %d" , av7110->dvb_adapter.num);break ; } i +=2 ;
drivers/media/dvb/ttpci/budget-av.c +6 -6
@@ -297,7 +297,7 @@ static int ciintf_init(struct budget_av budget_av->ca.slot_ts_enable = ciintf_slot_ts_enable; budget_av->ca.poll_slot_status = ciintf_poll_slot_status; budget_av->ca.data = budget_av; -if ((result =dvb_ca_en50221_init (budget_av->budget.dvb_adapter, +if ((result =dvb_ca_en50221_init (&budget_av->budget.dvb_adapter, &budget_av->ca,0 ,1 )) !=0 ) {printk ("budget_av: CI interface detected, but initialisation failed.\n" ); goto error;
@@ -767,7 +767,7 @@ static void frontend_init(struct budget_ budget_av->budget.dev->pci->subsystem_device); }else {if (dvb_register_frontend - (budget_av->budget.dvb_adapter, budget_av->budget.dvb_frontend)) { + (&budget_av->budget.dvb_adapter, budget_av->budget.dvb_frontend)) {printk ("budget-av: Frontend registration failed!\n" );if (budget_av->budget.dvb_frontend->ops->release) budget_av->budget.dvb_frontend->ops->release (budget_av->budget.dvb_frontend);
@@ -875,18 +875,18 @@ static int budget_av_attach(struct saa71/* fixme: find some sane values here... */ saa7146_write (dev,PCI_BT_V1 ,0x1c00101f ); - mac = budget_av->budget.dvb_adapter->proposed_mac; + mac = budget_av->budget.dvb_adapter.proposed_mac;if (i2c_readregs (&budget_av->budget.i2c_adap,0xa0 ,0x30 , mac,6 )) {printk ("KNC1-%d: Could not read MAC from KNC1 card\n" , - budget_av->budget.dvb_adapter->num); + budget_av->budget.dvb_adapter.num);memset (mac,0 ,6 ); }else {printk ("KNC1-%d: MAC addr = %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n" , - budget_av->budget.dvb_adapter->num, + budget_av->budget.dvb_adapter.num, mac[0 ], mac[1 ], mac[2 ], mac[3 ], mac[4 ], mac[5 ]); } - budget_av->budget.dvb_adapter->priv = budget_av; + budget_av->budget.dvb_adapter.priv = budget_av;frontend_init (budget_av);if (enable_ci)
drivers/media/dvb/ttpci/budget.h +1 -1
@@ -64,7 +64,7 @@ struct budget {spinlock_t debilock; -struct dvb_adapter *dvb_adapter; +struct dvb_adapter dvb_adapter;struct dvb_frontend *dvb_frontend;void *priv; };
drivers/media/dvb/ttpci/budget-patch.c +2 -2
@@ -453,7 +453,7 @@ static void frontend_init(struct budget_ budget->dev->pci->subsystem_vendor, budget->dev->pci->subsystem_device); }else { -if (dvb_register_frontend (budget->dvb_adapter, budget->dvb_frontend)) { +if (dvb_register_frontend (&budget->dvb_adapter, budget->dvb_frontend)) {printk ("budget-av: Frontend registration failed!\n" );if (budget->dvb_frontend->ops->release) budget->dvb_frontend->ops->release (budget->dvb_frontend);
@@ -702,7 +702,7 @@ static int budget_patch_attach (struct s dev->ext_priv = budget; - budget->dvb_adapter->priv = budget; + budget->dvb_adapter.priv = budget;frontend_init (budget);return 0 ;
drivers/media/dvb/ttpci/av7110.c +14 -14
@@ -130,7 +130,7 @@ static void init_av7110_av(struct av7110 av7110->current_input =0 ;if (i2c_writereg (av7110,0x20 ,0x00 ,0x00 ) ==1 ) {printk ("dvb-ttpci: Crystal audio DAC @ card %d detected\n" , - av7110->dvb_adapter->num); + av7110->dvb_adapter.num); av7110->adac_type =DVB_ADAC_CRYSTAL ;i2c_writereg (av7110,0x20 ,0x01 ,0xd2 );i2c_writereg (av7110,0x20 ,0x02 ,0x49 );
@@ -145,13 +145,13 @@ static void init_av7110_av(struct av7110 }else if (dev->pci->subsystem_vendor ==0x110a ) {printk ("dvb-ttpci: DVB-C w/o analog module @ card %d detected\n" , - av7110->dvb_adapter->num); + av7110->dvb_adapter.num); av7110->adac_type =DVB_ADAC_NONE ; }else { av7110->adac_type = adac;printk ("dvb-ttpci: adac type set to %d @ card %d\n" , - av7110->dvb_adapter->num, av7110->adac_type); + av7110->dvb_adapter.num, av7110->adac_type); }if (av7110->adac_type ==DVB_ADAC_NONE || av7110->adac_type ==DVB_ADAC_MSP ) {
@@ -231,7 +231,7 @@ static int arm_thread(void *data)if (newloops == av7110->arm_loops) {printk (KERN_ERR "dvb-ttpci: ARM crashed @ card %d\n" , - av7110->dvb_adapter->num); + av7110->dvb_adapter.num);arm_error (av7110);av7710_set_video_mode (av7110, vidmode);
@@ -1282,7 +1282,7 @@ static int av7110_register(struct av7110 av7110->dmxdev.demux = &dvbdemux->dmx; av7110->dmxdev.capabilities =0 ; -dvb_dmxdev_init (&av7110->dmxdev, av7110->dvb_adapter); +dvb_dmxdev_init (&av7110->dmxdev, &av7110->dvb_adapter); av7110->hw_frontend.source =DMX_FRONTEND_0 ;
@@ -1307,11 +1307,11 @@ static int av7110_register(struct av7110av7110_ca_register (av7110);#ifdef CONFIG_DVB_AV7110_OSD -dvb_register_device (av7110->dvb_adapter, &av7110->osd_dev, +dvb_register_device (&av7110->dvb_adapter, &av7110->osd_dev, &dvbdev_osd, av7110,DVB_DEVICE_OSD );#endif -dvb_net_init (av7110->dvb_adapter, &av7110->dvb_net, &dvbdemux->dmx); +dvb_net_init (&av7110->dvb_adapter, &av7110->dvb_net, &dvbdemux->dmx);if (budgetpatch) {/* initialize software demux1 without its own frontend
@@ -1334,9 +1334,9 @@ static int av7110_register(struct av7110 av7110->dmxdev1.demux = &dvbdemux1->dmx; av7110->dmxdev1.capabilities =0 ; -dvb_dmxdev_init (&av7110->dmxdev1, av7110->dvb_adapter); +dvb_dmxdev_init (&av7110->dmxdev1, &av7110->dvb_adapter); -dvb_net_init (av7110->dvb_adapter, &av7110->dvb_net1, &dvbdemux1->dmx); +dvb_net_init (&av7110->dvb_adapter, &av7110->dvb_net1, &dvbdemux1->dmx);printk ("dvb-ttpci: additional demux1 for budget-patch registered\n" ); }return 0 ;
@@ -2246,7 +2246,7 @@ static int frontend_init(struct av7110 *FE_FUNC_OVERRIDE (av7110->fe->ops->dishnetwork_send_legacy_command, av7110->fe_dishnetwork_send_legacy_command, av7110_fe_dishnetwork_send_legacy_command);FE_FUNC_OVERRIDE (av7110->fe->ops->set_frontend, av7110->fe_set_frontend, av7110_fe_set_frontend); - ret =dvb_register_frontend (av7110->dvb_adapter, av7110->fe); + ret =dvb_register_frontend (&av7110->dvb_adapter, av7110->fe);if (ret <0 ) {printk ("av7110: Frontend registration failed!\n" );if (av7110->fe->ops->release)
@@ -2460,7 +2460,7 @@ static int av7110_attach(struct saa7146_ goto err_dvb_unregister_adapter_2;ttpci_eeprom_parse_mac (&av7110->i2c_adap, - av7110->dvb_adapter->proposed_mac); + av7110->dvb_adapter.proposed_mac); ret = -ENOMEM ;if (budgetpatch) {
@@ -2631,7 +2631,7 @@ static int av7110_attach(struct saa7146_if (ret <0 ) goto err_av7110_unregister_11; - av7110->dvb_adapter->priv = av7110; + av7110->dvb_adapter.priv = av7110; ret =frontend_init (av7110);if (ret <0 ) goto err_av7110_exit_v4l_12;
@@ -2666,7 +2666,7 @@ err_saa71466_vfree_4: err_i2c_del_3:i2c_del_adapter (&av7110->i2c_adap); err_dvb_unregister_adapter_2: -dvb_unregister_adapter (av7110->dvb_adapter); +dvb_unregister_adapter (&av7110->dvb_adapter); err_put_firmware_1:put_firmware (av7110); err_kfree_0:
@@ -2712,7 +2712,7 @@ static int av7110_detach(struct saa7146_i2c_del_adapter (&av7110->i2c_adap); -dvb_unregister_adapter (av7110->dvb_adapter); +dvb_unregister_adapter (&av7110->dvb_adapter); av7110_num--;
drivers/media/dvb/ttpci/av7110_hw.c +4 -4
@@ -619,7 +619,7 @@ int av7110_firmversion(struct av7110 *avif (av7110_fw_query (av7110, tag, buf,16 )) {printk ("dvb-ttpci: failed to boot firmware @ card %d\n" , - av7110->dvb_adapter->num); + av7110->dvb_adapter.num);return -EIO ; }
@@ -630,16 +630,16 @@ int av7110_firmversion(struct av7110 *av av7110->avtype = (buf[8 ] <<16 ) + buf[9 ];printk ("dvb-ttpci: info @ card %d: firm %08x, rtsl %08x, vid %08x, app %08x\n" , - av7110->dvb_adapter->num, av7110->arm_fw, + av7110->dvb_adapter.num, av7110->arm_fw, av7110->arm_rtsl, av7110->arm_vid, av7110->arm_app);/* print firmware capabilities */ if (FW_CI_LL_SUPPORT (av7110->arm_app))printk ("dvb-ttpci: firmware @ card %d supports CI link layer interface\n" , - av7110->dvb_adapter->num); + av7110->dvb_adapter.num);else printk ("dvb-ttpci: no firmware support for CI link layer interface @ card %d\n" , - av7110->dvb_adapter->num); + av7110->dvb_adapter.num);return 0 ; }
drivers/media/dvb/ttpci/budget-core.c +6 -6
@@ -298,7 +298,7 @@ static int budget_register(struct budget budget->dmxdev.demux = &dvbdemux->dmx; budget->dmxdev.capabilities =0 ; -dvb_dmxdev_init (&budget->dmxdev, budget->dvb_adapter); +dvb_dmxdev_init (&budget->dmxdev, &budget->dvb_adapter); budget->hw_frontend.source =DMX_FRONTEND_0 ;
@@ -316,7 +316,7 @@ static int budget_register(struct budgetif (ret <0 )return ret; -dvb_net_init (budget->dvb_adapter, &budget->dvb_net, &dvbdemux->dmx); +dvb_net_init (&budget->dvb_adapter, &budget->dvb_net, &dvbdemux->dmx);return 0 ; }
@@ -385,11 +385,11 @@ int ttpci_budget_init(struct budget *budstrcpy (budget->i2c_adap.name, budget->card->name);if (i2c_add_adapter (&budget->i2c_adap) <0 ) { -dvb_unregister_adapter (budget->dvb_adapter); +dvb_unregister_adapter (&budget->dvb_adapter);return -ENOMEM ; } -ttpci_eeprom_parse_mac (&budget->i2c_adap, budget->dvb_adapter->proposed_mac); +ttpci_eeprom_parse_mac (&budget->i2c_adap, budget->dvb_adapter.proposed_mac);if (NULL == (budget->grabbing =saa7146_vmalloc_build_pgtable (dev->pci, length, &budget->pt))) {
@@ -417,7 +417,7 @@ err:vfree (budget->grabbing); -dvb_unregister_adapter (budget->dvb_adapter); +dvb_unregister_adapter (&budget->dvb_adapter);return ret; }
@@ -432,7 +432,7 @@ int ttpci_budget_deinit(struct budget *bi2c_del_adapter (&budget->i2c_adap); -dvb_unregister_adapter (budget->dvb_adapter); +dvb_unregister_adapter (&budget->dvb_adapter);tasklet_kill (&budget->vpe_tasklet);
drivers/media/dvb/ttpci/budget-ci.c +3 -3
@@ -395,7 +395,7 @@ static int ciintf_init(struct budget_ci budget_ci->ca.slot_shutdown = ciintf_slot_shutdown; budget_ci->ca.slot_ts_enable = ciintf_slot_ts_enable; budget_ci->ca.data = budget_ci; - if ((result = dvb_ca_en50221_init(budget_ci->budget.dvb_adapter, + if ((result = dvb_ca_en50221_init(&budget_ci->budget.dvb_adapter, &budget_ci->ca, DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE | DVB_CA_EN50221_FLAG_IRQ_FR |
@@ -881,7 +881,7 @@ static void frontend_init(struct budget_ budget_ci->budget.dev->pci->subsystem_device); }else {if (dvb_register_frontend - (budget_ci->budget.dvb_adapter, budget_ci->budget.dvb_frontend)) { + (&budget_ci->budget.dvb_adapter, budget_ci->budget.dvb_frontend)) {printk ("budget-ci: Frontend registration failed!\n" );if (budget_ci->budget.dvb_frontend->ops->release) budget_ci->budget.dvb_frontend->ops->release (budget_ci->budget.dvb_frontend);
@@ -916,7 +916,7 @@ static int budget_ci_attach(struct saa71ciintf_init (budget_ci); - budget_ci->budget.dvb_adapter->priv = budget_ci; + budget_ci->budget.dvb_adapter.priv = budget_ci;frontend_init (budget_ci);return 0 ;
drivers/media/dvb/ttpci/av7110_av.c +2 -2
@@ -1415,10 +1415,10 @@ int av7110_av_register(struct av7110 *av av7110->video_events.overflow =0 ;memset (&av7110->video_size,0 ,sizeof (video_size_t)); -dvb_register_device (av7110->dvb_adapter, &av7110->video_dev, +dvb_register_device (&av7110->dvb_adapter, &av7110->video_dev, &dvbdev_video, av7110,DVB_DEVICE_VIDEO ); -dvb_register_device (av7110->dvb_adapter, &av7110->audio_dev, +dvb_register_device (&av7110->dvb_adapter, &av7110->audio_dev, &dvbdev_audio, av7110,DVB_DEVICE_AUDIO );return 0 ;
drivers/media/dvb/ttpci/av7110.h +1 -1
@@ -220,7 +220,7 @@ struct av7110 {struct audio_mixer mixer; -struct dvb_adapter *dvb_adapter; +struct dvb_adapter dvb_adapter;struct dvb_device *video_dev;struct dvb_device *audio_dev;struct dvb_device *ca_dev;
drivers/media/dvb/ttpci/av7110_ca.c +1 -1
@@ -370,7 +370,7 @@ static struct dvb_device dvbdev_ca = {int av7110_ca_register (struct av7110 *av7110) { -return dvb_register_device (av7110->dvb_adapter, &av7110->ca_dev, +return dvb_register_device (&av7110->dvb_adapter, &av7110->ca_dev, &dvbdev_ca, av7110,DVB_DEVICE_CA ); }
drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c +10 -10
@@ -84,7 +84,7 @@ struct ttusb {struct semaphore semi2c;struct semaphore semusb; -struct dvb_adapter *adapter; +struct dvb_adapter adapter;struct usb_device *dev;struct i2c_adapter i2c_adap;
@@ -1412,7 +1412,7 @@ static void frontend_init(struct ttusb*le16_to_cpu (ttusb->dev->descriptor.idVendor), le16_to_cpu(ttusb->dev->descriptor.idProduct)); }else { -if (dvb_register_frontend (ttusb->adapter, ttusb->fe)) { +if (dvb_register_frontend (&ttusb->adapter, ttusb->fe)) {printk ("dvb-ttusb-budget: Frontend registration failed!\n" );if (ttusb->fe->ops->release) ttusb->fe->ops->release (ttusb->fe);
@@ -1462,7 +1462,7 @@ static int ttusb_probe(struct usb_interfup (&ttusb->semi2c);dvb_register_adapter (&ttusb->adapter,"Technotrend/Hauppauge Nova-USB" ,THIS_MODULE ); - ttusb->adapter->priv = ttusb; + ttusb->adapter.priv = ttusb;/* i2c */ memset (&ttusb->i2c_adap,0 ,sizeof (struct i2c_adapter ));
@@ -1481,7 +1481,7 @@ static int ttusb_probe(struct usb_interf result =i2c_add_adapter (&ttusb->i2c_adap);if (result) { -dvb_unregister_adapter (ttusb->adapter); +dvb_unregister_adapter (&ttusb->adapter);return result; }
@@ -1503,7 +1503,7 @@ static int ttusb_probe(struct usb_interfif ((result =dvb_dmx_init (&ttusb->dvb_demux)) <0 ) {printk ("ttusb_dvb: dvb_dmx_init failed (errno = %d)\n" , result);i2c_del_adapter (&ttusb->i2c_adap); -dvb_unregister_adapter (ttusb->adapter); +dvb_unregister_adapter (&ttusb->adapter);return -ENODEV ; }//FIXME dmxdev (nur WAS?)
@@ -1511,21 +1511,21 @@ static int ttusb_probe(struct usb_interf ttusb->dmxdev.demux = &ttusb->dvb_demux.dmx; ttusb->dmxdev.capabilities =0 ; -if ((result =dvb_dmxdev_init (&ttusb->dmxdev, ttusb->adapter)) <0 ) { +if ((result =dvb_dmxdev_init (&ttusb->dmxdev, &ttusb->adapter)) <0 ) {printk ("ttusb_dvb: dvb_dmxdev_init failed (errno = %d)\n" , result);dvb_dmx_release (&ttusb->dvb_demux);i2c_del_adapter (&ttusb->i2c_adap); -dvb_unregister_adapter (ttusb->adapter); +dvb_unregister_adapter (&ttusb->adapter);return -ENODEV ; } -if (dvb_net_init (ttusb->adapter, &ttusb->dvbnet, &ttusb->dvb_demux.dmx)) { +if (dvb_net_init (&ttusb->adapter, &ttusb->dvbnet, &ttusb->dvb_demux.dmx)) {printk ("ttusb_dvb: dvb_net_init failed!\n" );dvb_dmxdev_release (&ttusb->dmxdev);dvb_dmx_release (&ttusb->dvb_demux);i2c_del_adapter (&ttusb->i2c_adap); -dvb_unregister_adapter (ttusb->adapter); +dvb_unregister_adapter (&ttusb->adapter);return -ENODEV ; }
@@ -1559,7 +1559,7 @@ static void ttusb_disconnect(struct usb_dvb_dmx_release (&ttusb->dvb_demux);if (ttusb->fe !=NULL )dvb_unregister_frontend (ttusb->fe);i2c_del_adapter (&ttusb->i2c_adap); -dvb_unregister_adapter (ttusb->adapter); +dvb_unregister_adapter (&ttusb->adapter);ttusb_free_iso_urbs (ttusb);
drivers/media/dvb/ttusb-dec/ttusb_dec.c +10 -10
@@ -98,7 +98,7 @@ struct ttusb_dec {int can_playback;/* DVB bits */ -struct dvb_adapter *adapter; +struct dvb_adapter adapter;struct dmxdev dmxdev;struct dvb_demux demux;struct dmx_frontend frontend;
@@ -1435,7 +1435,7 @@ static int ttusb_dec_init_dvb(struct ttuprintk ("%s: dvb_dmx_init failed: error %d\n" , __FUNCTION__, result); -dvb_unregister_adapter (dec->adapter); +dvb_unregister_adapter (&dec->adapter);return result; }
@@ -1444,12 +1444,12 @@ static int ttusb_dec_init_dvb(struct ttu dec->dmxdev.demux = &dec->demux.dmx; dec->dmxdev.capabilities =0 ; -if ((result =dvb_dmxdev_init (&dec->dmxdev, dec->adapter)) <0 ) { +if ((result =dvb_dmxdev_init (&dec->dmxdev, &dec->adapter)) <0 ) {printk ("%s: dvb_dmxdev_init failed: error %d\n" , __FUNCTION__, result);dvb_dmx_release (&dec->demux); -dvb_unregister_adapter (dec->adapter); +dvb_unregister_adapter (&dec->adapter);return result; }
@@ -1463,7 +1463,7 @@ static int ttusb_dec_init_dvb(struct ttudvb_dmxdev_release (&dec->dmxdev);dvb_dmx_release (&dec->demux); -dvb_unregister_adapter (dec->adapter); +dvb_unregister_adapter (&dec->adapter);return result; }
@@ -1476,12 +1476,12 @@ static int ttusb_dec_init_dvb(struct ttu dec->demux.dmx.remove_frontend (&dec->demux.dmx, &dec->frontend);dvb_dmxdev_release (&dec->dmxdev);dvb_dmx_release (&dec->demux); -dvb_unregister_adapter (dec->adapter); +dvb_unregister_adapter (&dec->adapter);return result; } -dvb_net_init (dec->adapter, &dec->dvb_net, &dec->demux.dmx); +dvb_net_init (&dec->adapter, &dec->dvb_net, &dec->demux.dmx);return 0 ; }
@@ -1496,7 +1496,7 @@ static void ttusb_dec_exit_dvb(struct ttdvb_dmxdev_release (&dec->dmxdev);dvb_dmx_release (&dec->demux);if (dec->fe)dvb_unregister_frontend (dec->fe); -dvb_unregister_adapter (dec->adapter); +dvb_unregister_adapter (&dec->adapter); }static void ttusb_dec_exit_rc (struct ttusb_dec *dec)
@@ -1620,7 +1620,7 @@ static int ttusb_dec_probe(struct usb_in }ttusb_dec_init_dvb (dec); - dec->adapter->priv = dec; + dec->adapter.priv = dec;switch (le16_to_cpu (id->idProduct)) {case 0x1006 : dec->fe =ttusbdecfe_dvbs_attach (&fe_config);
@@ -1637,7 +1637,7 @@ static int ttusb_dec_probe(struct usb_inle16_to_cpu (dec->udev->descriptor.idVendor), le16_to_cpu(dec->udev->descriptor.idProduct)); }else { -if (dvb_register_frontend (dec->adapter, dec->fe)) { +if (dvb_register_frontend (&dec->adapter, dec->fe)) {printk ("budget-ci: Frontend registration failed!\n" );if (dec->fe->ops->release) dec->fe->ops->release (dec->fe);
drivers/media/dvb/bt8xx/dvb-bt8xx.c +10 -10
@@ -531,7 +531,7 @@ static void frontend_init(struct dvb_bt8 card->bt->dev->subsystem_vendor, card->bt->dev->subsystem_device); }else { -if (dvb_register_frontend (card->dvb_adapter, card->fe)) { +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);
@@ -550,7 +550,7 @@ static int __init dvb_bt8xx_load_card(streturn result; } - card->dvb_adapter->priv = card; + card->dvb_adapter.priv = card; card->bt->adapter = card->i2c_adapter;
@@ -568,7 +568,7 @@ static int __init dvb_bt8xx_load_card(stif ((result =dvb_dmx_init (&card->demux)) <0 ) {printk ("dvb_bt8xx: dvb_dmx_init failed (errno = %d)\n" , result); -dvb_unregister_adapter (card->dvb_adapter); +dvb_unregister_adapter (&card->dvb_adapter);return result; }
@@ -576,11 +576,11 @@ static int __init dvb_bt8xx_load_card(st card->dmxdev.demux = &card->demux.dmx; card->dmxdev.capabilities =0 ; -if ((result =dvb_dmxdev_init (&card->dmxdev, card->dvb_adapter)) <0 ) { +if ((result =dvb_dmxdev_init (&card->dmxdev, &card->dvb_adapter)) <0 ) {printk ("dvb_bt8xx: dvb_dmxdev_init failed (errno = %d)\n" , result);dvb_dmx_release (&card->demux); -dvb_unregister_adapter (card->dvb_adapter); +dvb_unregister_adapter (&card->dvb_adapter);return result; }
@@ -591,7 +591,7 @@ static int __init dvb_bt8xx_load_card(stdvb_dmxdev_release (&card->dmxdev);dvb_dmx_release (&card->demux); -dvb_unregister_adapter (card->dvb_adapter); +dvb_unregister_adapter (&card->dvb_adapter);return result; }
@@ -603,7 +603,7 @@ static int __init dvb_bt8xx_load_card(st card->demux.dmx.remove_frontend (&card->demux.dmx, &card->fe_hw);dvb_dmxdev_release (&card->dmxdev);dvb_dmx_release (&card->demux); -dvb_unregister_adapter (card->dvb_adapter); +dvb_unregister_adapter (&card->dvb_adapter);return result; }
@@ -614,11 +614,11 @@ static int __init dvb_bt8xx_load_card(st card->demux.dmx.remove_frontend (&card->demux.dmx, &card->fe_hw);dvb_dmxdev_release (&card->dmxdev);dvb_dmx_release (&card->demux); -dvb_unregister_adapter (card->dvb_adapter); +dvb_unregister_adapter (&card->dvb_adapter);return result; } -dvb_net_init (card->dvb_adapter, &card->dvbnet, &card->demux.dmx); +dvb_net_init (&card->dvb_adapter, &card->dvbnet, &card->demux.dmx);tasklet_init (&card->bt->tasklet, dvb_bt8xx_task, (unsigned long ) card);
@@ -759,7 +759,7 @@ static int dvb_bt8xx_remove(struct devicdvb_dmxdev_release (&card->dmxdev);dvb_dmx_release (&card->demux);if (card->fe)dvb_unregister_frontend (card->fe); -dvb_unregister_adapter (card->dvb_adapter); +dvb_unregister_adapter (&card->dvb_adapter);kfree (card);
drivers/media/dvb/bt8xx/dvb-bt8xx.h +1 -1
@@ -40,7 +40,7 @@ struct dvb_bt8xx_card {struct semaphore lock;int nfeeds;char card_name[32 ]; -struct dvb_adapter *dvb_adapter; +struct dvb_adapter dvb_adapter;struct bt878 *bt;unsigned int bttv_nr;struct dvb_demux demux;
drivers/media/video/video-buf-dvb.c +6 -6
@@ -149,10 +149,10 @@ int videobuf_dvb_register(struct videobu dvb->name, result); goto fail_adapter; } - dvb->adapter->priv = adapter_priv; + dvb->adapter.priv = adapter_priv;/* register frontend */ - result =dvb_register_frontend (dvb->adapter, dvb->frontend); + result =dvb_register_frontend (&dvb->adapter, dvb->frontend);if (result <0 ) {printk (KERN_WARNING "%s: dvb_register_frontend failed (errno = %d)\n" , dvb->name, result);
@@ -178,7 +178,7 @@ int videobuf_dvb_register(struct videobu dvb->dmxdev.filternum =256 ; dvb->dmxdev.demux = &dvb->demux.dmx; dvb->dmxdev.capabilities =0 ; - result =dvb_dmxdev_init (&dvb->dmxdev, dvb->adapter); + result =dvb_dmxdev_init (&dvb->dmxdev, &dvb->adapter);if (result <0 ) {printk (KERN_WARNING "%s: dvb_dmxdev_init failed (errno = %d)\n" , dvb->name, result);
@@ -209,7 +209,7 @@ int videobuf_dvb_register(struct videobu }/* register network adapter */ -dvb_net_init (dvb->adapter, &dvb->net, &dvb->demux.dmx); +dvb_net_init (&dvb->adapter, &dvb->net, &dvb->demux.dmx);return 0 ; fail_fe_conn:
@@ -223,7 +223,7 @@ fail_dmxdev: fail_dmx:dvb_unregister_frontend (dvb->frontend); fail_frontend: -dvb_unregister_adapter (dvb->adapter); +dvb_unregister_adapter (&dvb->adapter); fail_adapter:return result; }
@@ -236,7 +236,7 @@ void videobuf_dvb_unregister(struct videdvb_dmxdev_release (&dvb->dmxdev);dvb_dmx_release (&dvb->demux);dvb_unregister_frontend (dvb->frontend); -dvb_unregister_adapter (dvb->adapter); +dvb_unregister_adapter (&dvb->adapter); }EXPORT_SYMBOL (videobuf_dvb_register);
include/media/video-buf-dvb.h +1 -1
@@ -16,7 +16,7 @@ struct videobuf_dvb {int nfeeds;/* videobuf_dvb_(un)register manges this */ -struct dvb_adapter *adapter; +struct dvb_adapter adapter;struct dvb_demux demux;struct dmxdev dmxdev;struct dmx_frontend fe_hw;
--
PATCH 27/37 bt8xx: update documentation
In reply to Johannes Stezenbachupdate bt8xx documentation (Uwe Bugla)
---
Documentation/dvb/bt8xx.txt | 29 +++++++++-------------------- 1 files changed, 9 insertions(+), 20 deletions(-)
Documentation/dvb/bt8xx.txt +9 -20
@@ -17,34 +17,23 @@ Because of this, you need to enable "Device drivers" => "Multimedia devices" => "Video For Linux" => "BT848 Video For Linux" +Furthermore you need to enable +"Device drivers" => "Multimedia devices" => "Digital Video Broadcasting Devices" + => "DVB for Linux" "DVB Core Support" "Nebula/Pinnacle PCTV/TwinHan PCI Cards" + 2) Loading Modules ================== In general you need to load the bttv driver, which will handle the gpio and -i2c communication for us. Next you need the common dvb-bt8xx device driver -and one frontend driver. - -The bttv driver will HANG YOUR SYSTEM IF YOU DO NOT SPECIFY THE CORRECT -CARD ID! - -(If you don't get your card running and you suspect that the card id you're -using is wrong, have a look at "bttv-cards.c" for a list of possible card -ids.) - -Pay attention to failures when you load the frontend drivers -(e.g. dmesg, /var/log/messages). +i2c communication for us, plus the common dvb-bt8xx device driver. +The frontends for Nebula (nxt6000), Pinnacle PCTV (cx24110) and +TwinHan (dst) are loaded automatically by the dvb-bt8xx device driver. 3a) Nebula / Pinnacle PCTV -------------------------- - $ modprobe bttv i2c_hw=1 card=0x68 - $ modprobe dvb-bt8xx - -For Nebula cards use the "nxt6000" frontend driver: - $ modprobe nxt6000 - -For Pinnacle PCTV cards use the "cx24110" frontend driver: - $ modprobe cx24110 + $ modprobe bttv (normally bttv is being loaded automatically by kmod) + $ modprobe dvb-bt8xx (or just place dvb-bt8xx in /etc/modules for automatic loading) 3b) TwinHan -----------
--
PATCH 28/37 DST: reorganize Twinhan DST driver to support CI
In reply to Johannes Stezenbach- reorganize Twinhan DST driver to support CI
- add support for more cards
(Manu Abraham)
---
Documentation/dvb/ci.txt | 219 ++++++++ drivers/media/dvb/bt8xx/Kconfig | 3 drivers/media/dvb/bt8xx/Makefile | 4 drivers/media/dvb/bt8xx/bt878.c | 18 drivers/media/dvb/bt8xx/dst.c | 842 ++++++++++++++++++++++----------- drivers/media/dvb/bt8xx/dst.h | 40 - drivers/media/dvb/bt8xx/dst_ca.c | 868 +++++++++++++++++++++++++++++++++++ drivers/media/dvb/bt8xx/dst_ca.h | 58 ++ drivers/media/dvb/bt8xx/dst_common.h | 153 ++++++ drivers/media/dvb/bt8xx/dst_priv.h | 1 drivers/media/dvb/bt8xx/dvb-bt8xx.c | 95 ++- drivers/media/dvb/bt8xx/dvb-bt8xx.h | 2 12 files changed, 1924 insertions(+), 379 deletions(-)
Documentation/dvb/ci.txt new file +219 -0
@@ -0,0 +1,219 @@ +* For the user +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +NOTE: This document describes the usage of the high level CI API as +in accordance to the Linux DVB API. This is a not a documentation for the, +existing low level CI API. +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To utilize the High Level CI capabilities, + +(1*) This point is valid only for the Twinhan/clones + For the Twinhan/Twinhan clones, the dst_ca module handles the CI + hardware handling.This module is loaded automatically if a CI + (Common Interface, that holds the CAM (Conditional Access Module) + is detected. + +(2) one requires a userspace application, ca_zap. This small userland + application is in charge of sending the descrambling related information + to the CAM. + +This application requires the following to function properly as of now. + + (a) Tune to a valid channel, with szap. + eg: $ szap -c channels.conf -r "TMC" -x + + (b) a channels.conf containing a valid PMT PID + + eg: TMC:11996:h:0:27500:278:512:650:321 + + here 278 is a valid PMT PID. the rest of the values are the + same ones that szap uses. + + (c) after running a szap, you have to run ca_zap, for the + descrambler to function, + + eg: $ ca_zap patched_channels.conf "TMC" + + The patched means a patch to apply to scan, such that scan can + generate a channels.conf_with pmt, which has this PMT PID info + (NOTE: szap cannot use this channels.conf with the PMT_PID) + + + (d) Hopeflly Enjoy your favourite subscribed channel as you do with + a FTA card. + +(3) Currently ca_zap, and dst_test, both are meant for demonstration + purposes only, they can become full fledged applications if necessary. + + +* Cards that fall in this category +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +At present the cards that fall in this category are the Twinhan and it's +clones, these cards are available as VVMER, Tomato, Hercules, Orange and +so on. + +* CI modules that are supported +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The CI module support is largely dependant upon the firmware on the cards +Some cards do support almost all of the available CI modules. There is +nothing much that can be done in order to make additional CI modules +working with these cards. + +Modules that have been tested by this driver at present are + +(1) Irdeto 1 and 2 from SCM +(2) Viaccess from SCM +(3) Dragoncam + +* The High level CI API +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* For the programmer +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +With the High Level CI approach any new card with almost any random +architecture can be implemented with this style, the definitions +insidethe switch statement can be easily adapted for any card, thereby +eliminating the need for any additional ioctls. + +The disadvantage is that the driver/hardware has to manage the rest. For +the application programmer it would be as simple as sending/receiving an +array to/from the CI ioctls as defined in the Linux DVB API. No changes +have been made in the API to accomodate this feature. + + +* Why the need for another CI interface ? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +This is one of the most commonly asked question. Well a nice question. +Strictly speaking this is not a new interface. + +The CI interface is defined in the DVB API in ca.h as + +typedef struct ca_slot_info { + int num; /* slot number */ + + int type; /* CA interface this slot supports */ +#define CA_CI 1 /* CI high level interface */ +#define CA_CI_LINK 2 /* CI link layer level interface */ +#define CA_CI_PHYS 4 /* CI physical layer level interface */ +#define CA_DESCR 8 /* built-in descrambler */ +#define CA_SC 128 /* simple smart card interface */ + + unsigned int flags; +#define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */ +#define CA_CI_MODULE_READY 2 +} ca_slot_info_t; + + + +This CI interface follows the CI high level interface, which is not +implemented by most applications. Hence this area is revisited. + +This CI interface is quite different in the case that it tries to +accomodate all other CI based devices, that fall into the other categories + +This means that this CI interface handles the EN50221 style tags in the +Application layer only and no session management is taken care of by the +application. The driver/hardware will take care of all that. + +This interface is purely an EN50221 interface exchanging APDU's. This +means that no session management, link layer or a transport layer do +exist in this case in the application to driver communication. It is +as simple as that. The driver/hardware has to take care of that. + + +With this High Level CI interface, the interface can be defined with the +regular ioctls. + +All these ioctls are also valid for the High level CI interface + +#define CA_RESET _IO('o', 128) +#define CA_GET_CAP _IOR('o', 129, ca_caps_t) +#define CA_GET_SLOT_INFO _IOR('o', 130, ca_slot_info_t) +#define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t) +#define CA_GET_MSG _IOR('o', 132, ca_msg_t) +#define CA_SEND_MSG _IOW('o', 133, ca_msg_t) +#define CA_SET_DESCR _IOW('o', 134, ca_descr_t) +#define CA_SET_PID _IOW('o', 135, ca_pid_t) + + +On querying the device, the device yields information thus + +CA_GET_SLOT_INFO +---------------------------- +Command = [info] +APP: Number=[1] +APP: Type=[1] +APP: flags=[1] +APP: CI High level interface +APP: CA/CI Module Present + +CA_GET_CAP +---------------------------- +Command = [caps] +APP: Slots=[1] +APP: Type=[1] +APP: Descrambler keys=[16] +APP: Type=[1] + +CA_SEND_MSG +---------------------------- +Descriptors(Program Level)=[ 09 06 06 04 05 50 ff f1] +Found CA descriptor @ program level + +(20) ES type=[2] ES pid=[201] ES length =[0 (0x0)] +(25) ES type=[4] ES pid=[301] ES length =[0 (0x0)] +ca_message length is 25 (0x19) bytes +EN50221 CA MSG=[ 9f 80 32 19 03 01 2d d1 f0 08 01 09 06 06 04 05 50 ff f1 02 e0 c9 00 00 04 e1 2d 00 00] + + +Not all ioctl's are implemented in the driver from the API, the other +features of the hardware that cannot be implemented by the API are achieved +using the CA_GET_MSG and CA_SEND_MSG ioctls. An EN50221 style wrapper is +used to exchange the data to maintain compatibility with other hardware. + + +/* a message to/from a CI-CAM */ +typedef struct ca_msg { + unsigned int index; + unsigned int type; + unsigned int length; + unsigned char msg[256]; +} ca_msg_t; + + +The flow of data can be described thus, + + + + + + App (User) + ----- + parse + | + | + v + en50221 APDU (package) + -------------------------------------- + | | | High Level CI driver + | | | + | v | + | en50221 APDU (unpackage) | + | | | + | | | + | v | + | sanity checks | + | | | + | | | + | v | + | do (H/W dep) | + -------------------------------------- + | Hardware + | + v + + + + +The High Level CI interface uses the EN50221 DVB standard, following a +standard ensures futureproofness.
drivers/media/dvb/bt8xx/Makefile +1 -3
@@ -1,5 +1,3 @@ - -obj-$(CONFIG_DVB_BT8XX) += bt878.o dvb-bt8xx.o dst.o +obj-$(CONFIG_DVB_BT8XX) += bt878.o dvb-bt8xx.o dst.o dst_ca.o EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/video -Idrivers/media/dvb/frontends -
drivers/media/dvb/bt8xx/bt878.c +9 -9
@@ -4,8 +4,8 @@* Copyright (C) 2002 Peter Hettkamp <[email protected]> * * large parts based on the bttv driver -* Copyright (C) 1996,97,98 Ralph Metzler ([email protected]) -* & Marcus Metzler ([email protected]) +* Copyright (C) 1996,97,98 Ralph Metzler ([email protected]) +* & Marcus Metzler ([email protected]) * (c) 1999,2000 Gerd Knorr <[email protected]> * * This program is free software; you can redistribute it and/or
@@ -461,9 +461,9 @@ static int __devinit bt878_probe(structpci_set_drvdata (dev, bt);/* if(init_bt878(btv) < 0) { -bt878_remove(dev); -return -EIO; -} +bt878_remove(dev); +return -EIO; +} */ if ((result =bt878_mem_alloc (bt))) {
@@ -536,10 +536,10 @@ static struct pci_device_id bt878_pci_tbMODULE_DEVICE_TABLE (pci, bt878_pci_tbl);static struct pci_driver bt878_pci_driver = { - .name ="bt878" , + .name ="bt878" , .id_table = bt878_pci_tbl, - .probe = bt878_probe, - .remove = bt878_remove, + .probe = bt878_probe, + .remove = bt878_remove, };static int bt878_pci_driver_registered =0 ;
@@ -558,7 +558,7 @@ static int bt878_init_module(void) (BT878_VERSION_CODE >>8 ) &0xff , BT878_VERSION_CODE & 0xff);/* -bt878_check_chipset(); +bt878_check_chipset(); */ /* later we register inside of bt878_find_audio_dma() * because we may want to ignore certain cards */
drivers/media/dvb/bt8xx/dst.c +556 -286
1,159 lines not on this page · raw message
drivers/media/dvb/bt8xx/dst.h deleted +0 -40
@@ -1,40 +0,0 @@ -/* -Frontend-driver for TwinHan DST Frontend - -Copyright (C) 2003 Jamie Honan - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#ifndef DST_H -#define DST_H - -#include <linux/dvb/frontend.h> -#include <linux/device.h> -#include "bt878.h" - -struct dst_config -{ -/* the demodulator's i2c address */ -u8 demod_address; -}; - -extern struct dvb_frontend *dst_attach (const struct dst_config * config, -struct i2c_adapter * i2c, -struct bt878 *bt); - -#endif // DST_H
drivers/media/dvb/bt8xx/dst_ca.c new file +868 -0
868 lines not on this page · raw message
drivers/media/dvb/bt8xx/dst_ca.h new file +58 -0
58 lines not on this page · raw message
drivers/media/dvb/bt8xx/dst_common.h new file +153 -0
153 lines not on this page · raw message
drivers/media/dvb/bt8xx/dst_priv.h +0 -1
@@ -33,4 +33,3 @@ union dst_gpio_packet {struct bt878 ;int bt878_device_control (struct bt878 *bt,unsigned int cmd,union dst_gpio_packet *mp); -
drivers/media/dvb/bt8xx/dvb-bt8xx.c +58 -37
143 lines not on this page · raw message
drivers/media/dvb/bt8xx/dvb-bt8xx.h +1 -1
@@ -31,7 +31,7 @@#include "bttv.h" #include "mt352.h" #include "sp887x.h" -#include "dst.h" +#include "dst_common.h" #include "nxt6000.h" #include "cx24110.h" #include "or51211.h"
drivers/media/dvb/bt8xx/Kconfig +1 -2
@@ -11,9 +11,8 @@ config DVB_BT8XX the Nebula cards, the Pinnacle PCTV cards, the Twinhan DST cards and pcHDTV HD2000 cards. - Since these cards have no MPEG decoder onboard, they transmit + Since these cards have no MPEG decoder onboard, they transmit only compressed MPEG data over the PCI bus, so you need an external software decoder to watch TV on your computer. Say Y if you own such a device and want to use it. -
--
PATCH 29/37 DST: add support for Twinhan 200103A
In reply to Johannes Stezenbachadd support for the old Twinhan 200103A card (Steffen Motzer)
---
drivers/media/dvb/bt8xx/dst.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletion(-)
drivers/media/dvb/bt8xx/dst.c +9 -1
@@ -538,7 +538,7 @@ static int dst_type_print (u8 type) Known cards list Satellite ------------------- - + 200103A VP-1020 DST-MOT LG(old), TS=188 VP-1020 DST-03T LG(new), TS=204
@@ -571,6 +571,14 @@ static int dst_type_print (u8 type)struct dst_types dst_tlist[] = { { + .device_id ="200103A" , + .offset =0 , + .dst_type =DST_TYPE_IS_SAT , + .type_flags =DST_TYPE_HAS_SYMDIV |DST_TYPE_HAS_FW_1 , + .dst_feature =0 + },/* obsolete */ + + { .device_id ="DST-020" , .offset =0 , .dst_type =DST_TYPE_IS_SAT ,
--
PATCH 30/37 DST: fixed tuning problem
In reply to Johannes Stezenbachfixed a tuning problem for cards based on the old firmware (Steffen Motzer, Manu Abraham)
---
drivers/media/dvb/bt8xx/dst.c | 57 +++++++++++++++++++++++------------ drivers/media/dvb/bt8xx/dst_common.h | 6 +-- 2 files changed, 41 insertions(+), 22 deletions(-)
drivers/media/dvb/bt8xx/dst.c +38 -19
@@ -81,9 +81,7 @@ int dst_gpio_outb(struct dst_state* statdprintk ("%s: dst_gpio_enb error (err == %i, mask == %02x, enb == %02x)\n" , __FUNCTION__, err, mask, enbb);return -EREMOTEIO ; } - -msleep (1 ); - +udelay (1000 );/* because complete disabling means no output, no need to do output packet */ if (enbb ==0 )return 0 ;
@@ -150,8 +148,7 @@ int rdc_8820_reset(struct dst_state *stadprintk ("%s: dst_gpio_outb ERROR !\n" , __FUNCTION__);return -1 ; } -msleep (1 ); - +udelay (1000 );if (dst_gpio_outb (state,RDC_8820_RESET ,RDC_8820_RESET ,RDC_8820_RESET ,DELAY ) <0 ) {dprintk ("%s: dst_gpio_outb ERROR !\n" , __FUNCTION__);return -1 ;
@@ -167,8 +164,7 @@ int dst_pio_enable(struct dst_state *stadprintk ("%s: dst_gpio_outb ERROR !\n" , __FUNCTION__);return -1 ; } -msleep (1 ); - +udelay (1000 );return 0 ; }EXPORT_SYMBOL (dst_pio_enable);
@@ -179,6 +175,8 @@ int dst_pio_disable(struct dst_state *stdprintk ("%s: dst_gpio_outb ERROR !\n" , __FUNCTION__);return -1 ; } +if (state->type_flags &DST_TYPE_HAS_FW_1 ) +udelay (1000 );return 0 ; }
@@ -200,7 +198,7 @@ int dst_wait_dst_ready(struct dst_statedprintk ("%s: dst wait ready after %d\n" , __FUNCTION__, i);return 1 ; } -msleep (1 ); +msleep (35 ); }if (verbose >1 )dprintk ("%s: dst wait NOT ready after %d\n" , __FUNCTION__, i);
@@ -245,6 +243,11 @@ int dst_comm_init(struct dst_state* statdprintk ("%s: RDC 8820 State RESET Failed.\n" , __FUNCTION__);return -1 ; } +if (state->type_flags &DST_TYPE_HAS_FW_1 ) +msleep (100 ); +else +msleep (5 ); +return 0 ; }EXPORT_SYMBOL (dst_comm_init);
@@ -328,8 +331,9 @@ static int dst_set_freq(struct dst_stateu8 *val; state->frequency = freq; +if (debug >4 ) +dprintk ("%s: set Frequency %u\n" , __FUNCTION__, freq); -// dprintk("%s: set frequency %u\n", __FUNCTION__, freq); if (state->dst_type ==DST_TYPE_IS_SAT ) { freq = freq /1000 ;if (freq <950 || freq >2150 )
@@ -452,7 +456,8 @@ static int dst_set_symbolrate(struct dstif (state->dst_type ==DST_TYPE_IS_TERR ) {return 0 ; } -// dprintk("%s: set srate %u\n", __FUNCTION__, srate); +if (debug >4 ) +dprintk ("%s: set symrate %u\n" , __FUNCTION__, srate); srate /=1000 ; val = &state->tx_tuna[0 ];
@@ -461,7 +466,10 @@ static int dst_set_symbolrate(struct dst sval <<=20 ;do_div (sval,88000 ); symcalc = (u32 ) sval; -// dprintk("%s: set symcalc %u\n", __FUNCTION__, symcalc); + +if (debug >4 ) +dprintk ("%s: set symcalc %u\n" , __FUNCTION__, symcalc); + val[5 ] = (u8) (symcalc >>12 ); val[6 ] = (u8) (symcalc >>4 ); val[7 ] = (u8) (symcalc <<4 );
@@ -504,6 +512,7 @@ static void dst_type_flags_print(u32 typprintk (" 0x%x firmware version = 2" ,DST_TYPE_HAS_FW_2 );if (type_flags &DST_TYPE_HAS_FW_3 )printk (" 0x%x firmware version = 3" ,DST_TYPE_HAS_FW_3 ); +// if ((type_flags & DST_TYPE_HAS_FW_BUILD) && new_fw) printk ("\n" ); }
@@ -617,13 +626,13 @@ struct dst_types dst_tlist[] = { .dst_type = DST_TYPE_IS_SAT, .type_flags = DST_TYPE_HAS_TS204 | DST_TYPE_HAS_NEWTUNE | DST_TYPE_HAS_FW_1, .dst_feature = DST_TYPE_HAS_CA - }, /* unknown to vendor */ + }, /* An OEM board */ { .device_id = "DSTMCI", .offset = 1, .dst_type = DST_TYPE_IS_SAT, - .type_flags = DST_TYPE_HAS_NEWTUNE | DST_TYPE_HAS_FW_2, + .type_flags = DST_TYPE_HAS_NEWTUNE | DST_TYPE_HAS_FW_2 | DST_TYPE_HAS_FW_BUILD, .dst_feature =DST_TYPE_HAS_CA |DST_TYPE_HAS_DISEQC3 |DST_TYPE_HAS_DISEQC4 |DST_TYPE_HAS_MOTO |DST_TYPE_HAS_MAC },
@@ -640,7 +649,8 @@ struct dst_types dst_tlist[] = { .device_id = "DCT-CI", .offset = 1, .dst_type = DST_TYPE_IS_CABLE, - .type_flags = DST_TYPE_HAS_TS204 | DST_TYPE_HAS_NEWTUNE | DST_TYPE_HAS_FW_1 | DST_TYPE_HAS_FW_2, + .type_flags =DST_TYPE_HAS_TS204 |DST_TYPE_HAS_NEWTUNE |DST_TYPE_HAS_FW_1 + | DST_TYPE_HAS_FW_2 | DST_TYPE_HAS_FW_BUILD, .dst_feature =DST_TYPE_HAS_CA },
@@ -656,7 +666,7 @@ struct dst_types dst_tlist[] = { .device_id = "DTT-CI", .offset = 1, .dst_type = DST_TYPE_IS_TERR, - .type_flags = DST_TYPE_HAS_TS204 | DST_TYPE_HAS_FW_2, + .type_flags = DST_TYPE_HAS_TS204 | DST_TYPE_HAS_FW_2 | DST_TYPE_HAS_FW_BUILD, .dst_feature =0 },
@@ -782,7 +792,7 @@ static int dst_probe(struct dst_state *sdprintk ("%s: DST Initialization Failed.\n" , __FUNCTION__);return -1 ; } - +msleep (100 );if (dst_get_device_id (state) <0 ) {dprintk ("%s: unknown device.\n" , __FUNCTION__);return -1 ;
@@ -812,6 +822,8 @@ int dst_command(struct dst_state* state,dprintk ("%s: PIO Disable Failed.\n" , __FUNCTION__);return -1 ; } +if (state->type_flags &DST_TYPE_HAS_FW_1 ) +udelay (3000 );if (read_dst (state, &reply,GET_ACK )) {if (verbose >1 )
@@ -829,6 +841,13 @@ int dst_command(struct dst_state* state, }if (len >=2 && data[0 ] ==0 && (data[1 ] ==1 || data[1 ] ==3 ))return 0 ; + +// udelay(3000); +if (state->type_flags &DST_TYPE_HAS_FW_1 ) +udelay (3000 ); +else +udelay (2000 ); +if (!dst_wait_dst_ready (state,NO_DELAY ))return -1 ;
@@ -919,8 +938,6 @@ static int dst_get_tuna(struct dst_stateif (!dst_wait_dst_ready (state,NO_DELAY ))return 0 ; -msleep (10 ); -if (state->type_flags &DST_TYPE_HAS_NEWTUNE ) {/* how to get variable length reply ???? */ retval =read_dst (state, state->rx_tuna,10 );
@@ -969,7 +986,9 @@ static int dst_write_tuna(struct dvb_froint retval;u8 reply; -dprintk ("%s: type_flags 0x%x \n" , __FUNCTION__, state->type_flags); +if (debug >4 ) +dprintk ("%s: type_flags 0x%x \n" , __FUNCTION__, state->type_flags); + state->decode_freq =0 ; state->decode_lock = state->decode_strength = state->decode_snr =0 ;if (state->dst_type ==DST_TYPE_IS_SAT ) {
drivers/media/dvb/bt8xx/dst_common.h +3 -3
@@ -46,7 +46,7 @@#define DST_TYPE_HAS_FW_1 8#define DST_TYPE_HAS_FW_2 16#define DST_TYPE_HAS_FW_3 32 - +#define DST_TYPE_HAS_FW_BUILD 64/* Card capability list */
@@ -117,8 +117,8 @@ struct dst_types {char *device_id;int offset;u8 dst_type; -u32 type_flags; -u8 dst_feature; +u64 type_flags; +u64 dst_feature; };
--
PATCH 31/37 DST: fix for descrambling failure
In reply to Johannes Stezenbachfix for descrambling failure (Dominique Dumont, Manu Abraham)
---
drivers/media/dvb/bt8xx/dst.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/media/dvb/bt8xx/dst.c +1 -1
@@ -198,7 +198,7 @@ int dst_wait_dst_ready(struct dst_statedprintk ("%s: dst wait ready after %d\n" , __FUNCTION__, i);return 1 ; } -msleep (35 ); +msleep (10 ); }if (verbose >1 )dprintk ("%s: dst wait NOT ready after %d\n" , __FUNCTION__, i);
--
PATCH 32/37 DST: misc. fixes
In reply to Johannes Stezenbachremoved unused module parameter session
removed unnecesary delay for FTA cards
(Manu Abraham)
---
drivers/media/dvb/bt8xx/dst.c | 14 ++++++-------- drivers/media/dvb/bt8xx/dst_ca.c | 19 ++++++------------- drivers/media/dvb/bt8xx/dst_common.h | 8 ++++---- 3 files changed, 16 insertions(+), 25 deletions(-)
drivers/media/dvb/bt8xx/dst.c +6 -8
@@ -44,13 +44,7 @@ MODULE_PARM_DESC(debug, "debug messages,static unsigned int dst_addons;module_param (dst_addons, int,0644 ); -MODULE_PARM_DESC (dst_addons,"CA daughterboard, default is 0 (no)" ); - -static unsigned int new_fw; -module_param (new_fw, int,0644 ); -MODULE_PARM_DESC (new_fw,"Support for the new interface firmware, default 0" ); - - +MODULE_PARM_DESC (dst_addons,"CA daughterboard, default is 0 (No addons)" );#define dprintk if (debug) printk
@@ -787,7 +781,11 @@ static int dst_probe(struct dst_state *sdprintk ("%s: RDC 8820 RESET Failed.\n" , __FUNCTION__);return -1 ; } -msleep (4000 ); +if (dst_addons &DST_TYPE_HAS_CA ) +msleep (4000 ); +else +msleep (100 ); +if ((dst_comm_init (state)) <0 ) {dprintk ("%s: DST Initialization Failed.\n" , __FUNCTION__);return -1 ;
drivers/media/dvb/bt8xx/dst_ca.c +6 -13
@@ -40,23 +40,16 @@ static unsigned int debug = 1;module_param (debug, int,0644 );MODULE_PARM_DESC (dst_ca_debug,"debug messages, default is 0 (yes)" ); -static unsigned int session; -module_param (session, int,0644 ); -MODULE_PARM_DESC (session,"Support for hardware that has multiple sessions, default 0" ); - -static unsigned int new_ca; -module_param (new_ca, int,0644 ); -MODULE_PARM_DESC (new_ca,"Support for the new CA interface firmware, default 0" ); -#define dprintk if (debug) printk - +/* Need some more work */ static int ca_set_slot_descr (void ) {/* We could make this more graceful ? */ return -EOPNOTSUPP ; } +/* Need some more work */ static int ca_set_pid (void ) {/* We could make this more graceful ? */
@@ -213,7 +206,7 @@ static int ca_get_slot_caps(struct dst_sreturn 0 ; } - +/* Need some more work */ static int ca_get_slot_descr (struct dst_state *state,struct ca_msg *p_ca_message,void *arg) {return -EOPNOTSUPP ;
@@ -302,9 +295,9 @@ static int ca_get_message(struct dst_stareturn 0 ; } -static int handle_en50221_tag (struct ca_msg *p_ca_message,struct ca_msg *hw_buffer) +static int handle_en50221_tag (struct dst_state *state,struct ca_msg *p_ca_message,struct ca_msg *hw_buffer) { -if (session) { +if (state->dst_hw_cap &DST_TYPE_HAS_SESSION ) { hw_buffer->msg[2 ] = p_ca_message->msg[1 ];/* MSB */ hw_buffer->msg[3 ] = p_ca_message->msg[2 ];/* LSB */ }
@@ -351,7 +344,7 @@ static int ca_set_pmt(struct dst_state *if (verbose >3 )dprintk ("%s, p_ca_message length %d (0x%x)\n" , __FUNCTION__,p_ca_message->length,p_ca_message->length ); -handle_en50221_tag (p_ca_message, hw_buffer);/* EN50221 tag */ +handle_en50221_tag (state, p_ca_message, hw_buffer);/* EN50221 tag */ /* Handle the length field (variable) */ if (!(p_ca_message->msg[3 ] &0x80 )) {/* Length = 1 */
drivers/media/dvb/bt8xx/dst_common.h +4 -4
@@ -48,7 +48,6 @@#define DST_TYPE_HAS_FW_3 32#define DST_TYPE_HAS_FW_BUILD 64 -/* Card capability list */ #define DST_TYPE_HAS_MAC 1
@@ -58,6 +57,7 @@#define DST_TYPE_HAS_MOTO 16#define DST_TYPE_HAS_CA 32#define DST_TYPE_HAS_ANALOG 64/* Analog inputs */ +#define DST_TYPE_HAS_SESSION 128#define RDC_8820_PIO_0_DISABLE 0
@@ -107,7 +107,7 @@ struct dst_state {unsigned long cur_jiff;u8 k22;fe_bandwidth_t bandwidth; -u8 dst_hw_cap; +u32 dst_hw_cap;u8 dst_fw_version;fe_sec_mini_cmd_t minicmd;u8 messages[256 ];
@@ -117,8 +117,8 @@ struct dst_types {char *device_id;int offset;u8 dst_type; -u64 type_flags; -u64 dst_feature; +u32 type_flags; +u32 dst_feature; };
--
PATCH 33/37 bt8xx: updated documentation
In reply to Johannes Stezenbachupdated documentation (Manu Abraham)
---
Documentation/dvb/bt8xx.txt | 42 ++++++++++++++++-------------------------- 1 files changed, 16 insertions(+), 26 deletions(-)
Documentation/dvb/bt8xx.txt +16 -26
@@ -35,45 +35,35 @@ TwinHan (dst) are loaded automatically b $ modprobe bttv (normally bttv is being loaded automatically by kmod) $ modprobe dvb-bt8xx (or just place dvb-bt8xx in /etc/modules for automatic loading) -3b) TwinHan ------------ + +3b) TwinHan and Clones +-------------------------- $ modprobe bttv i2c_hw=1 card=0x71 $ modprobe dvb-bt8xx $ modprobe dst -The value 0x71 will override the PCI type detection for dvb-bt8xx, which -is necessary for TwinHan cards.# - -If you're having an older card (blue color circuit) and card=0x71 locks your -machine, try using 0x68, too. If that does not work, ask on the DVB mailing list. +The value 0x71 will override the PCI type detection for dvb-bt8xx, +which is necessary for TwinHan cards. -The DST module takes a couple of useful parameters, in case the -dst drivers fails to detect your type of card correctly. +If you're having an older card (blue color circuit) and card=0x71 locks +your machine, try using 0x68, too. If that does not work, ask on the +mailing list. -dst_type takes values 0 (satellite), 1 (terrestial TV), 2 (cable). +The DST module takes a couple of useful parameters. -dst_type_flags takes bit combined values: -1 = new tuner type packets. You can use this if your card is detected - and you have debug and you continually see the tuner packets not - working (make sure not a basic problem like dish alignment etc.) +verbose takes values 0 to 5. These values control the verbosity level. -2 = TS 204. If your card tunes OK, but the picture is terrible, seemingly - breaking up in one half continually, and crc fails a lot, then - this is worth a try (or trying to turn off) +debug takes values 0 and 1. You can either disable or enable debugging. -4 = has symdiv. Some cards, mostly without new tuner packets, require - a symbol division algorithm. Doesn't apply to terrestial TV. +dst_addons takes values 0 and 0x20. A value of 0 means it is a FTA card. +0x20 means it has a Conditional Access slot. -You can also specify a value to have the autodetected values turned off -(e.g. 0). The autodected values are determined bythe cards 'response +The autodected values are determined bythe cards 'response string' which you can see in your logs e.g. -dst_check_ci: recognize DST-MOT - -or +dst_get_device_id: Recognise [DSTMCI] -dst_check_ci: unable to recognize DSTXCI or STXCI -- -Authors: Richard Walker, Jamie Honan, Michael Hunold +Authors: Richard Walker, Jamie Honan, Michael Hunold, Manu Abraham
--
PATCH 34/37 DST: fix a bug in the module parameter
In reply to Johannes Stezenbachfix a bug in the module parameter (Dominique Dumont)
---
drivers/media/dvb/bt8xx/dst_ca.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/media/dvb/bt8xx/dst_ca.c +1 -1
@@ -38,7 +38,7 @@ MODULE_PARM_DESC(verbose, "verbose startstatic unsigned int debug =1 ;module_param (debug, int,0644 ); -MODULE_PARM_DESC (dst_ca_debug,"debug messages, default is 0 (yes)" ); +MODULE_PARM_DESC (debug,"debug messages, default is 1 (yes)" );#define dprintk if (debug) printk
--
PATCH 35/37 DST: fixed CI debug output
In reply to Johannes Stezenbachfixed CI debug output (Dominique Dumont)
---
drivers/media/dvb/bt8xx/dst_ca.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/media/dvb/bt8xx/dst_ca.c +1 -1
@@ -162,7 +162,7 @@ static int ca_get_app_info(struct dst_stdprintk ("%s: ================================ CI Module Application Info ======================================\n" , __FUNCTION__);dprintk ("%s: Application Type=[%d], Application Vendor=[%d], Vendor Code=[%d]\n%s: Application info=[%s]\n" , __FUNCTION__, state->messages[7 ], (state->messages[8 ] <<8 ) | state->messages[9 ], - (state->messages[10 ] <<8 ) | state->messages[11 ], __FUNCTION__, (char *)(&state->messages[11 ])); + (state->messages[10 ] <<8 ) | state->messages[11 ], __FUNCTION__, (char *)(&state->messages[12 ]));dprintk ("%s: ==================================================================================================\n" , __FUNCTION__); }
--
PATCH 36/37 bt8xx: whitespace cleanup
In reply to Johannes Stezenbachwhitespace cleanup
---
drivers/media/dvb/bt8xx/bt878.c | 36 ++++++++++++++++++------------------ drivers/media/dvb/bt8xx/bt878.h | 6 +++--- 2 files changed, 21 insertions(+), 21 deletions(-)
drivers/media/dvb/bt8xx/bt878.h +3 -3
@@ -1,4 +1,4 @@ -/* +/* bt878.h - Bt878 audio module (register offsets) Copyright (C) 2002 Peter Hettkamp <[email protected]>
@@ -120,14 +120,14 @@ struct bt878 {u32 risc_pos;struct tasklet_struct tasklet; -int shutdown; +int shutdown; };extern struct bt878 bt878[BT878_MAX ];void bt878_start (struct bt878 *bt,u32 controlreg,u32 op_sync_orin,u32 irq_err_ignore); -void bt878_stop (struct bt878 *bt); +void bt878_stop (struct bt878 *bt);#if defined(__powerpc__)/* big-endian */ extern __inline__void io_st_le32 (volatile unsigned __iomem *addr,unsigned val)
drivers/media/dvb/bt8xx/bt878.c +18 -18
@@ -12,19 +12,19 @@* modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. -* +* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. -* +* * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Or, point your browser to http://www.gnu.org/copyleft/gpl.html -* +* */ #include <linux/module.h>
@@ -58,7 +58,7 @@ module_param_named(verbose, bt878_verbosMODULE_PARM_DESC (verbose,"verbose startup messages, default is 1 (yes)" );module_param_named (debug, bt878_debug, int,0644 ); -MODULE_PARM_DESC (debug,"Turn on/off debugging (default:off)." ); +MODULE_PARM_DESC (debug,"Turn on/off debugging, default is 0 (off)." );int bt878_num;struct bt878 bt878[BT878_MAX ];
@@ -128,21 +128,21 @@ static int bt878_mem_alloc(struct bt878 }/* RISC instructions */ -#define RISC_WRITE (0x01 << 28) -#define RISC_JUMP (0x07 << 28) -#define RISC_SYNC (0x08 << 28) +#define RISC_WRITE (0x01 << 28) +#define RISC_JUMP (0x07 << 28) +#define RISC_SYNC (0x08 << 28)/* RISC bits */ -#define RISC_WR_SOL (1 << 27) -#define RISC_WR_EOL (1 << 26) -#define RISC_IRQ (1 << 24) +#define RISC_WR_SOL (1 << 27) +#define RISC_WR_EOL (1 << 26) +#define RISC_IRQ (1 << 24)#define RISC_STATUS (status) ((((~status) & 0x0F) << 20) | ((status & 0x0F) << 16)) -#define RISC_SYNC_RESYNC (1 << 15) -#define RISC_SYNC_FM1 0x06 -#define RISC_SYNC_VRO 0x0C +#define RISC_SYNC_RESYNC (1 << 15) +#define RISC_SYNC_FM1 0x06 +#define RISC_SYNC_VRO 0x0C#define RISC_FLUSH () bt->risc_pos = 0 -#define RISC_INSTR (instr) bt->risc_cpu[bt->risc_pos++] = cpu_to_le32(instr) +#define RISC_INSTR (instr) bt->risc_cpu[bt->risc_pos++] = cpu_to_le32(instr)static int bt878_make_risc (struct bt878 *bt) {
@@ -173,7 +173,7 @@ static void bt878_risc_program(struct btRISC_INSTR (RISC_SYNC |RISC_SYNC_FM1 | op_sync_orin);RISC_INSTR (0 ); -dprintk ("bt878: risc len lines %u, bytes per line %u\n" , +dprintk ("bt878: risc len lines %u, bytes per line %u\n" , bt->line_count, bt->line_bytes);for (line =0 ; line < bt->line_count; line++) {// At the beginning of every block we issue an IRQ with previous (finished) block number set
@@ -228,14 +228,14 @@ void bt878_start(struct bt878 *bt, u32 c* Hacked for DST to: * SCERR | OCERR | FDSR | FTRGT | FBUS | RISCI */ - int_mask =BT878_ASCERR |BT878_AOCERR |BT878_APABORT | -BT878_ARIPERR |BT878_APPERR |BT878_AFDSR |BT878_AFTRGT | + int_mask =BT878_ASCERR |BT878_AOCERR |BT878_APABORT | +BT878_ARIPERR |BT878_APPERR |BT878_AFDSR |BT878_AFTRGT |BT878_AFBUS |BT878_ARISCI ;/* ignore pesky bits */ int_mask &= ~irq_err_ignore; - +btwrite (int_mask,BT878_AINT_MASK );btwrite (controlreg,BT878_AGPIO_DMA_CTL ); }
--
PATCH 37/37 budget-av: CI fixes
In reply to Johannes Stezenbach- remove enable_ci, ci interface is assumed to be present if the saa7113 is not found.
- reduce the delay when checking for saa7113
- clean up the cam reset according to specifications
- turn off Vcc to the cam slot if cam is removed or fails reset
- remove cam reset in ciintf_init
- clean up printks (KERN_)
- move gpio setting into saa7113_init
- clean up unreadable frontend_init
(Kenneth Aafloy)
---
drivers/media/dvb/ttpci/budget-av.c | 216 +++++++++++++++++++----------------- 1 files changed, 118 insertions(+), 98 deletions(-)
drivers/media/dvb/ttpci/budget-av.c +118 -98
@@ -59,8 +59,12 @@ struct budget_av {struct dvb_ca_en50221 ca; }; -static int enable_ci =0 ; - +/* GPIO CI Connections: +* 0 - Vcc/Reset (Reset is controlled by capacitor) +* 1 - Attribute Memory +* 2 - Card Enable (Active Low) +* 3 - Card Detect +*/ /**************************************************************************** * INITIALIZATION
@@ -188,22 +192,35 @@ static int ciintf_slot_reset(struct dvb_ {struct budget_av *budget_av = (struct budget_av *) ca->data;struct saa7146_dev *saa = budget_av->budget.dev; -int max =20 ; +int timeout =50 ;// 5 seconds (4.4.6 Ready) if (slot !=0 )return -EINVAL ;dprintk (1 ,"ciintf_slot_reset\n" ); -/* reset the card */ -saa7146_setgpio (saa,0 ,SAA7146_GPIO_OUTHI ); -msleep (100 ); -saa7146_setgpio (saa,0 ,SAA7146_GPIO_OUTLO ); +saa7146_setgpio (saa,2 ,SAA7146_GPIO_OUTHI );/* disable card */ -while (--max >0 &&ciintf_read_attribute_mem (ca, slot,0 ) !=0x1d ) +saa7146_setgpio (saa,0 ,SAA7146_GPIO_OUTHI );/* Vcc off */ +msleep (2 ); +saa7146_setgpio (saa,0 ,SAA7146_GPIO_OUTLO );/* Vcc on */ +msleep (20 );/* 20 ms Vcc settling time */ + +saa7146_setgpio (saa,2 ,SAA7146_GPIO_OUTLO );/* enable card */ + +/* This should have been based on pin 16 READY of the pcmcia port, +* but AFAICS it is not routed to the saa7146 */ +while (--timeout >0 &&ciintf_read_attribute_mem (ca, slot,0 ) !=0x1d )msleep (100 ); -ttpci_budget_set_video_port (saa,BUDGET_VIDEO_PORTB ); +if (timeout <=0 ) + { +printk (KERN_ERR "budget-av: cam reset failed (timeout).\n" ); +saa7146_setgpio (saa,2 ,SAA7146_GPIO_OUTHI );/* disable card */ +saa7146_setgpio (saa,0 ,SAA7146_GPIO_OUTHI );/* Vcc off */ +return -ETIMEDOUT ; + } +return 0 ; }
@@ -240,7 +257,6 @@ static int ciintf_poll_slot_status(struc {struct budget_av *budget_av = (struct budget_av *) ca->data;struct saa7146_dev *saa = budget_av->budget.dev; -int cam =0 ;if (slot !=0 )return -EINVAL ;
@@ -248,15 +264,21 @@ static int ciintf_poll_slot_status(strucif (!budget_av->slot_status) {saa7146_setgpio (saa,3 ,SAA7146_GPIO_INPUT );udelay (1 ); - cam =saa7146_read (saa,PSR ) &MASK_06 ; -saa7146_setgpio (saa,3 ,SAA7146_GPIO_OUTLO ); - -if (cam) +if (saa7146_read (saa,PSR ) &MASK_06 ) + { +printk (KERN_INFO "budget-av: cam inserted\n" ); budget_av->slot_status =1 ; + } +saa7146_setgpio (saa,3 ,SAA7146_GPIO_OUTLO ); }else if (!open) {saa7146_setgpio (budget_av->budget.dev,1 ,SAA7146_GPIO_OUTLO );if (ttpci_budget_debiread (&budget_av->budget,DEBICICAM ,0 ,1 ,0 ,1 ) == -ETIMEDOUT ) + { +printk (KERN_INFO "budget-av: cam ejected\n" ); +saa7146_setgpio (saa,2 ,SAA7146_GPIO_OUTHI );/* disable card */ +saa7146_setgpio (saa,0 ,SAA7146_GPIO_OUTHI );/* Vcc off */ budget_av->slot_status =0 ; + } }if (budget_av->slot_status ==1 )
@@ -272,17 +294,11 @@ static int ciintf_init(struct budget_avmemset (&budget_av->ca,0 ,sizeof (struct dvb_ca_en50221 )); -/* setup GPIOs */ -saa7146_setgpio (saa,1 ,SAA7146_GPIO_OUTHI ); +saa7146_setgpio (saa,0 ,SAA7146_GPIO_OUTLO ); +saa7146_setgpio (saa,1 ,SAA7146_GPIO_OUTLO );saa7146_setgpio (saa,2 ,SAA7146_GPIO_OUTLO );saa7146_setgpio (saa,3 ,SAA7146_GPIO_OUTLO ); -/* Reset the card */ -saa7146_setgpio (saa,0 ,SAA7146_GPIO_OUTHI ); -msleep (50 ); -saa7146_setgpio (saa,0 ,SAA7146_GPIO_OUTLO ); -msleep (100 ); -/* Enable DEBI pins */ saa7146_write (saa,MC1 ,saa7146_read (saa,MC1 ) | (0x800 <<16 ) |0x800 );
@@ -297,13 +313,14 @@ static int ciintf_init(struct budget_av budget_av->ca.slot_ts_enable = ciintf_slot_ts_enable; budget_av->ca.poll_slot_status = ciintf_poll_slot_status; budget_av->ca.data = budget_av; +if ((result =dvb_ca_en50221_init (&budget_av->budget.dvb_adapter, &budget_av->ca,0 ,1 )) !=0 ) { -printk ("budget_av: CI interface detected, but initialisation failed.\n" ); +printk (KERN_ERR "budget-av: ci initialisation failed.\n" ); goto error; } -// success! -printk ("ciintf_init: CI interface initialised\n" ); + +printk (KERN_INFO "budget-av: ci interface initialised.\n" ); budget_av->budget.ci_present =1 ;return 0 ;
@@ -361,8 +378,12 @@ static const u8 saa7113_tab[] = {static int saa7113_init (struct budget_av *budget_av) {struct budget *budget = &budget_av->budget; +struct saa7146_dev *saa = budget->dev;const u8 *data = saa7113_tab; +saa7146_setgpio (saa,0 ,SAA7146_GPIO_OUTHI ); +msleep (200 ); +if (i2c_writereg (&budget->i2c_adap,0x4a ,0x01 ,0x08 ) !=1 ) {dprintk (1 ,"saa7113 not found on KNC card\n" );return -ENODEV ;
@@ -697,82 +718,90 @@ static u8 read_pwm(struct budget_av *budreturn pwm; } +#define SUBID_DVBS_KNC1 0x0010 +#define SUBID_DVBS_KNC1_PLUS 0x0011 +#define SUBID_DVBS_TYPHOON 0x4f56 +#define SUBID_DVBS_CINERGY1200 0x1154 + +#define SUBID_DVBC_KNC1 0x0020 +#define SUBID_DVBC_KNC1_PLUS 0x0021 +#define SUBID_DVBC_CINERGY1200 0x1156 + +#define SUBID_DVBT_KNC1_PLUS 0x0031 +#define SUBID_DVBT_KNC1 0x0030 +#define SUBID_DVBT_CINERGY1200 0x1157static void frontend_init (struct budget_av *budget_av) { -switch (budget_av->budget.dev->pci->subsystem_device) { -case 0x0011 :// KNC1 DVB-S Plus budget with AV IN (stv0299/Philips SU1278(tsa5059)) -saa7146_write (budget_av->budget.dev,GPIO_CTRL ,0x50000000 );// Enable / PowerON Frontend -case 0x4f56 :// Typhoon/KNC1 DVB-S budget (stv0299/Philips SU1278(tsa5059)) -case 0x0010 :// KNC1 DVB-S budget (stv0299/Philips SU1278(tsa5059)) - budget_av->budget.dvb_frontend = -stv0299_attach (&typhoon_config, &budget_av->budget.i2c_adap); -if (budget_av->budget.dvb_frontend !=NULL ) { +struct saa7146_dev * saa = budget_av->budget.dev; +struct dvb_frontend * fe =NULL ; + +switch (saa->pci->subsystem_device) { +case SUBID_DVBS_KNC1_PLUS : +case SUBID_DVBC_KNC1_PLUS : +case SUBID_DVBT_KNC1_PLUS : +// Enable / PowerON Frontend +saa7146_setgpio (saa,3 ,SAA7146_GPIO_OUTHI );break ; - } + } + +switch (saa->pci->subsystem_device) { + +case SUBID_DVBS_KNC1 : +case SUBID_DVBS_KNC1_PLUS : +case SUBID_DVBS_TYPHOON : + fe =stv0299_attach (&typhoon_config, + &budget_av->budget.i2c_adap);break ; -case 0x0021 :// KNC1 DVB-C Plus budget with AV IN (tda10021/Philips CU1216(tua6034)) -saa7146_write (budget_av->budget.dev,GPIO_CTRL ,0x50000000 );// Enable / PowerON Frontend -case 0x0020 :// KNC1 DVB-C budget (tda10021/Philips CU1216(tua6034)) - budget_av->budget.dvb_frontend = -tda10021_attach (&philips_cu1216_config, - &budget_av->budget.i2c_adap,read_pwm (budget_av)); -if (budget_av->budget.dvb_frontend !=NULL ) { -break ; - } +case SUBID_DVBS_CINERGY1200 : + fe =stv0299_attach (&cinergy_1200s_config, + &budget_av->budget.i2c_adap);break ; -case 0x0031 :// KNC1 DVB-T Plus budget with AV IN (tda10046/Philips TU1216(tda6651tt)) -saa7146_write (budget_av->budget.dev,GPIO_CTRL ,0x50000000 );// Enable / PowerON Frontend -case 0x0030 :// KNC1 DVB-T budget (tda10046/Philips TU1216(tda6651tt)) - budget_av->budget.dvb_frontend = -tda10046_attach (&philips_tu1216_config, &budget_av->budget.i2c_adap); -if (budget_av->budget.dvb_frontend !=NULL ) { -break ; - } +case SUBID_DVBC_KNC1 : +case SUBID_DVBC_KNC1_PLUS : + fe =tda10021_attach (&philips_cu1216_config, + &budget_av->budget.i2c_adap, +read_pwm (budget_av));break ; -case 0x1154 :// TerraTec Cinergy 1200 DVB-S (stv0299/Philips SU1278(tsa5059)) - budget_av->budget.dvb_frontend = -stv0299_attach (&cinergy_1200s_config, &budget_av->budget.i2c_adap); -if (budget_av->budget.dvb_frontend !=NULL ) { -break ; - } +case SUBID_DVBT_KNC1 : +case SUBID_DVBT_KNC1_PLUS : + fe =tda10046_attach (&philips_tu1216_config, + &budget_av->budget.i2c_adap);break ; -case 0x1156 :// Terratec Cinergy 1200 DVB-C (tda10021/Philips CU1216(tua6034)) - budget_av->budget.dvb_frontend = -tda10021_attach (&philips_cu1216_config, - &budget_av->budget.i2c_adap,read_pwm (budget_av)); -if (budget_av->budget.dvb_frontend) { -break ; - } +case SUBID_DVBC_CINERGY1200 : + fe =tda10021_attach (&philips_cu1216_config, + &budget_av->budget.i2c_adap, +read_pwm (budget_av));break ; -case 0x1157 :// Terratec Cinergy 1200 DVB-T (tda10046/Philips TU1216(tda6651tt)) - budget_av->budget.dvb_frontend = -tda10046_attach (&philips_tu1216_config, &budget_av->budget.i2c_adap); -if (budget_av->budget.dvb_frontend) { -break ; - } +case SUBID_DVBT_CINERGY1200 : + fe =tda10046_attach (&philips_tu1216_config, + &budget_av->budget.i2c_adap);break ; } -if (budget_av->budget.dvb_frontend ==NULL ) { -printk ("budget_av: A frontend driver was not found for device %04x/%04x subsystem %04x/%04x\n" , - budget_av->budget.dev->pci->vendor, - budget_av->budget.dev->pci->device, - budget_av->budget.dev->pci->subsystem_vendor, - budget_av->budget.dev->pci->subsystem_device); - }else { -if (dvb_register_frontend - (&budget_av->budget.dvb_adapter, budget_av->budget.dvb_frontend)) { -printk ("budget-av: Frontend registration failed!\n" ); -if (budget_av->budget.dvb_frontend->ops->release) - budget_av->budget.dvb_frontend->ops->release (budget_av->budget.dvb_frontend); - budget_av->budget.dvb_frontend =NULL ; - } +if (fe ==NULL ) { +printk (KERN_ERR "budget-av: A frontend driver was not found " +"for device %04x/%04x subsystem %04x/%04x\n" , + saa->pci->vendor, + saa->pci->device, + saa->pci->subsystem_vendor, + saa->pci->subsystem_device); +return ; + } + + budget_av->budget.dvb_frontend = fe; + +if (dvb_register_frontend (&budget_av->budget.dvb_adapter, + budget_av->budget.dvb_frontend)) { +printk (KERN_ERR "budget-av: Frontend registration failed!\n" ); +if (budget_av->budget.dvb_frontend->ops->release) + budget_av->budget.dvb_frontend->ops->release (budget_av->budget.dvb_frontend); + budget_av->budget.dvb_frontend =NULL ; } }
@@ -829,6 +858,7 @@ static int budget_av_attach(struct saa71memset (budget_av,0 ,sizeof (struct budget_av )); + budget_av->has_saa7113 =0 ; budget_av->budget.ci_present =0 ; dev->ext_priv = budget_av;
@@ -843,10 +873,7 @@ static int budget_av_attach(struct saa71saa7146_write (dev,DD1_INIT ,0x07000600 );saa7146_write (dev,MC2 ,MASK_09 |MASK_25 |MASK_10 |MASK_26 ); -saa7146_setgpio (dev,0 ,SAA7146_GPIO_OUTHI ); -msleep (500 ); - -if (0 ==saa7113_init (budget_av)) { +if (saa7113_init (budget_av) ==0 ) { budget_av->has_saa7113 =1 ;if (0 !=saa7146_vv_init (dev, &vv_data)) {
@@ -867,9 +894,7 @@ static int budget_av_attach(struct saa71saa7113_setinput (budget_av,0 ); }else { - budget_av->has_saa7113 =0 ; - -saa7146_setgpio (dev,0 ,SAA7146_GPIO_OUTLO ); +ciintf_init (budget_av); }/* fixme: find some sane values here... */
@@ -877,11 +902,11 @@ static int budget_av_attach(struct saa71 mac = budget_av->budget.dvb_adapter.proposed_mac;if (i2c_readregs (&budget_av->budget.i2c_adap,0xa0 ,0x30 , mac,6 )) { -printk ("KNC1-%d: Could not read MAC from KNC1 card\n" , +printk (KERN_ERR "KNC1-%d: Could not read MAC from KNC1 card\n" , budget_av->budget.dvb_adapter.num);memset (mac,0 ,6 ); }else { -printk ("KNC1-%d: MAC addr = %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n" , +printk (KERN_INFO "KNC1-%d: MAC addr = %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n" , budget_av->budget.dvb_adapter.num, mac[0 ], mac[1 ], mac[2 ], mac[3 ], mac[4 ], mac[5 ]); }
@@ -889,9 +914,6 @@ static int budget_av_attach(struct saa71 budget_av->budget.dvb_adapter.priv = budget_av;frontend_init (budget_av); -if (enable_ci) -ciintf_init (budget_av); -return 0 ; }
@@ -1024,5 +1046,3 @@ MODULE_LICENSE("GPL");MODULE_AUTHOR ("Ralph Metzler, Marcus Metzler, Michael Hunold, others" );MODULE_DESCRIPTION ("driver for the SAA7146 based so-called " "budget PCI DVB w/ analog input and CI-module (e.g. the KNC cards)" ); -module_param_named (enable_ci, enable_ci, int,0644 ); -MODULE_PARM_DESC (enable_ci,"Turn on/off CI module (default:off)." );
--
Quoted 6 lines · Johannes Stezenbach
Hi Andrew,
here are a bunch of patches from linuxtv.org CVS. Nothing exciting, just bugfixes, cleanups and support for a number of new card variants.
Do you view this as 2.6.12 material?
Quoted 5 lines
One hunk from my previous patchset didn't make it into 2.6.12-rc4, but still lingers somewhere in rc3-mm3, thus the "make
dvb_classstatic" patch will be rejected when applying to -rc3-mm3:dvb-core/dvbdev.cfrom http://lkml.org/lkml/2005/3/21/321
Yes, that fix seems to have been made upstream somewhere, so I'll drop that patch.
I notice that Greg's tree changes dvb_class to be of type class_simple, so there may be interactions between your stuff and gregkh-01-driver-gregkh-driver-022_class-11-drivers.patch. We'll see. (Warning, Greg's patch names tend to change, but it'll be something like that).
I notice you have a lot of things like:
Switch analog output of the Crystal sound chip to left/stereo/right mode. This will fix problems with some (most?) channels which do not encode 2-channel audio correctly. (Oliver Endriss)
In future, please try to gather Signed-off-by: lines for these contributions, thanks.
Quoted 6 lines · On Mon, May 09, 2005 Andrew Morton wrote:
Quoted 3 lines · Johannes Stezenbach
here are a bunch of patches from linuxtv.org CVS. Nothing exciting, just bugfixes, cleanups and support for a number of new card variants.
Do you view this as 2.6.12 material?
Yes, all of it is well tested and has been in CVS for a while.
Quoted 3 lines
I notice that Greg's tree changes
dvb_classto be of typeclass_simple, so there may be interactions between your stuff and gregkh-01-driver-gregkh-driver-022_class-11-drivers.patch. We'll see.
OK, I'll check that.
Quoted 8 lines
I notice you have a lot of things like:
Switch analog output of the Crystal sound chip to left/stereo/right mode. This will fix problems with some (most?) channels which do not encode 2-channel audio correctly. (Oliver Endriss)
In future, please try to gather Signed-off-by: lines for these contributions, thanks.
How should we handle this with CVS? Should people add a
Signed-off-by: line to the CVS commit log? If they don't, can I assume that "by policy" the Signed-off-by: line for the committer is implicit? Or do I have to bug them to mail me the Signed-off-by: line?
Thanks,
Johannes
Quoted 6 lines · Johannes Stezenbach
Quoted 3 lines
In future, please try to gather Signed-off-by: lines for these contributions, thanks.
How should we handle this with CVS? Should people add a
Signed-off-by: line to the CVS commit log?
That sounds reasonable.
Quoted 3 lines
If they don't,
can I assume that "by policy" the Signed-off-by: line for the committer is implicit?
I wouldn't do that. S-O-B does imply that they have read, agreed to and complied with the "Developer's Certificate of Origin" from Documentation/SubmittingPatches. That is not a thing which person A should be asserting on person B's behalf.
Quoted 2 lines
Or do I have to bug them to
mail me the Signed-off-by: line?
Yes please.