Message ID | 1295584225-21210-4-git-send-email-jarod@redhat.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-path: <mchehab@pedra> Envelope-to: mchehab@pedra Delivery-date: Fri, 21 Jan 2011 08:03:20 -0200 Received: from mchehab by pedra with local (Exim 4.72) (envelope-from <mchehab@pedra>) id 1PgDpv-0000gv-PV for mchehab@pedra; Fri, 21 Jan 2011 08:03:20 -0200 Received: from casper.infradead.org [85.118.1.10] by pedra with IMAP (fetchmail-6.3.17) for <mchehab@localhost> (single-drop); Fri, 21 Jan 2011 08:03:19 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1Pg8f9-000839-TS; Fri, 21 Jan 2011 04:31:52 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753593Ab1AUEbu (ORCPT <rfc822; kmpark@infradead.org> + 1 other); Thu, 20 Jan 2011 23:31:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:8756 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752582Ab1AUEbu (ORCPT <rfc822;linux-media@vger.kernel.org>); Thu, 20 Jan 2011 23:31:50 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0L4VKVe022087 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 20 Jan 2011 23:31:47 -0500 Received: from hades.wilsonet.com.com (vpn-236-56.phx2.redhat.com [10.3.236.56]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p0L4UdL7005963; Thu, 20 Jan 2011 23:31:06 -0500 From: Jarod Wilson <jarod@redhat.com> To: linux-media@vger.kernel.org Cc: Jarod Wilson <jarod@redhat.com>, Andy Walls <awalls@md.metrocast.net>, Mike Isley <isley@isley.net> Subject: [PATCH 3/3] ir-kbd-i2c: improve remote behavior with z8 behind usb Date: Thu, 20 Jan 2011 23:30:25 -0500 Message-Id: <1295584225-21210-4-git-send-email-jarod@redhat.com> In-Reply-To: <1295584225-21210-1-git-send-email-jarod@redhat.com> References: <1295584225-21210-1-git-send-email-jarod@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org Sender: <mchehab@pedra> |
Commit Message
Jarod Wilson
Jan. 21, 2011, 4:30 a.m. UTC
Add the same "are you ready?" i2c_master_send() poll command to
get_key_haup_xvr found in lirc_zilog, which is apparently seen in
the Windows driver for the PVR-150 w/a z8. This stabilizes what is
received from both the HD-PVR and HVR-1950, even with their polling
intervals at the default of 100, thus the removal of the custom
260ms polling_interval in pvrusb2-i2c-core.c.
CC: Andy Walls <awalls@md.metrocast.net>
CC: Mike Isley <isley@isley.net>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
---
drivers/media/video/ir-kbd-i2c.c | 13 +++++++++++++
drivers/media/video/pvrusb2/pvrusb2-i2c-core.c | 1 -
2 files changed, 13 insertions(+), 1 deletions(-)
Comments
D'oh, butchered Mike's last name (and domain name), apologies... On Thu, Jan 20, 2011 at 11:30:25PM -0500, Jarod Wilson wrote: > Add the same "are you ready?" i2c_master_send() poll command to > get_key_haup_xvr found in lirc_zilog, which is apparently seen in > the Windows driver for the PVR-150 w/a z8. This stabilizes what is > received from both the HD-PVR and HVR-1950, even with their polling > intervals at the default of 100, thus the removal of the custom > 260ms polling_interval in pvrusb2-i2c-core.c. > > CC: Andy Walls <awalls@md.metrocast.net> > CC: Mike Isely <isely@isely.net> > Signed-off-by: Jarod Wilson <jarod@redhat.com> > --- > drivers/media/video/ir-kbd-i2c.c | 13 +++++++++++++ > drivers/media/video/pvrusb2/pvrusb2-i2c-core.c | 1 - > 2 files changed, 13 insertions(+), 1 deletions(-) > > diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c > index d2b20ad..a221ad6 100644 > --- a/drivers/media/video/ir-kbd-i2c.c > +++ b/drivers/media/video/ir-kbd-i2c.c > @@ -128,6 +128,19 @@ static int get_key_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) > > static int get_key_haup_xvr(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) > { > + int ret; > + unsigned char buf[1] = { 0 }; > + > + /* > + * This is the same apparent "are you ready?" poll command observed > + * watching Windows driver traffic and implemented in lirc_zilog. With > + * this added, we get far saner remote behavior with z8 chips on usb > + * connected devices, even with the default polling interval of 100ms. > + */ > + ret = i2c_master_send(ir->c, buf, 1); > + if (ret != 1) > + return (ret < 0) ? ret : -EINVAL; > + > return get_key_haup_common (ir, ir_key, ir_raw, 6, 3); > } > > diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c > index ccc8849..451ecd4 100644 > --- a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c > +++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c > @@ -597,7 +597,6 @@ static void pvr2_i2c_register_ir(struct pvr2_hdw *hdw) > init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; > init_data->type = RC_TYPE_RC5; > init_data->name = hdw->hdw_desc->description; > - init_data->polling_interval = 260; /* ms From lirc_zilog */ > /* IR Receiver */ > info.addr = 0x71; > info.platform_data = init_data; > -- > 1.7.3.4 >
On Thu, 2011-01-20 at 23:30 -0500, Jarod Wilson wrote: > Add the same "are you ready?" i2c_master_send() poll command to > get_key_haup_xvr found in lirc_zilog, which is apparently seen in > the Windows driver for the PVR-150 w/a z8. This stabilizes what is > received from both the HD-PVR and HVR-1950, even with their polling > intervals at the default of 100, thus the removal of the custom > 260ms polling_interval in pvrusb2-i2c-core.c. > > CC: Andy Walls <awalls@md.metrocast.net> > CC: Mike Isley <isley@isley.net> > Signed-off-by: Jarod Wilson <jarod@redhat.com> I haven't tested it, but it looks good. The only thing to worry about is accidentally writing a 0 to register 0 at address 0x71 and maybe losing an Rx button press. (However, for that to happen, the Z8 would have already screwed up in its role of an I2C slave anyway, or the I2C master did not honor the Z8's clock stretches.) Since it makes things better and lirc_zilog already does it anyway... Acked-by: Andy Walls <awalls@md.metrocast.net> > --- > drivers/media/video/ir-kbd-i2c.c | 13 +++++++++++++ > drivers/media/video/pvrusb2/pvrusb2-i2c-core.c | 1 - > 2 files changed, 13 insertions(+), 1 deletions(-) > > diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c > index d2b20ad..a221ad6 100644 > --- a/drivers/media/video/ir-kbd-i2c.c > +++ b/drivers/media/video/ir-kbd-i2c.c > @@ -128,6 +128,19 @@ static int get_key_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) > > static int get_key_haup_xvr(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) > { > + int ret; > + unsigned char buf[1] = { 0 }; > + > + /* > + * This is the same apparent "are you ready?" poll command observed > + * watching Windows driver traffic and implemented in lirc_zilog. With > + * this added, we get far saner remote behavior with z8 chips on usb > + * connected devices, even with the default polling interval of 100ms. > + */ > + ret = i2c_master_send(ir->c, buf, 1); > + if (ret != 1) > + return (ret < 0) ? ret : -EINVAL; > + > return get_key_haup_common (ir, ir_key, ir_raw, 6, 3); > } > > diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c > index ccc8849..451ecd4 100644 > --- a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c > +++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c > @@ -597,7 +597,6 @@ static void pvr2_i2c_register_ir(struct pvr2_hdw *hdw) > init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; > init_data->type = RC_TYPE_RC5; > init_data->name = hdw->hdw_desc->description; > - init_data->polling_interval = 260; /* ms From lirc_zilog */ > /* IR Receiver */ > info.addr = 0x71; > info.platform_data = init_data; -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
The pvrusb2 change is obviously trivial so I have no issue with it. Acked-By: Mike Isely <isely@pobox.com> Note the spelling of my last name "Isely" not "Isley". A good way to remember is to think of the normal word "wisely" and just drop the leading "w". (And yes, isely@isely.net and isely@pobox.com lead to the same inbox.) -Mike On Thu, 20 Jan 2011, Jarod Wilson wrote: > Add the same "are you ready?" i2c_master_send() poll command to > get_key_haup_xvr found in lirc_zilog, which is apparently seen in > the Windows driver for the PVR-150 w/a z8. This stabilizes what is > received from both the HD-PVR and HVR-1950, even with their polling > intervals at the default of 100, thus the removal of the custom > 260ms polling_interval in pvrusb2-i2c-core.c. > > CC: Andy Walls <awalls@md.metrocast.net> > CC: Mike Isley <isley@isley.net> > Signed-off-by: Jarod Wilson <jarod@redhat.com> > --- > drivers/media/video/ir-kbd-i2c.c | 13 +++++++++++++ > drivers/media/video/pvrusb2/pvrusb2-i2c-core.c | 1 - > 2 files changed, 13 insertions(+), 1 deletions(-) > > diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c > index d2b20ad..a221ad6 100644 > --- a/drivers/media/video/ir-kbd-i2c.c > +++ b/drivers/media/video/ir-kbd-i2c.c > @@ -128,6 +128,19 @@ static int get_key_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) > > static int get_key_haup_xvr(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) > { > + int ret; > + unsigned char buf[1] = { 0 }; > + > + /* > + * This is the same apparent "are you ready?" poll command observed > + * watching Windows driver traffic and implemented in lirc_zilog. With > + * this added, we get far saner remote behavior with z8 chips on usb > + * connected devices, even with the default polling interval of 100ms. > + */ > + ret = i2c_master_send(ir->c, buf, 1); > + if (ret != 1) > + return (ret < 0) ? ret : -EINVAL; > + > return get_key_haup_common (ir, ir_key, ir_raw, 6, 3); > } > > diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c > index ccc8849..451ecd4 100644 > --- a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c > +++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c > @@ -597,7 +597,6 @@ static void pvr2_i2c_register_ir(struct pvr2_hdw *hdw) > init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; > init_data->type = RC_TYPE_RC5; > init_data->name = hdw->hdw_desc->description; > - init_data->polling_interval = 260; /* ms From lirc_zilog */ > /* IR Receiver */ > info.addr = 0x71; > info.platform_data = init_data; >
On Fri, Jan 21, 2011 at 10:31:42AM -0600, Mike Isely wrote: > > The pvrusb2 change is obviously trivial so I have no issue with it. > > Acked-By: Mike Isely <isely@pobox.com> > > Note the spelling of my last name "Isely" not "Isley". A good way to > remember is to think of the normal word "wisely" and just drop the > leading "w". (And yes, isely@isely.net and isely@pobox.com lead to the > same inbox.) Thanks Mike, apologies about the misspelling, I didn't catch it until after I hit send. I had the Isley Brothers in my head. :) > On Thu, 20 Jan 2011, Jarod Wilson wrote: > > > Add the same "are you ready?" i2c_master_send() poll command to > > get_key_haup_xvr found in lirc_zilog, which is apparently seen in > > the Windows driver for the PVR-150 w/a z8. This stabilizes what is > > received from both the HD-PVR and HVR-1950, even with their polling > > intervals at the default of 100, thus the removal of the custom > > 260ms polling_interval in pvrusb2-i2c-core.c. > > > > CC: Andy Walls <awalls@md.metrocast.net> > > CC: Mike Isley <isley@isley.net> > > Signed-off-by: Jarod Wilson <jarod@redhat.com> > > --- > > drivers/media/video/ir-kbd-i2c.c | 13 +++++++++++++ > > drivers/media/video/pvrusb2/pvrusb2-i2c-core.c | 1 - > > 2 files changed, 13 insertions(+), 1 deletions(-) > > > > diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c > > index d2b20ad..a221ad6 100644 > > --- a/drivers/media/video/ir-kbd-i2c.c > > +++ b/drivers/media/video/ir-kbd-i2c.c > > @@ -128,6 +128,19 @@ static int get_key_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) > > > > static int get_key_haup_xvr(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) > > { > > + int ret; > > + unsigned char buf[1] = { 0 }; > > + > > + /* > > + * This is the same apparent "are you ready?" poll command observed > > + * watching Windows driver traffic and implemented in lirc_zilog. With > > + * this added, we get far saner remote behavior with z8 chips on usb > > + * connected devices, even with the default polling interval of 100ms. > > + */ > > + ret = i2c_master_send(ir->c, buf, 1); > > + if (ret != 1) > > + return (ret < 0) ? ret : -EINVAL; > > + > > return get_key_haup_common (ir, ir_key, ir_raw, 6, 3); > > } > > > > diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c > > index ccc8849..451ecd4 100644 > > --- a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c > > +++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c > > @@ -597,7 +597,6 @@ static void pvr2_i2c_register_ir(struct pvr2_hdw *hdw) > > init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; > > init_data->type = RC_TYPE_RC5; > > init_data->name = hdw->hdw_desc->description; > > - init_data->polling_interval = 260; /* ms From lirc_zilog */ > > /* IR Receiver */ > > info.addr = 0x71; > > info.platform_data = init_data; > > > > -- > > Mike Isely > isely @ isely (dot) net > PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8
On Fri, 21 Jan 2011, Mike Isely wrote: > > Note the spelling of my last name "Isely" not "Isley". A good way to > remember is to think of the normal word "wisely" and just drop the > leading "w". (And yes, isely@isely.net and isely@pobox.com lead to the > same inbox.) And of course having said that, I then failed to fix the cc list. Sorry about that. D'Oh!!! -Mike
On Fri, 21 Jan 2011, Jarod Wilson wrote: > On Fri, Jan 21, 2011 at 10:31:42AM -0600, Mike Isely wrote: > > > > The pvrusb2 change is obviously trivial so I have no issue with it. > > > > Acked-By: Mike Isely <isely@pobox.com> > > > > Note the spelling of my last name "Isely" not "Isley". A good way to > > remember is to think of the normal word "wisely" and just drop the > > leading "w". (And yes, isely@isely.net and isely@pobox.com lead to the > > same inbox.) > > Thanks Mike, apologies about the misspelling, I didn't catch it until > after I hit send. I had the Isley Brothers in my head. :) No problem. It's a very common mistake. And no, I'm not related to them. For the record, I generally don't get concerned about the spelling of my name, unless the error causes problems (e.g. lost e-mail) or the error gets propagated to a large list where it might multiply... Anyway, sorry also about taking this thread off topic. Enough said... -Mike
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c index d2b20ad..a221ad6 100644 --- a/drivers/media/video/ir-kbd-i2c.c +++ b/drivers/media/video/ir-kbd-i2c.c @@ -128,6 +128,19 @@ static int get_key_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) static int get_key_haup_xvr(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) { + int ret; + unsigned char buf[1] = { 0 }; + + /* + * This is the same apparent "are you ready?" poll command observed + * watching Windows driver traffic and implemented in lirc_zilog. With + * this added, we get far saner remote behavior with z8 chips on usb + * connected devices, even with the default polling interval of 100ms. + */ + ret = i2c_master_send(ir->c, buf, 1); + if (ret != 1) + return (ret < 0) ? ret : -EINVAL; + return get_key_haup_common (ir, ir_key, ir_raw, 6, 3); } diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c index ccc8849..451ecd4 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c +++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c @@ -597,7 +597,6 @@ static void pvr2_i2c_register_ir(struct pvr2_hdw *hdw) init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; init_data->type = RC_TYPE_RC5; init_data->name = hdw->hdw_desc->description; - init_data->polling_interval = 260; /* ms From lirc_zilog */ /* IR Receiver */ info.addr = 0x71; info.platform_data = init_data;