Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:
1) It requires that the scancode to be at the range 00-7f;
2) keycodes should be masked on 7 bits in order for it to work;
3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;
4) it is different than what is done with dvb-usb approach;
5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.
This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
u16 scancode;
u32 keycode;
};
This is very close to what dvb does. So, a further integration with DVB
code will be easy.
While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.
The only notable effect is the redution of about 35% of the ir-common
module size:
text data bss dec hex filename
6721 29208 4 35933 8c5d old/ir-common.ko
5756 18040 4 23800 5cf8 new/ir-common.ko
In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.
This patch itself shouldn't be doing any functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Patch solves problem of missed keystrokes on some remote controls,
as reported on http://bugzilla.kernel.org/show_bug.cgi?id=9637 .
Signed-off-by: Andrzej Hajda <andrzej.hajda@wp.pl>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
I updated and simplyfied patch from Zbynek Hrabovsky for recent kernel.
It enables autodetection of card, sound in analog TV , sound in FM radio
and switching between antenna and cable RF input. Radio tuner still
doesn't work, I don't even know how it works. Some guys wrote me that FM
radio works with TV tuner used instead of radio part (symlink video0 ->
radio0).
Cc: Gerd Knorr <kraxel@bytesex.org>
Signed-off-by: Vlastimil Labsky <vlasta.labsky@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Enables analog/digital tv, radio and remote control (gpio).
Tested-by: Marcin Wojcikowski <emtees.mts@gmail.com>
Tested-by: Karel Juhanak <karel.juhanak@warnet.cz>
Tested-by: Andrew Goff <goffa72@gmail.com>
Tested-by: Jan Novak <novak-j@seznam.cz>
Signed-off-by: Miroslav Sustek <sustmidown@centrum.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Adds support to the remote control of the Winfast TV2000 XP Global TV
capture card. A case statement was added in order to initialize the
GPIO data structures as well as a case statement for handling the keys
correctly when pressed.
Thanks to Hermann and Mauro for all the help
Signed-off-by: Pieter C van Schaik <vansterpc@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
cx88: Add support for the Hauppauge IROnly board.
Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
When unloading the cx8800 driver I sometimes get a general protection
fault. Analysis revealed a race in cx88_ir_stop(). It can be solved by
using a delayed work instead of a timer for infrared input polling.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Thanks to Sidney Matias <sidney.matias@gmail.com> for getting GPIO
values and testing on this device.
Cc: Sidney Matias <sidney.matias@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
From the author:
This patch-set fixes remote control issues I have experienced
with hauppauge drivers in Linux since the PVR-350 and now
with both a NOVA-S+ and HVR-4000. It has also been confirmed
to work with an HVR-1300 user who had exactly the same issue.
Hauppage remote controls use RC5. RC5 has a bit-field which
represents the target device. The hauppauge windows drivers
have a registry key which can enable filtering, but the linux
drivers will accept any target device in this bit field for
internal processing.
This causes problems with setups such as mythtv where remote
control key presses destined for the TV (target = 0) are
interpreted by the kernel and subsequenctly LIRC then mythtv.
Of the remote controls I have to hand (wintv black, pvr/hvr
silver) the hauppauge remotes send one of two device targets
ids, these are interpreted by the patch which then filters
out any non hauppauge addresses.
Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Adding support for Hauppauge's cx88 S2 based products, based on the
cx24116 DVB-S2 demodulator.
Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The attached patch adds complete remote control support for Powercolor Real
Angel 330.
Signed-off-by: Daniel Fraga <fragabr@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
- Static memory is always initialized with 0.
- Replaced in some cases C99 comments for /* */
Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
IR corrections for the Pinnacle 800i
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Chaogui Zhang <czhang1974@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Correctly set the atatch structures, enable IR, configure the
xc5000 tuner includes.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
IR workqueue should be disabled during suspend. This avoids some troubles, like
the one reported on bug #8689:
"The Hauppauge HVR 1100 ir-remote control does not work after resume from
suspend to ram or disk."
This patch disables IR before suspending, re-enabling it after resume.
Thanks to Peter Poklop <Peter.Poklop@gmx.at> for reporting it and helping with
the fix.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Reviewed-by: Peter Poklop <Peter.Poklop@gmx.at>
Since at least kernel 2.6.12-rc2, module.h includes moduleparm.h. This
patch removes all occurences of moduleparm.h from drivers/media files.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Used for the PCI_INTMSK and PCI_INT_STAT registers.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
The cx88 driver state stored the ID of the board type in core->board. Every
time the driver need to get some information about the board configuration, it
uses the board number as an index into board configuration array.
This patch changes it so that the board number is in core->boardnr, and
core->board is a copy of the board configuration information. This allows
access to board information without the extra indirection. e.g.
cx88_boards[core->board].mpeg becomes core->board.mpeg.
This has a number of advantages:
- The code is simpler to write.
- It compiles to be smaller and faster, without needing the extra array lookup
to get at the board information.
- The cx88_boards array no longer needs to be exported to all cx88 modules.
- The boards array can be made const
- It should be possible to avoid keeping the (large) cx88_boards array around
after the module is loaded.
- If module parameters or eeprom info override some board configuration
setting, it's not necessary to modify the boards array, which would
affect all boards of the same type.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
In the function, cx88_ir_handle_key:
- convert nested if statement to a switch..case block
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
- add support for the I2C based IR transceiver of the Hauppauge HVR-1300
- remove bad code from cx88-input.c
Signed-off-by: Jan Frey <jfrey@gmx.de>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
In preparation for struct class_device -> struct device input
core conversion switch to using input_dev->dev.parent when
specifying device position in sysfs tree.
Signed-off-by: Dmitry Torokhov <dtor at mail.ru>
Acked-by: Thierry Merle <thierry.merle@free.fr>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Also sprinkled some input_sync() throughout the code.
Acked-by: Ricardo Cerqueira <v4l@cerqueira.org>
Acked-by: Oliver Endriss <o.endriss@gmx.de>
Acked-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
fix remote control on WinFast 2000XP Expert by setting timing back to 1 ms,
like it was in the original patch by Robert Reid.
Signed-off-by: Hermann Pitton <hermann-pitton@arcor.de>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
The WinTV-HVR3000 is currently defined for analog support only. This
patch adds full DVB-T support. (DVB-S support will be added soon)
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This is the first in a series of patches to add full WinTV-HVR1300
support to Linux. This first patch will enable analog TV support
and DVB-T support. Later patches will add the hardware MPEG encoder
support.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This patch adds support for Norwood PCI TV Tuner (non-pro)
Signed-off-by: Peter Naulls <peter@chocky.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Fix keycode calculations (all codes for this remote were wrong due to a
lost + sign)
Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
There was an unmasked bit in the keycodes that was causing random
behaviour (the code could be N or N+1). Masked that bit now.
Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
The description of the card has been updated to it's full name/model.
The tuner has also been switched to a more compatible one (radio
wasn't working, now it is)
Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Adds support for the Y0400052 remote supplied with this card.
In addition to adding a number of buttons to the current winfast definition,
it enables all the keys currently masked out with #ifdef 0.
It is supplied separately as it remaps two keys from the current definition,
The teletext button now sends KEY_TEXT instead of KEY_SUBTITLE, as that
keycode is used by the subtitle button.
KEY_BACK was changed to KEY_LAST to group it with KEY_NEXT.
Other then that the keys don't overlap, so this should support several
different versions of the Leadtek remotes.
Signed-off-by: Malcolm Valentine <farkit@iinet.net.au>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Added support for a new cx88 card, including it's remote
Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This patch adds support for the IR remote control found in the card
CX88_BOARD_PROLINK_PLAYTVPVR.
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
add IR support to KWorld DVB-T (cx22702-based)
Signed-off-by: Marco Manenti <marco_manenti@colman.it>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
- Remove duplicated keymaps and add keymap for KWorld LTV883IR.
Thanks to Jon Ferguson <jon@sd-6.org>.
Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
- All the keymaps have the same structure, and can be shared between different
chips, so it makes no sense having them scattered between the input files.
This aggregates them all at ir-common module.
- Added new Hauppauge remote (Hauppauge grey), contributed by J.O. Aho
<trizt@iname.com> (with some small changes)
Changed KEY_KPx (keypad numerals) references to KEY_x, to avoid problems
when NumLock is off (suggested by Peter Missel <peter.missel@onlinehome.de>)
- Some cleanups at IR code
Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
- Add a missing case which was preventing the operation of the HVR1100
remote.
Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
- Both AverTV Studio 303 cards, #6 and #36,
use the same remote control programming.
Signed-off-by: George Gazurkoff <gazurkoff@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
- Added support for VP-3054 (aka DigitalNow DNTV Live! DVB-T Pro!).
- This board has a secondary I2C bus and remote control.
- Added a new module to handle secondary I2C bus on this board.
Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
- This patch makes kernel in sync with v4l subsystem tree.
- some lines reordered to be sync.
- some reduntant codes removed.
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
- Enable remote control on AVERTV STUDIO 303
- This patch adapted from a patch found on a website posted by
an anonymous user. Thanks to original anonymous author for
creating this patch. Tested successfully by George Gazurkoff.
Signed-off-by: George Gazurkoff <gazurkoff@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
- Add support for the Hauppauge HVR1100 and HVR1100-LP products.
- Add i2c_gate_ctrl callback function to dvb_frontend_ops struct.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
- Enable IR support for the Nova-S-Plus.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>