drxk cleanups
cover drxk cleanups
While checking for log10 implementations at DVB code, I noticed that drxk had its own implementation for it.
So, I decided to do a cleanup there, using the existing implementation.
I also took some time to cleanup (most of) the remaining checkpatch.pl compliants, as it really sucks to work on a code that it is too polluted.
No functional changes should be noticed after applying this patch series.
Assuming that 3.9-rc8 will be the final one, the patches on this series are meant to be applied for Kernel 3.11.
Mauro Carvalho Chehab (9):
[media] drxk_hard: don't re-implement log10 [media] drxk_hard: Don't use CamelCase
[media] drxk_hard: use pr_info/pr_warn/pr_err/... macros [media] drxk_hard: don't split strings across lines [media] drxk_hard: use usleep_range()
[media] drxk_hard.h: Remove some alien comment markups [media] drxk_hard.h: don't use more than 80 columns [media] drxk_hard: remove needless parenthesis [media] drxk_hard: Remove most 80-cols checkpatch warnings
drivers/media/dvb-frontends/drxk.h | 2 +- drivers/media/dvb-frontends/drxk_hard.c | 3154 ++++++++++++++++--------------- drivers/media/dvb-frontends/drxk_hard.h | 277 +-- 3 files changed, 1745 insertions(+), 1688 deletions(-)
Signature · 1 line
1.8.1.4
PATCH 1/9 drxk_hard: don't re-implement log10
Log10 routine is already defined at dvb_math.h and provides a good enough approximation for 100 x log10(). So, instead of reinventing the wheel, use the already existing function.
While here, don't use CamelCase on the function name.
--- drivers/media/dvb-frontends/drxk_hard.c | 104 +++----------------------------- 1 file changed, 8 insertions(+), 96 deletions(-)
drivers/media/dvb-frontends/drxk_hard.c +8 -96
@@ -34,6 +34,7 @@#include "dvb_frontend.h" #include "drxk.h" #include "drxk_hard.h" +#include "dvb_math.h" static int PowerDownDVBT (struct drxk_state *state,bool setPowerMode);static int PowerDownQAM (struct drxk_state *state);
@@ -201,98 +202,9 @@ static inline u32 Frac28a(u32 a, u32 c)return Q1 ; } -static u32 Log10Times100 (u32 x) +static inline u32 log10times100 (u32 value) { -static const u8 scale =15 ; -static const u8 indexWidth =5 ; -u8 i =0 ; -u32 y =0 ; -u32 d =0 ; -u32 k =0 ; -u32 r =0 ; -/* -log2lut[n] = (1<<scale) * 200 * log2(1.0 + ((1.0/(1<<INDEXWIDTH)) * n)) -0 <= n < ((1<<INDEXWIDTH)+1) -*/ - -static const u32 log2lut[] = { -0 ,/* 0.000000 */ -290941 ,/* 290941.300628 */ -573196 ,/* 573196.476418 */ -847269 ,/* 847269.179851 */ -1113620 ,/* 1113620.489452 */ -1372674 ,/* 1372673.576986 */ -1624818 ,/* 1624817.752104 */ -1870412 ,/* 1870411.981536 */ -2109788 ,/* 2109787.962654 */ -2343253 ,/* 2343252.817465 */ -2571091 ,/* 2571091.461923 */ -2793569 ,/* 2793568.696416 */ -3010931 ,/* 3010931.055901 */ -3223408 ,/* 3223408.452106 */ -3431216 ,/* 3431215.635215 */ -3634553 ,/* 3634553.498355 */ -3833610 ,/* 3833610.244726 */ -4028562 ,/* 4028562.434393 */ -4219576 ,/* 4219575.925308 */ -4406807 ,/* 4406806.721144 */ -4590402 ,/* 4590401.736809 */ -4770499 ,/* 4770499.491025 */ -4947231 ,/* 4947230.734179 */ -5120719 ,/* 5120719.018555 */ -5291081 ,/* 5291081.217197 */ -5458428 ,/* 5458427.996830 */ -5622864 ,/* 5622864.249668 */ -5784489 ,/* 5784489.488298 */ -5943398 ,/* 5943398.207380 */ -6099680 ,/* 6099680.215452 */ -6253421 ,/* 6253420.939751 */ -6404702 ,/* 6404701.706649 */ -6553600 ,/* 6553600.000000 */ - }; - - -if (x ==0 ) -return 0 ; - -/* Scale x (normalize) */ -/* computing y in log(x/y) = log(x) - log(y) */ -if ((x & ((0xffffffff ) << (scale +1 ))) ==0 ) { -for (k = scale; k >0 ; k--) { -if (x & (((u32 )1 ) << scale)) -break ; - x <<=1 ; - } - }else { -for (k = scale; k <31 ; k++) { -if ((x & (((u32) (-1 )) << (scale +1 ))) ==0 ) -break ; - x >>=1 ; - } - } -/* -Now x has binary point between bit[scale] and bit[scale-1] -and 1.0 <= x < 2.0 */ - -/* correction for divison: log(x) = log(x/y)+log(y) */ - y = k * ((((u32 )1 ) << scale) *200 ); - -/* remove integer part */ - x &= ((((u32 )1 ) << scale) -1 ); -/* get index */ - i = (u8) (x >> (scale - indexWidth)); -/* compute delta (x - a) */ - d = x & ((((u32 )1 ) << (scale - indexWidth)) -1 ); -/* compute log, multiplication (d* (..)) must be within range ! */ - y += log2lut[i] + - ((d * (log2lut[i +1 ] - log2lut[i])) >> (scale - indexWidth)); -/* Conver to log10() */ - y /=108853 ;/* (log2(10) << scale) */ - r = (y >>1 ); -/* rounding */ -if (y & ((u32 )1 )) - r++; -return r; +return (100L *intlog10 (value)) >>24 ; }/****************************************************************************/
@@ -2530,8 +2442,8 @@ static int GetQAMSignalToNoise(struct drxk_state *state, }if (qamSlErrPower >0 ) { - qamSlMer =Log10Times100 (qamSlSigPower) - -Log10Times100 ((u32 ) qamSlErrPower); + qamSlMer =log10times100 (qamSlSigPower) - +log10times100 ((u32 ) qamSlErrPower); } *pSignalToNoise = qamSlMer;
@@ -2620,12 +2532,12 @@ static int GetDVBTSignalToNoise(struct drxk_state *state,*/ /* log(x) x = 9bits * 9bits->18 bits */ - a =Log10Times100 (EqRegTdTpsPwrOfs * + a =log10times100 (EqRegTdTpsPwrOfs * EqRegTdTpsPwrOfs);/* log(x) x = 16bits * 7bits->23 bits */ - b =Log10Times100 (EqRegTdReqSmbCnt * tpsCnt); + b =log10times100 (EqRegTdReqSmbCnt * tpsCnt);/* log(x) x = (16bits + 16bits) << 15 ->32 bits */ - c =Log10Times100 (SqrErrIQ); + c =log10times100 (SqrErrIQ); iMER = a + b - c; }
Signature · 1 line
1.8.1.4
PATCH 2/9 drxk_hard: Don't use CamelCase
In reply to Mauro Carvalho ChehabThare are lots of CamelCase warnings produced by checkpatch.pl. This weren't fixed at the time the driver got submitted due to the lack of manpower do to such cleanup.
Now that I have one script that automates this task, cleans it. That makes the driver almost checkpatch-compliant, except for 80 column warnings.
--- drivers/media/dvb-frontends/drxk.h | 2 +- drivers/media/dvb-frontends/drxk_hard.c | 2558 +++++++++++++++---------------- drivers/media/dvb-frontends/drxk_hard.h | 248 +-- 3 files changed, 1404 insertions(+), 1404 deletions(-)
drivers/media/dvb-frontends/drxk.h +1 -1
@@ -8,7 +8,7 @@/** * struct drxk_config - Configure the initial parameters for DRX-K * -* @adr: I2C Address of the DRX-K +* @adr: I2C address of the DRX-K * @parallel_ts: True means that the device uses parallel TS, * Serial otherwise. * @dynamic_clk: True means that the clock will be dynamically
drivers/media/dvb-frontends/drxk_hard.c +1279 -1279
2,992 lines not on this page · raw message
drivers/media/dvb-frontends/drxk_hard.h +124 -124
248 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.8.1.4
Part of the diff is not shown here. View the raw message.
PATCH 3/9 drxk_hard: use pr_info/pr_warn/pr_err/... macros
In reply to Mauro Carvalho Chehabreplace all occurrences of printk(KERN_* by
pr_info/pr_warn/pr_err/pr_debug/pr_cont macros.
--- drivers/media/dvb-frontends/drxk_hard.c | 182 ++++++++++++++++---------------- 1 file changed, 89 insertions(+), 93 deletions(-)
drivers/media/dvb-frontends/drxk_hard.c +89 -93
@@ -21,6 +21,8 @@* Or, point your browser to http://www.gnu.org/copyleft/gpl.html */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/module.h> #include <linux/moduleparam.h>
@@ -264,7 +266,7 @@ static int i2c_write(struct drxk_state *state, u8 adr, u8 *data, int len) status = -EIO ;if (status <0 ) -printk (KERN_ERR "drxk: i2c write error at addr 0x%02x\n" , adr); +pr_err ("i2c write error at addr 0x%02x\n" , adr);return status; }
@@ -287,7 +289,7 @@ static int i2c_read(struct drxk_state *state,if (status >=0 ) status = -EIO ; -printk (KERN_ERR "drxk: i2c read error at addr 0x%02x\n" , adr); +pr_err ("i2c read error at addr 0x%02x\n" , adr);return status; }if (debug >2 ) {
@@ -474,7 +476,7 @@ static int write_block(struct drxk_state *state, u32 address, status =i2c_write (state, state->demod_address, &state->chunk[0 ], chunk + adr_length);if (status <0 ) { -printk (KERN_ERR "drxk: %s: i2c write error at addr 0x%02x\n" , +pr_err ("%s: i2c write error at addr 0x%02x\n" , __func__, address);break ; }
@@ -531,7 +533,7 @@ static int power_up_device(struct drxk_state *state) error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -800,7 +802,7 @@ static int drxx_open(struct drxk_state *state) status =write16 (state,SIO_TOP_COMM_KEY__A , key); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -845,7 +847,7 @@ static int get_device_capabilities(struct drxk_state *state) state->m_osc_clock_freq =20250 ;break ;default : -printk (KERN_ERR "drxk: Clock Frequency is unknown\n" ); +pr_err ("Clock Frequency is unknown\n" );return -EINVAL ; }/*
@@ -856,7 +858,7 @@ static int get_device_capabilities(struct drxk_state *state)if (status <0 ) goto error; -printk (KERN_INFO "drxk: status = 0x%08x\n" , sio_top_jtagid_lo); +pr_info ("status = 0x%08x\n" , sio_top_jtagid_lo);/* driver 0.9.0 */ switch ((sio_top_jtagid_lo >>29 ) &0xF ) {
@@ -875,8 +877,7 @@ static int get_device_capabilities(struct drxk_state *state)default : state->m_device_spin =DRXK_SPIN_UNKNOWN ; status = -EINVAL ; -printk (KERN_ERR "drxk: Spin %d unknown\n" , - (sio_top_jtagid_lo >>29 ) &0xF ); +pr_err ("Spin %d unknown\n" , (sio_top_jtagid_lo >>29 ) &0xF ); goto error2; }switch ((sio_top_jtagid_lo >>12 ) &0xFF ) {
@@ -985,21 +986,20 @@ static int get_device_capabilities(struct drxk_state *state) state->m_has_irqn = false;break ;default : -printk (KERN_ERR "drxk: DeviceID 0x%02x not supported\n" , +pr_err ("DeviceID 0x%02x not supported\n" , ((sio_top_jtagid_lo >>12 ) &0xFF )); status = -EINVAL ; goto error2; } -printk (KERN_INFO -"drxk: detected a drx-39%02xk, spin %s, xtal %d.%03d MHz\n" , +pr_info ("detected a drx-39%02xk, spin %s, xtal %d.%03d MHz\n" , ((sio_top_jtagid_lo >>12 ) &0xFF ), spin, state->m_osc_clock_freq /1000 , state->m_osc_clock_freq %1000 ); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__); error2:return status;
@@ -1042,7 +1042,7 @@ static int hi_command(struct drxk_state *state, u16 cmd, u16 *p_result) } error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1081,7 +1081,7 @@ static int hi_cfg_command(struct drxk_state *state) error:mutex_unlock (&state->mutex);if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1244,7 +1244,7 @@ static int mpegts_configure_pins(struct drxk_state *state, bool mpeg_enable) status =write16 (state,SIO_TOP_COMM_KEY__A ,0x0000 ); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1287,13 +1287,13 @@ static int bl_chain_cmd(struct drxk_state *state, ((time_is_after_jiffies(end))));if (bl_status ==0x1 ) { -printk (KERN_ERR "drxk: SIO not ready\n" ); +pr_err ("SIO not ready\n" ); status = -EINVAL ; goto error2; } error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__); error2:mutex_unlock (&state->mutex);return status;
@@ -1349,13 +1349,13 @@ static int download_microcode(struct drxk_state *state, offset +=sizeof (u16);if (offset + block_size > length) { -printk (KERN_ERR "drxk: Firmware is corrupted.\n" ); +pr_err ("Firmware is corrupted.\n" );return -EINVAL ; } status =write_block (state, address, block_size, p_src);if (status <0 ) { -printk (KERN_ERR "drxk: Error %d while loading firmware\n" , status); +pr_err ("Error %d while loading firmware\n" , status);break ; } p_src += block_size;
@@ -1395,7 +1395,7 @@ static int dvbt_enable_ofdm_token_ring(struct drxk_state *state, bool enable)msleep (1 ); }while (1 );if (data != desired_status) { -printk (KERN_ERR "drxk: SIO not ready\n" ); +pr_err ("SIO not ready\n" );return -EINVAL ; }return status;
@@ -1427,7 +1427,7 @@ static int mpegts_stop(struct drxk_state *state) error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1451,7 +1451,7 @@ static int scu_command(struct drxk_state *state,if ((cmd ==0 ) || ((parameter_len >0 ) && (parameter ==NULL )) || ((result_len >0 ) && (result ==NULL ))) { -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1477,7 +1477,7 @@ static int scu_command(struct drxk_state *state, goto error; }while (!(cur_cmd ==DRX_SCU_READY ) && (time_is_after_jiffies (end)));if (cur_cmd !=DRX_SCU_READY ) { -printk (KERN_ERR "drxk: SCU not ready\n" ); +pr_err ("SCU not ready\n" ); status = -EIO ; goto error2; }
@@ -1515,7 +1515,7 @@ static int scu_command(struct drxk_state *state,sprintf (errname,"ERROR: %d\n" , err); p = errname; } -printk (KERN_ERR "drxk: %s while sending cmd 0x%04x with params:" , p, cmd); +pr_err ("%s while sending cmd 0x%04x with params:" , p, cmd);print_hex_dump_bytes ("drxk: " ,DUMP_PREFIX_NONE , buffer, cnt); status = -EINVAL ; goto error2;
@@ -1523,7 +1523,7 @@ static int scu_command(struct drxk_state *state, error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__); error2:mutex_unlock (&state->mutex);return status;
@@ -1559,7 +1559,7 @@ static int set_iqm_af(struct drxk_state *state, bool active) error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1664,7 +1664,7 @@ static int ctrl_power_mode(struct drxk_state *state, enum drx_power_mode *mode) error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1716,7 +1716,7 @@ static int power_down_dvbt(struct drxk_state *state, bool set_power_mode) } error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1796,7 +1796,7 @@ static int setoperation_mode(struct drxk_state *state, } error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1847,7 +1847,7 @@ static int start(struct drxk_state *state, s32 offset_freq, } error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1885,7 +1885,7 @@ static int get_lock_status(struct drxk_state *state, u32 *p_lock_status) } error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1906,7 +1906,7 @@ static int mpegts_start(struct drxk_state *state) status =write16 (state,FEC_OC_SNC_UNLOCK__A ,1 ); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1952,7 +1952,7 @@ static int mpegts_dto_init(struct drxk_state *state) status =write16 (state,FEC_OC_SNC_HWM__A ,12 ); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -2089,7 +2089,7 @@ static int mpegts_dto_setup(struct drxk_state *state, status =write16 (state,FEC_OC_TMD_MODE__A , fec_oc_tmd_mode); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -2269,7 +2269,7 @@ static int set_agc_rf(struct drxk_state *state, } error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -2397,7 +2397,7 @@ static int set_agc_if(struct drxk_state *state, status =write16 (state,SCU_RAM_AGC_INGAIN_TGT_MIN__A , p_agc_cfg->top); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -2418,7 +2418,7 @@ static int get_qam_signal_to_noise(struct drxk_state *state,/* get the register value needed for MER */ status =read16 (state,QAM_SL_ERR_POWER__A , &qam_sl_err_power);if (status <0 ) { -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return -EINVAL ; }
@@ -2545,7 +2545,7 @@ static int get_dvbt_signal_to_noise(struct drxk_state *state, error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -2740,7 +2740,7 @@ static int ConfigureI2CBridge(struct drxk_state *state, bool b_enable_bridge) error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -2758,7 +2758,7 @@ static int set_pre_saw(struct drxk_state *state, status =write16 (state,IQM_AF_PDREF__A , p_pre_saw_cfg->reference); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -2800,13 +2800,13 @@ static int bl_direct_cmd(struct drxk_state *state, u32 target_addr, goto error; }while ((bl_status ==0x1 ) &&time_is_after_jiffies (end));if (bl_status ==0x1 ) { -printk (KERN_ERR "drxk: SIO not ready\n" ); +pr_err ("SIO not ready\n" ); status = -EINVAL ; goto error2; } error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__); error2:mutex_unlock (&state->mutex);return status;
@@ -2847,7 +2847,7 @@ static int adc_sync_measurement(struct drxk_state *state, u16 *count) error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -2891,7 +2891,7 @@ static int adc_synchronization(struct drxk_state *state) status = -EINVAL ; error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -2957,7 +2957,7 @@ static int set_frequency_shifter(struct drxk_state *state, status =write32 (state,IQM_FS_RATE_OFS_LO__A , state->m_iqm_fs_rate_ofs);if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -2992,7 +2992,8 @@ static int init_agc(struct drxk_state *state, bool is_dtv)/* AGCInit() not available for DVBT; init done in microcode */ if (!is_qam (state)) { -printk (KERN_ERR "drxk: %s: mode %d is not DVB-C\n" , __func__, state->m_operation_mode); +pr_err ("%s: mode %d is not DVB-C\n" , + __func__, state->m_operation_mode);return -EINVAL ; }
@@ -3145,7 +3146,7 @@ static int init_agc(struct drxk_state *state, bool is_dtv) status =write16 (state,SCU_RAM_AGC_KI__A , data); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -3159,7 +3160,7 @@ static int dvbtqam_get_acc_pkt_err(struct drxk_state *state, u16 *packet_err)else status =read16 (state,SCU_RAM_FEC_ACCUM_PKT_FAILURES__A , packet_err);if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -3279,7 +3280,7 @@ static int dvbt_sc_command(struct drxk_state *state, }/* switch (cmd->cmd) */ error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -3291,7 +3292,7 @@ static int power_up_dvbt(struct drxk_state *state)dprintk (1 ,"\n" ); status =ctrl_power_mode (state, &power_mode);if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -3305,7 +3306,7 @@ static int dvbt_ctrl_set_inc_enable(struct drxk_state *state, bool *enabled)else status =write16 (state,IQM_CF_BYPASSDET__A ,1 );if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -3325,7 +3326,7 @@ static int dvbt_ctrl_set_fr_enable(struct drxk_state *state, bool *enabled) status =write16 (state,OFDM_SC_RA_RAM_FR_THRES_8K__A ,0 ); }if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -3361,7 +3362,7 @@ static int dvbt_ctrl_set_echo_threshold(struct drxk_state *state, status =write16 (state,OFDM_SC_RA_RAM_ECHO_THRES__A , data); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -3384,7 +3385,7 @@ static int dvbt_ctrl_set_sqi_speed(struct drxk_state *state, (u16) *speed); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -3423,7 +3424,7 @@ static int dvbt_activate_presets(struct drxk_state *state) status =write16 (state,SCU_RAM_AGC_INGAIN_TGT_MAX__A , state->m_dvbt_if_agc_cfg.ingain_tgt_max); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -3629,7 +3630,7 @@ static int set_dvbt_standard(struct drxk_state *state, error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -3661,7 +3662,7 @@ static int dvbt_start(struct drxk_state *state) goto error; error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -3980,7 +3981,7 @@ static int set_dvbt(struct drxk_state *state, u16 intermediate_freqk_hz, status =dvbt_ctrl_set_sqi_speed (state, &state->m_sqi_speed); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -4031,7 +4032,7 @@ static int get_dvbt_lock_status(struct drxk_state *state, u32 *p_lock_status) *p_lock_status =NEVER_LOCK ; end:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -4044,7 +4045,7 @@ static int power_up_qam(struct drxk_state *state)dprintk (1 ,"\n" ); status =ctrl_power_mode (state, &power_mode);if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -4079,7 +4080,7 @@ static int power_down_qam(struct drxk_state *state) error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -4167,7 +4168,7 @@ static int set_qam_measurement(struct drxk_state *state, status =write16 (state,FEC_OC_SNC_FAIL_PERIOD__A , fec_rs_period); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -4353,7 +4354,7 @@ static int set_qam16(struct drxk_state *state) error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -4548,7 +4549,7 @@ static int set_qam32(struct drxk_state *state) status =write16 (state,SCU_RAM_QAM_FSM_LCAVG_OFFSET5__A , (u16) -86 ); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -4741,7 +4742,7 @@ static int set_qam64(struct drxk_state *state) status =write16 (state,SCU_RAM_QAM_FSM_LCAVG_OFFSET5__A , (u16) -80 ); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -4937,7 +4938,7 @@ static int set_qam128(struct drxk_state *state) status =write16 (state,SCU_RAM_QAM_FSM_LCAVG_OFFSET5__A , (u16) -23 ); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -5132,7 +5133,7 @@ static int set_qam256(struct drxk_state *state) status =write16 (state,SCU_RAM_QAM_FSM_LCAVG_OFFSET5__A , (u16) -8 ); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -5158,7 +5159,7 @@ static int qam_reset_qam(struct drxk_state *state) status =scu_command (state,SCU_RAM_COMMAND_STANDARD_QAM |SCU_RAM_COMMAND_CMD_DEMOD_RESET ,0 ,NULL ,1 , &cmd_result); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -5228,7 +5229,7 @@ static int qam_set_symbolrate(struct drxk_state *state) error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -5253,7 +5254,7 @@ static int get_qam_lock_status(struct drxk_state *state, u32 *p_lock_status)SCU_RAM_COMMAND_CMD_DEMOD_GET_LOCK ,0 ,NULL ,2 , result);if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);if (result[1 ] <SCU_RAM_QAM_LOCKED_LOCKED_DEMOD_LOCKED ) {/* 0x0000 NOT LOCKED */
@@ -5324,15 +5325,14 @@ static int qam_demodulator_command(struct drxk_state *state, number_of_parameters, set_param_parameters, 1, &cmd_result); }else { -printk (KERN_WARNING "drxk: Unknown QAM demodulator parameter " -"count %d\n" , number_of_parameters); +pr_warn ("Unknown QAM demodulator parameter count %d\n" , + number_of_parameters); status = -EINVAL ; } error:if (status <0 ) -printk (KERN_WARNING "drxk: Warning %d on %s\n" , - status, __func__); +pr_warn ("Warning %d on %s\n" , status, __func__);return status; }
@@ -5587,7 +5587,7 @@ static int set_qam(struct drxk_state *state, u16 intermediate_freqk_hz, error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -5749,7 +5749,7 @@ static int set_qam_standard(struct drxk_state *state, status =write16 (state,SCU_COMM_EXEC__A ,SCU_COMM_EXEC_ACTIVE ); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -5832,7 +5832,7 @@ static int write_gpio(struct drxk_state *state) status =write16 (state,SIO_TOP_COMM_KEY__A ,0x0000 ); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -5857,7 +5857,7 @@ static int switch_antenna_to_qam(struct drxk_state *state) status =write_gpio (state); }if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -5882,7 +5882,7 @@ static int switch_antenna_to_dvbt(struct drxk_state *state) status =write_gpio (state); }if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -5919,7 +5919,7 @@ static int power_down_device(struct drxk_state *state) status =hi_cfg_command (state); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -6060,7 +6060,7 @@ static int init_drxk(struct drxk_state *state)if (status <0 ) goto error; -printk (KERN_INFO "DRXK driver version %d.%d.%d\n" , +pr_info ("DRXK driver version %d.%d.%d\n" ,DRXK_VERSION_MAJOR ,DRXK_VERSION_MINOR ,DRXK_VERSION_PATCH );
@@ -6128,7 +6128,7 @@ error:if (status <0 ) { state->m_drxk_state =DRXK_NO_DEV ;drxk_i2c_unlock (state); -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__); }return status;
@@ -6141,11 +6141,9 @@ static void load_firmware_cb(const struct firmware *fw,dprintk (1 ,": %s\n" , fw ?"firmware loaded" :"firmware not loaded" );if (!fw) { -printk (KERN_ERR -"drxk: Could not load firmware file %s.\n" , +pr_err ("Could not load firmware file %s.\n" , state->microcode_name); -printk (KERN_INFO -"drxk: Copy %s to your hotplug directory!\n" , +pr_info ("Copy %s to your hotplug directory!\n" , state->microcode_name); state->microcode_name =NULL ;
@@ -6219,8 +6217,7 @@ static int drxk_set_parameters(struct dvb_frontend *fe)return -EAGAIN ;if (!fe->ops.tuner_ops.get_if_frequency) { -printk (KERN_ERR -"drxk: Error: get_if_frequency() not defined at tuner. Can't work without it!\n" ); +pr_err ("Error: get_if_frequency() not defined at tuner. Can't work without it!\n" );return -EINVAL ; }
@@ -6704,8 +6701,7 @@ struct dvb_frontend *drxk_attach(const struct drxk_config *config,GFP_KERNEL , state, load_firmware_cb);if (status <0 ) { -printk (KERN_ERR -"drxk: failed to request a firmware\n" ); +pr_err ("failed to request a firmware\n" );return NULL ; } }
@@ -6733,11 +6729,11 @@ struct dvb_frontend *drxk_attach(const struct drxk_config *config, p->post_bit_error.stat[0 ].scale =FE_SCALE_NOT_AVAILABLE ; p->post_bit_count.stat[0 ].scale =FE_SCALE_NOT_AVAILABLE ; -printk (KERN_INFO "drxk: frontend initialized.\n" ); +pr_info ("frontend initialized.\n" );return &state->frontend; error: -printk (KERN_ERR "drxk: not found\n" ); +pr_err ("not found\n" );kfree (state);return NULL ; }
Signature · 1 line
1.8.1.4
Re: [PATCH 3/9] [media] drxk_hard: use pr_info/pr_warn/pr_err/... macros
Em Sun, 28 Apr 2013 12:47:45 -0300
Mauro Carvalho Chehab <[email protected]> escreveu:
Quoted 5 lines
replace all occurrences of printk(KERN_* by
pr_info/pr_warn/pr_err/pr_debug/pr_cont macros.Signed-off-by Mauro Carvalho Chehab <[email protected]>---
Sorry... sent the wrong version. The correct one is attached.
-
[PATCH] [media] drxk_hard: use pr_info/pr_warn/pr_err/... macros
replace all occurrences of printk(KERN_* by
pr_info/pr_warn/pr_err/pr_debug/pr_cont macros.
drivers/media/dvb-frontends/drxk_hard.c +99 -103
@@ -21,6 +21,8 @@* Or, point your browser to http://www.gnu.org/copyleft/gpl.html */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/module.h> #include <linux/moduleparam.h>
@@ -166,7 +168,7 @@ MODULE_PARM_DESC(debug, "enable debug messages"); #define dprintk(level, fmt, arg...) do { \ if (debug >= level) \ - printk(KERN_DEBUG "drxk: %s" fmt, __func__, ## arg); \ + pr_debug(fmt, ##arg); \ } while (0)
@@ -256,15 +258,15 @@ static int i2c_write(struct drxk_state *state, u8 adr, u8 *data, int len)if (debug >2 ) {int i;for (i =0 ; i < len; i++) -printk (KERN_CONT " %02x" , data[i]); -printk (KERN_CONT "\n" ); +pr_cont (" %02x" , data[i]); +pr_cont ("\n" ); } status =drxk_i2c_transfer (state, &msg,1 );if (status >=0 && status !=1 ) status = -EIO ;if (status <0 ) -printk (KERN_ERR "drxk: i2c write error at addr 0x%02x\n" , adr); +pr_err ("i2c write error at addr 0x%02x\n" , adr);return status; }
@@ -283,22 +285,22 @@ static int i2c_read(struct drxk_state *state, status =drxk_i2c_transfer (state, msgs,2 );if (status !=2 ) {if (debug >2 ) -printk (KERN_CONT ": ERROR!\n" ); +pr_cont (": ERROR!\n" );if (status >=0 ) status = -EIO ; -printk (KERN_ERR "drxk: i2c read error at addr 0x%02x\n" , adr); +pr_err ("i2c read error at addr 0x%02x\n" , adr);return status; }if (debug >2 ) {int i;dprintk (2 ,": read from" );for (i =0 ; i < len; i++) -printk (KERN_CONT " %02x" , msg[i]); -printk (KERN_CONT ", value = " ); +pr_cont (" %02x" , msg[i]); +pr_cont (", value = " );for (i =0 ; i < alen; i++) -printk (KERN_CONT " %02x" , answ[i]); -printk (KERN_CONT "\n" ); +pr_cont (" %02x" , answ[i]); +pr_cont ("\n" ); }return 0 ; }
@@ -468,13 +470,13 @@ static int write_block(struct drxk_state *state, u32 address,int i;if (p_block)for (i =0 ; i < chunk; i++) -printk (KERN_CONT " %02x" , p_block[i]); -printk (KERN_CONT "\n" ); +pr_cont (" %02x" , p_block[i]); +pr_cont ("\n" ); } status =i2c_write (state, state->demod_address, &state->chunk[0 ], chunk + adr_length);if (status <0 ) { -printk (KERN_ERR "drxk: %s: i2c write error at addr 0x%02x\n" , +pr_err ("%s: i2c write error at addr 0x%02x\n" , __func__, address);break ; }
@@ -531,7 +533,7 @@ static int power_up_device(struct drxk_state *state) error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -800,7 +802,7 @@ static int drxx_open(struct drxk_state *state) status =write16 (state,SIO_TOP_COMM_KEY__A , key); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -845,7 +847,7 @@ static int get_device_capabilities(struct drxk_state *state) state->m_osc_clock_freq =20250 ;break ;default : -printk (KERN_ERR "drxk: Clock Frequency is unknown\n" ); +pr_err ("Clock Frequency is unknown\n" );return -EINVAL ; }/*
@@ -856,7 +858,7 @@ static int get_device_capabilities(struct drxk_state *state)if (status <0 ) goto error; -printk (KERN_INFO "drxk: status = 0x%08x\n" , sio_top_jtagid_lo); +pr_info ("status = 0x%08x\n" , sio_top_jtagid_lo);/* driver 0.9.0 */ switch ((sio_top_jtagid_lo >>29 ) &0xF ) {
@@ -875,8 +877,7 @@ static int get_device_capabilities(struct drxk_state *state)default : state->m_device_spin =DRXK_SPIN_UNKNOWN ; status = -EINVAL ; -printk (KERN_ERR "drxk: Spin %d unknown\n" , - (sio_top_jtagid_lo >>29 ) &0xF ); +pr_err ("Spin %d unknown\n" , (sio_top_jtagid_lo >>29 ) &0xF ); goto error2; }switch ((sio_top_jtagid_lo >>12 ) &0xFF ) {
@@ -985,21 +986,20 @@ static int get_device_capabilities(struct drxk_state *state) state->m_has_irqn = false;break ;default : -printk (KERN_ERR "drxk: DeviceID 0x%02x not supported\n" , +pr_err ("DeviceID 0x%02x not supported\n" , ((sio_top_jtagid_lo >>12 ) &0xFF )); status = -EINVAL ; goto error2; } -printk (KERN_INFO -"drxk: detected a drx-39%02xk, spin %s, xtal %d.%03d MHz\n" , +pr_info ("detected a drx-39%02xk, spin %s, xtal %d.%03d MHz\n" , ((sio_top_jtagid_lo >>12 ) &0xFF ), spin, state->m_osc_clock_freq /1000 , state->m_osc_clock_freq %1000 ); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__); error2:return status;
@@ -1042,7 +1042,7 @@ static int hi_command(struct drxk_state *state, u16 cmd, u16 *p_result) } error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1081,7 +1081,7 @@ static int hi_cfg_command(struct drxk_state *state) error:mutex_unlock (&state->mutex);if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1244,7 +1244,7 @@ static int mpegts_configure_pins(struct drxk_state *state, bool mpeg_enable) status =write16 (state,SIO_TOP_COMM_KEY__A ,0x0000 ); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1287,13 +1287,13 @@ static int bl_chain_cmd(struct drxk_state *state, ((time_is_after_jiffies(end))));if (bl_status ==0x1 ) { -printk (KERN_ERR "drxk: SIO not ready\n" ); +pr_err ("SIO not ready\n" ); status = -EINVAL ; goto error2; } error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__); error2:mutex_unlock (&state->mutex);return status;
@@ -1349,13 +1349,13 @@ static int download_microcode(struct drxk_state *state, offset +=sizeof (u16);if (offset + block_size > length) { -printk (KERN_ERR "drxk: Firmware is corrupted.\n" ); +pr_err ("Firmware is corrupted.\n" );return -EINVAL ; } status =write_block (state, address, block_size, p_src);if (status <0 ) { -printk (KERN_ERR "drxk: Error %d while loading firmware\n" , status); +pr_err ("Error %d while loading firmware\n" , status);break ; } p_src += block_size;
@@ -1395,7 +1395,7 @@ static int dvbt_enable_ofdm_token_ring(struct drxk_state *state, bool enable)msleep (1 ); }while (1 );if (data != desired_status) { -printk (KERN_ERR "drxk: SIO not ready\n" ); +pr_err ("SIO not ready\n" );return -EINVAL ; }return status;
@@ -1427,7 +1427,7 @@ static int mpegts_stop(struct drxk_state *state) error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1451,7 +1451,7 @@ static int scu_command(struct drxk_state *state,if ((cmd ==0 ) || ((parameter_len >0 ) && (parameter ==NULL )) || ((result_len >0 ) && (result ==NULL ))) { -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1477,7 +1477,7 @@ static int scu_command(struct drxk_state *state, goto error; }while (!(cur_cmd ==DRX_SCU_READY ) && (time_is_after_jiffies (end)));if (cur_cmd !=DRX_SCU_READY ) { -printk (KERN_ERR "drxk: SCU not ready\n" ); +pr_err ("SCU not ready\n" ); status = -EIO ; goto error2; }
@@ -1515,7 +1515,7 @@ static int scu_command(struct drxk_state *state,sprintf (errname,"ERROR: %d\n" , err); p = errname; } -printk (KERN_ERR "drxk: %s while sending cmd 0x%04x with params:" , p, cmd); +pr_err ("%s while sending cmd 0x%04x with params:" , p, cmd);print_hex_dump_bytes ("drxk: " ,DUMP_PREFIX_NONE , buffer, cnt); status = -EINVAL ; goto error2;
@@ -1523,7 +1523,7 @@ static int scu_command(struct drxk_state *state, error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__); error2:mutex_unlock (&state->mutex);return status;
@@ -1559,7 +1559,7 @@ static int set_iqm_af(struct drxk_state *state, bool active) error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1664,7 +1664,7 @@ static int ctrl_power_mode(struct drxk_state *state, enum drx_power_mode *mode) error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1716,7 +1716,7 @@ static int power_down_dvbt(struct drxk_state *state, bool set_power_mode) } error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1796,7 +1796,7 @@ static int setoperation_mode(struct drxk_state *state, } error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1847,7 +1847,7 @@ static int start(struct drxk_state *state, s32 offset_freq, } error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1885,7 +1885,7 @@ static int get_lock_status(struct drxk_state *state, u32 *p_lock_status) } error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1906,7 +1906,7 @@ static int mpegts_start(struct drxk_state *state) status =write16 (state,FEC_OC_SNC_UNLOCK__A ,1 ); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -1952,7 +1952,7 @@ static int mpegts_dto_init(struct drxk_state *state) status =write16 (state,FEC_OC_SNC_HWM__A ,12 ); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -2089,7 +2089,7 @@ static int mpegts_dto_setup(struct drxk_state *state, status =write16 (state,FEC_OC_TMD_MODE__A , fec_oc_tmd_mode); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -2269,7 +2269,7 @@ static int set_agc_rf(struct drxk_state *state, } error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -2397,7 +2397,7 @@ static int set_agc_if(struct drxk_state *state, status =write16 (state,SCU_RAM_AGC_INGAIN_TGT_MIN__A , p_agc_cfg->top); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -2418,7 +2418,7 @@ static int get_qam_signal_to_noise(struct drxk_state *state,/* get the register value needed for MER */ status =read16 (state,QAM_SL_ERR_POWER__A , &qam_sl_err_power);if (status <0 ) { -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return -EINVAL ; }
@@ -2545,7 +2545,7 @@ static int get_dvbt_signal_to_noise(struct drxk_state *state, error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -2740,7 +2740,7 @@ static int ConfigureI2CBridge(struct drxk_state *state, bool b_enable_bridge) error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -2758,7 +2758,7 @@ static int set_pre_saw(struct drxk_state *state, status =write16 (state,IQM_AF_PDREF__A , p_pre_saw_cfg->reference); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -2800,13 +2800,13 @@ static int bl_direct_cmd(struct drxk_state *state, u32 target_addr, goto error; }while ((bl_status ==0x1 ) &&time_is_after_jiffies (end));if (bl_status ==0x1 ) { -printk (KERN_ERR "drxk: SIO not ready\n" ); +pr_err ("SIO not ready\n" ); status = -EINVAL ; goto error2; } error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__); error2:mutex_unlock (&state->mutex);return status;
@@ -2847,7 +2847,7 @@ static int adc_sync_measurement(struct drxk_state *state, u16 *count) error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -2891,7 +2891,7 @@ static int adc_synchronization(struct drxk_state *state) status = -EINVAL ; error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -2957,7 +2957,7 @@ static int set_frequency_shifter(struct drxk_state *state, status =write32 (state,IQM_FS_RATE_OFS_LO__A , state->m_iqm_fs_rate_ofs);if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -2992,7 +2992,8 @@ static int init_agc(struct drxk_state *state, bool is_dtv)/* AGCInit() not available for DVBT; init done in microcode */ if (!is_qam (state)) { -printk (KERN_ERR "drxk: %s: mode %d is not DVB-C\n" , __func__, state->m_operation_mode); +pr_err ("%s: mode %d is not DVB-C\n" , + __func__, state->m_operation_mode);return -EINVAL ; }
@@ -3145,7 +3146,7 @@ static int init_agc(struct drxk_state *state, bool is_dtv) status =write16 (state,SCU_RAM_AGC_KI__A , data); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -3159,7 +3160,7 @@ static int dvbtqam_get_acc_pkt_err(struct drxk_state *state, u16 *packet_err)else status =read16 (state,SCU_RAM_FEC_ACCUM_PKT_FAILURES__A , packet_err);if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -3279,7 +3280,7 @@ static int dvbt_sc_command(struct drxk_state *state, }/* switch (cmd->cmd) */ error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -3291,7 +3292,7 @@ static int power_up_dvbt(struct drxk_state *state)dprintk (1 ,"\n" ); status =ctrl_power_mode (state, &power_mode);if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -3305,7 +3306,7 @@ static int dvbt_ctrl_set_inc_enable(struct drxk_state *state, bool *enabled)else status =write16 (state,IQM_CF_BYPASSDET__A ,1 );if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -3325,7 +3326,7 @@ static int dvbt_ctrl_set_fr_enable(struct drxk_state *state, bool *enabled) status =write16 (state,OFDM_SC_RA_RAM_FR_THRES_8K__A ,0 ); }if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -3361,7 +3362,7 @@ static int dvbt_ctrl_set_echo_threshold(struct drxk_state *state, status =write16 (state,OFDM_SC_RA_RAM_ECHO_THRES__A , data); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -3384,7 +3385,7 @@ static int dvbt_ctrl_set_sqi_speed(struct drxk_state *state, (u16) *speed); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -3423,7 +3424,7 @@ static int dvbt_activate_presets(struct drxk_state *state) status =write16 (state,SCU_RAM_AGC_INGAIN_TGT_MAX__A , state->m_dvbt_if_agc_cfg.ingain_tgt_max); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -3629,7 +3630,7 @@ static int set_dvbt_standard(struct drxk_state *state, error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -3661,7 +3662,7 @@ static int dvbt_start(struct drxk_state *state) goto error; error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -3980,7 +3981,7 @@ static int set_dvbt(struct drxk_state *state, u16 intermediate_freqk_hz, status =dvbt_ctrl_set_sqi_speed (state, &state->m_sqi_speed); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -4031,7 +4032,7 @@ static int get_dvbt_lock_status(struct drxk_state *state, u32 *p_lock_status) *p_lock_status =NEVER_LOCK ; end:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -4044,7 +4045,7 @@ static int power_up_qam(struct drxk_state *state)dprintk (1 ,"\n" ); status =ctrl_power_mode (state, &power_mode);if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -4079,7 +4080,7 @@ static int power_down_qam(struct drxk_state *state) error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -4167,7 +4168,7 @@ static int set_qam_measurement(struct drxk_state *state, status =write16 (state,FEC_OC_SNC_FAIL_PERIOD__A , fec_rs_period); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -4353,7 +4354,7 @@ static int set_qam16(struct drxk_state *state) error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -4548,7 +4549,7 @@ static int set_qam32(struct drxk_state *state) status =write16 (state,SCU_RAM_QAM_FSM_LCAVG_OFFSET5__A , (u16) -86 ); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -4741,7 +4742,7 @@ static int set_qam64(struct drxk_state *state) status =write16 (state,SCU_RAM_QAM_FSM_LCAVG_OFFSET5__A , (u16) -80 ); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -4937,7 +4938,7 @@ static int set_qam128(struct drxk_state *state) status =write16 (state,SCU_RAM_QAM_FSM_LCAVG_OFFSET5__A , (u16) -23 ); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -5132,7 +5133,7 @@ static int set_qam256(struct drxk_state *state) status =write16 (state,SCU_RAM_QAM_FSM_LCAVG_OFFSET5__A , (u16) -8 ); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -5158,7 +5159,7 @@ static int qam_reset_qam(struct drxk_state *state) status =scu_command (state,SCU_RAM_COMMAND_STANDARD_QAM |SCU_RAM_COMMAND_CMD_DEMOD_RESET ,0 ,NULL ,1 , &cmd_result); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -5228,7 +5229,7 @@ static int qam_set_symbolrate(struct drxk_state *state) error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -5253,7 +5254,7 @@ static int get_qam_lock_status(struct drxk_state *state, u32 *p_lock_status)SCU_RAM_COMMAND_CMD_DEMOD_GET_LOCK ,0 ,NULL ,2 , result);if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);if (result[1 ] <SCU_RAM_QAM_LOCKED_LOCKED_DEMOD_LOCKED ) {/* 0x0000 NOT LOCKED */
@@ -5324,15 +5325,14 @@ static int qam_demodulator_command(struct drxk_state *state, number_of_parameters, set_param_parameters, 1, &cmd_result); }else { -printk (KERN_WARNING "drxk: Unknown QAM demodulator parameter " -"count %d\n" , number_of_parameters); +pr_warn ("Unknown QAM demodulator parameter count %d\n" , + number_of_parameters); status = -EINVAL ; } error:if (status <0 ) -printk (KERN_WARNING "drxk: Warning %d on %s\n" , - status, __func__); +pr_warn ("Warning %d on %s\n" , status, __func__);return status; }
@@ -5587,7 +5587,7 @@ static int set_qam(struct drxk_state *state, u16 intermediate_freqk_hz, error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -5749,7 +5749,7 @@ static int set_qam_standard(struct drxk_state *state, status =write16 (state,SCU_COMM_EXEC__A ,SCU_COMM_EXEC_ACTIVE ); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -5832,7 +5832,7 @@ static int write_gpio(struct drxk_state *state) status =write16 (state,SIO_TOP_COMM_KEY__A ,0x0000 ); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -5857,7 +5857,7 @@ static int switch_antenna_to_qam(struct drxk_state *state) status =write_gpio (state); }if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -5882,7 +5882,7 @@ static int switch_antenna_to_dvbt(struct drxk_state *state) status =write_gpio (state); }if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -5919,7 +5919,7 @@ static int power_down_device(struct drxk_state *state) status =hi_cfg_command (state); error:if (status <0 ) -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__);return status; }
@@ -6060,7 +6060,7 @@ static int init_drxk(struct drxk_state *state)if (status <0 ) goto error; -printk (KERN_INFO "DRXK driver version %d.%d.%d\n" , +pr_info ("DRXK driver version %d.%d.%d\n" ,DRXK_VERSION_MAJOR ,DRXK_VERSION_MINOR ,DRXK_VERSION_PATCH );
@@ -6128,7 +6128,7 @@ error:if (status <0 ) { state->m_drxk_state =DRXK_NO_DEV ;drxk_i2c_unlock (state); -printk (KERN_ERR "drxk: Error %d on %s\n" , status, __func__); +pr_err ("Error %d on %s\n" , status, __func__); }return status;
@@ -6141,11 +6141,9 @@ static void load_firmware_cb(const struct firmware *fw,dprintk (1 ,": %s\n" , fw ?"firmware loaded" :"firmware not loaded" );if (!fw) { -printk (KERN_ERR -"drxk: Could not load firmware file %s.\n" , +pr_err ("Could not load firmware file %s.\n" , state->microcode_name); -printk (KERN_INFO -"drxk: Copy %s to your hotplug directory!\n" , +pr_info ("Copy %s to your hotplug directory!\n" , state->microcode_name); state->microcode_name =NULL ;
@@ -6219,8 +6217,7 @@ static int drxk_set_parameters(struct dvb_frontend *fe)return -EAGAIN ;if (!fe->ops.tuner_ops.get_if_frequency) { -printk (KERN_ERR -"drxk: Error: get_if_frequency() not defined at tuner. Can't work without it!\n" ); +pr_err ("Error: get_if_frequency() not defined at tuner. Can't work without it!\n" );return -EINVAL ; }
@@ -6704,8 +6701,7 @@ struct dvb_frontend *drxk_attach(const struct drxk_config *config,GFP_KERNEL , state, load_firmware_cb);if (status <0 ) { -printk (KERN_ERR -"drxk: failed to request a firmware\n" ); +pr_err ("failed to request a firmware\n" );return NULL ; } }
@@ -6733,11 +6729,11 @@ struct dvb_frontend *drxk_attach(const struct drxk_config *config, p->post_bit_error.stat[0 ].scale =FE_SCALE_NOT_AVAILABLE ; p->post_bit_count.stat[0 ].scale =FE_SCALE_NOT_AVAILABLE ; -printk (KERN_INFO "drxk: frontend initialized.\n" ); +pr_info ("frontend initialized.\n" );return &state->frontend; error: -printk (KERN_ERR "drxk: not found\n" ); +pr_err ("not found\n" );kfree (state);return NULL ; }
PATCH 4/9 drxk_hard: don't split strings across lines
In reply to Mauro Carvalho Chehab WARNING: quoted string split across lines #5416: FILE: media/dvb-frontends/drxk_hard.c:5416:
+ dprintk(1, "Could not set demodulator parameters. Make "
+ "sure qam_demod_parameter_count (%d) is correct for "
WARNING: quoted string split across lines #5423: FILE: media/dvb-frontends/drxk_hard.c:5423:
+ dprintk(1, "Auto-probing the correct QAM demodulator command "
+ "parameters was successful - using %d parameters.\n",
--- drivers/media/dvb-frontends/drxk_hard.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)
drivers/media/dvb-frontends/drxk_hard.c +15 -15
@@ -168,7 +168,7 @@ MODULE_PARM_DESC(debug, "enable debug messages"); #define dprintk(level, fmt, arg...) do { \ if (debug >= level) \ - printk(KERN_DEBUG "drxk: %s" fmt, __func__, ## arg); \ + pr_debug(fmt, ##arg); \ } while (0)
@@ -258,8 +258,8 @@ static int i2c_write(struct drxk_state *state, u8 adr, u8 *data, int len)if (debug >2 ) {int i;for (i =0 ; i < len; i++) -printk (KERN_CONT " %02x" , data[i]); -printk (KERN_CONT "\n" ); +pr_cont (" %02x" , data[i]); +pr_cont ("\n" ); } status =drxk_i2c_transfer (state, &msg,1 );if (status >=0 && status !=1 )
@@ -285,7 +285,7 @@ static int i2c_read(struct drxk_state *state, status =drxk_i2c_transfer (state, msgs,2 );if (status !=2 ) {if (debug >2 ) -printk (KERN_CONT ": ERROR!\n" ); +pr_cont (": ERROR!\n" );if (status >=0 ) status = -EIO ;
@@ -296,11 +296,11 @@ static int i2c_read(struct drxk_state *state,int i;dprintk (2 ,": read from" );for (i =0 ; i < len; i++) -printk (KERN_CONT " %02x" , msg[i]); -printk (KERN_CONT ", value = " ); +pr_cont (" %02x" , msg[i]); +pr_cont (", value = " );for (i =0 ; i < alen; i++) -printk (KERN_CONT " %02x" , answ[i]); -printk (KERN_CONT "\n" ); +pr_cont (" %02x" , answ[i]); +pr_cont ("\n" ); }return 0 ; }
@@ -470,8 +470,8 @@ static int write_block(struct drxk_state *state, u32 address,int i;if (p_block)for (i =0 ; i < chunk; i++) -printk (KERN_CONT " %02x" , p_block[i]); -printk (KERN_CONT "\n" ); +pr_cont (" %02x" , p_block[i]); +pr_cont ("\n" ); } status =i2c_write (state, state->demod_address, &state->chunk[0 ], chunk + adr_length);
@@ -5412,15 +5412,15 @@ static int set_qam(struct drxk_state *state, u16 intermediate_freqk_hz, }if (status <0 ) { -dprintk (1 ,"Could not set demodulator parameters. Make " -"sure qam_demod_parameter_count (%d) is correct for " -"your firmware (%s).\n" , +dprintk (1 ,"Could not set demodulator parameters.\n" ); +dprintk (1 , +"Make sure qam_demod_parameter_count (%d) is correct for your firmware (%s).\n" , state->qam_demod_parameter_count, state->microcode_name); goto error; }else if (!state->qam_demod_parameter_count) { -dprintk (1 ,"Auto-probing the correct QAM demodulator command " -"parameters was successful - using %d parameters.\n" , +dprintk (1 , +"Auto-probing the QAM command parameters was successful - using %d parameters.\n" , qam_demod_param_count);/*
Signature · 1 line
1.8.1.4
PATCH 5/9 drxk_hard: use usleep_range()
In reply to Mauro Carvalho ChehabFixes the following checkpatch.pl warnings:
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(10);
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);
--- drivers/media/dvb-frontends/drxk_hard.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/media/dvb-frontends/drxk_hard.c +9 -9
@@ -505,7 +505,7 @@ static int power_up_device(struct drxk_state *state) data =0 ; status =i2c_write (state, state->demod_address, &data,1 ); -msleep (10 ); +usleep_range (10000 ,11000 ); retry_count++;if (status <0 )continue ;
@@ -1017,7 +1017,7 @@ static int hi_command(struct drxk_state *state, u16 cmd, u16 *p_result)if (status <0 ) goto error;if (cmd ==SIO_HI_RA_RAM_CMD_RESET ) -msleep (1 ); +usleep_range (1000 ,2000 ); powerdown_cmd = (bool) ((cmd == SIO_HI_RA_RAM_CMD_CONFIG) &&
@@ -1030,7 +1030,7 @@ static int hi_command(struct drxk_state *state, u16 cmd, u16 *p_result)u16 wait_cmd; do { - msleep(1); + usleep_range(1000, 2000); retry_count += 1; status = read16(state, SIO_HI_RA_RAM_CMD__A, &wait_cmd);
@@ -1279,7 +1279,7 @@ static int bl_chain_cmd(struct drxk_state *state, end = jiffies +msecs_to_jiffies (time_out); do { - msleep(1); + usleep_range(1000, 2000); status = read16(state, SIO_BL_STATUS__A, &bl_status); if (status < 0) goto error;
@@ -1392,7 +1392,7 @@ static int dvbt_enable_ofdm_token_ring(struct drxk_state *state, bool enable) status =read16 (state,SIO_OFDM_SH_OFDM_RING_STATUS__A , &data);if ((status >=0 && data == desired_status) ||time_is_after_jiffies (end))break ; -msleep (1 ); +usleep_range (1000 ,2000 ); }while (1 );if (data != desired_status) {pr_err ("SIO not ready\n" );
@@ -1471,7 +1471,7 @@ static int scu_command(struct drxk_state *state,/* Wait until SCU has processed command */ end = jiffies +msecs_to_jiffies (DRXK_MAX_WAITTIME ); do { - msleep(1); + usleep_range(1000, 2000); status = read16(state, SCU_RAM_COMMAND__A, &cur_cmd); if (status < 0) goto error;
@@ -3187,7 +3187,7 @@ static int dvbt_sc_command(struct drxk_state *state,/* Wait until sc is ready to receive command */ retry_cnt =0 ;do { -msleep (1 ); +usleep_range (1000 ,2000 ); status =read16 (state,OFDM_SC_RA_RAM_CMD__A , &cur_cmd); retry_cnt++; }while ((cur_cmd !=0 ) && (retry_cnt <DRXK_MAX_RETRIES ));
@@ -3239,7 +3239,7 @@ static int dvbt_sc_command(struct drxk_state *state,/* Wait until sc is ready processing command */ retry_cnt =0 ;do { -msleep (1 ); +usleep_range (1000 ,2000 ); status =read16 (state,OFDM_SC_RA_RAM_CMD__A , &cur_cmd); retry_cnt++; }while ((cur_cmd !=0 ) && (retry_cnt <DRXK_MAX_RETRIES ));
@@ -5947,7 +5947,7 @@ static int init_drxk(struct drxk_state *state)if (status <0 ) goto error;/* TODO is this needed, if yes how much delay in worst case scenario */ -msleep (1 ); +usleep_range (1000 ,2000 ); state->m_drxk_a3_patch_code = true; status =get_device_capabilities (state);if (status <0 )
Signature · 1 line
1.8.1.4
PATCH 6/9 drxk_hard.h: Remove some alien comment markups
In reply to Mauro Carvalho ChehabThe comments markup language used on Kernel is defined at:
Documentation/kernel-doc-nano-HOWTO.txt
Remove invalid markups from the header file.
--- drivers/media/dvb-frontends/drxk_hard.h | 106 ++++++++++++++++---------------- 1 file changed, 53 insertions(+), 53 deletions(-)
drivers/media/dvb-frontends/drxk_hard.h +53 -53
@@ -77,17 +77,17 @@ enum drx_power_mode { }; -/** /brief Intermediate power mode for DRXK, power down OFDM clock domain */ +/* Intermediate power mode for DRXK, power down OFDM clock domain */ #ifndef DRXK_POWER_DOWN_OFDM #define DRXK_POWER_DOWN_OFDM DRX_POWER_MODE_1#endif -/** /brief Intermediate power mode for DRXK, power down core (sysclk) */ +/* Intermediate power mode for DRXK, power down core (sysclk) */ #ifndef DRXK_POWER_DOWN_CORE #define DRXK_POWER_DOWN_CORE DRX_POWER_MODE_9#endif -/** /brief Intermediate power mode for DRXK, power down pll (only osc runs) */ +/* Intermediate power mode for DRXK, power down pll (only osc runs) */ #ifndef DRXK_POWER_DOWN_PLL #define DRXK_POWER_DOWN_PLL DRX_POWER_MODE_10#endif
@@ -193,13 +193,13 @@ struct s_cfg_pre_saw { };struct drxk_ofdm_sc_cmd_t { -u16 cmd;/**< Command number */ -u16 subcmd;/**< Sub-command parameter*/ -u16 param0;/**< General purpous param */ -u16 param1;/**< General purpous param */ -u16 param2;/**< General purpous param */ -u16 param3;/**< General purpous param */ -u16 param4;/**< General purpous param */ +u16 cmd;/* Command number */ +u16 subcmd;/* Sub-command parameter*/ +u16 param0;/* General purpous param */ +u16 param1;/* General purpous param */ +u16 param2;/* General purpous param */ +u16 param3;/* General purpous param */ +u16 param4;/* General purpous param */ };struct drxk_state {
@@ -213,7 +213,7 @@ struct drxk_state {struct mutex mutex; -u32 m_instance;/**< Channel 1,2,3 or 4 */ +u32 m_instance;/* Channel 1,2,3 or 4 */ int m_chunk_size;u8 chunk[256 ];
@@ -234,33 +234,33 @@ struct drxk_state {u16 m_hi_cfg_wake_up_key;u16 m_hi_cfg_timeout;u16 m_hi_cfg_ctrl; -s32 m_sys_clock_freq;/**< system clock frequency in kHz */ - -enum e_drxk_state m_drxk_state;/**< State of Drxk (init,stopped,started) */ -enum operation_mode m_operation_mode;/**< digital standards */ -struct s_cfg_agc m_vsb_rf_agc_cfg;/**< settings for VSB RF-AGC */ -struct s_cfg_agc m_vsb_if_agc_cfg;/**< settings for VSB IF-AGC */ -u16 m_vsb_pga_cfg;/**< settings for VSB PGA */ -struct s_cfg_pre_saw m_vsb_pre_saw_cfg;/**< settings for pre SAW sense */ -s32 m_Quality83percent;/**< MER level (*0.1 dB) for 83% quality indication */ -s32 m_Quality93percent;/**< MER level (*0.1 dB) for 93% quality indication */ +s32 m_sys_clock_freq;/* system clock frequency in kHz */ + +enum e_drxk_state m_drxk_state;/* State of Drxk (init,stopped,started) */ +enum operation_mode m_operation_mode;/* digital standards */ +struct s_cfg_agc m_vsb_rf_agc_cfg;/* settings for VSB RF-AGC */ +struct s_cfg_agc m_vsb_if_agc_cfg;/* settings for VSB IF-AGC */ +u16 m_vsb_pga_cfg;/* settings for VSB PGA */ +struct s_cfg_pre_saw m_vsb_pre_saw_cfg;/* settings for pre SAW sense */ +s32 m_Quality83percent;/* MER level (*0.1 dB) for 83% quality indication */ +s32 m_Quality93percent;/* MER level (*0.1 dB) for 93% quality indication */ bool m_smart_ant_inverted;bool m_b_debug_enable_bridge; -bool m_b_p_down_open_bridge;/**< only open DRXK bridge before power-down once it has been accessed */ -bool m_b_power_down;/**< Power down when not used */ - -u32 m_iqm_fs_rate_ofs;/**< frequency shift as written to DRXK register (28bit fixpoint) */ - -bool m_enable_mpeg_output;/**< If TRUE, enable MPEG output */ -bool m_insert_rs_byte;/**< If TRUE, insert RS byte */ -bool m_enable_parallel;/**< If TRUE, parallel out otherwise serial */ -bool m_invert_data;/**< If TRUE, invert DATA signals */ -bool m_invert_err;/**< If TRUE, invert ERR signal */ -bool m_invert_str;/**< If TRUE, invert STR signals */ -bool m_invert_val;/**< If TRUE, invert VAL signals */ -bool m_invert_clk;/**< If TRUE, invert CLK signals */ +bool m_b_p_down_open_bridge;/* only open DRXK bridge before power-down once it has been accessed */ +bool m_b_power_down;/* Power down when not used */ + +u32 m_iqm_fs_rate_ofs;/* frequency shift as written to DRXK register (28bit fixpoint) */ + +bool m_enable_mpeg_output;/* If TRUE, enable MPEG output */ +bool m_insert_rs_byte;/* If TRUE, insert RS byte */ +bool m_enable_parallel;/* If TRUE, parallel out otherwise serial */ +bool m_invert_data;/* If TRUE, invert DATA signals */ +bool m_invert_err;/* If TRUE, invert ERR signal */ +bool m_invert_str;/* If TRUE, invert STR signals */ +bool m_invert_val;/* If TRUE, invert VAL signals */ +bool m_invert_clk;/* If TRUE, invert CLK signals */ bool m_dvbc_static_clk; -bool m_dvbt_static_clk;/**< If TRUE, static MPEG clockrate will +bool m_dvbt_static_clk;/* If TRUE, static MPEG clockrate will be used, otherwise clockrate will adapt to the bitrate of the TS */ u32 m_dvbt_bitrate;
@@ -271,22 +271,22 @@ struct drxk_state {bool m_itut_annex_c;/* If true, uses ITU-T DVB-C Annex C, instead of Annex A */ -enum drxmpeg_str_width_t m_width_str;/**< MPEG start width */ -u32 m_mpeg_ts_static_bitrate;/**< Maximum bitrate in b/s in case +enum drxmpeg_str_width_t m_width_str;/* MPEG start width */ +u32 m_mpeg_ts_static_bitrate;/* Maximum bitrate in b/s in case static clockrate is selected */ -/* LARGE_INTEGER m_startTime; */ /**< Contains the time of the last demod start */ -s32 m_mpeg_lock_time_out;/**< WaitForLockStatus Timeout (counts from start time) */ -s32 m_demod_lock_time_out;/**< WaitForLockStatus Timeout (counts from start time) */ +/* LARGE_INTEGER m_startTime; */ /* Contains the time of the last demod start */ +s32 m_mpeg_lock_time_out;/* WaitForLockStatus Timeout (counts from start time) */ +s32 m_demod_lock_time_out;/* WaitForLockStatus Timeout (counts from start time) */ bool m_disable_te_ihandling;bool m_rf_agc_pol;bool m_if_agc_pol; -struct s_cfg_agc m_atv_rf_agc_cfg;/**< settings for ATV RF-AGC */ -struct s_cfg_agc m_atv_if_agc_cfg;/**< settings for ATV IF-AGC */ -struct s_cfg_pre_saw m_atv_pre_saw_cfg;/**< settings for ATV pre SAW sense */ +struct s_cfg_agc m_atv_rf_agc_cfg;/* settings for ATV RF-AGC */ +struct s_cfg_agc m_atv_if_agc_cfg;/* settings for ATV IF-AGC */ +struct s_cfg_pre_saw m_atv_pre_saw_cfg;/* settings for ATV pre SAW sense */ bool m_phase_correction_bypass;s16 m_atv_top_vid_peak;u16 m_atv_top_noise_th;
@@ -294,13 +294,13 @@ struct drxk_state {bool m_enable_cvbs_output;bool m_enable_sif_output;bool m_b_mirror_freq_spect; -enum e_drxk_constellation m_constellation;/**< constellation type of the channel */ -u32 m_curr_symbol_rate;/**< Current QAM symbol rate */ -struct s_cfg_agc m_qam_rf_agc_cfg;/**< settings for QAM RF-AGC */ -struct s_cfg_agc m_qam_if_agc_cfg;/**< settings for QAM IF-AGC */ -u16 m_qam_pga_cfg;/**< settings for QAM PGA */ -struct s_cfg_pre_saw m_qam_pre_saw_cfg;/**< settings for QAM pre SAW sense */ -enum e_drxk_interleave_mode m_qam_interleave_mode;/**< QAM Interleave mode */ +enum e_drxk_constellation m_constellation;/* constellation type of the channel */ +u32 m_curr_symbol_rate;/* Current QAM symbol rate */ +struct s_cfg_agc m_qam_rf_agc_cfg;/* settings for QAM RF-AGC */ +struct s_cfg_agc m_qam_if_agc_cfg;/* settings for QAM IF-AGC */ +u16 m_qam_pga_cfg;/* settings for QAM PGA */ +struct s_cfg_pre_saw m_qam_pre_saw_cfg;/* settings for QAM pre SAW sense */ +enum e_drxk_interleave_mode m_qam_interleave_mode;/* QAM Interleave mode */ u16 m_fec_rs_plen;u16 m_fec_rs_prescale;
@@ -309,9 +309,9 @@ struct drxk_state {u16 m_gpio;u16 m_gpio_cfg; -struct s_cfg_agc m_dvbt_rf_agc_cfg;/**< settings for QAM RF-AGC */ -struct s_cfg_agc m_dvbt_if_agc_cfg;/**< settings for QAM IF-AGC */ -struct s_cfg_pre_saw m_dvbt_pre_saw_cfg;/**< settings for QAM pre SAW sense */ +struct s_cfg_agc m_dvbt_rf_agc_cfg;/* settings for QAM RF-AGC */ +struct s_cfg_agc m_dvbt_if_agc_cfg;/* settings for QAM IF-AGC */ +struct s_cfg_pre_saw m_dvbt_pre_saw_cfg;/* settings for QAM pre SAW sense */ u16 m_agcfast_clip_ctrl_delay;bool m_adc_comp_passed;
Signature · 1 line
1.8.1.4
PATCH 7/9 drxk_hard.h: don't use more than 80 columns
In reply to Mauro Carvalho ChehabAlmost all 80-col warnings are related to comments. There's one, however, that it is due to a one-line enum declaration for enum agc_ctrl_mode.
Break it into one line per enumered data.
--- drivers/media/dvb-frontends/drxk_hard.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/media/dvb-frontends/drxk_hard.h +6 -1
@@ -93,7 +93,12 @@ enum drx_power_mode {#endif -enum agc_ctrl_mode {DRXK_AGC_CTRL_AUTO =0 ,DRXK_AGC_CTRL_USER ,DRXK_AGC_CTRL_OFF }; +enum agc_ctrl_mode { +DRXK_AGC_CTRL_AUTO =0 , +DRXK_AGC_CTRL_USER , +DRXK_AGC_CTRL_OFF +}; +enum e_drxk_state {DRXK_UNINITIALIZED =0 ,DRXK_STOPPED ,
Signature · 1 line
1.8.1.4
PATCH 8/9 drxk_hard: remove needless parenthesis
In reply to Mauro Carvalho ChehabThere are several places where: state->var = (some_var)
The parenthesis there are doing nothing but making it harder to read and breaking the 80 columns soft limits.
Just get rid of it.
--- drivers/media/dvb-frontends/drxk_hard.c | 50 ++++++++++++++++----------------- 1 file changed, 25 insertions(+), 25 deletions(-)
drivers/media/dvb-frontends/drxk_hard.c +25 -25
@@ -628,21 +628,21 @@ static int init_state(struct drxk_state *state)/* Init AGC and PGA parameters */ /* VSB IF */ - state->m_vsb_if_agc_cfg.ctrl_mode = (ul_vsb_if_agc_mode); - state->m_vsb_if_agc_cfg.output_level = (ul_vsb_if_agc_output_level); - state->m_vsb_if_agc_cfg.min_output_level = (ul_vsb_if_agc_min_level); - state->m_vsb_if_agc_cfg.max_output_level = (ul_vsb_if_agc_max_level); - state->m_vsb_if_agc_cfg.speed = (ul_vsb_if_agc_speed); + state->m_vsb_if_agc_cfg.ctrl_mode = ul_vsb_if_agc_mode; + state->m_vsb_if_agc_cfg.output_level = ul_vsb_if_agc_output_level; + state->m_vsb_if_agc_cfg.min_output_level = ul_vsb_if_agc_min_level; + state->m_vsb_if_agc_cfg.max_output_level = ul_vsb_if_agc_max_level; + state->m_vsb_if_agc_cfg.speed = ul_vsb_if_agc_speed; state->m_vsb_pga_cfg =140 ;/* VSB RF */ - state->m_vsb_rf_agc_cfg.ctrl_mode = (ul_vsb_rf_agc_mode); - state->m_vsb_rf_agc_cfg.output_level = (ul_vsb_rf_agc_output_level); - state->m_vsb_rf_agc_cfg.min_output_level = (ul_vsb_rf_agc_min_level); - state->m_vsb_rf_agc_cfg.max_output_level = (ul_vsb_rf_agc_max_level); - state->m_vsb_rf_agc_cfg.speed = (ul_vsb_rf_agc_speed); - state->m_vsb_rf_agc_cfg.top = (ul_vsb_rf_agc_top); - state->m_vsb_rf_agc_cfg.cut_off_current = (ul_vsb_rf_agc_cut_off_current); + state->m_vsb_rf_agc_cfg.ctrl_mode = ul_vsb_rf_agc_mode; + state->m_vsb_rf_agc_cfg.output_level = ul_vsb_rf_agc_output_level; + state->m_vsb_rf_agc_cfg.min_output_level = ul_vsb_rf_agc_min_level; + state->m_vsb_rf_agc_cfg.max_output_level = ul_vsb_rf_agc_max_level; + state->m_vsb_rf_agc_cfg.speed = ul_vsb_rf_agc_speed; + state->m_vsb_rf_agc_cfg.top = ul_vsb_rf_agc_top; + state->m_vsb_rf_agc_cfg.cut_off_current = ul_vsb_rf_agc_cut_off_current; state->m_vsb_pre_saw_cfg.reference =0x07 ; state->m_vsb_pre_saw_cfg.use_pre_saw = true;
@@ -654,20 +654,20 @@ static int init_state(struct drxk_state *state) }/* ATV IF */ - state->m_atv_if_agc_cfg.ctrl_mode = (ul_atv_if_agc_mode); - state->m_atv_if_agc_cfg.output_level = (ul_atv_if_agc_output_level); - state->m_atv_if_agc_cfg.min_output_level = (ul_atv_if_agc_min_level); - state->m_atv_if_agc_cfg.max_output_level = (ul_atv_if_agc_max_level); - state->m_atv_if_agc_cfg.speed = (ul_atv_if_agc_speed); + state->m_atv_if_agc_cfg.ctrl_mode = ul_atv_if_agc_mode; + state->m_atv_if_agc_cfg.output_level = ul_atv_if_agc_output_level; + state->m_atv_if_agc_cfg.min_output_level = ul_atv_if_agc_min_level; + state->m_atv_if_agc_cfg.max_output_level = ul_atv_if_agc_max_level; + state->m_atv_if_agc_cfg.speed = ul_atv_if_agc_speed;/* ATV RF */ - state->m_atv_rf_agc_cfg.ctrl_mode = (ul_atv_rf_agc_mode); - state->m_atv_rf_agc_cfg.output_level = (ul_atv_rf_agc_output_level); - state->m_atv_rf_agc_cfg.min_output_level = (ul_atv_rf_agc_min_level); - state->m_atv_rf_agc_cfg.max_output_level = (ul_atv_rf_agc_max_level); - state->m_atv_rf_agc_cfg.speed = (ul_atv_rf_agc_speed); - state->m_atv_rf_agc_cfg.top = (ul_atv_rf_agc_top); - state->m_atv_rf_agc_cfg.cut_off_current = (ul_atv_rf_agc_cut_off_current); + state->m_atv_rf_agc_cfg.ctrl_mode = ul_atv_rf_agc_mode; + state->m_atv_rf_agc_cfg.output_level = ul_atv_rf_agc_output_level; + state->m_atv_rf_agc_cfg.min_output_level = ul_atv_rf_agc_min_level; + state->m_atv_rf_agc_cfg.max_output_level = ul_atv_rf_agc_max_level; + state->m_atv_rf_agc_cfg.speed = ul_atv_rf_agc_speed; + state->m_atv_rf_agc_cfg.top = ul_atv_rf_agc_top; + state->m_atv_rf_agc_cfg.cut_off_current = ul_atv_rf_agc_cut_off_current; state->m_atv_pre_saw_cfg.reference =0x04 ; state->m_atv_pre_saw_cfg.use_pre_saw = true;
@@ -764,7 +764,7 @@ static int init_state(struct drxk_state *state) state->m_sqi_speed =DRXK_DVBT_SQI_SPEED_MEDIUM ; state->m_agcfast_clip_ctrl_delay =0 ; - state->m_gpio_cfg = (ul_gpio_cfg); + state->m_gpio_cfg = ul_gpio_cfg; state->m_b_power_down = false; state->m_current_power_mode =DRX_POWER_DOWN ;
Signature · 1 line
1.8.1.4
PATCH 9/9 drxk_hard: Remove most 80-cols checkpatch warnings
In reply to Mauro Carvalho ChehabThere are a few cases where breaking the code into separate lines make it worse to read. However, on several places, breaking it to make checkpatch.pl happier is OK and improves code readability.
So, break longer lines where that won't cause harm.
--- drivers/media/dvb-frontends/drxk_hard.c | 406 +++++++++++++++++++++----------- 1 file changed, 275 insertions(+), 131 deletions(-)
drivers/media/dvb-frontends/drxk_hard.c +275 -131
@@ -189,8 +189,10 @@ static inline u32 Frac28a(u32 a, u32 c)u32 R0 =0 ;R0 = (a % c) <<4 ;/* 32-28 == 4 shifts possible at max */ -Q1 = a / c;/* integer part, only the 4 least significant bits -will be visible in the result */ +Q1 = a / c;/* +* integer part, only the 4 least significant +* bits will be visible in the result +*/ /* division using radix 16, 7 nibbles in the result */ for (i =0 ; i <7 ; i++) {
@@ -783,7 +785,8 @@ static int drxx_open(struct drxk_state *state)dprintk (1 ,"\n" );/* stop lock indicator process */ - status =write16 (state,SCU_RAM_GPIO__A ,SCU_RAM_GPIO_HW_LOCK_IND_DISABLE ); + status =write16 (state,SCU_RAM_GPIO__A , +SCU_RAM_GPIO_HW_LOCK_IND_DISABLE );if (status <0 ) goto error;/* Check device id */
@@ -817,7 +820,8 @@ static int get_device_capabilities(struct drxk_state *state)/* driver 0.9.0 */ /* stop lock indicator process */ - status =write16 (state,SCU_RAM_GPIO__A ,SCU_RAM_GPIO_HW_LOCK_IND_DISABLE ); + status =write16 (state,SCU_RAM_GPIO__A , +SCU_RAM_GPIO_HW_LOCK_IND_DISABLE );if (status <0 ) goto error; status =write16 (state,SIO_TOP_COMM_KEY__A ,SIO_TOP_COMM_KEY_KEY );
@@ -1055,22 +1059,28 @@ static int hi_cfg_command(struct drxk_state *state)mutex_lock (&state->mutex); - status =write16 (state,SIO_HI_RA_RAM_PAR_6__A , state->m_hi_cfg_timeout); + status =write16 (state,SIO_HI_RA_RAM_PAR_6__A , + state->m_hi_cfg_timeout);if (status <0 ) goto error; - status =write16 (state,SIO_HI_RA_RAM_PAR_5__A , state->m_hi_cfg_ctrl); + status =write16 (state,SIO_HI_RA_RAM_PAR_5__A , + state->m_hi_cfg_ctrl);if (status <0 ) goto error; - status =write16 (state,SIO_HI_RA_RAM_PAR_4__A , state->m_hi_cfg_wake_up_key); + status =write16 (state,SIO_HI_RA_RAM_PAR_4__A , + state->m_hi_cfg_wake_up_key);if (status <0 ) goto error; - status =write16 (state,SIO_HI_RA_RAM_PAR_3__A , state->m_hi_cfg_bridge_delay); + status =write16 (state,SIO_HI_RA_RAM_PAR_3__A , + state->m_hi_cfg_bridge_delay);if (status <0 ) goto error; - status =write16 (state,SIO_HI_RA_RAM_PAR_2__A , state->m_hi_cfg_timing_div); + status =write16 (state,SIO_HI_RA_RAM_PAR_2__A , + state->m_hi_cfg_timing_div);if (status <0 ) goto error; - status =write16 (state,SIO_HI_RA_RAM_PAR_1__A ,SIO_HI_RA_RAM_PAR_1_PAR1_SEC_KEY ); + status =write16 (state,SIO_HI_RA_RAM_PAR_1__A , +SIO_HI_RA_RAM_PAR_1_PAR1_SEC_KEY );if (status <0 ) goto error; status =hi_command (state,SIO_HI_RA_RAM_CMD_CONFIG ,0 );
@@ -1109,7 +1119,8 @@ static int mpegts_configure_pins(struct drxk_state *state, bool mpeg_enable) state->m_enable_parallel ? "parallel" : "serial");/* stop lock indicator process */ - status =write16 (state,SCU_RAM_GPIO__A ,SCU_RAM_GPIO_HW_LOCK_IND_DISABLE ); + status =write16 (state,SCU_RAM_GPIO__A , +SCU_RAM_GPIO_HW_LOCK_IND_DISABLE );if (status <0 ) goto error;
@@ -1181,25 +1192,32 @@ static int mpegts_configure_pins(struct drxk_state *state, bool mpeg_enable)if (state->m_enable_parallel == true) {/* paralel -> enable MD1 to MD7 */ - status =write16 (state,SIO_PDR_MD1_CFG__A , sio_pdr_mdx_cfg); + status =write16 (state,SIO_PDR_MD1_CFG__A , + sio_pdr_mdx_cfg);if (status <0 ) goto error; - status =write16 (state,SIO_PDR_MD2_CFG__A , sio_pdr_mdx_cfg); + status =write16 (state,SIO_PDR_MD2_CFG__A , + sio_pdr_mdx_cfg);if (status <0 ) goto error; - status =write16 (state,SIO_PDR_MD3_CFG__A , sio_pdr_mdx_cfg); + status =write16 (state,SIO_PDR_MD3_CFG__A , + sio_pdr_mdx_cfg);if (status <0 ) goto error; - status =write16 (state,SIO_PDR_MD4_CFG__A , sio_pdr_mdx_cfg); + status =write16 (state,SIO_PDR_MD4_CFG__A , + sio_pdr_mdx_cfg);if (status <0 ) goto error; - status =write16 (state,SIO_PDR_MD5_CFG__A , sio_pdr_mdx_cfg); + status =write16 (state,SIO_PDR_MD5_CFG__A , + sio_pdr_mdx_cfg);if (status <0 ) goto error; - status =write16 (state,SIO_PDR_MD6_CFG__A , sio_pdr_mdx_cfg); + status =write16 (state,SIO_PDR_MD6_CFG__A , + sio_pdr_mdx_cfg);if (status <0 ) goto error; - status =write16 (state,SIO_PDR_MD7_CFG__A , sio_pdr_mdx_cfg); + status =write16 (state,SIO_PDR_MD7_CFG__A , + sio_pdr_mdx_cfg);if (status <0 ) goto error; }else {
@@ -1390,7 +1408,8 @@ static int dvbt_enable_ofdm_token_ring(struct drxk_state *state, bool enable) end = jiffies +msecs_to_jiffies (DRXK_OFDM_TR_SHUTDOWN_TIMEOUT );do { status =read16 (state,SIO_OFDM_SH_OFDM_RING_STATUS__A , &data); -if ((status >=0 && data == desired_status) ||time_is_after_jiffies (end)) +if ((status >=0 && data == desired_status) + ||time_is_after_jiffies (end))break ;usleep_range (1000 ,2000 ); }while (1 );
@@ -1487,7 +1506,8 @@ static int scu_command(struct drxk_state *state,int ii;for (ii = result_len -1 ; ii >=0 ; ii -=1 ) { - status =read16 (state,SCU_RAM_PARAM_0__A - ii, &result[ii]); + status =read16 (state,SCU_RAM_PARAM_0__A - ii, + &result[ii]);if (status <0 ) goto error; }
@@ -1683,11 +1703,17 @@ static int power_down_dvbt(struct drxk_state *state, bool set_power_mode) goto error;if (data ==SCU_COMM_EXEC_ACTIVE ) {/* Send OFDM stop command */ - status =scu_command (state,SCU_RAM_COMMAND_STANDARD_OFDM |SCU_RAM_COMMAND_CMD_DEMOD_STOP ,0 ,NULL ,1 , &cmd_result); + status =scu_command (state, +SCU_RAM_COMMAND_STANDARD_OFDM + |SCU_RAM_COMMAND_CMD_DEMOD_STOP , +0 ,NULL ,1 , &cmd_result);if (status <0 ) goto error;/* Send OFDM reset command */ - status =scu_command (state,SCU_RAM_COMMAND_STANDARD_OFDM |SCU_RAM_COMMAND_CMD_DEMOD_RESET ,0 ,NULL ,1 , &cmd_result); + status =scu_command (state, +SCU_RAM_COMMAND_STANDARD_OFDM + |SCU_RAM_COMMAND_CMD_DEMOD_RESET , +0 ,NULL ,1 , &cmd_result);if (status <0 ) goto error; }
@@ -1733,7 +1759,8 @@ static int setoperation_mode(struct drxk_state *state,*/ /* disable HW lock indicator */ - status =write16 (state,SCU_RAM_GPIO__A ,SCU_RAM_GPIO_HW_LOCK_IND_DISABLE ); + status =write16 (state,SCU_RAM_GPIO__A , +SCU_RAM_GPIO_HW_LOCK_IND_DISABLE );if (status <0 ) goto error;
@@ -2083,7 +2110,8 @@ static int mpegts_dto_setup(struct drxk_state *state, status =write32 (state,FEC_OC_RCN_CTL_RATE_LO__A , fec_oc_rcn_ctl_rate);if (status <0 ) goto error; - status =write16 (state,FEC_OC_TMD_INT_UPD_RATE__A , fec_oc_tmd_int_upd_rate); + status =write16 (state,FEC_OC_TMD_INT_UPD_RATE__A , + fec_oc_tmd_int_upd_rate);if (status <0 ) goto error; status =write16 (state,FEC_OC_TMD_MODE__A , fec_oc_tmd_mode);
@@ -2193,17 +2221,21 @@ static int set_agc_rf(struct drxk_state *state,/* Set TOP, only if IF-AGC is in AUTO mode */ if (p_if_agc_settings->ctrl_mode ==DRXK_AGC_CTRL_AUTO ) - status =write16 (state,SCU_RAM_AGC_IF_IACCU_HI_TGT_MAX__A , p_agc_cfg->top); + status =write16 (state, +SCU_RAM_AGC_IF_IACCU_HI_TGT_MAX__A , + p_agc_cfg->top);if (status <0 ) goto error;/* Cut-Off current */ - status =write16 (state,SCU_RAM_AGC_RF_IACCU_HI_CO__A , p_agc_cfg->cut_off_current); + status =write16 (state,SCU_RAM_AGC_RF_IACCU_HI_CO__A , + p_agc_cfg->cut_off_current);if (status <0 ) goto error;/* Max. output level */ - status =write16 (state,SCU_RAM_AGC_RF_MAX__A , p_agc_cfg->max_output_level); + status =write16 (state,SCU_RAM_AGC_RF_MAX__A , + p_agc_cfg->max_output_level);if (status <0 ) goto error;
@@ -2238,7 +2270,8 @@ static int set_agc_rf(struct drxk_state *state, goto error;/* Write value to output pin */ - status =write16 (state,SCU_RAM_AGC_RF_IACCU_HI__A , p_agc_cfg->output_level); + status =write16 (state,SCU_RAM_AGC_RF_IACCU_HI__A , + p_agc_cfg->output_level);if (status <0 ) goto error;break ;
@@ -2332,7 +2365,8 @@ static int set_agc_if(struct drxk_state *state,if (p_rf_agc_settings ==NULL )return -1 ;/* Restore TOP */ - status =write16 (state,SCU_RAM_AGC_IF_IACCU_HI_TGT_MAX__A , p_rf_agc_settings->top); + status =write16 (state,SCU_RAM_AGC_IF_IACCU_HI_TGT_MAX__A , + p_rf_agc_settings->top);if (status <0 ) goto error;break ;
@@ -2365,7 +2399,8 @@ static int set_agc_if(struct drxk_state *state, goto error;/* Write value to output pin */ - status =write16 (state,SCU_RAM_AGC_IF_IACCU_HI_TGT_MAX__A , p_agc_cfg->output_level); + status =write16 (state,SCU_RAM_AGC_IF_IACCU_HI_TGT_MAX__A , + p_agc_cfg->output_level);if (status <0 ) goto error;break ;
@@ -2470,16 +2505,20 @@ static int get_dvbt_signal_to_noise(struct drxk_state *state,dprintk (1 ,"\n" ); - status =read16 (state,OFDM_EQ_TOP_TD_TPS_PWR_OFS__A , &eq_reg_td_tps_pwr_ofs); + status =read16 (state,OFDM_EQ_TOP_TD_TPS_PWR_OFS__A , + &eq_reg_td_tps_pwr_ofs);if (status <0 ) goto error; - status =read16 (state,OFDM_EQ_TOP_TD_REQ_SMB_CNT__A , &eq_reg_td_req_smb_cnt); + status =read16 (state,OFDM_EQ_TOP_TD_REQ_SMB_CNT__A , + &eq_reg_td_req_smb_cnt);if (status <0 ) goto error; - status =read16 (state,OFDM_EQ_TOP_TD_SQR_ERR_EXP__A , &eq_reg_td_sqr_err_exp); + status =read16 (state,OFDM_EQ_TOP_TD_SQR_ERR_EXP__A , + &eq_reg_td_sqr_err_exp);if (status <0 ) goto error; - status =read16 (state,OFDM_EQ_TOP_TD_SQR_ERR_I__A , ®_data); + status =read16 (state,OFDM_EQ_TOP_TD_SQR_ERR_I__A , + ®_data);if (status <0 ) goto error;/* Extend SQR_ERR_I operational range */
@@ -2497,7 +2536,8 @@ static int get_dvbt_signal_to_noise(struct drxk_state *state, (eq_reg_td_sqr_err_q < 0x00000FFFUL)) eq_reg_td_sqr_err_q +=0x00010000UL ; - status =read16 (state,OFDM_SC_RA_RAM_OP_PARAM__A , &transmission_params); + status =read16 (state,OFDM_SC_RA_RAM_OP_PARAM__A , + &transmission_params);if (status <0 ) goto error;
@@ -2604,12 +2644,14 @@ static int get_dvbt_quality(struct drxk_state *state, s32 *p_quality) status =get_dvbt_signal_to_noise (state, &signal_to_noise);if (status <0 )break ; - status =read16 (state,OFDM_EQ_TOP_TD_TPS_CONST__A , &constellation); + status =read16 (state,OFDM_EQ_TOP_TD_TPS_CONST__A , + &constellation);if (status <0 )break ; constellation &=OFDM_EQ_TOP_TD_TPS_CONST__M ; - status =read16 (state,OFDM_EQ_TOP_TD_TPS_CODE_HP__A , &code_rate); + status =read16 (state,OFDM_EQ_TOP_TD_TPS_CODE_HP__A , + &code_rate);if (status <0 )break ; code_rate &=OFDM_EQ_TOP_TD_TPS_CODE_HP__M ;
@@ -2723,15 +2765,18 @@ static int ConfigureI2CBridge(struct drxk_state *state, bool b_enable_bridge)if (state->no_i2c_bridge)return 0 ; - status =write16 (state,SIO_HI_RA_RAM_PAR_1__A ,SIO_HI_RA_RAM_PAR_1_PAR1_SEC_KEY ); + status =write16 (state,SIO_HI_RA_RAM_PAR_1__A , +SIO_HI_RA_RAM_PAR_1_PAR1_SEC_KEY );if (status <0 ) goto error;if (b_enable_bridge) { - status =write16 (state,SIO_HI_RA_RAM_PAR_2__A ,SIO_HI_RA_RAM_PAR_2_BRD_CFG_CLOSED ); + status =write16 (state,SIO_HI_RA_RAM_PAR_2__A , +SIO_HI_RA_RAM_PAR_2_BRD_CFG_CLOSED );if (status <0 ) goto error; }else { - status =write16 (state,SIO_HI_RA_RAM_PAR_2__A ,SIO_HI_RA_RAM_PAR_2_BRD_CFG_OPEN ); + status =write16 (state,SIO_HI_RA_RAM_PAR_2__A , +SIO_HI_RA_RAM_PAR_2_BRD_CFG_OPEN );if (status <0 ) goto error; }
@@ -3013,7 +3058,8 @@ static int init_agc(struct drxk_state *state, bool is_dtv) ingain_tgt_max =5119 ; fast_clp_ctrl_delay = state->m_qam_if_agc_cfg.fast_clip_ctrl_delay; - status =write16 (state,SCU_RAM_AGC_FAST_CLP_CTRL_DELAY__A , fast_clp_ctrl_delay); + status =write16 (state,SCU_RAM_AGC_FAST_CLP_CTRL_DELAY__A , + fast_clp_ctrl_delay);if (status <0 ) goto error;
@@ -3029,10 +3075,12 @@ static int init_agc(struct drxk_state *state, bool is_dtv) status =write16 (state,SCU_RAM_AGC_INGAIN_TGT_MAX__A , ingain_tgt_max);if (status <0 ) goto error; - status =write16 (state,SCU_RAM_AGC_IF_IACCU_HI_TGT_MIN__A , if_iaccu_hi_tgt_min); + status =write16 (state,SCU_RAM_AGC_IF_IACCU_HI_TGT_MIN__A , + if_iaccu_hi_tgt_min);if (status <0 ) goto error; - status =write16 (state,SCU_RAM_AGC_IF_IACCU_HI_TGT_MAX__A , if_iaccu_hi_tgt_max); + status =write16 (state,SCU_RAM_AGC_IF_IACCU_HI_TGT_MAX__A , + if_iaccu_hi_tgt_max);if (status <0 ) goto error; status =write16 (state,SCU_RAM_AGC_IF_IACCU_HI__A ,0 );
@@ -3054,10 +3102,12 @@ static int init_agc(struct drxk_state *state, bool is_dtv)if (status <0 ) goto error; - status =write16 (state,SCU_RAM_AGC_KI_INNERGAIN_MIN__A , ki_innergain_min); + status =write16 (state,SCU_RAM_AGC_KI_INNERGAIN_MIN__A , + ki_innergain_min);if (status <0 ) goto error; - status =write16 (state,SCU_RAM_AGC_IF_IACCU_HI_TGT__A , if_iaccu_hi_tgt); + status =write16 (state,SCU_RAM_AGC_IF_IACCU_HI_TGT__A , + if_iaccu_hi_tgt);if (status <0 ) goto error; status =write16 (state,SCU_RAM_AGC_CLP_CYCLEN__A , clp_cyclen);
@@ -3158,7 +3208,8 @@ static int dvbtqam_get_acc_pkt_err(struct drxk_state *state, u16 *packet_err)if (packet_err ==NULL ) status =write16 (state,SCU_RAM_FEC_ACCUM_PKT_FAILURES__A ,0 );else - status =read16 (state,SCU_RAM_FEC_ACCUM_PKT_FAILURES__A , packet_err); + status =read16 (state,SCU_RAM_FEC_ACCUM_PKT_FAILURES__A , + packet_err);if (status <0 )pr_err ("Error %d on %s\n" , status, __func__);return status;
@@ -3332,7 +3383,7 @@ static int dvbt_ctrl_set_fr_enable(struct drxk_state *state, bool *enabled) }static int dvbt_ctrl_set_echo_threshold (struct drxk_state *state, -struct drxk_cfg_dvbt_echo_thres_t *echo_thres) +struct drxk_cfg_dvbt_echo_thres_t *echo_thres) {u16 data =0 ;int status;
@@ -3421,7 +3472,8 @@ static int dvbt_activate_presets(struct drxk_state *state) status =dvbt_ctrl_set_echo_threshold (state, &echo_thres8k);if (status <0 ) goto error; - status =write16 (state,SCU_RAM_AGC_INGAIN_TGT_MAX__A , state->m_dvbt_if_agc_cfg.ingain_tgt_max); + status =write16 (state,SCU_RAM_AGC_INGAIN_TGT_MAX__A , + state->m_dvbt_if_agc_cfg.ingain_tgt_max); error:if (status <0 )pr_err ("Error %d on %s\n" , status, __func__);
@@ -3451,12 +3503,17 @@ static int set_dvbt_standard(struct drxk_state *state,/* added antenna switch */ switch_antenna_to_dvbt (state);/* send OFDM reset command */ - status =scu_command (state,SCU_RAM_COMMAND_STANDARD_OFDM |SCU_RAM_COMMAND_CMD_DEMOD_RESET ,0 ,NULL ,1 , &cmd_result); + status =scu_command (state, +SCU_RAM_COMMAND_STANDARD_OFDM + |SCU_RAM_COMMAND_CMD_DEMOD_RESET , +0 ,NULL ,1 , &cmd_result);if (status <0 ) goto error;/* send OFDM setenv command */ - status =scu_command (state,SCU_RAM_COMMAND_STANDARD_OFDM |SCU_RAM_COMMAND_CMD_DEMOD_SET_ENV ,0 ,NULL ,1 , &cmd_result); + status =scu_command (state,SCU_RAM_COMMAND_STANDARD_OFDM + |SCU_RAM_COMMAND_CMD_DEMOD_SET_ENV , +0 ,NULL ,1 , &cmd_result);if (status <0 ) goto error;
@@ -3510,7 +3567,7 @@ static int set_dvbt_standard(struct drxk_state *state, status =write16 (state,IQM_RC_STRETCH__A ,16 );if (status <0 ) goto error; - status =write16 (state,IQM_CF_OUT_ENA__A ,0x4 );/* enable output 2 */ + status =write16 (state,IQM_CF_OUT_ENA__A ,0x4 );/* enable output 2 */ if (status <0 ) goto error; status =write16 (state,IQM_CF_DS_ENA__A ,0x4 );/* decimate output 2 */
@@ -3531,7 +3588,8 @@ static int set_dvbt_standard(struct drxk_state *state,if (status <0 ) goto error; - status =bl_chain_cmd (state,DRXK_BL_ROM_OFFSET_TAPS_DVBT ,DRXK_BLCC_NR_ELEMENTS_TAPS ,DRXK_BLC_TIMEOUT ); + status =bl_chain_cmd (state,DRXK_BL_ROM_OFFSET_TAPS_DVBT , +DRXK_BLCC_NR_ELEMENTS_TAPS ,DRXK_BLC_TIMEOUT );if (status <0 ) goto error;
@@ -3585,7 +3643,8 @@ static int set_dvbt_standard(struct drxk_state *state,if (!state->m_drxk_a3_rom_code) {/* AGCInit() is not done for DVBT, so set agcfast_clip_ctrl_delay */ - status =write16 (state,SCU_RAM_AGC_FAST_CLP_CTRL_DELAY__A , state->m_dvbt_if_agc_cfg.fast_clip_ctrl_delay); + status =write16 (state,SCU_RAM_AGC_FAST_CLP_CTRL_DELAY__A , + state->m_dvbt_if_agc_cfg.fast_clip_ctrl_delay);if (status <0 ) goto error; }
@@ -3650,7 +3709,9 @@ static int dvbt_start(struct drxk_state *state)/* start correct processes to get in lock */ /* DRXK: OFDM_SC_RA_RAM_PROC_LOCKTRACK is no longer in mapfile! */ param1 =OFDM_SC_RA_RAM_LOCKTRACK_MIN ; - status =dvbt_sc_command (state,OFDM_SC_RA_RAM_CMD_PROC_START ,0 ,OFDM_SC_RA_RAM_SW_EVENT_RUN_NMASK__M , param1,0 ,0 ,0 ); + status =dvbt_sc_command (state,OFDM_SC_RA_RAM_CMD_PROC_START ,0 , +OFDM_SC_RA_RAM_SW_EVENT_RUN_NMASK__M , param1, +0 ,0 ,0 );if (status <0 ) goto error;/* start FEC OC */
@@ -3686,9 +3747,12 @@ static int set_dvbt(struct drxk_state *state, u16 intermediate_freqk_hz,u16 param1;int status; -dprintk (1 ,"IF =%d, TFO = %d\n" , intermediate_freqk_hz, tuner_freq_offset); +dprintk (1 ,"IF =%d, TFO = %d\n" , + intermediate_freqk_hz, tuner_freq_offset); - status =scu_command (state,SCU_RAM_COMMAND_STANDARD_OFDM |SCU_RAM_COMMAND_CMD_DEMOD_STOP ,0 ,NULL ,1 , &cmd_result); + status =scu_command (state,SCU_RAM_COMMAND_STANDARD_OFDM + |SCU_RAM_COMMAND_CMD_DEMOD_STOP , +0 ,NULL ,1 , &cmd_result);if (status <0 ) goto error;
@@ -3711,7 +3775,7 @@ static int set_dvbt(struct drxk_state *state, u16 intermediate_freqk_hz,if (status <0 ) goto error; -/*== Write channel settings to device =====================================*/ +/*== Write channel settings to device ================================*/ /* mode */ switch (state->props.transmission_mode) {
@@ -3834,71 +3898,92 @@ static int set_dvbt(struct drxk_state *state, u16 intermediate_freqk_hz,break ; } -/* SAW filter selection: normaly not necesarry, but if wanted -the application can select a SAW filter via the driver by using UIOs */ +/* +* SAW filter selection: normaly not necesarry, but if wanted +* the application can select a SAW filter via the driver by +* using UIOs +*/ +/* First determine real bandwidth (Hz) */ /* Also set delay for impulse noise cruncher */ -/* Also set parameters for EC_OC fix, note EC_OC_REG_TMD_HIL_MAR is changed -by SC for fix for some 8K,1/8 guard but is restored by InitEC and ResetEC -functions */ +/* +* Also set parameters for EC_OC fix, note EC_OC_REG_TMD_HIL_MAR is +* changed by SC for fix for some 8K,1/8 guard but is restored by +* InitEC and ResetEC functions +*/ switch (state->props.bandwidth_hz) {case 0 : state->props.bandwidth_hz =8000000 ;/* fall though */ case 8000000 : bandwidth =DRXK_BANDWIDTH_8MHZ_IN_HZ ; - status =write16 (state,OFDM_SC_RA_RAM_SRMM_FIX_FACT_8K__A ,3052 ); + status =write16 (state,OFDM_SC_RA_RAM_SRMM_FIX_FACT_8K__A , +3052 );if (status <0 ) goto error;/* cochannel protection for PAL 8 MHz */ - status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_8K_PER_LEFT__A ,7 ); + status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_8K_PER_LEFT__A , +7 );if (status <0 ) goto error; - status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_8K_PER_RIGHT__A ,7 ); + status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_8K_PER_RIGHT__A , +7 );if (status <0 ) goto error; - status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_2K_PER_LEFT__A ,7 ); + status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_2K_PER_LEFT__A , +7 );if (status <0 ) goto error; - status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_2K_PER_RIGHT__A ,1 ); + status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_2K_PER_RIGHT__A , +1 );if (status <0 ) goto error;break ;case 7000000 : bandwidth =DRXK_BANDWIDTH_7MHZ_IN_HZ ; - status =write16 (state,OFDM_SC_RA_RAM_SRMM_FIX_FACT_8K__A ,3491 ); + status =write16 (state,OFDM_SC_RA_RAM_SRMM_FIX_FACT_8K__A , +3491 );if (status <0 ) goto error;/* cochannel protection for PAL 7 MHz */ - status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_8K_PER_LEFT__A ,8 ); + status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_8K_PER_LEFT__A , +8 );if (status <0 ) goto error; - status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_8K_PER_RIGHT__A ,8 ); + status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_8K_PER_RIGHT__A , +8 );if (status <0 ) goto error; - status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_2K_PER_LEFT__A ,4 ); + status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_2K_PER_LEFT__A , +4 );if (status <0 ) goto error; - status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_2K_PER_RIGHT__A ,1 ); + status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_2K_PER_RIGHT__A , +1 );if (status <0 ) goto error;break ;case 6000000 : bandwidth =DRXK_BANDWIDTH_6MHZ_IN_HZ ; - status =write16 (state,OFDM_SC_RA_RAM_SRMM_FIX_FACT_8K__A ,4073 ); + status =write16 (state,OFDM_SC_RA_RAM_SRMM_FIX_FACT_8K__A , +4073 );if (status <0 ) goto error;/* cochannel protection for NTSC 6 MHz */ - status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_8K_PER_LEFT__A ,19 ); + status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_8K_PER_LEFT__A , +19 );if (status <0 ) goto error; - status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_8K_PER_RIGHT__A ,19 ); + status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_8K_PER_RIGHT__A , +19 );if (status <0 ) goto error; - status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_2K_PER_LEFT__A ,14 ); + status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_2K_PER_LEFT__A , +14 );if (status <0 ) goto error; - status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_2K_PER_RIGHT__A ,1 ); + status =write16 (state,OFDM_SC_RA_RAM_NI_INIT_2K_PER_RIGHT__A , +1 );if (status <0 ) goto error;break ;
@@ -3914,13 +3999,16 @@ static int set_dvbt(struct drxk_state *state, u16 intermediate_freqk_hz,((SysFreq / BandWidth) * (2^21)) - (2^23) */ /* (SysFreq / BandWidth) * (2^28) */ -/* assert (MAX(sysClk)/MIN(bandwidth) < 16) -=> assert(MAX(sysClk) < 16*MIN(bandwidth)) -=> assert(109714272 > 48000000) = true so Frac 28 can be used */ +/* +* assert (MAX(sysClk)/MIN(bandwidth) < 16) +* => assert(MAX(sysClk) < 16*MIN(bandwidth)) +* => assert(109714272 > 48000000) = true +* so Frac 28 can be used +*/ iqm_rc_rate_ofs =Frac28a ((u32) ((state->m_sys_clock_freq *1000 ) /3 ), bandwidth); -/* (SysFreq / BandWidth) * (2^21), rounding before truncating */ +/* (SysFreq / BandWidth) * (2^21), rounding before truncating */ if ((iqm_rc_rate_ofs &0x7fL ) >=0x40 ) iqm_rc_rate_ofs +=0x80L ; iqm_rc_rate_ofs = iqm_rc_rate_ofs >>7 ;
@@ -3942,11 +4030,12 @@ static int set_dvbt(struct drxk_state *state, u16 intermediate_freqk_hz,if (status <0 ) goto error;#endif - status =set_frequency_shifter (state, intermediate_freqk_hz, tuner_freq_offset, true); + status =set_frequency_shifter (state, intermediate_freqk_hz, + tuner_freq_offset, true);if (status <0 ) goto error; -/*== start SC, write channel settings to SC ===============================*/ +/*== start SC, write channel settings to SC ==========================*/ /* Activate SCU to enable SCU commands */ status =write16 (state,SCU_COMM_EXEC__A ,SCU_COMM_EXEC_ACTIVE );
@@ -3962,7 +4051,9 @@ static int set_dvbt(struct drxk_state *state, u16 intermediate_freqk_hz, goto error; - status =scu_command (state,SCU_RAM_COMMAND_STANDARD_OFDM |SCU_RAM_COMMAND_CMD_DEMOD_START ,0 ,NULL ,1 , &cmd_result); + status =scu_command (state,SCU_RAM_COMMAND_STANDARD_OFDM + |SCU_RAM_COMMAND_CMD_DEMOD_START , +0 ,NULL ,1 , &cmd_result);if (status <0 ) goto error;
@@ -4071,7 +4162,9 @@ static int power_down_qam(struct drxk_state *state) status =write16 (state,QAM_COMM_EXEC__A ,QAM_COMM_EXEC_STOP );if (status <0 ) goto error; - status =scu_command (state,SCU_RAM_COMMAND_STANDARD_QAM |SCU_RAM_COMMAND_CMD_DEMOD_STOP ,0 ,NULL ,1 , &cmd_result); + status =scu_command (state,SCU_RAM_COMMAND_STANDARD_QAM + |SCU_RAM_COMMAND_CMD_DEMOD_STOP , +0 ,NULL ,1 , &cmd_result);if (status <0 ) goto error; }
@@ -4139,7 +4232,7 @@ static int set_qam_measurement(struct drxk_state *state,if (status <0 ) goto error; - fec_bits_desired /=1000 ;/* symbol_rate [Hz] -> symbol_rate [kHz] */ + fec_bits_desired /=1000 ;/* symbol_rate [Hz] -> symbol_rate [kHz] */ fec_bits_desired *=500 ;/* meas. period [ms] */ /* Annex A/C: bits/RsPeriod = 204 * 8 = 1632 */
@@ -4162,7 +4255,8 @@ static int set_qam_measurement(struct drxk_state *state, status =write16 (state,FEC_RS_MEASUREMENT_PERIOD__A , fec_rs_period);if (status <0 ) goto error; - status =write16 (state,FEC_RS_MEASUREMENT_PRESCALE__A , fec_rs_prescale); + status =write16 (state,FEC_RS_MEASUREMENT_PRESCALE__A , + fec_rs_prescale);if (status <0 ) goto error; status =write16 (state,FEC_OC_SNC_FAIL_PERIOD__A , fec_rs_period);
@@ -4228,7 +4322,8 @@ static int set_qam16(struct drxk_state *state) goto error;/* QAM Slicer Settings */ - status =write16 (state,SCU_RAM_QAM_SL_SIG_POWER__A ,DRXK_QAM_SL_SIG_POWER_QAM16 ); + status =write16 (state,SCU_RAM_QAM_SL_SIG_POWER__A , +DRXK_QAM_SL_SIG_POWER_QAM16 );if (status <0 ) goto error;
@@ -4424,7 +4519,8 @@ static int set_qam32(struct drxk_state *state)/* QAM Slicer Settings */ - status =write16 (state,SCU_RAM_QAM_SL_SIG_POWER__A ,DRXK_QAM_SL_SIG_POWER_QAM32 ); + status =write16 (state,SCU_RAM_QAM_SL_SIG_POWER__A , +DRXK_QAM_SL_SIG_POWER_QAM32 );if (status <0 ) goto error;
@@ -4617,7 +4713,8 @@ static int set_qam64(struct drxk_state *state) goto error;/* QAM Slicer Settings */ - status =write16 (state,SCU_RAM_QAM_SL_SIG_POWER__A ,DRXK_QAM_SL_SIG_POWER_QAM64 ); + status =write16 (state,SCU_RAM_QAM_SL_SIG_POWER__A , +DRXK_QAM_SL_SIG_POWER_QAM64 );if (status <0 ) goto error;
@@ -4813,7 +4910,8 @@ static int set_qam128(struct drxk_state *state)/* QAM Slicer Settings */ - status =write16 (state,SCU_RAM_QAM_SL_SIG_POWER__A ,DRXK_QAM_SL_SIG_POWER_QAM128 ); + status =write16 (state,SCU_RAM_QAM_SL_SIG_POWER__A , +DRXK_QAM_SL_SIG_POWER_QAM128 );if (status <0 ) goto error;
@@ -5008,7 +5106,8 @@ static int set_qam256(struct drxk_state *state)/* QAM Slicer Settings */ - status =write16 (state,SCU_RAM_QAM_SL_SIG_POWER__A ,DRXK_QAM_SL_SIG_POWER_QAM256 ); + status =write16 (state,SCU_RAM_QAM_SL_SIG_POWER__A , +DRXK_QAM_SL_SIG_POWER_QAM256 );if (status <0 ) goto error;
@@ -5156,7 +5255,9 @@ static int qam_reset_qam(struct drxk_state *state)if (status <0 ) goto error; - status =scu_command (state,SCU_RAM_COMMAND_STANDARD_QAM |SCU_RAM_COMMAND_CMD_DEMOD_RESET ,0 ,NULL ,1 , &cmd_result); + status =scu_command (state,SCU_RAM_COMMAND_STANDARD_QAM + |SCU_RAM_COMMAND_CMD_DEMOD_RESET , +0 ,NULL ,1 , &cmd_result); error:if (status <0 )pr_err ("Error %d on %s\n" , status, __func__);
@@ -5267,8 +5368,10 @@ static int get_qam_lock_status(struct drxk_state *state, u32 *p_lock_status) }else {/* 0xC000 NEVER LOCKED */ /* (system will never be able to lock to the signal) */ -/* TODO: check this, intermediate & standard specific lock states are not -taken into account here */ +/* +* TODO: check this, intermediate & standard specific lock +* states are not taken into account here +*/ *p_lock_status =NEVER_LOCK ; }return status;
@@ -5300,13 +5403,15 @@ static int qam_demodulator_command(struct drxk_state *state, set_env_parameters[0 ] =QAM_TOP_ANNEX_A ; status =scu_command (state, -SCU_RAM_COMMAND_STANDARD_QAM |SCU_RAM_COMMAND_CMD_DEMOD_SET_ENV , +SCU_RAM_COMMAND_STANDARD_QAM + |SCU_RAM_COMMAND_CMD_DEMOD_SET_ENV ,1 , set_env_parameters,1 , &cmd_result);if (status <0 ) goto error; status =scu_command (state, -SCU_RAM_COMMAND_STANDARD_QAM |SCU_RAM_COMMAND_CMD_DEMOD_SET_PARAM , +SCU_RAM_COMMAND_STANDARD_QAM + |SCU_RAM_COMMAND_CMD_DEMOD_SET_PARAM , number_of_parameters, set_param_parameters,1 , &cmd_result); }else if (number_of_parameters ==4 ) {
@@ -5321,7 +5426,8 @@ static int qam_demodulator_command(struct drxk_state *state,/* set_param_parameters[3] |= QAM_LOCKRANGE_NORMAL; */ status =scu_command (state, -SCU_RAM_COMMAND_STANDARD_QAM |SCU_RAM_COMMAND_CMD_DEMOD_SET_PARAM , +SCU_RAM_COMMAND_STANDARD_QAM + |SCU_RAM_COMMAND_CMD_DEMOD_SET_PARAM , number_of_parameters, set_param_parameters,1 , &cmd_result); }else {
@@ -5439,12 +5545,14 @@ static int set_qam(struct drxk_state *state, u16 intermediate_freqk_hz,if (status <0 ) goto error;#endif - status =set_frequency_shifter (state, intermediate_freqk_hz, tuner_freq_offset, true); + status =set_frequency_shifter (state, intermediate_freqk_hz, + tuner_freq_offset, true);if (status <0 ) goto error;/* Setup BER measurement */ - status =set_qam_measurement (state, state->m_constellation, state->props.symbol_rate); + status =set_qam_measurement (state, state->m_constellation, + state->props.symbol_rate);if (status <0 ) goto error;
@@ -5517,7 +5625,8 @@ static int set_qam(struct drxk_state *state, u16 intermediate_freqk_hz, goto error;/* Mirroring, QAM-block starting point not inverted */ - status =write16 (state,QAM_SY_SP_INV__A ,QAM_SY_SP_INV_SPECTRUM_INV_DIS ); + status =write16 (state,QAM_SY_SP_INV__A , +QAM_SY_SP_INV_SPECTRUM_INV_DIS );if (status <0 ) goto error;
@@ -5578,7 +5687,9 @@ static int set_qam(struct drxk_state *state, u16 intermediate_freqk_hz, goto error;/* STEP 5: start QAM demodulator (starts FEC, QAM and IQM HW) */ - status =scu_command (state,SCU_RAM_COMMAND_STANDARD_QAM |SCU_RAM_COMMAND_CMD_DEMOD_START ,0 ,NULL ,1 , &cmd_result); + status =scu_command (state,SCU_RAM_COMMAND_STANDARD_QAM + |SCU_RAM_COMMAND_CMD_DEMOD_START , +0 ,NULL ,1 , &cmd_result);if (status <0 ) goto error;
@@ -5628,13 +5739,22 @@ static int set_qam_standard(struct drxk_state *state,boot loader from ROM table */ switch (o_mode) {case OM_QAM_ITU_A : - status =bl_chain_cmd (state,DRXK_BL_ROM_OFFSET_TAPS_ITU_A ,DRXK_BLCC_NR_ELEMENTS_TAPS ,DRXK_BLC_TIMEOUT ); + status =bl_chain_cmd (state,DRXK_BL_ROM_OFFSET_TAPS_ITU_A , +DRXK_BLCC_NR_ELEMENTS_TAPS , +DRXK_BLC_TIMEOUT );break ;case OM_QAM_ITU_C : - status =bl_direct_cmd (state,IQM_CF_TAP_RE0__A ,DRXK_BL_ROM_OFFSET_TAPS_ITU_C ,DRXK_BLDC_NR_ELEMENTS_TAPS ,DRXK_BLC_TIMEOUT ); + status =bl_direct_cmd (state,IQM_CF_TAP_RE0__A , +DRXK_BL_ROM_OFFSET_TAPS_ITU_C , +DRXK_BLDC_NR_ELEMENTS_TAPS , +DRXK_BLC_TIMEOUT );if (status <0 ) goto error; - status =bl_direct_cmd (state,IQM_CF_TAP_IM0__A ,DRXK_BL_ROM_OFFSET_TAPS_ITU_C ,DRXK_BLDC_NR_ELEMENTS_TAPS ,DRXK_BLC_TIMEOUT ); + status =bl_direct_cmd (state, +IQM_CF_TAP_IM0__A , +DRXK_BL_ROM_OFFSET_TAPS_ITU_C , +DRXK_BLDC_NR_ELEMENTS_TAPS , +DRXK_BLC_TIMEOUT );break ;default : status = -EINVAL ;
@@ -5642,13 +5762,14 @@ static int set_qam_standard(struct drxk_state *state,if (status <0 ) goto error; - status =write16 (state,IQM_CF_OUT_ENA__A , (1 <<IQM_CF_OUT_ENA_QAM__B )); + status =write16 (state,IQM_CF_OUT_ENA__A ,1 <<IQM_CF_OUT_ENA_QAM__B );if (status <0 ) goto error; status =write16 (state,IQM_CF_SYMMETRIC__A ,0 );if (status <0 ) goto error; - status =write16 (state,IQM_CF_MIDTAP__A , ((1 <<IQM_CF_MIDTAP_RE__B ) | (1 <<IQM_CF_MIDTAP_IM__B ))); + status =write16 (state,IQM_CF_MIDTAP__A , + ((1 <<IQM_CF_MIDTAP_RE__B ) | (1 <<IQM_CF_MIDTAP_IM__B )));if (status <0 ) goto error;
@@ -5760,7 +5881,8 @@ static int write_gpio(struct drxk_state *state)dprintk (1 ,"\n" );/* stop lock indicator process */ - status =write16 (state,SCU_RAM_GPIO__A ,SCU_RAM_GPIO_HW_LOCK_IND_DISABLE ); + status =write16 (state,SCU_RAM_GPIO__A , +SCU_RAM_GPIO_HW_LOCK_IND_DISABLE );if (status <0 ) goto error;
@@ -5772,7 +5894,8 @@ static int write_gpio(struct drxk_state *state)if (state->m_has_sawsw) {if (state->uio_mask &0x0001 ) {/* UIO-1 */ /* write to io pad configuration register - output mode */ - status =write16 (state,SIO_PDR_SMA_TX_CFG__A , state->m_gpio_cfg); + status =write16 (state,SIO_PDR_SMA_TX_CFG__A , + state->m_gpio_cfg);if (status <0 ) goto error;
@@ -5791,7 +5914,8 @@ static int write_gpio(struct drxk_state *state) }if (state->uio_mask &0x0002 ) {/* UIO-2 */ /* write to io pad configuration register - output mode */ - status =write16 (state,SIO_PDR_SMA_RX_CFG__A , state->m_gpio_cfg); + status =write16 (state,SIO_PDR_SMA_RX_CFG__A , + state->m_gpio_cfg);if (status <0 ) goto error;
@@ -5810,7 +5934,8 @@ static int write_gpio(struct drxk_state *state) }if (state->uio_mask &0x0004 ) {/* UIO-3 */ /* write to io pad configuration register - output mode */ - status =write16 (state,SIO_PDR_GPIO_CFG__A , state->m_gpio_cfg); + status =write16 (state,SIO_PDR_GPIO_CFG__A , + state->m_gpio_cfg);if (status <0 ) goto error;
@@ -5909,7 +6034,8 @@ static int power_down_device(struct drxk_state *state)if (status <0 ) goto error; - status =write16 (state,SIO_CC_PWD_MODE__A ,SIO_CC_PWD_MODE_LEVEL_CLOCK ); + status =write16 (state,SIO_CC_PWD_MODE__A , +SIO_CC_PWD_MODE_LEVEL_CLOCK );if (status <0 ) goto error; status =write16 (state,SIO_CC_UPDATE__A ,SIO_CC_UPDATE_KEY );
@@ -5940,13 +6066,19 @@ static int init_drxk(struct drxk_state *state)if (status <0 ) goto error;/* Soft reset of OFDM-, sys- and osc-clockdomain */ - status =write16 (state,SIO_CC_SOFT_RST__A ,SIO_CC_SOFT_RST_OFDM__M |SIO_CC_SOFT_RST_SYS__M |SIO_CC_SOFT_RST_OSC__M ); + status =write16 (state,SIO_CC_SOFT_RST__A , +SIO_CC_SOFT_RST_OFDM__M + |SIO_CC_SOFT_RST_SYS__M + |SIO_CC_SOFT_RST_OSC__M );if (status <0 ) goto error; status =write16 (state,SIO_CC_UPDATE__A ,SIO_CC_UPDATE_KEY );if (status <0 ) goto error; -/* TODO is this needed, if yes how much delay in worst case scenario */ +/* +* TODO is this needed? If yes, how much delay in +* worst case scenario +*/ usleep_range (1000 ,2000 ); state->m_drxk_a3_patch_code = true; status =get_device_capabilities (state);
@@ -5979,7 +6111,8 @@ static int init_drxk(struct drxk_state *state) && !(state->m_DRXK_A2_ROM_CODE))#endif { - status =write16 (state,SCU_RAM_GPIO__A ,SCU_RAM_GPIO_HW_LOCK_IND_DISABLE ); + status =write16 (state,SCU_RAM_GPIO__A , +SCU_RAM_GPIO_HW_LOCK_IND_DISABLE );if (status <0 ) goto error; }
@@ -5998,12 +6131,14 @@ static int init_drxk(struct drxk_state *state) goto error;/* enable token-ring bus through OFDM block for possible ucode upload */ - status =write16 (state,SIO_OFDM_SH_OFDM_RING_ENABLE__A ,SIO_OFDM_SH_OFDM_RING_ENABLE_ON ); + status =write16 (state,SIO_OFDM_SH_OFDM_RING_ENABLE__A , +SIO_OFDM_SH_OFDM_RING_ENABLE_ON );if (status <0 ) goto error;/* include boot loader section */ - status =write16 (state,SIO_BL_COMM_EXEC__A ,SIO_BL_COMM_EXEC_ACTIVE ); + status =write16 (state,SIO_BL_COMM_EXEC__A , +SIO_BL_COMM_EXEC_ACTIVE );if (status <0 ) goto error; status =bl_chain_cmd (state,0 ,6 ,100 );
@@ -6018,7 +6153,8 @@ static int init_drxk(struct drxk_state *state) }/* disable token-ring bus through OFDM block for possible ucode upload */ - status =write16 (state,SIO_OFDM_SH_OFDM_RING_ENABLE__A ,SIO_OFDM_SH_OFDM_RING_ENABLE_OFF ); + status =write16 (state,SIO_OFDM_SH_OFDM_RING_ENABLE__A , +SIO_OFDM_SH_OFDM_RING_ENABLE_OFF );if (status <0 ) goto error;
@@ -6048,7 +6184,8 @@ static int init_drxk(struct drxk_state *state) (((DRXK_VERSION_MAJOR /10 ) %10 ) <<8 ) + ((DRXK_VERSION_MAJOR %10 ) <<4 ) + (DRXK_VERSION_MINOR %10 ); - status =write16 (state,SCU_RAM_DRIVER_VER_HI__A , driver_version); + status =write16 (state,SCU_RAM_DRIVER_VER_HI__A , + driver_version);if (status <0 ) goto error; driver_version =
@@ -6056,7 +6193,8 @@ static int init_drxk(struct drxk_state *state) (((DRXK_VERSION_PATCH /100 ) %10 ) <<8 ) + (((DRXK_VERSION_PATCH /10 ) %10 ) <<4 ) + (DRXK_VERSION_PATCH %10 ); - status =write16 (state,SCU_RAM_DRIVER_VER_LO__A , driver_version); + status =write16 (state,SCU_RAM_DRIVER_VER_LO__A , + driver_version);if (status <0 ) goto error;
@@ -6064,10 +6202,13 @@ static int init_drxk(struct drxk_state *state)DRXK_VERSION_MAJOR ,DRXK_VERSION_MINOR , DRXK_VERSION_PATCH); -/* Dirty fix of default values for ROM/PATCH microcode -Dirty because this fix makes it impossible to setup suitable values -before calling DRX_Open. This solution requires changes to RF AGC speed -to be done via the CTRL function after calling DRX_Open */ +/* +* Dirty fix of default values for ROM/PATCH microcode +* Dirty because this fix makes it impossible to setup +* suitable values before calling DRX_Open. This solution +* requires changes to RF AGC speed to be done via the CTRL +* function after calling DRX_Open +*/ /* m_dvbt_rf_agc_cfg.speed = 3; */
@@ -6238,7 +6379,8 @@ static int drxk_set_parameters(struct dvb_frontend *fe)case SYS_DVBC_ANNEX_C :if (!state->m_has_dvbc)return -EINVAL ; - state->m_itut_annex_c = (delsys ==SYS_DVBC_ANNEX_C ) ? true : false; + state->m_itut_annex_c = (delsys ==SYS_DVBC_ANNEX_C ) ? + true : false;if (state->m_itut_annex_c)setoperation_mode (state,OM_QAM_ITU_C );else
@@ -6352,7 +6494,7 @@ static int get_strength(struct drxk_state *state, u64 *strength)if (if_agc.output_level > if_agc.max_output_level) if_agc.output_level = if_agc.max_output_level; - agc_range = (u32) (if_agc.max_output_level - if_agc.min_output_level); + agc_range = (u32)(if_agc.max_output_level - if_agc.min_output_level);if (agc_range >0 ) { atten +=100UL * ((u32)(tuner_if_gain)) *
@@ -6433,9 +6575,11 @@ static int drxk_get_stats(struct dvb_frontend *fe)/* BER measurement is valid if at least FEC lock is achieved */ -/* OFDM_EC_VD_REQ_SMB_CNT__A and/or OFDM_EC_VD_REQ_BIT_CNT can be written -to set nr of symbols or bits over which -to measure EC_VD_REG_ERR_BIT_CNT__A . See CtrlSetCfg(). */ +/* +* OFDM_EC_VD_REQ_SMB_CNT__A and/or OFDM_EC_VD_REQ_BIT_CNT can be +* written to set nr of symbols or bits over which to measure +* EC_VD_REG_ERR_BIT_CNT__A . See CtrlSetCfg(). +*/ /* Read registers for post/preViterbi BER calculation */ status =read16 (state,OFDM_EC_VD_ERR_BIT_CNT__A , ®16);
@@ -6566,8 +6710,8 @@ static int drxk_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)return 0 ; } -static int drxk_get_tune_settings (struct dvb_frontend *fe,struct dvb_frontend_tune_settings - *sets) +static int drxk_get_tune_settings (struct dvb_frontend *fe, +struct dvb_frontend_tune_settings *sets) {struct drxk_state *state = fe->demodulator_priv;struct dtv_frontend_properties *p = &fe->dtv_property_cache;
Signature · 1 line
1.8.1.4