提交 955e6ed8 编写于 作者: M Mauro Carvalho Chehab

[media] CodingStyle cleanup at s5h1432 and cx231xx

The patches received from the vendor contained a lot of CodingStyle
issues. Cleans the style issues reported by checkpatch.pl on
those drivers.

It is better to do such style fixes when merging a big set of
changes than latter. Of course, the better is to receive patches
already cleaned ;)
Acked-by: NSri Deevi <Srinivasa.Deevi@conexant.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 61b04cb2
/* /*
Samsung s5h1432 DVB-T demodulator driver * Samsung s5h1432 DVB-T demodulator driver
*
Copyright (C) 2009 Bill Liu <Bill.Liu@Conexant.com> * Copyright (C) 2009 Bill Liu <Bill.Liu@Conexant.com>
*
This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. * (at your option) any later version.
*
This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. * GNU General Public License for more details.
*
You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
*/
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -162,7 +161,7 @@ static int s5h1432_set_IF(struct dvb_frontend *fe, u32 ifFreqHz) ...@@ -162,7 +161,7 @@ static int s5h1432_set_IF(struct dvb_frontend *fe, u32 ifFreqHz)
value = (u32) (((48000 - (ifFreqHz / 1000)) * 512 * value = (u32) (((48000 - (ifFreqHz / 1000)) * 512 *
(u32) 32768) / (48 * 1000)); (u32) 32768) / (48 * 1000));
printk(KERN_INFO printk(KERN_INFO
"Default IFFreq %d :reg value = 0x%x \n", "Default IFFreq %d :reg value = 0x%x\n",
ifFreqHz, value); ifFreqHz, value);
s5h1432_writereg(state, S5H1432_I2C_TOP_ADDR, 0xe4, s5h1432_writereg(state, S5H1432_I2C_TOP_ADDR, 0xe4,
(u8) value & 0xFF); (u8) value & 0xFF);
...@@ -379,7 +378,6 @@ struct dvb_frontend *s5h1432_attach(const struct s5h1432_config *config, ...@@ -379,7 +378,6 @@ struct dvb_frontend *s5h1432_attach(const struct s5h1432_config *config,
kfree(state); kfree(state);
return NULL; return NULL;
} }
EXPORT_SYMBOL(s5h1432_attach); EXPORT_SYMBOL(s5h1432_attach);
static struct dvb_frontend_ops s5h1432_ops = { static struct dvb_frontend_ops s5h1432_ops = {
...@@ -415,8 +413,3 @@ MODULE_PARM_DESC(debug, "Enable verbose debug messages"); ...@@ -415,8 +413,3 @@ MODULE_PARM_DESC(debug, "Enable verbose debug messages");
MODULE_DESCRIPTION("Samsung s5h1432 DVB-T Demodulator driver"); MODULE_DESCRIPTION("Samsung s5h1432 DVB-T Demodulator driver");
MODULE_AUTHOR("Bill Liu"); MODULE_AUTHOR("Bill Liu");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
/*
* Local variables:
* c-basic-offset: 8
*/
/* /*
Samsung s5h1432 VSB/QAM demodulator driver * Samsung s5h1432 VSB/QAM demodulator driver
*
Copyright (C) 2009 Bill Liu <Bill.Liu@Conexant.com> * Copyright (C) 2009 Bill Liu <Bill.Liu@Conexant.com>
*
This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. * (at your option) any later version.
*
This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. * GNU General Public License for more details.
*
You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/ */
#ifndef __S5H1432_H__ #ifndef __S5H1432_H__
#define __S5H1432_H__ #define __S5H1432_H__
...@@ -89,8 +89,3 @@ static inline struct dvb_frontend *s5h1432_attach(const struct s5h1432_config ...@@ -89,8 +89,3 @@ static inline struct dvb_frontend *s5h1432_attach(const struct s5h1432_config
#endif /* CONFIG_DVB_s5h1432 */ #endif /* CONFIG_DVB_s5h1432 */
#endif /* __s5h1432_H__ */ #endif /* __s5h1432_H__ */
/*
* Local variables:
* c-basic-offset: 8
*/
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
*******************************************************************************/ *******************************************************************************/
/****************************************************************************** /******************************************************************************
* VERVE REGISTER * * VERVE REGISTER *
* * * *
******************************************************************************/ ******************************************************************************/
static int verve_write_byte(struct cx231xx *dev, u8 saddr, u8 data) static int verve_write_byte(struct cx231xx *dev, u8 saddr, u8 data)
{ {
...@@ -936,11 +936,11 @@ void cx231xx_enable656(struct cx231xx *dev) ...@@ -936,11 +936,11 @@ void cx231xx_enable656(struct cx231xx *dev)
{ {
u8 temp = 0; u8 temp = 0;
int status; int status;
/*enable TS1 data[0:7] as output to export 656*/ /*enable TS1 data[0:7] as output to export 656*/
status = vid_blk_write_byte(dev, TS1_PIN_CTL0, 0xFF); status = vid_blk_write_byte(dev, TS1_PIN_CTL0, 0xFF);
/*enable TS1 clock as output to export 656*/ /*enable TS1 clock as output to export 656*/
status = vid_blk_read_byte(dev, TS1_PIN_CTL1, &temp); status = vid_blk_read_byte(dev, TS1_PIN_CTL1, &temp);
temp = temp|0x04; temp = temp|0x04;
...@@ -1344,13 +1344,13 @@ void cx231xx_dump_HH_reg(struct cx231xx *dev) ...@@ -1344,13 +1344,13 @@ void cx231xx_dump_HH_reg(struct cx231xx *dev)
i = i+3; i = i+3;
} }
status = vid_blk_read_word(dev, AFE_CTRL_C2HH_SRC_CTRL, &value); status = vid_blk_read_word(dev, AFE_CTRL_C2HH_SRC_CTRL, &value);
cx231xx_info("AFE_CTRL_C2HH_SRC_CTRL=0x%x\n", value); cx231xx_info("AFE_CTRL_C2HH_SRC_CTRL=0x%x\n", value);
vid_blk_write_word(dev, AFE_CTRL_C2HH_SRC_CTRL, 0x4485D390); vid_blk_write_word(dev, AFE_CTRL_C2HH_SRC_CTRL, 0x4485D390);
status = vid_blk_read_word(dev, AFE_CTRL_C2HH_SRC_CTRL, &value); status = vid_blk_read_word(dev, AFE_CTRL_C2HH_SRC_CTRL, &value);
cx231xx_info("AFE_CTRL_C2HH_SRC_CTRL=0x%x\n", value); cx231xx_info("AFE_CTRL_C2HH_SRC_CTRL=0x%x\n", value);
} }
void cx231xx_dump_SC_reg(struct cx231xx *dev) void cx231xx_dump_SC_reg(struct cx231xx *dev)
{ {
u8 value[4] = { 0, 0, 0, 0 }; u8 value[4] = { 0, 0, 0, 0 };
...@@ -1455,12 +1455,12 @@ void cx231xx_Setup_AFE_for_LowIF(struct cx231xx *dev) ...@@ -1455,12 +1455,12 @@ void cx231xx_Setup_AFE_for_LowIF(struct cx231xx *dev)
/* /*
config colibri to lo-if mode config colibri to lo-if mode
FIXME: ntf_mode = 2'b00 by default. But set 0x1 would reduce FIXME: ntf_mode = 2'b00 by default. But set 0x1 would reduce
the diff IF input by half, the diff IF input by half,
for low-if agc defect for low-if agc defect
*/ */
status = afe_read_byte(dev, ADC_NTF_PRECLMP_EN_CH3, &value); status = afe_read_byte(dev, ADC_NTF_PRECLMP_EN_CH3, &value);
...@@ -1535,10 +1535,9 @@ void cx231xx_set_Colibri_For_LowIF(struct cx231xx *dev, u32 if_freq, ...@@ -1535,10 +1535,9 @@ void cx231xx_set_Colibri_For_LowIF(struct cx231xx *dev, u32 if_freq,
u32 cx231xx_Get_Colibri_CarrierOffset(u32 mode, u32 standerd) u32 cx231xx_Get_Colibri_CarrierOffset(u32 mode, u32 standerd)
{ {
u32 colibri_carrier_offset = 0; u32 colibri_carrier_offset = 0;
if (mode == TUNER_MODE_FM_RADIO) { if (mode == TUNER_MODE_FM_RADIO) {
colibri_carrier_offset = 1100000; colibri_carrier_offset = 1100000;
} else if (standerd & (V4L2_STD_NTSC | V4L2_STD_NTSC_M_JP)) { } else if (standerd & (V4L2_STD_NTSC | V4L2_STD_NTSC_M_JP)) {
colibri_carrier_offset = 4832000; /*4.83MHz */ colibri_carrier_offset = 4832000; /*4.83MHz */
...@@ -1549,74 +1548,70 @@ u32 cx231xx_Get_Colibri_CarrierOffset(u32 mode, u32 standerd) ...@@ -1549,74 +1548,70 @@ u32 cx231xx_Get_Colibri_CarrierOffset(u32 mode, u32 standerd)
colibri_carrier_offset = 2100000; /*2.10MHz */ colibri_carrier_offset = 2100000; /*2.10MHz */
} }
return colibri_carrier_offset;
return colibri_carrier_offset;
} }
void cx231xx_set_DIF_bandpass(struct cx231xx *dev, u32 if_freq, void cx231xx_set_DIF_bandpass(struct cx231xx *dev, u32 if_freq,
u8 spectral_invert, u32 mode) u8 spectral_invert, u32 mode)
{ {
unsigned long pll_freq_word;
unsigned long pll_freq_word; int status = 0;
int status = 0; u32 dif_misc_ctrl_value = 0;
u32 dif_misc_ctrl_value = 0; u64 pll_freq_u64 = 0;
u64 pll_freq_u64 = 0; u32 i = 0;
u32 i = 0;
cx231xx_info("if_freq=%d;spectral_invert=0x%x;mode=0x%x\n", cx231xx_info("if_freq=%d;spectral_invert=0x%x;mode=0x%x\n",
if_freq, spectral_invert, mode); if_freq, spectral_invert, mode);
if (mode == TUNER_MODE_FM_RADIO) { if (mode == TUNER_MODE_FM_RADIO) {
pll_freq_word = 0x905A1CAC; pll_freq_word = 0x905A1CAC;
status = vid_blk_write_word(dev, DIF_PLL_FREQ_WORD, pll_freq_word); status = vid_blk_write_word(dev, DIF_PLL_FREQ_WORD, pll_freq_word);
} else /*KSPROPERTY_TUNER_MODE_TV*/{
/* Calculate the PLL frequency word based on the adjusted if_freq*/
pll_freq_word = if_freq;
pll_freq_u64 = (u64)pll_freq_word << 28L;
do_div(pll_freq_u64, 50000000);
pll_freq_word = (u32)pll_freq_u64;
/*pll_freq_word = 0x3463497;*/
status = vid_blk_write_word(dev, DIF_PLL_FREQ_WORD, pll_freq_word);
if (spectral_invert) {
if_freq -= 400000;
/* Enable Spectral Invert*/
status = vid_blk_read_word(dev, DIF_MISC_CTRL,
&dif_misc_ctrl_value);
dif_misc_ctrl_value = dif_misc_ctrl_value | 0x00200000;
status = vid_blk_write_word(dev, DIF_MISC_CTRL,
dif_misc_ctrl_value);
} else {
if_freq += 400000;
/* Disable Spectral Invert*/
status = vid_blk_read_word(dev, DIF_MISC_CTRL,
&dif_misc_ctrl_value);
dif_misc_ctrl_value = dif_misc_ctrl_value & 0xFFDFFFFF;
status = vid_blk_write_word(dev, DIF_MISC_CTRL,
dif_misc_ctrl_value);
}
if_freq = (if_freq/100000)*100000; } else /*KSPROPERTY_TUNER_MODE_TV*/{
/* Calculate the PLL frequency word based on the adjusted if_freq*/
pll_freq_word = if_freq;
pll_freq_u64 = (u64)pll_freq_word << 28L;
do_div(pll_freq_u64, 50000000);
pll_freq_word = (u32)pll_freq_u64;
/*pll_freq_word = 0x3463497;*/
status = vid_blk_write_word(dev, DIF_PLL_FREQ_WORD, pll_freq_word);
if (if_freq < 3000000) if (spectral_invert) {
if_freq = 3000000; if_freq -= 400000;
/* Enable Spectral Invert*/
status = vid_blk_read_word(dev, DIF_MISC_CTRL,
&dif_misc_ctrl_value);
dif_misc_ctrl_value = dif_misc_ctrl_value | 0x00200000;
status = vid_blk_write_word(dev, DIF_MISC_CTRL,
dif_misc_ctrl_value);
} else {
if_freq += 400000;
/* Disable Spectral Invert*/
status = vid_blk_read_word(dev, DIF_MISC_CTRL,
&dif_misc_ctrl_value);
dif_misc_ctrl_value = dif_misc_ctrl_value & 0xFFDFFFFF;
status = vid_blk_write_word(dev, DIF_MISC_CTRL,
dif_misc_ctrl_value);
}
if_freq = (if_freq/100000)*100000;
if (if_freq > 16000000) if (if_freq < 3000000)
if_freq = 16000000; if_freq = 3000000;
}
cx231xx_info("Enter IF=%zd\n", if (if_freq > 16000000)
sizeof(Dif_set_array)/sizeof(struct dif_settings)); if_freq = 16000000;
for (i = 0; i < sizeof(Dif_set_array)/sizeof(struct dif_settings); i++) {
if (Dif_set_array[i].if_freq == if_freq) {
status = vid_blk_write_word(dev,
Dif_set_array[i].register_address, Dif_set_array[i].value);
} }
}
cx231xx_info("Enter IF=%zd\n",
sizeof(Dif_set_array)/sizeof(struct dif_settings));
for (i = 0; i < sizeof(Dif_set_array)/sizeof(struct dif_settings); i++) {
if (Dif_set_array[i].if_freq == if_freq) {
status = vid_blk_write_word(dev,
Dif_set_array[i].register_address, Dif_set_array[i].value);
}
}
} }
/****************************************************************************** /******************************************************************************
...@@ -2122,8 +2117,8 @@ int cx231xx_tuner_post_channel_change(struct cx231xx *dev) ...@@ -2122,8 +2117,8 @@ int cx231xx_tuner_post_channel_change(struct cx231xx *dev)
{ {
int status = 0; int status = 0;
u32 dwval; u32 dwval;
cx231xx_info("cx231xx_tuner_post_channel_change dev->tuner_type =0%d\n", cx231xx_info("cx231xx_tuner_post_channel_change dev->tuner_type =0%d\n",
dev->tuner_type); dev->tuner_type);
/* Set the RF and IF k_agc values to 4 for PAL/NTSC and 8 for /* Set the RF and IF k_agc values to 4 for PAL/NTSC and 8 for
* SECAM L/B/D standards */ * SECAM L/B/D standards */
status = vid_blk_read_word(dev, DIF_AGC_IF_REF, &dwval); status = vid_blk_read_word(dev, DIF_AGC_IF_REF, &dwval);
......
/* /*
cx231xx-dif.h - driver for Conexant Cx23100/101/102 USB video capture devices * cx231xx-dif.h - driver for Conexant Cx23100/101/102 USB video capture devices
*
Copyright {C} 2009 <Bill.Liu@conexant.com> * Copyright {C} 2009 <Bill.Liu@conexant.com>
*
This program is free software, you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 2 of the License, or
(at your option) any later version. * (at your option) any later version.
*
This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY, without even the implied warranty of * but WITHOUT ANY WARRANTY, without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. * GNU General Public License for more details.
*
You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
along with this program, if not, write to the Free Software * along with this program, if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#ifndef _CX231XX_DIF_H #ifndef _CX231XX_DIF_H
......
...@@ -56,13 +56,13 @@ ...@@ -56,13 +56,13 @@
/* Boards supported by driver */ /* Boards supported by driver */
#define CX231XX_BOARD_UNKNOWN 0 #define CX231XX_BOARD_UNKNOWN 0
#define CX231XX_BOARD_CNXT_CARRAERA 1 #define CX231XX_BOARD_CNXT_CARRAERA 1
#define CX231XX_BOARD_CNXT_SHELBY 2 #define CX231XX_BOARD_CNXT_SHELBY 2
#define CX231XX_BOARD_CNXT_RDE_253S 3 #define CX231XX_BOARD_CNXT_RDE_253S 3
#define CX231XX_BOARD_CNXT_RDU_253S 4 #define CX231XX_BOARD_CNXT_RDU_253S 4
#define CX231XX_BOARD_CNXT_VIDEO_GRABBER 5 #define CX231XX_BOARD_CNXT_VIDEO_GRABBER 5
#define CX231XX_BOARD_CNXT_RDE_250 6 #define CX231XX_BOARD_CNXT_RDE_250 6
#define CX231XX_BOARD_CNXT_RDU_250 7 #define CX231XX_BOARD_CNXT_RDU_250 7
#define CX231XX_BOARD_HAUPPAUGE_EXETER 8 #define CX231XX_BOARD_HAUPPAUGE_EXETER 8
#define CX231XX_BOARD_HAUPPAUGE_USBLIVE2 9 #define CX231XX_BOARD_HAUPPAUGE_USBLIVE2 9
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册