Commit b0c31e89 authored by Simon Arlott's avatar Simon Arlott Committed by Greg Kroah-Hartman

V4L: saa7134: Copy tuner data earlier to avoid overwriting manual tuner type

V4L: saa7134: Copy tuner data earlier to avoid overwriting manual tuner type

(cherry picked from commit d53687d1)

Copy tuner data earlier in init to avoid overwriting manual tuner type

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.
Signed-off-by: default avatarSimon Arlott <simon@fire.lp0.eu>
Reviewed-by: default avatarHermann Pitton <hermann-pitton@arcor.de>
Cc: Brian Marete <bgmarete@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent aed3f31c
...@@ -5703,9 +5703,6 @@ int saa7134_board_init2(struct saa7134_dev *dev) ...@@ -5703,9 +5703,6 @@ int saa7134_board_init2(struct saa7134_dev *dev)
unsigned char buf; unsigned char buf;
int board; int board;
dev->tuner_type = saa7134_boards[dev->board].tuner_type;
dev->tuner_addr = saa7134_boards[dev->board].tuner_addr;
switch (dev->board) { switch (dev->board) {
case SAA7134_BOARD_BMK_MPEX_NOTUNER: case SAA7134_BOARD_BMK_MPEX_NOTUNER:
case SAA7134_BOARD_BMK_MPEX_TUNER: case SAA7134_BOARD_BMK_MPEX_TUNER:
......
...@@ -946,11 +946,12 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, ...@@ -946,11 +946,12 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
dev->board = SAA7134_BOARD_UNKNOWN; dev->board = SAA7134_BOARD_UNKNOWN;
} }
dev->autodetected = card[dev->nr] != dev->board; 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; dev->tda9887_conf = saa7134_boards[dev->board].tda9887_conf;
if (UNSET != tuner[dev->nr]) if (UNSET != tuner[dev->nr])
dev->tuner_type = 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, dev->name,pci_dev->subsystem_vendor,
pci_dev->subsystem_device,saa7134_boards[dev->board].name, pci_dev->subsystem_device,saa7134_boards[dev->board].name,
dev->board, dev->autodetected ? dev->board, dev->autodetected ?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment