aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/oxygen
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2010-11-02 12:18:23 -0400
committerTakashi Iwai <tiwai@suse.de>2010-11-03 03:26:13 -0400
commit31f86bacfc9c8f6a3f25fa991c1f373374a9f25b (patch)
tree305e4de678bdc4e6453f41dd35fcbc94eefe2a68 /sound/pci/oxygen
parent45c1de8e20cec40b6846def0aeca09cb1bfb839b (diff)
ALSA: oxygen: add Kuroutoshikou CMI8787-HG2PCI support
Add support for the Kuroutoshikou CMI8787-HG2PCI sound card. [replaced non-latin letters in the patch by tiwai] Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/oxygen')
-rw-r--r--sound/pci/oxygen/oxygen.c19
-rw-r--r--sound/pci/oxygen/oxygen_lib.c2
2 files changed, 16 insertions, 5 deletions
diff --git a/sound/pci/oxygen/oxygen.c b/sound/pci/oxygen/oxygen.c
index 5e258b26f044..dd0f3f478999 100644
--- a/sound/pci/oxygen/oxygen.c
+++ b/sound/pci/oxygen/oxygen.c
@@ -71,6 +71,7 @@ enum {
71 MODEL_CLARO, /* HT-Omega Claro */ 71 MODEL_CLARO, /* HT-Omega Claro */
72 MODEL_CLARO_HALO, /* HT-Omega Claro halo */ 72 MODEL_CLARO_HALO, /* HT-Omega Claro halo */
73 MODEL_HIFIER, /* TempoTec HiFier Fantasia */ 73 MODEL_HIFIER, /* TempoTec HiFier Fantasia */
74 MODEL_HG2PCI, /* Kuroutoshikou CMI8787-HG2PCI */
74}; 75};
75 76
76static DEFINE_PCI_DEVICE_TABLE(oxygen_ids) = { 77static DEFINE_PCI_DEVICE_TABLE(oxygen_ids) = {
@@ -80,7 +81,7 @@ static DEFINE_PCI_DEVICE_TABLE(oxygen_ids) = {
80 { OXYGEN_PCI_SUBID(0x13f6, 0x0001), .driver_data = MODEL_CMEDIA_REF }, 81 { OXYGEN_PCI_SUBID(0x13f6, 0x0001), .driver_data = MODEL_CMEDIA_REF },
81 { OXYGEN_PCI_SUBID(0x13f6, 0x0010), .driver_data = MODEL_CMEDIA_REF }, 82 { OXYGEN_PCI_SUBID(0x13f6, 0x0010), .driver_data = MODEL_CMEDIA_REF },
82 { OXYGEN_PCI_SUBID(0x13f6, 0x8788), .driver_data = MODEL_CMEDIA_REF }, 83 { OXYGEN_PCI_SUBID(0x13f6, 0x8788), .driver_data = MODEL_CMEDIA_REF },
83 { OXYGEN_PCI_SUBID(0x13f6, 0xffff), .driver_data = MODEL_CMEDIA_REF }, 84 { OXYGEN_PCI_SUBID(0x13f6, 0xffff), .driver_data = MODEL_HG2PCI },
84 { OXYGEN_PCI_SUBID(0x147a, 0xa017), .driver_data = MODEL_CMEDIA_REF }, 85 { OXYGEN_PCI_SUBID(0x147a, 0xa017), .driver_data = MODEL_CMEDIA_REF },
85 { OXYGEN_PCI_SUBID(0x14c3, 0x1710), .driver_data = MODEL_HIFIER }, 86 { OXYGEN_PCI_SUBID(0x14c3, 0x1710), .driver_data = MODEL_HIFIER },
86 { OXYGEN_PCI_SUBID(0x14c3, 0x1711), .driver_data = MODEL_HIFIER }, 87 { OXYGEN_PCI_SUBID(0x14c3, 0x1711), .driver_data = MODEL_HIFIER },
@@ -243,6 +244,11 @@ static void hifier_init(struct oxygen *chip)
243 snd_component_add(chip->card, "CS5340"); 244 snd_component_add(chip->card, "CS5340");
244} 245}
245 246
247static void hg2pci_init(struct oxygen *chip)
248{
249 ak4396_init(chip);
250}
251
246static void generic_cleanup(struct oxygen *chip) 252static void generic_cleanup(struct oxygen *chip)
247{ 253{
248} 254}
@@ -572,15 +578,20 @@ static int __devinit get_oxygen_model(struct oxygen *chip,
572 CAPTURE_1_FROM_SPDIF; 578 CAPTURE_1_FROM_SPDIF;
573 break; 579 break;
574 case MODEL_HIFIER: 580 case MODEL_HIFIER:
581 case MODEL_HG2PCI:
575 chip->model.shortname = "C-Media CMI8787"; 582 chip->model.shortname = "C-Media CMI8787";
576 chip->model.chip = "CMI8787"; 583 chip->model.chip = "CMI8787";
577 chip->model.init = hifier_init; 584 if (id->driver_data == MODEL_HIFIER)
585 chip->model.init = hifier_init;
586 else
587 chip->model.init = hg2pci_init;
578 chip->model.resume = stereo_resume; 588 chip->model.resume = stereo_resume;
579 chip->model.mixer_init = generic_mixer_init; 589 chip->model.mixer_init = generic_mixer_init;
580 chip->model.set_adc_params = set_no_params; 590 chip->model.set_adc_params = set_no_params;
581 chip->model.device_config = PLAYBACK_0_TO_I2S | 591 chip->model.device_config = PLAYBACK_0_TO_I2S |
582 PLAYBACK_1_TO_SPDIF | 592 PLAYBACK_1_TO_SPDIF;
583 CAPTURE_0_FROM_I2S_1; 593 if (id->driver_data == MODEL_HIFIER)
594 chip->model.device_config |= CAPTURE_0_FROM_I2S_1;
584 chip->model.dac_channels = 2; 595 chip->model.dac_channels = 2;
585 break; 596 break;
586 } 597 }
diff --git a/sound/pci/oxygen/oxygen_lib.c b/sound/pci/oxygen/oxygen_lib.c
index e5ebe56fb0c5..2e6579962217 100644
--- a/sound/pci/oxygen/oxygen_lib.c
+++ b/sound/pci/oxygen/oxygen_lib.c
@@ -262,7 +262,7 @@ oxygen_search_pci_id(struct oxygen *chip, const struct pci_device_id ids[])
262 */ 262 */
263 subdevice = oxygen_read_eeprom(chip, 2); 263 subdevice = oxygen_read_eeprom(chip, 2);
264 /* use default ID if EEPROM is missing */ 264 /* use default ID if EEPROM is missing */
265 if (subdevice == 0xffff) 265 if (subdevice == 0xffff && oxygen_read_eeprom(chip, 1) == 0xffff)
266 subdevice = 0x8788; 266 subdevice = 0x8788;
267 /* 267 /*
268 * We use only the subsystem device ID for searching because it is 268 * We use only the subsystem device ID for searching because it is