Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux-dvb] Re: [PATCHES] Frontend kernel i2c conversion.
On Thursday 15 July 2004 20:10, Johannes Stezenbach wrote:
> I have no time (and not the hardware) for testing, but the patches
> look good so far. Please commit, if something breaks we can fix later.
> I believe this is the only way to get this stuff tested.
Exactly my thought also.
> One thing:
> ./include/linux/i2c.h:#define I2C_DEVNAME(str) .name = str
>
> I believe that this is some legacy crap that we should get rid off.
> It isn't used anywhere in drivers/i2c/.
[snip]
> Looks much saner to me.
Yes, to me too, done.
Can I also make something like the attached change to all frontends?
It would make module parameters be read/writable in /sys/module/[module],
and also make all frontends have the same debug interface. Thus you can turn
on/off debugging without reloading the module, which could be usefull/handy
when this change goes in. Offcourse I'll make the module load parameters
read-only, as they would not have an effect anyways.
> Thanks a lot for doing all this work!
No problem.
Kenneth
Index: stv0299.c
===================================================================
RCS file: /cvs/linuxtv/dvb-kernel/linux/drivers/media/dvb/frontends/stv0299.c,v
retrieving revision 1.51
diff -u -r1.51 stv0299.c
--- stv0299.c 12 Jul 2004 18:15:36 -0000 1.51
+++ stv0299.c 15 Jul 2004 19:20:28 -0000
@@ -55,16 +55,21 @@
#include "dvb_frontend.h"
#include "dvb_functions.h"
-/* fixme: add this to i2c-id.h */
-#define I2C_DRIVERID_STV0299 I2C_DRIVERID_EXP0
+#define FRONTEND_NAME "dvbfe_stv0299"
-#if 0
-#define dprintk(x...) printk(x)
-#else
-#define dprintk(x...)
-#endif
-
-static int stv0299_status = 0;
+#define dprintk(args...) \
+ do { \
+ if (debug) printk(KERN_DEBUG FRONTEND_NAME ": " args); \
+ } while (0)
+
+static int debug;
+static int stv0299_status;
+
+module_param(debug, int, 0600);
+MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");
+module_param(stv0299_status, int, 0600);
+MODULE_PARM_DESC(stv0299_status, "Which status value to support "
+ "(0 == BER (default), 1 == UCBLOCKS)");
#define STATUS_BER 0
#define STATUS_UCBLOCKS 1
@@ -1440,8 +1445,8 @@
static struct i2c_driver driver = {
.owner = THIS_MODULE,
- .name = "stv0299",
- .id = I2C_DRIVERID_STV0299,
+ .name = FRONTEND_NAME,
+ .id = I2C_DRIVERID_DVBFE_STV0299,
.flags = I2C_DF_NOTIFY,
.attach_adapter = attach_adapter,
.detach_client = detach_client,
@@ -1449,7 +1454,7 @@
};
static struct i2c_client client_template = {
- I2C_DEVNAME("stv0299"),
+ .name = FRONTEND_NAME,
.flags = I2C_CLIENT_ALLOW_USE,
.driver = &driver,
};
@@ -1473,6 +1478,3 @@
"Andreas Oberritter, Andrew de Quincey, Kenneth Aafløy");
MODULE_LICENSE("GPL");
-MODULE_PARM(stv0299_status, "i");
-MODULE_PARM_DESC(stv0299_status, "Which status value to support (0: BER, 1: UCBLOCKS)");
-
Home |
Main Index |
Thread Index