All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarod Wilson <jarod@redhat.com>
To: Andy Walls <awalls@md.metrocast.net>
Cc: Jean Delvare <khali@linux-fr.org>,
	linux-media@vger.kernel.org, Janne Grunau <j@jannau.net>
Subject: Re: [PATCH] hdpvr: enable IR part
Date: Fri, 14 Jan 2011 17:08:00 -0500	[thread overview]
Message-ID: <20110114220759.GG9849@redhat.com> (raw)
In-Reply-To: <1295041480.2459.9.camel@localhost>

On Fri, Jan 14, 2011 at 04:44:40PM -0500, Andy Walls wrote:
> On Fri, 2011-01-14 at 14:54 -0500, Jarod Wilson wrote:
> > A number of things going on here, but the end result is that the IR part
> > on the hdpvr gets enabled, and can be used with ir-kbd-i2c and/or
> > lirc_zilog.
> > 
> > First up, there are some conditional build fixes that come into play
> > whether i2c is built-in or modular. Second, we're swapping out
> > i2c_new_probed_device() for i2c_new_device(), as in my testing, probing
> > always fails, but we *know* that all hdpvr devices have a z8 chip at
> > 0x70 and 0x71. Third, we're poking at an i2c address directly without a
> > client, and writing some magic bits to actually turn on this IR part
> > (this could use some improvement in the future). Fourth, some of the
> > i2c_adapter storage has been reworked, as the existing implementation
> > used to lead to an oops following i2c changes c. 2.6.31.
> > 
> > Earlier editions of this patch have been floating around the 'net for a
> > while, including being patched into Fedora kernels, and they *do* work.
> > This specific version isn't yet tested, beyond loading ir-kbd-i2c and
> > confirming that it does bind to the RX address of the hdpvr:
> > 
> > Registered IR keymap rc-hauppauge-new
> > input: i2c IR (HD PVR) as /devices/virtual/rc/rc1/input6
> > rc1: i2c IR (HD PVR) as /devices/virtual/rc/rc1
> > ir-kbd-i2c: i2c IR (HD PVR) detected at i2c-1/1-0071/ir0 [Hauppage HD PVR I2C]
> > 
> > (Yes, I'm posting before fully testing, and I do have a reason for that,
> > and will post a v2 after testing this weekend, if need be)...
> 
> As discussed on IRC
> 1. no need to probe for the Z8 as HD PVR always has one.  

Did a bit further prodding w/i2cdetect under Jean's guidance[1]. The hdpvr
hardware doesn't like the quick writes used by the i2c_new_probed_device()
routine, but does work with short reads for detection. That would require
writing a custom probe routine though, and just isn't worth the effort on
the hdpvr, since we know it always has an IR part, so i2c_new_device()
really is the way to go here.

[1] 'i2cdetect -l' shows my hdpvr at i2c-1, 'i2cdetect 1', which probes
similar to i2_new_probed_device() doesn't return a device where expected,
but 'i2cdetect -r 1', which uses a short read, does.

> 2. accessing the chip at address 0x54 directly should eventually be
> reworked with nicer i2c subsystem methods, but that can wait

Agreed, this should be cleaned up at some point.

> Note, that code in lirc_zilog.c indicates that ir-kbd-i2c.c's function
> get_key_haup_xvr() *may* need some additions to account for the Rx data
> format.  I'm not sure of this though.  (Or a custom get_key() in the
> hdpvr module could be provided as a function pointer to ir-kbd-i2c.c via
> platform_data.)
> 
> I will provide a debug patch in another email so that it's easier to see
> the data ir-kbd-i2c.c sees coming from the Z8.

I'll tack that onto the machine I've got hooked to the hdpvr and see what
I can see this weekend, thanks much for the pointers.

-- 
Jarod Wilson
jarod@redhat.com


  reply	other threads:[~2011-01-14 22:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-14 19:54 [PATCH] hdpvr: enable IR part Jarod Wilson
2011-01-14 21:44 ` Andy Walls
2011-01-14 22:08   ` Jarod Wilson [this message]
2011-01-15  2:30     ` Jarod Wilson
2011-01-15  4:35       ` Andy Walls
2011-01-15  5:37         ` Jarod Wilson
2011-01-15  5:53           ` Jarod Wilson
2011-01-15  6:56           ` Jarod Wilson
2011-01-15 21:56             ` Andy Walls
2011-01-15 22:10               ` Jarod Wilson
2011-01-15 14:41           ` Andy Walls
2011-01-15 21:46           ` Andy Walls
  -- strict thread matches above, loose matches on Subject: below --
2011-01-15 12:50 Andy Walls
2011-01-15 15:26 ` Andy Walls

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110114220759.GG9849@redhat.com \
    --to=jarod@redhat.com \
    --cc=awalls@md.metrocast.net \
    --cc=j@jannau.net \
    --cc=khali@linux-fr.org \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.