public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Simon Arlott <simon@fire.lp0.eu>
To: linux-dvb@linuxtv.org
Cc: hermann pitton <hermann-pitton@arcor.de>,
	video4linux-list@redhat.com,
	v4l-dvb list <v4l-dvb-maintainer@linuxtv.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Brian Marete <bgmarete@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] saa7134: Copy tuner data earlier in init to avoid overwriting manual tuner type
Date: Sat, 19 Jul 2008 03:16:07 +0100	[thread overview]
Message-ID: <48814E67.80708@simon.arlott.org.uk> (raw)
In-Reply-To: <1216421799.2666.23.camel@pc10.localdom.local>

When saa7134_board_init2 runs, it immediately overwrites the current value
(set earlier from module parameter) of tuner_type with the static values,
and then does autodetection. This patch moves the tuner_addr copy to earlier
in saa7134_initdev and removes the tuner_type copy from saa7134_board_init2.

Autodetection could still potentially change to the wrong tuner type, but it
is now possible to override the default type for the card again.

My card's tuner is configured with autodetection from eeprom, so I don't 
need to manually set the tuner. I've checked that the autodetection still 
works for my card.

Reviewed-by: Hermann Pitton <hermann-pitton@arcor.de>
Cc: Brian Marete <bgmarete@gmail.com>
Tested-by: Simon Arlott <simon@fire.lp0.eu>
Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
---
> this restores tuner behavior on the saa7134 driver.
> 
> I can't test XCeive tuners, which load different firmware dynamically.
> Mauro was on them.
> 
> Please send the patch to Mauro and/or provide your signed-off-by.
> 
> This must go to the stable team ASAP as well.
> 
> Reviewed-by: Hermann Pitton <hermann-pitton@arcor.de>

drivers/media/video/saa7134/saa7134-cards.c |    3 ---
drivers/media/video/saa7134/saa7134-core.c  |    5 +++--
2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index 2618cfa..0227cf9 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -5703,9 +5703,6 @@ int saa7134_board_init2(struct saa7134_dev *dev)
	unsigned char buf;
	int board;

-	dev->tuner_type = saa7134_boards[dev->board].tuner_type;
-	dev->tuner_addr = saa7134_boards[dev->board].tuner_addr;
-
	switch (dev->board) {
	case SAA7134_BOARD_BMK_MPEX_NOTUNER:
	case SAA7134_BOARD_BMK_MPEX_TUNER:
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index 2c19cd0..69f340d 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -946,11 +946,12 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
		dev->board = SAA7134_BOARD_UNKNOWN;
	}
	dev->autodetected = card[dev->nr] != dev->board;
-	dev->tuner_type   = saa7134_boards[dev->board].tuner_type;
+	dev->tuner_type = saa7134_boards[dev->board].tuner_type;
+	dev->tuner_addr = saa7134_boards[dev->board].tuner_addr;
	dev->tda9887_conf = saa7134_boards[dev->board].tda9887_conf;
	if (UNSET != tuner[dev->nr])
		dev->tuner_type = tuner[dev->nr];
-		printk(KERN_INFO "%s: subsystem: %04x:%04x, board: %s [card=%d,%s]\n",
+	printk(KERN_INFO "%s: subsystem: %04x:%04x, board: %s [card=%d,%s]\n",
		dev->name,pci_dev->subsystem_vendor,
		pci_dev->subsystem_device,saa7134_boards[dev->board].name,
		dev->board, dev->autodetected ?
-- 
1.5.6.2

-- 
Simon Arlott


  reply	other threads:[~2008-07-19  2:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-18 11:28 [PATCH] V4L: Link tuner before saa7134 Brian Marete
2008-07-18 11:51 ` Simon Arlott
2008-07-18 22:56   ` [linux-dvb] " hermann pitton
2008-07-19  2:16     ` Simon Arlott [this message]
2008-07-21 12:34   ` Brian Marete

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=48814E67.80708@simon.arlott.org.uk \
    --to=simon@fire.lp0.eu \
    --cc=bgmarete@gmail.com \
    --cc=hermann-pitton@arcor.de \
    --cc=linux-dvb@linuxtv.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=v4l-dvb-maintainer@linuxtv.org \
    --cc=video4linux-list@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox