aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb-frontends')
-rw-r--r--drivers/media/dvb-frontends/drx39xyj/drx39xxj.c36
-rw-r--r--drivers/media/dvb-frontends/drx39xyj/drx39xxj_dummy.c10
-rw-r--r--drivers/media/dvb-frontends/drx39xyj/drxj.c2
3 files changed, 26 insertions, 22 deletions
diff --git a/drivers/media/dvb-frontends/drx39xyj/drx39xxj.c b/drivers/media/dvb-frontends/drx39xyj/drx39xxj.c
index 6db009e2d705..e5f276f5d215 100644
--- a/drivers/media/dvb-frontends/drx39xyj/drx39xxj.c
+++ b/drivers/media/dvb-frontends/drx39xyj/drx39xxj.c
@@ -19,6 +19,8 @@
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.= 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.=
20 */ 20 */
21 21
22#define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__
23
22#include <linux/module.h> 24#include <linux/module.h>
23#include <linux/init.h> 25#include <linux/init.h>
24#include <linux/string.h> 26#include <linux/string.h>
@@ -44,7 +46,7 @@ static int drx39xxj_set_powerstate(struct dvb_frontend *fe, int enable)
44 46
45 result = drx_ctrl(demod, DRX_CTRL_POWER_MODE, &power_mode); 47 result = drx_ctrl(demod, DRX_CTRL_POWER_MODE, &power_mode);
46 if (result != 0) { 48 if (result != 0) {
47 printk(KERN_ERR "Power state change failed\n"); 49 pr_err("Power state change failed\n");
48 return 0; 50 return 0;
49 } 51 }
50 52
@@ -63,14 +65,14 @@ static int drx39xxj_read_status(struct dvb_frontend *fe, fe_status_t *status)
63 65
64 result = drx_ctrl(demod, DRX_CTRL_LOCK_STATUS, &lock_status); 66 result = drx_ctrl(demod, DRX_CTRL_LOCK_STATUS, &lock_status);
65 if (result != 0) { 67 if (result != 0) {
66 printk(KERN_ERR "drx39xxj: could not get lock status!\n"); 68 pr_err("drx39xxj: could not get lock status!\n");
67 *status = 0; 69 *status = 0;
68 } 70 }
69 71
70 switch (lock_status) { 72 switch (lock_status) {
71 case DRX_NEVER_LOCK: 73 case DRX_NEVER_LOCK:
72 *status = 0; 74 *status = 0;
73 printk(KERN_ERR "drx says NEVER_LOCK\n"); 75 pr_err("drx says NEVER_LOCK\n");
74 break; 76 break;
75 case DRX_NOT_LOCKED: 77 case DRX_NOT_LOCKED:
76 *status = 0; 78 *status = 0;
@@ -93,7 +95,7 @@ static int drx39xxj_read_status(struct dvb_frontend *fe, fe_status_t *status)
93 | FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK; 95 | FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK;
94 break; 96 break;
95 default: 97 default:
96 printk(KERN_ERR "Lock state unknown %d\n", lock_status); 98 pr_err("Lock state unknown %d\n", lock_status);
97 } 99 }
98 100
99 return 0; 101 return 0;
@@ -108,7 +110,7 @@ static int drx39xxj_read_ber(struct dvb_frontend *fe, u32 *ber)
108 110
109 result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality); 111 result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
110 if (result != 0) { 112 if (result != 0) {
111 printk(KERN_ERR "drx39xxj: could not get ber!\n"); 113 pr_err("drx39xxj: could not get ber!\n");
112 *ber = 0; 114 *ber = 0;
113 return 0; 115 return 0;
114 } 116 }
@@ -127,7 +129,7 @@ static int drx39xxj_read_signal_strength(struct dvb_frontend *fe,
127 129
128 result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality); 130 result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
129 if (result != 0) { 131 if (result != 0) {
130 printk(KERN_ERR "drx39xxj: could not get signal strength!\n"); 132 pr_err("drx39xxj: could not get signal strength!\n");
131 *strength = 0; 133 *strength = 0;
132 return 0; 134 return 0;
133 } 135 }
@@ -146,7 +148,7 @@ static int drx39xxj_read_snr(struct dvb_frontend *fe, u16 *snr)
146 148
147 result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality); 149 result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
148 if (result != 0) { 150 if (result != 0) {
149 printk(KERN_ERR "drx39xxj: could not read snr!\n"); 151 pr_err("drx39xxj: could not read snr!\n");
150 *snr = 0; 152 *snr = 0;
151 return 0; 153 return 0;
152 } 154 }
@@ -164,7 +166,7 @@ static int drx39xxj_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
164 166
165 result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality); 167 result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
166 if (result != 0) { 168 if (result != 0) {
167 printk(KERN_ERR "drx39xxj: could not get uc blocks!\n"); 169 pr_err("drx39xxj: could not get uc blocks!\n");
168 *ucblocks = 0; 170 *ucblocks = 0;
169 return 0; 171 return 0;
170 } 172 }
@@ -218,7 +220,7 @@ static int drx39xxj_set_frontend(struct dvb_frontend *fe)
218 /* Set the standard (will be powered up if necessary */ 220 /* Set the standard (will be powered up if necessary */
219 result = drx_ctrl(demod, DRX_CTRL_SET_STANDARD, &standard); 221 result = drx_ctrl(demod, DRX_CTRL_SET_STANDARD, &standard);
220 if (result != 0) { 222 if (result != 0) {
221 printk(KERN_ERR "Failed to set standard! result=%02x\n", 223 pr_err("Failed to set standard! result=%02x\n",
222 result); 224 result);
223 return -EINVAL; 225 return -EINVAL;
224 } 226 }
@@ -235,7 +237,7 @@ static int drx39xxj_set_frontend(struct dvb_frontend *fe)
235 /* program channel */ 237 /* program channel */
236 result = drx_ctrl(demod, DRX_CTRL_SET_CHANNEL, &channel); 238 result = drx_ctrl(demod, DRX_CTRL_SET_CHANNEL, &channel);
237 if (result != 0) { 239 if (result != 0) {
238 printk(KERN_ERR "Failed to set channel!\n"); 240 pr_err("Failed to set channel!\n");
239 return -EINVAL; 241 return -EINVAL;
240 } 242 }
241 /* Just for giggles, let's shut off the LNA again.... */ 243 /* Just for giggles, let's shut off the LNA again.... */
@@ -243,14 +245,14 @@ static int drx39xxj_set_frontend(struct dvb_frontend *fe)
243 uio_data.value = false; 245 uio_data.value = false;
244 result = drx_ctrl(demod, DRX_CTRL_UIO_WRITE, &uio_data); 246 result = drx_ctrl(demod, DRX_CTRL_UIO_WRITE, &uio_data);
245 if (result != 0) { 247 if (result != 0) {
246 printk(KERN_ERR "Failed to disable LNA!\n"); 248 pr_err("Failed to disable LNA!\n");
247 return 0; 249 return 0;
248 } 250 }
249#ifdef DJH_DEBUG 251#ifdef DJH_DEBUG
250 for (i = 0; i < 2000; i++) { 252 for (i = 0; i < 2000; i++) {
251 fe_status_t status; 253 fe_status_t status;
252 drx39xxj_read_status(fe, &status); 254 drx39xxj_read_status(fe, &status);
253 printk(KERN_DBG "i=%d status=%d\n", i, status); 255 pr_dbg("i=%d status=%d\n", i, status);
254 msleep(100); 256 msleep(100);
255 i += 100; 257 i += 100;
256 } 258 }
@@ -273,7 +275,7 @@ static int drx39xxj_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
273 int result; 275 int result;
274 276
275#ifdef DJH_DEBUG 277#ifdef DJH_DEBUG
276 printk(KERN_DBG "i2c gate call: enable=%d state=%d\n", enable, 278 pr_dbg("i2c gate call: enable=%d state=%d\n", enable,
277 state->i2c_gate_open); 279 state->i2c_gate_open);
278#endif 280#endif
279 281
@@ -289,7 +291,7 @@ static int drx39xxj_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
289 291
290 result = drx_ctrl(demod, DRX_CTRL_I2C_BRIDGE, &i2c_gate_state); 292 result = drx_ctrl(demod, DRX_CTRL_I2C_BRIDGE, &i2c_gate_state);
291 if (result != 0) { 293 if (result != 0) {
292 printk(KERN_ERR "drx39xxj: could not open i2c gate [%d]\n", 294 pr_err("drx39xxj: could not open i2c gate [%d]\n",
293 result); 295 result);
294 dump_stack(); 296 dump_stack();
295 } else { 297 } else {
@@ -383,7 +385,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
383 385
384 result = drx_open(demod); 386 result = drx_open(demod);
385 if (result != 0) { 387 if (result != 0) {
386 printk(KERN_ERR "DRX open failed! Aborting\n"); 388 pr_err("DRX open failed! Aborting\n");
387 kfree(state); 389 kfree(state);
388 return NULL; 390 return NULL;
389 } 391 }
@@ -394,7 +396,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
394 /* Configure user-I/O #3: enable read/write */ 396 /* Configure user-I/O #3: enable read/write */
395 result = drx_ctrl(demod, DRX_CTRL_UIO_CFG, &uio_cfg); 397 result = drx_ctrl(demod, DRX_CTRL_UIO_CFG, &uio_cfg);
396 if (result != 0) { 398 if (result != 0) {
397 printk(KERN_ERR "Failed to setup LNA GPIO!\n"); 399 pr_err("Failed to setup LNA GPIO!\n");
398 return NULL; 400 return NULL;
399 } 401 }
400 402
@@ -402,7 +404,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
402 uio_data.value = false; 404 uio_data.value = false;
403 result = drx_ctrl(demod, DRX_CTRL_UIO_WRITE, &uio_data); 405 result = drx_ctrl(demod, DRX_CTRL_UIO_WRITE, &uio_data);
404 if (result != 0) { 406 if (result != 0) {
405 printk(KERN_ERR "Failed to disable LNA!\n"); 407 pr_err("Failed to disable LNA!\n");
406 return NULL; 408 return NULL;
407 } 409 }
408 410
diff --git a/drivers/media/dvb-frontends/drx39xyj/drx39xxj_dummy.c b/drivers/media/dvb-frontends/drx39xyj/drx39xxj_dummy.c
index 854077419118..c5187a14a03f 100644
--- a/drivers/media/dvb-frontends/drx39xyj/drx39xxj_dummy.c
+++ b/drivers/media/dvb-frontends/drx39xyj/drx39xxj_dummy.c
@@ -1,3 +1,5 @@
1#define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__
2
1#include <linux/kernel.h> 3#include <linux/kernel.h>
2#include <linux/init.h> 4#include <linux/init.h>
3#include <linux/module.h> 5#include <linux/module.h>
@@ -99,11 +101,11 @@ int drxbsp_i2c_write_read(struct i2c_device_addr *w_dev_addr,
99 } 101 }
100 102
101 if (state->i2c == NULL) { 103 if (state->i2c == NULL) {
102 printk("i2c was zero, aborting\n"); 104 pr_err("i2c was zero, aborting\n");
103 return 0; 105 return 0;
104 } 106 }
105 if (i2c_transfer(state->i2c, msg, num_msgs) != num_msgs) { 107 if (i2c_transfer(state->i2c, msg, num_msgs) != num_msgs) {
106 printk(KERN_WARNING "drx3933: I2C write/read failed\n"); 108 pr_warn("drx3933: I2C write/read failed\n");
107 return -EREMOTEIO; 109 return -EREMOTEIO;
108 } 110 }
109 111
@@ -119,11 +121,11 @@ int drxbsp_i2c_write_read(struct i2c_device_addr *w_dev_addr,
119 .flags = I2C_M_RD, .buf = r_data, .len = r_count}, 121 .flags = I2C_M_RD, .buf = r_data, .len = r_count},
120 }; 122 };
121 123
122 printk("drx3933 i2c operation addr=%x i2c=%p, wc=%x rc=%x\n", 124 pr_dbg("drx3933 i2c operation addr=%x i2c=%p, wc=%x rc=%x\n",
123 w_dev_addr->i2c_addr, state->i2c, w_count, r_count); 125 w_dev_addr->i2c_addr, state->i2c, w_count, r_count);
124 126
125 if (i2c_transfer(state->i2c, msg, 2) != 2) { 127 if (i2c_transfer(state->i2c, msg, 2) != 2) {
126 printk(KERN_WARNING "drx3933: I2C write/read failed\n"); 128 pr_warn("drx3933: I2C write/read failed\n");
127 return -EREMOTEIO; 129 return -EREMOTEIO;
128 } 130 }
129#endif 131#endif
diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c
index 811e09c61ba1..aafe6dffdab5 100644
--- a/drivers/media/dvb-frontends/drx39xyj/drxj.c
+++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c
@@ -35,7 +35,7 @@
35INCLUDE FILES 35INCLUDE FILES
36----------------------------------------------------------------------------*/ 36----------------------------------------------------------------------------*/
37 37
38#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 38#define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__
39 39
40#include "drxj.h" 40#include "drxj.h"
41#include "drxj_map.h" 41#include "drxj_map.h"