All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Sander Pientka <cumulus0007@gmail.com>
Cc: hermann pitton <hermann-pitton@arcor.de>, linux-media@vger.kernel.org
Subject: Re: Remote control at Zolid Hybrid TV Tuner
Date: Wed, 12 May 2010 15:59:02 -0300	[thread overview]
Message-ID: <4BEAFA76.5070809@redhat.com> (raw)
In-Reply-To: <AANLkTin6b9JT1j0iNBmrp0UIhN9Z2Y-V6xdrEy7g5NQb@mail.gmail.com>

Sander Pientka wrote:
> Hi Hermann,
> 
> I am going to revive this old thread, I completely forgot about it and
> I still want to solve this problem.
> 
> Yes, with the IR transmitter not plugged in, the gpio is reported as
> 00000 by dmesg.
> 
> I am aware there is a picture of the backside missing on the wiki, I
> will try to make one a.s.a.p.
> 
> NEC IR support seems to be built-in already: drivers/media/IR/ir-nec-decoder.c.
> 
> Besides, dmesg outputs a section of error messages I don't understand:
> 
> [ 1585.548221] tda18271_write_regs: ERROR: idx = 0x5, len = 1,
> i2c_transfer returned: -5
> [ 1585.548229] tda18271_toggle_output: error -5 on line 47
> [ 1585.720118] tda18271_write_regs: ERROR: idx = 0x5, len = 1,
> i2c_transfer returned: -5
> [ 1585.720129] tda18271_init: error -5 on line 826
> [ 1585.720136] tda18271_tune: error -5 on line 904
> [ 1585.720141] tda18271_set_analog_params: error -5 on line 1041
> [ 1586.381026] tda18271_write_regs: ERROR: idx = 0x6, len = 1,
> i2c_transfer returned: -5
> [ 1586.500589] tda18271_write_regs: ERROR: idx = 0x1d, len = 1,
> i2c_transfer returned: -5
> [ 1586.629447] tda18271_write_regs: ERROR: idx = 0x10, len = 1,
> i2c_transfer returned: -5
> [ 1586.629458] tda18271_channel_configuration: error -5 on line 160
> [ 1586.629465] tda18271_set_analog_params: error -5 on line 1041
> 
> 
> Do you have any idea about the origin of these errors? Do you think
> they affect the IR functionality?

The above errors won't change anything at IR side. For IR, the better approach
is to start using raw_decode mode. I've enabled it only for Avermedia M135A, 
since this is the board I'm using at the IR refactoring tests, but the same approach
should work fine for any other saa7134 board that uses GPIO18 or GPIO16. For GPIO18,
all you need is to use something like:

        case SAA7134_BOARD_AVERMEDIA_M135A:
                ir_codes     = RC_MAP_AVERMEDIA_M135A_RM_JX;
                mask_keydown = 0x0040000;
                mask_keyup   = 0x0040000;
                mask_keycode = 0xffff;
                raw_decode   = 1;
                break;

(Of course, replacing the board name by your board name (SAA7134_BOARD_ZOLID_HYBRID_PCI?),
and pointing to the proper ir_codes table. You'll likely need to write one table for
the IR that were shipped with your board.

To do that, you'll need to enable debug at ir_core (modprobe ir_core debug=1), and type every
key on your keyboard, associating the scancode number with a key name. See http://www.linuxtv.org/wiki/index.php/Remote_Controllers for a reference of the most comon keycodes.

For example, pressing the power button of an IR I have here (for Leadtek PVR3000), it
gives this info at the dmesg log:
ir_nec_decode: NEC scancode 0x0300

All I need to do is to write a new keymap:

add a new media/rc-map.h


 as, for example:
	drivers/media/IR/keymaps/rc-leadtek_pvr3000.c
(copying one of the existing keymaps) and add:

static struct ir_scancode leadtek_winfast_pvr3000_dlx[] = {
	{ 0x300, KEY_POWER2 },

for every key that it is there. Then, add the new file at drivers/media/IR/keymaps/Makefile.

I've tried to summarize the above patches on a change I just did at the wiki page. Feel 
free to improve it, if needed.

Cheers,
Mauro

  parent reply	other threads:[~2010-05-12 18:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-16 19:16 Remote control at Zolid Hybrid TV Tuner Sander Pientka
2010-02-17  2:56 ` hermann pitton
     [not found]   ` <db09c9681002170838tdb15cbbu67cd45a518c11b4b@mail.gmail.com>
     [not found]     ` <1266445236.7202.17.camel@pc07.localdom.local>
2010-05-08 14:12       ` Sander Pientka
2010-05-12  9:02         ` hermann pitton
2010-05-12 18:59         ` Mauro Carvalho Chehab [this message]
2010-05-13  3:28           ` hermann pitton
2010-05-13  4:49             ` Mercurial x git tree sync - was: " Mauro Carvalho Chehab
2010-05-13  7:37               ` hermann pitton
2010-05-13 12:32                 ` Mauro Carvalho Chehab
2010-05-13 17:46                   ` hermann pitton
2010-05-13 18:21                     ` Mauro Carvalho Chehab
2010-05-13 18:45                       ` Mauro Carvalho Chehab
2010-05-14 21:09                         ` hermann pitton
2010-05-15  0:52                           ` hermann pitton
2010-05-13 20:15               ` Douglas Schilling Landgraf

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=4BEAFA76.5070809@redhat.com \
    --to=mchehab@redhat.com \
    --cc=cumulus0007@gmail.com \
    --cc=hermann-pitton@arcor.de \
    --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.