aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/oxygen/hifier.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2009-02-19 02:42:44 -0500
committerTakashi Iwai <tiwai@suse.de>2009-02-19 04:22:25 -0500
commit30459d7b1843cbdea56ca120c8cac10dc5613e90 (patch)
tree47341d43931193917c28dab16eaf7e1a12b2b6d6 /sound/pci/oxygen/hifier.c
parenta69bb3c3fe0881d986ec78e253cb8a6bb9c28230 (diff)
sound: oxygen: handle cards with broken EEPROM
Under as yet unknown circumstances, the first word of the sound card's EEPROM gets overwritten. When this has happened, we cannot rely on the subsystem IDs that the kernel reads from the PCI configuration registers. Instead, we read the IDs directly from the EEPROM and do the ID matching manually. Because the model-specific driver cannot determine the model before calling oxygen_pci_probe(), that function now gets a get_model() callback as parameter. The customizing of the model structure, which was formerly done by the probe() callback, also has moved into get_model(). Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/oxygen/hifier.c')
-rw-r--r--sound/pci/oxygen/hifier.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sound/pci/oxygen/hifier.c b/sound/pci/oxygen/hifier.c
index cc98bad9916a..84ef13183419 100644
--- a/sound/pci/oxygen/hifier.c
+++ b/sound/pci/oxygen/hifier.c
@@ -45,6 +45,7 @@ MODULE_PARM_DESC(enable, "enable card");
45static struct pci_device_id hifier_ids[] __devinitdata = { 45static struct pci_device_id hifier_ids[] __devinitdata = {
46 { OXYGEN_PCI_SUBID(0x14c3, 0x1710) }, 46 { OXYGEN_PCI_SUBID(0x14c3, 0x1710) },
47 { OXYGEN_PCI_SUBID(0x14c3, 0x1711) }, 47 { OXYGEN_PCI_SUBID(0x14c3, 0x1711) },
48 { OXYGEN_PCI_SUBID_BROKEN_EEPROM },
48 { } 49 { }
49}; 50};
50MODULE_DEVICE_TABLE(pci, hifier_ids); 51MODULE_DEVICE_TABLE(pci, hifier_ids);
@@ -172,6 +173,13 @@ static const struct oxygen_model model_hifier = {
172 .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST, 173 .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
173}; 174};
174 175
176static int __devinit get_hifier_model(struct oxygen *chip,
177 const struct pci_device_id *id)
178{
179 chip->model = model_hifier;
180 return 0;
181}
182
175static int __devinit hifier_probe(struct pci_dev *pci, 183static int __devinit hifier_probe(struct pci_dev *pci,
176 const struct pci_device_id *pci_id) 184 const struct pci_device_id *pci_id)
177{ 185{
@@ -184,7 +192,8 @@ static int __devinit hifier_probe(struct pci_dev *pci,
184 ++dev; 192 ++dev;
185 return -ENOENT; 193 return -ENOENT;
186 } 194 }
187 err = oxygen_pci_probe(pci, index[dev], id[dev], THIS_MODULE, &model_hifier, 0); 195 err = oxygen_pci_probe(pci, index[dev], id[dev], THIS_MODULE,
196 hifier_ids, get_hifier_model);
188 if (err >= 0) 197 if (err >= 0)
189 ++dev; 198 ++dev;
190 return err; 199 return err;