LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   kernel patch (https://www.linuxquestions.org/questions/linux-general-1/kernel-patch-538625/)

nukenuke123 03-18-2007 10:58 PM

kernel patch
 
hi
can any told how to remove this patch from the article and how to do it plzzzzzzzzzzz hellllllllp


=============================================================================================
Try this. I think it is a fault with ir-kbd-i2c, in that it is being probed at the same time as the dst_probe is occurring, and so dst_probe fails. This patch might fix your problem. You can either apply this, or else just delete bttv_probe part yourself. If you use this patch, you need to specify insmod option twinhan=1 for ir-kbd-i2c module
Added twinhan option to bypass "ir_probe", which causes "dst_probe" to fail on Twinhan DST clones.
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
index 59edf58..0ab2db6 100644
--- a/drivers/media/video/ir-kbd-i2c.c
+++ b/drivers/media/video/ir-kbd-i2c.c
@@ -52,8 +54,11 @@ module_param(debug, int, 0644); /* de

static int hauppauge = 0;
module_param(hauppauge, int, 0644); /* Choose Hauppauge remote */
-MODULE_PARM_DESC(hauppauge, "Specify Hauppauge remote: 0=black, 1=grey (defaults to 0)"); +MODULE_PARM_DESC(hauppauge, "Specify Hauppauge remote: 0=black, 1=grey (defaults to 0)")
+static int twinhan = 0;
+module_param(twinhan, int, 0644); /* Fix for Twinhan cards */
+MODULE_PARM_DESC(twinhan, "Workaround for Twinhan _write_dst error which causes dst_probe to fail: 1=on, 0=off (default 0)");
#define DEVNAME "ir-kbd-i2c"
#define dprintk(level, fmt, arg...) if (debug >= level) \
@@ -339,7 +344,7 @@ static int ir_attach(struct i2c_adapter
case 0x1a:
name = "Hauppauge";
ir->get_key = get_key_haup;
- ir_type = IR_TYPE_RC5;
+ ir_type = IR_TYPE_OTHER;
if (hauppauge == 1) {
ir_codes = ir_codes_hauppauge_new;
} else {
@@ -447,51 +452,55 @@ static int ir_probe(struct i2c_adapter *

That's why we probe 0x1a (~0x34) first. CB
*/
-
- static const int probe_bttv[] = { 0x1a, 0x18, 0x4b, 0x64, 0x30, -1};
- static const int probe_saa7134[] = { 0x7a, 0x47, 0x71, -1 };
- static const int probe_em28XX[] = { 0x30, 0x47, -1 };
- const int *probe = NULL;
- struct i2c_client c;
- unsigned char buf;
- int i,rc;
-
- switch (adap->id) {
- case I2C_HW_B_BT848:
- probe = probe_bttv;
- break;
- case I2C_HW_B_CX2341X:
- probe = probe_bttv;
- break;
- case I2C_HW_SAA7134:
- probe = probe_saa7134;
- break;
- case I2C_HW_B_EM28XX:
- probe = probe_em28XX;
- break;
- }
- if (NULL == probe)
+ if (twinhan == 1) {
+ dprintk(1,"Twinhan option specified. IR disabled.\n");
return 0;
-
- memset(&c,0,sizeof(c));
- c.adapter = adap;
- for (i = 0; -1 != probe[i]; i++) {
- c.addr = probe[i];
- rc = i2c_master_recv(&c,&buf,0);
- dprintk(1,"probe 0x%02x @ %s: %s\n",
- probe[i], adap->name,
- (0 == rc) ? "yes" : "no");
- if (0 == rc) {
- ir_attach(adap,probe[i],0,0);
+ } else {
+ static const int probe_bttv[] = { 0x1a, 0x18, 0x4b, 0x64, 0x30, -1};
+ static const int probe_saa7134[] = { 0x7a, 0x47, 0x71, -1 };
+ static const int probe_em28XX[] = { 0x30, 0x47, -1 };
+ const int *probe = NULL;
+ struct i2c_client c;
+ unsigned char buf;
+ int i,rc;
+
+ switch (adap->id) {
+ case I2C_HW_B_BT848:
+ probe = probe_bttv;
+ break;
+ case I2C_HW_B_CX2341X:
+ probe = probe_bttv;
+ break;
+ case I2C_HW_SAA7134:
+ probe = probe_saa7134;
+ break;
+ case I2C_HW_B_EM28XX:
+ probe = probe_em28XX;
break;
}
+ if (NULL == probe)
+ return 0;
+
+ memset(&c,0,sizeof(c));
+ c.adapter = adap;
+ for (i = 0; -1 != probe[i]; i++) {
+ c.addr = probe[i];
+ rc = i2c_master_recv(&c,&buf,0);
+ dprintk(1,"probe 0x%02x @ %s: %s\n",
+ probe[i], adap->name,
+ (0 == rc) ? "yes" : "no");
+ if (0 == rc) {
+ ir_attach(adap,probe[i],0,0);
+ break;
+ }
+ }
+ return 0;
}
- return 0;
}


=============================================================================

btmiller 03-19-2007 02:15 AM

The patch is everything below (not including) the line that begins with diff up to (not including) the line of all equals signs at the bottom. Copy that portion to a file in the top directory of your Linux kernel source. Then do:

patch -p1 < filename.diff

Where filename.diff is the file you made. Check for errors applying the patch. If there are none go ahead and go through the usual procedure of rebuilding the kernel and/or the particular driver you want.

nukenuke123 03-19-2007 02:12 PM

thanx
i'll try


All times are GMT -5. The time now is 01:22 PM.