#include "ec100.h"
#include "mxl5005s.h"
-/* debug */
-static int dvb_usb_ec168_debug;
-module_param_named(debug, dvb_usb_ec168_debug, int, 0644);
-MODULE_PARM_DESC(debug, "set debugging level" DVB_USB_DEBUG_STATUS);
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
static int ec168_ctrl_msg(struct dvb_usb_device *d, struct ec168_req *req)
request = DEMOD_RW;
break;
default:
- err("unknown command:%02x", req->cmd);
- ret = -EPERM;
+ pr_err("%s: unknown command=%02x\n", KBUILD_MODNAME, req->cmd);
+ ret = -EINVAL;
goto error;
}
req->index, buf, req->size, EC168_USB_TIMEOUT);
ec168_debug_dump(request, requesttype, req->value, req->index, buf,
- req->size, deb_xfer);
+ req->size);
if (ret < 0)
goto err_dealloc;
err_dealloc:
kfree(buf);
error:
- deb_info("%s: failed:%d\n", __func__, ret);
+ pr_debug("%s: failed=%d\n", __func__, ret);
return ret;
}
ret = ec168_ctrl_msg(d, &req);
i += 2;
} else {
- err("I2C read not implemented");
- ret = -ENOSYS;
+ pr_err("%s: I2C read not implemented\n",
+ KBUILD_MODNAME);
+ ret = -EOPNOTSUPP;
i += 2;
}
} else {
int ret;
u8 reply;
struct ec168_req req = {GET_CONFIG, 0, 1, sizeof(reply), &reply};
- deb_info("%s:\n", __func__);
+ pr_debug("%s:\n", __func__);
ret = ec168_ctrl_msg(d, &req);
if (ret)
goto error;
- deb_info("%s: reply:%02x\n", __func__, reply);
+ pr_debug("%s: reply=%02x\n", __func__, reply);
if (reply == 0x01)
ret = WARM;
return ret;
error:
- deb_info("%s: failed:%d\n", __func__, ret);
+ pr_debug("%s: failed=%d\n", __func__, ret);
return ret;
}
int i, len, packets, remainder, ret;
u16 addr = 0x0000; /* firmware start address */
struct ec168_req req = {DOWNLOAD_FIRMWARE, 0, 0, 0, NULL};
- deb_info("%s:\n", __func__);
+ pr_debug("%s:\n", __func__);
#define FW_PACKET_MAX_DATA 2048
packets = fw->size / FW_PACKET_MAX_DATA;
ret = ec168_ctrl_msg(d, &req);
if (ret) {
- err("firmware download failed:%d packet:%d", ret, i);
+ pr_err("%s: firmware download failed=%d packet=%d\n",
+ KBUILD_MODNAME, ret, i);
goto error;
}
}
return ret;
error:
- deb_info("%s: failed:%d\n", __func__, ret);
+ pr_debug("%s: failed=%d\n", __func__, ret);
return ret;
}
static int ec168_ec100_frontend_attach(struct dvb_usb_adapter *adap)
{
- deb_info("%s:\n", __func__);
+ pr_debug("%s:\n", __func__);
adap->fe[0] = dvb_attach(ec100_attach, &ec168_ec100_config,
&adap->dev->i2c_adap);
if (adap->fe[0] == NULL)
static int ec168_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap)
{
- deb_info("%s:\n", __func__);
+ pr_debug("%s:\n", __func__);
return dvb_attach(mxl5005s_attach, adap->fe[0],
&adap->dev->i2c_adap,
&ec168_mxl5003s_config) == NULL ? -ENODEV : 0;
static int ec168_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
{
struct ec168_req req = {STREAMING_CTRL, 0x7f01, 0x0202, 0, NULL};
- deb_info("%s: onoff:%d\n", __func__, onoff);
+ pr_debug("%s: onoff=%d\n", __func__, onoff);
if (onoff)
req.index = 0x0102;
return ec168_ctrl_msg(adap->dev, &req);
module_usb_driver(ec168_driver);
MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>");
-MODULE_DESCRIPTION("E3C EC168 DVB-T USB2.0 driver");
+MODULE_DESCRIPTION("E3C EC168 driver");
MODULE_LICENSE("GPL");
#ifndef EC168_H
#define EC168_H
-#define DVB_USB_LOG_PREFIX "ec168"
#include "dvb_usb.h"
-#ifdef CONFIG_DVB_USB_DEBUG
-#define dprintk(var, level, args...) \
- do { if ((var & level)) printk(args); } while (0)
-#define DVB_USB_DEBUG_STATUS
-#else
-#define dprintk(args...)
-#define debug_dump(b, l, func)
-#define DVB_USB_DEBUG_STATUS " (debugging is not enabled)"
-#endif
-
-#define deb_info(args...) dprintk(dvb_usb_ec168_debug, 0x01, args)
-#define deb_rc(args...) dprintk(dvb_usb_ec168_debug, 0x02, args)
-#define deb_xfer(args...) dprintk(dvb_usb_ec168_debug, 0x04, args)
-#define deb_reg(args...) dprintk(dvb_usb_ec168_debug, 0x08, args)
-#define deb_i2c(args...) dprintk(dvb_usb_ec168_debug, 0x10, args)
-#define deb_fw(args...) dprintk(dvb_usb_ec168_debug, 0x20, args)
-
-#define ec168_debug_dump(r, t, v, i, b, l, func) { \
- int loop_; \
- func("%02x %02x %02x %02x %02x %02x %02x %02x", \
- t, r, v & 0xff, v >> 8, i & 0xff, i >> 8, l & 0xff, l >> 8); \
+#define ec168_debug_dump(r, t, v, i, b, l) { \
+ char *direction; \
if (t == (USB_TYPE_VENDOR | USB_DIR_OUT)) \
- func(" >>> "); \
+ direction = ">>>"; \
else \
- func(" <<< "); \
- for (loop_ = 0; loop_ < l; loop_++) \
- func("%02x ", b[loop_]); \
- func("\n");\
+ direction = "<<<"; \
+ pr_debug("%s: %02x %02x %02x %02x %02x %02x %02x %02x %s\n", \
+ __func__, t, r, v & 0xff, v >> 8, i & 0xff, i >> 8, \
+ l & 0xff, l >> 8, direction); \
}
#define EC168_USB_TIMEOUT 1000