hdpvr: i2c fixups for fully functional IR support
PATCH 1/1 hdpvr: i2c fixups for fully functional IR support
Patch is against http://hg.jannau.net/hdpvr/
1) Adds support for building hdpvr i2c support when i2c is built as a module (based on work by David Engel on the mythtv-users list)
2) Refines the hdpvr_i2c_write() success check (based on a thread in the sagetv forums)
With this patch in place, and the latest lirc_zilog driver in my lirc git tree, the IR part in my hdpvr works perfectly, both for reception and transmitting.
--- Makefile | 4 +--- hdpvr-core.c | 4 ++-- hdpvr-i2c.c | 5 ++++- 3 files changed, 7 insertions(+), 6 deletions(-)
linux/drivers/media/video/hdpvr/Makefile +1 -3
@@ -1,6 +1,4 @@ -hdpvr-objs := hdpvr-control.o hdpvr-core.o hdpvr-video.o - -hdpvr-$(CONFIG_I2C) += hdpvr-i2c.o +hdpvr-objs := hdpvr-control.o hdpvr-core.o hdpvr-i2c.o hdpvr-video.o obj-$(CONFIG_VIDEO_HDPVR) += hdpvr.o
linux/drivers/media/video/hdpvr/hdpvr-core.c +2 -2
@@ -362,7 +362,7 @@ goto error; } -#ifdef CONFIG_I2C +#if defined(CONFIG_I2C ) || defined(CONFIG_I2C_MODULE ) retval =hdpvr_register_i2c_adapter (dev);if (retval <0 ) {v4l2_err (&dev->v4l2_dev,"registering i2c adapter failed\n" );
@@ -413,7 +413,7 @@mutex_unlock (&dev->io_mutex);/* deregister I2C adapter */ -#ifdef CONFIG_I2C +#if defined(CONFIG_I2C ) || defined(CONFIG_I2C_MODULE )mutex_lock (&dev->i2c_mutex);if (dev->i2c_adapter)i2c_del_adapter (dev->i2c_adapter);
linux/drivers/media/video/hdpvr/hdpvr-i2c.c +4 -1
@@ -10,6 +10,7 @@* */ +#if defined(CONFIG_I2C ) || defined(CONFIG_I2C_MODULE )#include <linux/i2c.h> #include "hdpvr.h"
@@ -67,7 +68,7 @@REQTYPE_I2C_WRITE_STAT ,CTRL_READ_REQUEST , 0, 0, buf, 2, 1000); -if (ret ==2 ) +if ((ret ==2 ) && (buf[1 ] == (len -1 ))) ret =0 ;else if (ret >=0 ) ret = -EIO ;
@@ -164,3 +165,5 @@ error: return retval; } + +#endif /* CONFIG_I2C */
Signature · 2 lines
Jarod Wilson [email protected]
Quoted 5 lines · Jarod Wilson
Patch is against http://hg.jannau.net/hdpvr/
1) Adds support for building hdpvr i2c support when i2c is built as a module (based on work by David Engel on the mythtv-users list)
Quoted 8 lines
2) Refines the
hdpvr_i2c_write()success check (based on a thread in the sagetv forums)With this patch in place, and the latest
lirc_zilogdriver in my lirc git tree, the IR part in my hdpvr works perfectly, both for reception and transmitting.Signed-off-by Jarod Wilson <[email protected]>
Jarod,
I recall a problem Brandon Jenkins had from last year, that when I2C was enabled in hdpvr, his machine with multiple HVR-1600s and an HD-PVR would produce a kernel oops.
Have you tested this on a machine with both an HVR-1600 and HD-PVR installed?
Regards,
Andy
Quoted 65 lines
--- Makefile | 4 +--- hdpvr-core.c | 4 ++-- hdpvr-i2c.c | 5 ++++- 3 files changed, 7 insertions(+), 6 deletions(-)diff -r
d49772394029linux/drivers/media/video/hdpvr/Makefilelinux/drivers/media/video/hdpvr/Makefile +1
-3@@ -1,6 +1,4 @@ -hdpvr-objs := hdpvr-control.o hdpvr-core.o hdpvr-video.o - -hdpvr-$(CONFIG_I2C) += hdpvr-i2c.o +hdpvr-objs := hdpvr-control.o hdpvr-core.o hdpvr-i2c.o hdpvr-video.o obj-$(CONFIG_VIDEO_HDPVR) += hdpvr.odiff -r
d49772394029linux/drivers/media/video/hdpvr/hdpvr-core.clinux/drivers/media/video/hdpvr/hdpvr-core.c +2
-2@@ -362,7 +362,7 @@ goto error; } -#ifdef CONFIG_I2C +#if defined(CONFIG_I2C ) || defined(CONFIG_I2C_MODULE ) retval =hdpvr_register_i2c_adapter (dev);if (retval <0 ) {v4l2_err (&dev->v4l2_dev,"registering i2c adapter failed\n" );@@ -413,7 +413,7 @@mutex_unlock (&dev->io_mutex);/* deregister I2C adapter */ -#ifdef CONFIG_I2C +#if defined(CONFIG_I2C ) || defined(CONFIG_I2C_MODULE )mutex_lock (&dev->i2c_mutex);if (dev->i2c_adapter)i2c_del_adapter (dev->i2c_adapter);diff -r
d49772394029linux/drivers/media/video/hdpvr/hdpvr-i2c.clinux/drivers/media/video/hdpvr/hdpvr-i2c.c +4
-1@@ -10,6 +10,7 @@* */ +#if defined(CONFIG_I2C ) || defined(CONFIG_I2C_MODULE )#include <linux/i2c.h> #include "hdpvr.h" @@ -67,7 +68,7 @@REQTYPE_I2C_WRITE_STAT ,CTRL_READ_REQUEST , 0, 0, buf, 2, 1000); -if (ret ==2 ) +if ((ret ==2 ) && (buf[1 ] == (len -1 ))) ret =0 ;else if (ret >=0 ) ret = -EIO ;@@ -164,3 +165,5 @@ error: return retval; } + +#endif /* CONFIG_I2C */
Quoted 15 lines · Andy Walls
Quoted 5 lines · Jarod Wilson
Patch is against http://hg.jannau.net/hdpvr/
1) Adds support for building hdpvr i2c support when i2c is built as a module (based on work by David Engel on the mythtv-users list)
Quoted 8 lines
2) Refines the
hdpvr_i2c_write()success check (based on a thread in the sagetv forums)With this patch in place, and the latest
lirc_zilogdriver in my lirc git tree, the IR part in my hdpvr works perfectly, both for reception and transmitting.Signed-off-by Jarod Wilson<[email protected]>
Quoted 8 lines
Jarod,
I recall a problem Brandon Jenkins had from last year, that when I2C was enabled in hdpvr, his machine with multiple HVR-1600s and an HD-PVR would produce a kernel oops.
Have you tested this on a machine with both an HVR-1600 and HD-PVR installed?
Hrm, no, haven't tested it with such a setup, don't have an HVR-1600. I do have an HVR-1250 that I think might suffice for testing though, if I'm thinking clearly.
Ugh. And I just noticed that while everything works swimmingly with a 2.6.30 kernel base, the i2c changes in 2.6.31 actually break it, so there's gonna be at least one more patch coming... I'm an idjit for not testing w/2.6.31 before sending this in, I *knew* there were major i2c changes to account for... (Its actually the hdpvr driver oopsing, before one even tries loading lirc_zilog).
Signature · 2 lines
Jarod Wilson [email protected]
Quoted 22 lines · Jarod Wilson
Quoted 21 lines · Andy Walls
Quoted 5 lines · Jarod Wilson
Patch is against http://hg.jannau.net/hdpvr/
1) Adds support for building hdpvr i2c support when i2c is built as a module (based on work by David Engel on the mythtv-users list)
Quoted 8 lines
2) Refines the
hdpvr_i2c_write()success check (based on a thread in the sagetv forums)With this patch in place, and the latest
lirc_zilogdriver in my lirc git tree, the IR part in my hdpvr works perfectly, both for reception and transmitting.Signed-off-by Jarod Wilson<[email protected]>Jarod,
I recall a problem Brandon Jenkins had from last year, that when I2C was enabled in hdpvr, his machine with multiple HVR-1600s and an HD-PVR would produce a kernel oops.
Quoted 6 lines
Quoted 2 lines
Have you tested this on a machine with both an HVR-1600 and HD-PVR installed?
Hrm, no, haven't tested it with such a setup, don't have an HVR-1600. I do have an HVR-1250 that I think might suffice for testing though, if I'm thinking clearly.
Hrm. A brief google search suggests the 1250 IR part isn't enabled. I see a number of i2c devices in i2cdetect -l output, but none that say anything about IR... I could just plug the hdpvr in there and see what happens, I suppose...
Quoted 6 lines
Ugh. And I just noticed that while everything works swimmingly with a 2.6.30 kernel base, the i2c changes in 2.6.31 actually break it, so there's gonna be at least one more patch coming... I'm an idjit for not testing w/2.6.31 before sending this in, I *knew* there were major i2c changes to account for... (Its actually the hdpvr driver oopsing, before one even tries loading
lirc_zilog).
Getting closer. The hdpvr driver is no longer oopsing, and lirc_zilog binds correctly. Transmit and receive are working too, but there's still an oops on module unload I'm tracking down. Should be able to finish sorting it all out tomorrow and get patches into the mail.
Signature · 2 lines
Jarod Wilson [email protected]
Quoted 26 lines · Jarod Wilson
Quoted 25 lines · Jarod Wilson
Quoted 23 lines · Andy Walls
Quoted 5 lines · Jarod Wilson
Patch is against http://hg.jannau.net/hdpvr/
1) Adds support for building hdpvr i2c support when i2c is built as a module (based on work by David Engel on the mythtv-users list)
Quoted 8 lines
2) Refines the
hdpvr_i2c_write()success check (based on a thread in the sagetv forums)With this patch in place, and the latest
lirc_zilogdriver in my lirc git tree, the IR part in my hdpvr works perfectly, both for reception and transmitting.Signed-off-by Jarod Wilson<[email protected]>Jarod,
I recall a problem Brandon Jenkins had from last year, that when I2C was enabled in hdpvr, his machine with multiple HVR-1600s and an HD-PVR would produce a kernel oops.
Have you tested this on a machine with both an HVR-1600 and HD-PVR installed?
Quoted 8 lines
Quoted 3 lines
Hrm, no, haven't tested it with such a setup, don't have an HVR-1600. I do have an HVR-1250 that I think might suffice for testing though, if I'm thinking clearly.
Hrm. A brief google search suggests the 1250 IR part isn't enabled. I see a number of i2c devices in i2cdetect -l output, but none that say anything about IR... I could just plug the hdpvr in there and see what happens, I suppose...
You should try that. It was an issue of legacy I2C driver probing that caused the hdpvr module to have problems. The cx18 driver simply stimulated the i2c subsystem to do legacy probing (via the tuner modules IIRC)? See the email I sent you.
Quoted 11 lines
Quoted 6 lines
Ugh. And I just noticed that while everything works swimmingly with a 2.6.30 kernel base, the i2c changes in 2.6.31 actually break it, so there's gonna be at least one more patch coming... I'm an idjit for not testing w/2.6.31 before sending this in, I *knew* there were major i2c changes to account for... (Its actually the hdpvr driver oopsing, before one even tries loading
lirc_zilog).Getting closer. The hdpvr driver is no longer oopsing, and
lirc_zilogbinds correctly. Transmit and receive are working too, but there's still an oops on module unload I'm tracking down. Should be able to finish sorting it all out tomorrow and get patches into the mail.
Regards,
Andy
Quoted 16 lines · Andy Walls
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
I recall a problem Brandon Jenkins had from last year, that when I2C was enabled in hdpvr, his machine with multiple HVR-1600s and an HD-PVR would produce a kernel oops.
Have you tested this on a machine with both an HVR-1600 and HD-PVR installed?
Quoted 8 lines
Quoted 3 lines
Hrm, no, haven't tested it with such a setup, don't have an HVR-1600. I do have an HVR-1250 that I think might suffice for testing though, if I'm thinking clearly.
Hrm. A brief google search suggests the 1250 IR part isn't enabled. I see a number of i2c devices in i2cdetect -l output, but none that say anything about IR... I could just plug the hdpvr in there and see what happens, I suppose...
Quoted 4 lines
You should try that. It was an issue of legacy I2C driver probing that caused the hdpvr module to have problems. The cx18 driver simply stimulated the i2c subsystem to do legacy probing (via the tuner modules IIRC)? See the email I sent you.
So from what I can tell, the i2c changes in 2.6.31 *should* prevent that from happening, and now that I've got everything working on 2.6.31 too, I'll try hooking up my hdpvr to my box w/an hvr-1250, hvr-1800 and pchdtv hd-3000 in it and see what blows up (hopefully nothing...).
Signature · 2 lines
Jarod Wilson [email protected]
Quoted 15 lines · Jarod Wilson
Quoted 6 lines · Andy Walls
Quoted 5 lines
Hrm. A brief google search suggests the 1250 IR part isn't enabled. I see a number of i2c devices in i2cdetect -l output, but none that say anything about IR... I could just plug the hdpvr in there and see what
happens, I suppose...Quoted 6 lines
You should try that. It was an issue of legacy I2C driver probing that
caused the hdpvr module to have problems. The cx18 driver simply stimulated the i2c subsystem to do legacy probing (via the tuner modules
IIRC)? See the email I sent you.
Quoted 5 lines
So from what I can tell, the i2c changes in 2.6.31 *should* prevent that from happening, and now that I've got everything working on 2.6.31 too, I'll try hooking up my hdpvr to my box w/an hvr-1250, hvr-1800 and pchdtv hd-3000 in it and see what blows up (hopefully nothing...).
We still need something to prevent it from happening with older kernels. Easiest solution would be to disable it for 2.6.30 and earlier.
Janne
Quoted 16 lines · Janne Grunau
Quoted 15 lines · Jarod Wilson
Quoted 12 lines · Andy Walls
Quoted 5 lines
Hrm. A brief google search suggests the 1250 IR part isn't enabled. I see a number of i2c devices in i2cdetect -l output, but none that say anything about IR... I could just plug the hdpvr in there and see what
happens, I suppose...You should try that. It was an issue of legacy I2C driver probing that
caused the hdpvr module to have problems. The cx18 driver simply stimulated the i2c subsystem to do legacy probing (via the tuner modules
IIRC)? See the email I sent you.
Quoted 8 lines
Quoted 5 lines
So from what I can tell, the i2c changes in 2.6.31 *should* prevent that from happening, and now that I've got everything working on 2.6.31 too, I'll try hooking up my hdpvr to my box w/an hvr-1250, hvr-1800 and pchdtv hd-3000 in it and see what blows up (hopefully nothing...).
We still need something to prevent it from happening with older kernels. Easiest solution would be to disable it for 2.6.30 and earlier.
So I just tried a few permutations of hooking it up to the previously mentioned box, running a 2.6.29.6 kernel. No oops hooking the hdpvr up after everything else is already up, and no problems booting the system w/the hdpvr already connected (in which case it was the first device set up). One i2c adapter exposed by the hd-3000, three each by the hvr-1800 and the hvr-1250, and the one on the hdpvr.
So perhaps we're okay, but I couldn't say for certain if its okay in combination with the hvr-1600 (i.e. Brandon's setup). Maybe skip enabling the i2c bits by default on kernels prior to 2.6.31, but add a modparam to let people enable them if they want to try it out?
Signature · 2 lines
Jarod Wilson [email protected]
Quoted 21 lines · Andy Walls
Quoted 5 lines · Jarod Wilson
Patch is against http://hg.jannau.net/hdpvr/
1) Adds support for building hdpvr i2c support when i2c is built as a module (based on work by David Engel on the mythtv-users list)
Quoted 8 lines
2) Refines the
hdpvr_i2c_write()success check (based on a thread in the sagetv forums)With this patch in place, and the latest
lirc_zilogdriver in my lirc git tree, the IR part in my hdpvr works perfectly, both for reception and transmitting.Signed-off-by Jarod Wilson <[email protected]>Jarod,
I recall a problem Brandon Jenkins had from last year, that when I2C was enabled in hdpvr, his machine with multiple HVR-1600s and an HD-PVR would produce a kernel oops.
Quoted 7 lines
Have you tested this on a machine with both an HVR-1600 and HD-PVR installed?
Regards,
Andy
I don't mind testing. Currently I am running ArchLinux 64-bit, kernel26-2.6.30.6-1. Please tell me where to build the driver from.
Thanks,
Brandon
Quoted 25 lines · Brandon Jenkins
Quoted 24 lines · Andy Walls
Quoted 5 lines · Jarod Wilson
Patch is against http://hg.jannau.net/hdpvr/
1) Adds support for building hdpvr i2c support when i2c is built as a module (based on work by David Engel on the mythtv-users list)
Quoted 8 lines
2) Refines the
hdpvr_i2c_write()success check (based on a thread in the sagetv forums)With this patch in place, and the latest
lirc_zilogdriver in my lirc git tree, the IR part in my hdpvr works perfectly, both for reception and transmitting.Signed-off-by Jarod Wilson <[email protected]>Jarod,
I recall a problem Brandon Jenkins had from last year, that when I2C was enabled in hdpvr, his machine with multiple HVR-1600s and an HD-PVR would produce a kernel oops.
Have you tested this on a machine with both an HVR-1600 and HD-PVR installed?
Quoted 7 lines
Quoted 4 lines
Regards,
AndyI don't mind testing. Currently I am running ArchLinux 64-bit, kernel26-2.6.30.6-1. Please tell me where to build the driver from.
Hrm... It *was* in Janne's hdpvr tree, but it seems to have gone missing... v4l-dvb tip + this patch should work too:
http://wilsonet.com/jarod/junk/hdpvr-ir/hdpvr-ir-2.6.31.patch
This is exactly what I put in the Fedora 2.6.31 kernel, iirc, and works a treat here. Have also tested against 2.6.29 in a box with a pcHDTV HD-3000 a Hauppauge HVR-1250 and HVR-1800 in it with no issues, so fingers crossed...
Signature · 2 lines
Jarod Wilson [email protected]
Quoted 7 lines · Jarod Wilson
Quoted 2 lines · Brandon Jenkins
I don't mind testing. Currently I am running ArchLinux 64-bit, kernel26-2.6.30.6-1. Please tell me where to build the driver from.
Hrm... It *was* in Janne's hdpvr tree, but it seems to have gone missing...
It's in http://hg.jannau.net/hdpvr. I just merged several weeks of v4l-dvb changes after the last commit. So it's not at the top of the log.
Janne
Quoted 6 lines · Janne Grunau
Quoted 5 lines · Jarod Wilson
Quoted 2 lines · Brandon Jenkins
I don't mind testing. Currently I am running ArchLinux 64-bit, kernel26-2.6.30.6-1. Please tell me where to build the driver from.
Quoted 6 lines
Quoted 2 lines
Hrm... It *was* in Janne's hdpvr tree, but it seems to have gone missing...
It's in http://hg.jannau.net/hdpvr. I just merged several weeks of v4l-dvb changes after the last commit. So it's not at the top of the log.
Bah, so it is. I looked at the actual source files and somehow thought I didn't see the latest bits in there, but I just looked again, and you're of course right, everything's there...
Signature · 2 lines
Jarod Wilson [email protected]
Driver build procedure used:
Cloned http://hg.jannau.net/hdpvr
Pulled http://linuxtv.org/hg/v4l-dvb/
Pulled http://linuxtv.org/hg/~awalls/v4l-dvb/
This should bring in all changes for HDPVR and CX18.
What specifically would you like me to test? I can't reload the modules until the kids are done watching TV. :)
Thanks,
Brandon
Quoted 10 lines · Brandon Jenkins
Driver build procedure used:
Cloned http://hg.jannau.net/hdpvr
Pulled http://linuxtv.org/hg/v4l-dvb/
Pulled http://linuxtv.org/hg/~awalls/v4l-dvb/This should bring in all changes for HDPVR and CX18.
What specifically would you like me to test? I can't reload the modules until the kids are done watching TV. :)
Whatever it was you did last time that was triggering an oops... Things I did myself were hotplugging the hdpvr after everything else was already up, and booting with the hdpvr connected (which in my case, led to it being set up before any of the other cards).
Signature · 2 lines
Jarod Wilson [email protected]