Commit cc5ad2b6 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] nxt6000: use pr_foo() macros instead of printk()

Replace printk() macros by their pr_foo() counterparts and
use pr_cont() for the continuation lines.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 5479a582
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -39,7 +41,11 @@ struct nxt6000_state { ...@@ -39,7 +41,11 @@ struct nxt6000_state {
}; };
static int debug; static int debug;
#define dprintk if (debug) printk #define dprintk(fmt, arg...) do { \
if (debug) \
printk(KERN_DEBUG pr_fmt("%s: " fmt), \
__func__, ##arg); \
} while (0)
static int nxt6000_writereg(struct nxt6000_state* state, u8 reg, u8 data) static int nxt6000_writereg(struct nxt6000_state* state, u8 reg, u8 data)
{ {
...@@ -215,119 +221,129 @@ static void nxt6000_dump_status(struct nxt6000_state *state) ...@@ -215,119 +221,129 @@ static void nxt6000_dump_status(struct nxt6000_state *state)
{ {
u8 val; u8 val;
/* #if 0
printk("RS_COR_STAT: 0x%02X\n", nxt6000_readreg(fe, RS_COR_STAT)); pr_info("RS_COR_STAT: 0x%02X\n",
printk("VIT_SYNC_STATUS: 0x%02X\n", nxt6000_readreg(fe, VIT_SYNC_STATUS)); nxt6000_readreg(fe, RS_COR_STAT));
printk("OFDM_COR_STAT: 0x%02X\n", nxt6000_readreg(fe, OFDM_COR_STAT)); pr_info("VIT_SYNC_STATUS: 0x%02X\n",
printk("OFDM_SYR_STAT: 0x%02X\n", nxt6000_readreg(fe, OFDM_SYR_STAT)); nxt6000_readreg(fe, VIT_SYNC_STATUS));
printk("OFDM_TPS_RCVD_1: 0x%02X\n", nxt6000_readreg(fe, OFDM_TPS_RCVD_1)); pr_info("OFDM_COR_STAT: 0x%02X\n",
printk("OFDM_TPS_RCVD_2: 0x%02X\n", nxt6000_readreg(fe, OFDM_TPS_RCVD_2)); nxt6000_readreg(fe, OFDM_COR_STAT));
printk("OFDM_TPS_RCVD_3: 0x%02X\n", nxt6000_readreg(fe, OFDM_TPS_RCVD_3)); pr_info("OFDM_SYR_STAT: 0x%02X\n",
printk("OFDM_TPS_RCVD_4: 0x%02X\n", nxt6000_readreg(fe, OFDM_TPS_RCVD_4)); nxt6000_readreg(fe, OFDM_SYR_STAT));
printk("OFDM_TPS_RESERVED_1: 0x%02X\n", nxt6000_readreg(fe, OFDM_TPS_RESERVED_1)); pr_info("OFDM_TPS_RCVD_1: 0x%02X\n",
printk("OFDM_TPS_RESERVED_2: 0x%02X\n", nxt6000_readreg(fe, OFDM_TPS_RESERVED_2)); nxt6000_readreg(fe, OFDM_TPS_RCVD_1));
*/ pr_info("OFDM_TPS_RCVD_2: 0x%02X\n",
printk("NXT6000 status:"); nxt6000_readreg(fe, OFDM_TPS_RCVD_2));
pr_info("OFDM_TPS_RCVD_3: 0x%02X\n",
nxt6000_readreg(fe, OFDM_TPS_RCVD_3));
pr_info("OFDM_TPS_RCVD_4: 0x%02X\n",
nxt6000_readreg(fe, OFDM_TPS_RCVD_4));
pr_info("OFDM_TPS_RESERVED_1: 0x%02X\n",
nxt6000_readreg(fe, OFDM_TPS_RESERVED_1));
pr_info("OFDM_TPS_RESERVED_2: 0x%02X\n",
nxt6000_readreg(fe, OFDM_TPS_RESERVED_2));
#endif
pr_info("NXT6000 status:");
val = nxt6000_readreg(state, RS_COR_STAT); val = nxt6000_readreg(state, RS_COR_STAT);
printk(" DATA DESCR LOCK: %d,", val & 0x01); pr_cont(" DATA DESCR LOCK: %d,", val & 0x01);
printk(" DATA SYNC LOCK: %d,", (val >> 1) & 0x01); pr_cont(" DATA SYNC LOCK: %d,", (val >> 1) & 0x01);
val = nxt6000_readreg(state, VIT_SYNC_STATUS); val = nxt6000_readreg(state, VIT_SYNC_STATUS);
printk(" VITERBI LOCK: %d,", (val >> 7) & 0x01); pr_cont(" VITERBI LOCK: %d,", (val >> 7) & 0x01);
switch ((val >> 4) & 0x07) { switch ((val >> 4) & 0x07) {
case 0x00: case 0x00:
printk(" VITERBI CODERATE: 1/2,"); pr_cont(" VITERBI CODERATE: 1/2,");
break; break;
case 0x01: case 0x01:
printk(" VITERBI CODERATE: 2/3,"); pr_cont(" VITERBI CODERATE: 2/3,");
break; break;
case 0x02: case 0x02:
printk(" VITERBI CODERATE: 3/4,"); pr_cont(" VITERBI CODERATE: 3/4,");
break; break;
case 0x03: case 0x03:
printk(" VITERBI CODERATE: 5/6,"); pr_cont(" VITERBI CODERATE: 5/6,");
break; break;
case 0x04: case 0x04:
printk(" VITERBI CODERATE: 7/8,"); pr_cont(" VITERBI CODERATE: 7/8,");
break; break;
default: default:
printk(" VITERBI CODERATE: Reserved,"); pr_cont(" VITERBI CODERATE: Reserved,");
} }
val = nxt6000_readreg(state, OFDM_COR_STAT); val = nxt6000_readreg(state, OFDM_COR_STAT);
printk(" CHCTrack: %d,", (val >> 7) & 0x01); pr_cont(" CHCTrack: %d,", (val >> 7) & 0x01);
printk(" TPSLock: %d,", (val >> 6) & 0x01); pr_cont(" TPSLock: %d,", (val >> 6) & 0x01);
printk(" SYRLock: %d,", (val >> 5) & 0x01); pr_cont(" SYRLock: %d,", (val >> 5) & 0x01);
printk(" AGCLock: %d,", (val >> 4) & 0x01); pr_cont(" AGCLock: %d,", (val >> 4) & 0x01);
switch (val & 0x0F) { switch (val & 0x0F) {
case 0x00: case 0x00:
printk(" CoreState: IDLE,"); pr_cont(" CoreState: IDLE,");
break; break;
case 0x02: case 0x02:
printk(" CoreState: WAIT_AGC,"); pr_cont(" CoreState: WAIT_AGC,");
break; break;
case 0x03: case 0x03:
printk(" CoreState: WAIT_SYR,"); pr_cont(" CoreState: WAIT_SYR,");
break; break;
case 0x04: case 0x04:
printk(" CoreState: WAIT_PPM,"); pr_cont(" CoreState: WAIT_PPM,");
break; break;
case 0x01: case 0x01:
printk(" CoreState: WAIT_TRL,"); pr_cont(" CoreState: WAIT_TRL,");
break; break;
case 0x05: case 0x05:
printk(" CoreState: WAIT_TPS,"); pr_cont(" CoreState: WAIT_TPS,");
break; break;
case 0x06: case 0x06:
printk(" CoreState: MONITOR_TPS,"); pr_cont(" CoreState: MONITOR_TPS,");
break; break;
default: default:
printk(" CoreState: Reserved,"); pr_cont(" CoreState: Reserved,");
} }
val = nxt6000_readreg(state, OFDM_SYR_STAT); val = nxt6000_readreg(state, OFDM_SYR_STAT);
printk(" SYRLock: %d,", (val >> 4) & 0x01); pr_cont(" SYRLock: %d,", (val >> 4) & 0x01);
printk(" SYRMode: %s,", (val >> 2) & 0x01 ? "8K" : "2K"); pr_cont(" SYRMode: %s,", (val >> 2) & 0x01 ? "8K" : "2K");
switch ((val >> 4) & 0x03) { switch ((val >> 4) & 0x03) {
case 0x00: case 0x00:
printk(" SYRGuard: 1/32,"); pr_cont(" SYRGuard: 1/32,");
break; break;
case 0x01: case 0x01:
printk(" SYRGuard: 1/16,"); pr_cont(" SYRGuard: 1/16,");
break; break;
case 0x02: case 0x02:
printk(" SYRGuard: 1/8,"); pr_cont(" SYRGuard: 1/8,");
break; break;
case 0x03: case 0x03:
printk(" SYRGuard: 1/4,"); pr_cont(" SYRGuard: 1/4,");
break; break;
} }
...@@ -336,77 +352,77 @@ static void nxt6000_dump_status(struct nxt6000_state *state) ...@@ -336,77 +352,77 @@ static void nxt6000_dump_status(struct nxt6000_state *state)
switch ((val >> 4) & 0x07) { switch ((val >> 4) & 0x07) {
case 0x00: case 0x00:
printk(" TPSLP: 1/2,"); pr_cont(" TPSLP: 1/2,");
break; break;
case 0x01: case 0x01:
printk(" TPSLP: 2/3,"); pr_cont(" TPSLP: 2/3,");
break; break;
case 0x02: case 0x02:
printk(" TPSLP: 3/4,"); pr_cont(" TPSLP: 3/4,");
break; break;
case 0x03: case 0x03:
printk(" TPSLP: 5/6,"); pr_cont(" TPSLP: 5/6,");
break; break;
case 0x04: case 0x04:
printk(" TPSLP: 7/8,"); pr_cont(" TPSLP: 7/8,");
break; break;
default: default:
printk(" TPSLP: Reserved,"); pr_cont(" TPSLP: Reserved,");
} }
switch (val & 0x07) { switch (val & 0x07) {
case 0x00: case 0x00:
printk(" TPSHP: 1/2,"); pr_cont(" TPSHP: 1/2,");
break; break;
case 0x01: case 0x01:
printk(" TPSHP: 2/3,"); pr_cont(" TPSHP: 2/3,");
break; break;
case 0x02: case 0x02:
printk(" TPSHP: 3/4,"); pr_cont(" TPSHP: 3/4,");
break; break;
case 0x03: case 0x03:
printk(" TPSHP: 5/6,"); pr_cont(" TPSHP: 5/6,");
break; break;
case 0x04: case 0x04:
printk(" TPSHP: 7/8,"); pr_cont(" TPSHP: 7/8,");
break; break;
default: default:
printk(" TPSHP: Reserved,"); pr_cont(" TPSHP: Reserved,");
} }
val = nxt6000_readreg(state, OFDM_TPS_RCVD_4); val = nxt6000_readreg(state, OFDM_TPS_RCVD_4);
printk(" TPSMode: %s,", val & 0x01 ? "8K" : "2K"); pr_cont(" TPSMode: %s,", val & 0x01 ? "8K" : "2K");
switch ((val >> 4) & 0x03) { switch ((val >> 4) & 0x03) {
case 0x00: case 0x00:
printk(" TPSGuard: 1/32,"); pr_cont(" TPSGuard: 1/32,");
break; break;
case 0x01: case 0x01:
printk(" TPSGuard: 1/16,"); pr_cont(" TPSGuard: 1/16,");
break; break;
case 0x02: case 0x02:
printk(" TPSGuard: 1/8,"); pr_cont(" TPSGuard: 1/8,");
break; break;
case 0x03: case 0x03:
printk(" TPSGuard: 1/4,"); pr_cont(" TPSGuard: 1/4,");
break; break;
} }
...@@ -416,8 +432,8 @@ static void nxt6000_dump_status(struct nxt6000_state *state) ...@@ -416,8 +432,8 @@ static void nxt6000_dump_status(struct nxt6000_state *state)
val = nxt6000_readreg(state, RF_AGC_STATUS); val = nxt6000_readreg(state, RF_AGC_STATUS);
val = nxt6000_readreg(state, RF_AGC_STATUS); val = nxt6000_readreg(state, RF_AGC_STATUS);
printk(" RF AGC LOCK: %d,", (val >> 4) & 0x01); pr_cont(" RF AGC LOCK: %d,", (val >> 4) & 0x01);
printk("\n"); pr_cont("\n");
} }
static int nxt6000_read_status(struct dvb_frontend *fe, enum fe_status *status) static int nxt6000_read_status(struct dvb_frontend *fe, enum fe_status *status)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment