Commit Graph

16 Commits (6de048bf1dd2ad35fe9b2326bf9d6d23fb2fff7a)

Author SHA1 Message Date
Jarod Wilson da48db669f V4L/DVB: IR/imon: remove bad ir_input_dev use
The ir_input_dev gets filled in by __ir_input_register, the one
allocated in imon_init_idev was being overwritten by the correct one
shortly after it was initialized (ultimately resulting in a memory
leak). Additionally, there was an ill-advised memcpy into that
extraneous ir_input_dev which gets fixed by this.

Ill-advised memcpy pointed out by Dmitry Torokhov, bad usage of
ir_input_dev pointed out by Maxim Levitsky.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:57 -03:00
Jarod Wilson 20cd195972 V4L/DVB: IR/imon: remove incorrect calls to input_free_device
Per Dmitry Torokhov, following input_unregister_device with an
input_free_device is forbidden, the former is sufficient alone.

Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:57 -03:00
Joe Perches abf84383ec V4L/DVB: drivers/media: Remove unnecessary casts of private_data
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:42:53 -03:00
Jarod Wilson 49da8be59b V4L/DVB: IR/imon: auto-configure another 0xffdc device variant
Per Pieter Hoekstra:

I have a Antec Fusion with a iMON Lcd and I get the following error:
imon 6-1:1.0: Unknown 0xffdc device, defaulting to VFD and iMON IR (id
0x9e)

The driver is functional if I load it like this: (I do not use a remote for it)
modprobe imon display_type=1 (On Mythbuntu 10.04/2.6.32)

This device is a lcd-type with support for a MCE remote. Looking at
the source code, this device (0x9e) is the same as id 0x9f.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 15:33:00 -03:00
Jarod Wilson 8a3fa8129c V4L/DVB: IR/imon: use the proper ir-core device unregister function
Was using input_unregister_device directly, instead of using
ir_input_unregister, which tears down a bunch of other things in
addition to eventually calling input_unregister_device.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 14:55:30 -03:00
Jarod Wilson bbe4690f6c V4L/DVB: IR/imon: add auto-config for 0xffdc rf device
Add auto-config support for iMON 2.4G LT RF device, based on
debug output from Giulio Amodeo in Red Hat bugzilla #572288.

Also flips the switch on only setting up the rf associate sysfs
attr only if we think we're looking at an RF device, vs. previously,
setting up the attr for all 0xffdc devices, so its possible (but a bit
unlikely) there's another iMON RF device we'll have to fix up.

Nb: should be applied after "IR/imon: clean up usage of bools", or there
will be a slight contextual mismatch.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:23:26 -03:00
Jarod Wilson f789bf4013 V4L/DVB: IR/imon: clean up usage of bools
There was a mix of 0/1 and false/true. Pick one convention and stick
with it (I picked false/true).

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:23:25 -03:00
Jarod Wilson 083e472176 V4L/DVB: IR/imon: remove dead IMON_KEY_RELEASE_OFFSET
On Tue, May 04, 2010 at 06:06:41PM +0200, Dan Carpenter wrote:
> On Tue, May 04, 2010 at 10:03:18AM -0400, Jarod Wilson wrote:
> > @@ -1205,7 +1204,7 @@ static u32 imon_panel_key_lookup(u64 hw_code)
> >  		if (imon_panel_key_table[i].hw_code == (code | 0xffee))
> >  			break;
> >
> > -	keycode = imon_panel_key_table[i % IMON_KEY_RELEASE_OFFSET].keycode;
> > +	keycode = imon_panel_key_table[i].keycode;
> >
> >  	return keycode;
> >  }
>
> There is still potentially a problem here because if we don't hit the
> break statement, then we're one past the end of the array.

D'oh. Okay, here's v2, should fix that buglet too.

This hack was used when the imon driver was using internal key lookup
routines, but became dead weight when the driver was converted to use
ir-core's key lookup routines. These bits simply didn't get removed,
drop 'em now.

Pointed out by Dan Carpenter.

v2: fix possible attempt to access beyond end of key table array,
also pointed out by Dan.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:17 -03:00
Dan Carpenter 9723dbb034 V4L/DVB: media/IR/imon: potential double unlock on error
If there is an error here we should unlock in the caller (which is
imon_init_intf1()).  We can remove this stray unlock.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:04 -03:00
Dan Carpenter 5f6e3c8e34 V4L/DVB: media/IR/imon: testing the wrong variable
There is a typo here.  We meant to test "ir" instead of "props".  The
"props" variable was tested earlier.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:03 -03:00
Dan Carpenter f03900d696 V4L/DVB: media/IR/imon: precendence issue: ! vs ==
The original condition is always false because ! has higher precedence
than == and neither 0 nor 1 is equal to IMON_DISPLAY_TYPE_VGA.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:03 -03:00
Jarod Wilson db190fc13a V4L/DVB: IR/imon: add proper auto-repeat support
Simplified from version 1, in that hacks heisted from ati_remote2.c
aren't actually necessary, the real fix for too many repeats was
from setting too long a timer release value (200ms) on repeats in
mce mode -- this patch drops the release timeout to 33ms, matching
the input subsystem default input_dev->rep[REP_PERIOD].

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:27 -03:00
Jarod Wilson 666a9ed897 V4L/DVB: IR/imon: minor change_protocol fixups
This is a follow-up to my prior patch implementing ir-core's
change_protocol functionality in the imon driver, which eliminates
a false warning when change_protocol is called without a specific
protocol selected yet (i.e., still IR_TYPE_UNKNOWN). It also removes
some extraneous blank lines getting spewn into dmesg.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:26 -03:00
Jarod Wilson 6718e8ad95 V4L/DVB: IR/imon: convert to ir-core protocol change handling
Drop the imon driver's internal protocol definitions in favor of using
those provided by ir-core. Should make ir-keytable Just Work for
switching protocol on the fly on the imon devices that support both the
native imon remotes and mce remotes.

The imon-no-pad-stabilize pseudo-protocol was dropped as a protocol, and
converted to a separate modprobe option (which it probably should have
been in the first place). On the TODO list is to convert this to an as yet
unwritten protocol-specific options framework.

While the mce remotes obviously map to IR_TYPE_RC6, I've yet to look at
what the actual ir signals from the native imon remotes are, so for the
moment, imon native ir is mapped to IR_TYPE_OTHER. Nailing it down more
accurately is also on the TODO list.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:24 -03:00
Mauro Carvalho Chehab 1f71baef3e V4L/DVB: irmon: Cleanup some warning noise
Driver is not properly initializing u64 constants on 32 bit systems:
drivers/media/IR/imon.c:301: warning: integer constant is too large for ‘long’ type
drivers/media/IR/imon.c:302: warning: integer constant is too large for ‘long’ type
drivers/media/IR/imon.c:304: warning: integer constant is too large for ‘long’ type
drivers/media/IR/imon.c:305: warning: integer constant is too large for ‘long’ type
drivers/media/IR/imon.c:308: warning: integer constant is too large for ‘long’ type
drivers/media/IR/imon.c:309: warning: integer constant is too large for ‘long’ type
drivers/media/IR/imon.c:310: warning: integer constant is too large for ‘long’ type

Fix also a few troubles at error printk handling:
drivers/media/IR/imon.c: In function ‘imon_init_intf0’:
drivers/media/IR/imon.c:1909: warning: ‘ret’ may be used uninitialized in this function
drivers/media/IR/imon.c: In function ‘imon_init_intf1’:
drivers/media/IR/imon.c:1989: warning: ‘ret’ may be used uninitialized in this function

Cc: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:44 -03:00
Jarod Wilson 21677cfc56 V4L/DVB: ir-core: add imon driver
This is a new driver for the SoundGraph iMON and Antec Veris IR/display
devices commonly found in many home theater pc cases and as after-market
case additions.

[mchehab@redhat.com: add KERN_CONT on line 2098 to shutup checkpatc.pl]

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:42 -03:00