public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cx23885: Fix interrupt storm that happens in some cards when IR is enabled.
@ 2013-07-18  1:33 Luis Alves
  2013-07-18  1:58 ` Devin Heitmueller
  2013-07-18 11:04 ` Konstantin Dimitrov
  0 siblings, 2 replies; 8+ messages in thread
From: Luis Alves @ 2013-07-18  1:33 UTC (permalink / raw)
  To: linux-media; +Cc: mchehab, crope, awalls, Luis Alves

Hi,

This i2c init should stop the interrupt storm that happens in some cards when the IR receiver in enabled.
It works perfectly in my TBS6981.

It would be good to test in other problematic cards.

In this patch I've added the IR init to the TeVii S470/S471 (and some others that fall in the same case statment).
Other cards but these that suffer the same issue should also be tested.

Give feedback!

Regards,
Luis



Signed-off-by: Luis Alves <ljalvs@gmail.com>
---
 drivers/media/pci/cx23885/cx23885-cards.c |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/media/pci/cx23885/cx23885-cards.c b/drivers/media/pci/cx23885/cx23885-cards.c
index 7e923f8..89ce132 100644
--- a/drivers/media/pci/cx23885/cx23885-cards.c
+++ b/drivers/media/pci/cx23885/cx23885-cards.c
@@ -1081,6 +1081,27 @@ int cx23885_tuner_callback(void *priv, int component, int command, int arg)
 	return 0;
 }
 
+void cx23885_ir_setup(struct cx23885_dev *dev)
+{
+	struct i2c_msg msg;
+	char buffer[2];
+
+	/* this should stop the IR interrupt
+	   storm that happens in some cards */
+	msg.addr = 0x4c;
+	msg.flags = 0;
+	msg.len = 2;
+	msg.buf = buffer;
+
+	buffer[0] = 0x1f;
+	buffer[1] = 0x80;
+	i2c_transfer(&dev->i2c_bus[2].i2c_adap, &msg, 1);
+
+	buffer[0] = 0x23;
+	buffer[1] = 0x80;
+	i2c_transfer(&dev->i2c_bus[2].i2c_adap, &msg, 1);
+}
+
 void cx23885_gpio_setup(struct cx23885_dev *dev)
 {
 	switch (dev->board) {
@@ -1664,6 +1685,7 @@ void cx23885_card_setup(struct cx23885_dev *dev)
 		ts1->gen_ctrl_val  = 0x5; /* Parallel */
 		ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */
 		ts1->src_sel_val   = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
+		cx23885_ir_setup(dev);
 		break;
 	case CX23885_BOARD_NETUP_DUAL_DVBS2_CI:
 	case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF:
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread
* Re: [PATCH] cx23885: Fix interrupt storm that happens in some cards when IR is enabled.
@ 2013-07-18 10:03 Luis Alves
  0 siblings, 0 replies; 8+ messages in thread
From: Luis Alves @ 2013-07-18 10:03 UTC (permalink / raw)
  To: linux-media

Sorry if I wasn't clear, but this patch is not intended to be merged
in the main tree (as it is).
I've sent it so that people facing this interrupt storm when IR is
enabled can test it in their cards (I only have the TBS6981 to test
and it works).
Probably I should have just sent a mail with a code sample...

About what it does, I don't have a clue! I just know that it does
silence the interrupt spam.
My best guess is that the IR interrupt line is shared with the ADC
interrupt line and maybe the ADC is generating an end-of-conversion
interrupt by default.
And touching this register can be disabling the ADC interrupts - or
powering down the ADC - or just disabling the ADC clock.

It would be valuable for other people that have this issues in their
cards to test and then make a proper patch to the cx23885.

If this doesn't work with other cards, then I'll just add those two
lines to be specific to my card init code.

Thanks and Regards,
Luis

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

end of thread, other threads:[~2013-07-18 12:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-18  1:33 [PATCH] cx23885: Fix interrupt storm that happens in some cards when IR is enabled Luis Alves
2013-07-18  1:58 ` Devin Heitmueller
2013-07-18  2:15   ` Antti Palosaari
2013-07-18  2:41     ` Devin Heitmueller
2013-07-18 10:49       ` Andy Walls
2013-07-18 11:04 ` Konstantin Dimitrov
2013-07-18 12:33   ` Luis Alves
  -- strict thread matches above, loose matches on Subject: below --
2013-07-18 10:03 Luis Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox