linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* AVerTV MCE 116 Plus remote
@ 2009-10-02 21:49 Aleksandr V. Piskunov
  2009-10-03 13:19 ` Andy Walls
  0 siblings, 1 reply; 3+ messages in thread
From: Aleksandr V. Piskunov @ 2009-10-02 21:49 UTC (permalink / raw)
  To: linux-media; +Cc: Oldrich Jedlicka

Preliminary version of patch adding support for AVerTV MCE 116 Plus remote.
This board has an IR sensor is connected to EM78P153S, general purpose 8-bit
microcontroller with a 1024 × 13 bits of OTP-ROM. According to i2cdetect, it is
sitting on address 0x40.

Patch allows ir-kbd-i2c to probe cx2341x boards for this address. Manually
loading ir-kbd-i2c now detects remote, every key is working as expected.

As I understand, current I2C/probing code is being redesigned/refactored. Sheer
amount of #ifdefs for every second kernel version is making my eyes bleed, so
please somebody involved check if patch is ok. 

Should I also add the 0x40 address to addr_list[] in ivtv-i2c.c? How to point
ivtv to this remote and autoload ir-kbd-i2c?

diff --git a/linux/drivers/media/video/ir-kbd-i2c.c b/linux/drivers/media/video/ir-kbd-i2c.c
--- a/linux/drivers/media/video/ir-kbd-i2c.c
+++ b/linux/drivers/media/video/ir-kbd-i2c.c
@@ -461,7 +461,7 @@
 		}
 		break;
 	case 0x40:
-		name        = "AVerMedia Cardbus remote";
+		name        = "AVerMedia RM-FP/RM-KH remote";
 		ir->get_key = get_key_avermedia_cardbus;
 		ir_type     = IR_TYPE_OTHER;
 		ir_codes    = &ir_codes_avermedia_cardbus_table;
@@ -706,8 +706,12 @@
 			ir_attach(adap, msg.addr, 0, 0);
 	}
 
-	/* Special case for AVerMedia Cardbus remote */
-	if (adap->id == I2C_HW_SAA7134) {
+	/* Special case for AVerMedia remotes:
+	   * AVerTV Hybrid+FM Cardbus
+	   * AVerTV MCE 116 Plus
+	   * probably others with RM-FP, RM-KH remotes and microcontroller
+	     chip @ 0x40 */
+	if ((adap->id == I2C_HW_SAA7134) || (adap->id == I2C_HW_B_CX2341X)) {
 		unsigned char subaddr, data;
 		struct i2c_msg msg[] = { { .addr = 0x40, .flags = 0,
 					   .buf = &subaddr, .len = 1},

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: AVerTV MCE 116 Plus remote
  2009-10-02 21:49 AVerTV MCE 116 Plus remote Aleksandr V. Piskunov
@ 2009-10-03 13:19 ` Andy Walls
  2009-10-03 17:43   ` Aleksandr V. Piskunov
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Walls @ 2009-10-03 13:19 UTC (permalink / raw)
  To: Aleksandr V. Piskunov; +Cc: linux-media, Oldrich Jedlicka

On Sat, 2009-10-03 at 00:49 +0300, Aleksandr V. Piskunov wrote:
> Preliminary version of patch adding support for AVerTV MCE 116 Plus remote.
> This board has an IR sensor is connected to EM78P153S, general purpose 8-bit
> microcontroller with a 1024 × 13 bits of OTP-ROM. According to i2cdetect, it is
> sitting on address 0x40.
> 
> Patch allows ir-kbd-i2c to probe cx2341x boards for this address. Manually
> loading ir-kbd-i2c now detects remote, every key is working as expected.
> 
> As I understand, current I2C/probing code is being redesigned/refactored. Sheer
> amount of #ifdefs for every second kernel version is making my eyes bleed, so
> please somebody involved check if patch is ok. 


Aleksandr,


> Should I also add the 0x40 address to addr_list[] in ivtv-i2c.c? How to point
> ivtv to this remote and autoload ir-kbd-i2c?

No.


At first glance, this patch doesn't look safe for all ivtv boards so:

	Naked-by: Andy Walls <awalls@radix.net>


In ivtv-i2c.c I see:

	#define IVTV_MSP3400_I2C_ADDR           0x40

It is probably not good to assume that only an IR microcontroller could
be at I2C address 0x40 for a CX2341x adapter.

I will work up an ivtv specific change similar to what I did in
cx18-cards.c and cx18-i2c.c for IR on the HVR-1600 for bringing up the
IR for the M116 cards alone.

What kernel version do you use?

Regards,
Andy


> diff --git a/linux/drivers/media/video/ir-kbd-i2c.c b/linux/drivers/media/video/ir-kbd-i2c.c
> --- a/linux/drivers/media/video/ir-kbd-i2c.c
> +++ b/linux/drivers/media/video/ir-kbd-i2c.c
> @@ -461,7 +461,7 @@
>  		}
>  		break;
>  	case 0x40:
> -		name        = "AVerMedia Cardbus remote";
> +		name        = "AVerMedia RM-FP/RM-KH remote";
>  		ir->get_key = get_key_avermedia_cardbus;
>  		ir_type     = IR_TYPE_OTHER;
>  		ir_codes    = &ir_codes_avermedia_cardbus_table;
> @@ -706,8 +706,12 @@
>  			ir_attach(adap, msg.addr, 0, 0);
>  	}
>  
> -	/* Special case for AVerMedia Cardbus remote */
> -	if (adap->id == I2C_HW_SAA7134) {
> +	/* Special case for AVerMedia remotes:
> +	   * AVerTV Hybrid+FM Cardbus
> +	   * AVerTV MCE 116 Plus
> +	   * probably others with RM-FP, RM-KH remotes and microcontroller
> +	     chip @ 0x40 */
> +	if ((adap->id == I2C_HW_SAA7134) || (adap->id == I2C_HW_B_CX2341X)) {
>  		unsigned char subaddr, data;
>  		struct i2c_msg msg[] = { { .addr = 0x40, .flags = 0,
>  					   .buf = &subaddr, .len = 1},



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: AVerTV MCE 116 Plus remote
  2009-10-03 13:19 ` Andy Walls
@ 2009-10-03 17:43   ` Aleksandr V. Piskunov
  0 siblings, 0 replies; 3+ messages in thread
From: Aleksandr V. Piskunov @ 2009-10-03 17:43 UTC (permalink / raw)
  To: Andy Walls; +Cc: Aleksandr V. Piskunov, linux-media, Oldrich Jedlicka

On Sat, Oct 03, 2009 at 09:19:07AM -0400, Andy Walls wrote:
> On Sat, 2009-10-03 at 00:49 +0300, Aleksandr V. Piskunov wrote:
> > Preliminary version of patch adding support for AVerTV MCE 116 Plus remote.
> > This board has an IR sensor is connected to EM78P153S, general purpose 8-bit
> > microcontroller with a 1024 × 13 bits of OTP-ROM. According to i2cdetect, it is
> > sitting on address 0x40.
> > 
> > Patch allows ir-kbd-i2c to probe cx2341x boards for this address. Manually
> > loading ir-kbd-i2c now detects remote, every key is working as expected.
> > 
> > As I understand, current I2C/probing code is being redesigned/refactored. Sheer
> > amount of #ifdefs for every second kernel version is making my eyes bleed, so
> > please somebody involved check if patch is ok. 
> 
> 
> Aleksandr,
> 
> 
> > Should I also add the 0x40 address to addr_list[] in ivtv-i2c.c? How to point
> > ivtv to this remote and autoload ir-kbd-i2c?
> 
> No.
> 
> 
> At first glance, this patch doesn't look safe for all ivtv boards so:
> 
> 	Naked-by: Andy Walls <awalls@radix.net>
> 
> 
> In ivtv-i2c.c I see:
> 
> 	#define IVTV_MSP3400_I2C_ADDR           0x40
> 
> It is probably not good to assume that only an IR microcontroller could
> be at I2C address 0x40 for a CX2341x adapter.
> 

Yea, that did confuse me too yesterday, saw it while searching sources for 0x40.
Thanks for pointing out the problem! Besides after some testing I don't really like
the way that IR controller behaves, doesn't always catch keypresses, repeats
chaotically and sends wrong keygroup codes from time to time. Basically in order to
get a more or less stable keypress, one has to "doubleclick" the button on remote,
strange..

> I will work up an ivtv specific change similar to what I did in
> cx18-cards.c and cx18-i2c.c for IR on the HVR-1600 for bringing up the
> IR for the M116 cards alone.
> 
> What kernel version do you use?
> 

2.8.28, can easily switch to any later for testing.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-10-03 17:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-02 21:49 AVerTV MCE 116 Plus remote Aleksandr V. Piskunov
2009-10-03 13:19 ` Andy Walls
2009-10-03 17:43   ` Aleksandr V. Piskunov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).