diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2008-09-22 03:03:42 -0400 |
---|---|---|
committer | Clemens Ladisch <clemens@ladisch.de> | 2008-09-22 03:03:42 -0400 |
commit | dbbbd6744439d95d2b0dc23c5cdca2c477377f76 (patch) | |
tree | 6a149c7dbc7d0889cf8c348be2618210661bea84 /sound/pci | |
parent | d76596b1ee7f5cdbd0b73d374ba72372a2c8b725 (diff) |
ALSA: oxygen: configure MIDI via device_config
To enable the MIDI port, model drivers must now set flags in
device_config, not only in misc_flags. This allows model drivers to
enable the UART without creating an ALSA MIDI device.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/oxygen/oxygen.c | 1 | ||||
-rw-r--r-- | sound/pci/oxygen/oxygen.h | 21 | ||||
-rw-r--r-- | sound/pci/oxygen/oxygen_lib.c | 9 | ||||
-rw-r--r-- | sound/pci/oxygen/virtuoso.c | 4 |
4 files changed, 24 insertions, 11 deletions
diff --git a/sound/pci/oxygen/oxygen.c b/sound/pci/oxygen/oxygen.c index bb2e7d82d832..62888c7b61d4 100644 --- a/sound/pci/oxygen/oxygen.c +++ b/sound/pci/oxygen/oxygen.c | |||
@@ -297,6 +297,7 @@ static int generic_probe(struct oxygen *chip, unsigned long driver_data) | |||
297 | CAPTURE_0_FROM_I2S_2 | | 297 | CAPTURE_0_FROM_I2S_2 | |
298 | CAPTURE_1_FROM_SPDIF; | 298 | CAPTURE_1_FROM_SPDIF; |
299 | chip->model.misc_flags = OXYGEN_MISC_MIDI; | 299 | chip->model.misc_flags = OXYGEN_MISC_MIDI; |
300 | chip->model.device_config |= MIDI_OUTPUT | MIDI_INPUT; | ||
300 | } | 301 | } |
301 | return 0; | 302 | return 0; |
302 | } | 303 | } |
diff --git a/sound/pci/oxygen/oxygen.h b/sound/pci/oxygen/oxygen.h index 30cd996d3661..f82a96290f72 100644 --- a/sound/pci/oxygen/oxygen.h +++ b/sound/pci/oxygen/oxygen.h | |||
@@ -19,14 +19,19 @@ | |||
19 | #define OXYGEN_IO_SIZE 0x100 | 19 | #define OXYGEN_IO_SIZE 0x100 |
20 | 20 | ||
21 | /* model-specific configuration of outputs/inputs */ | 21 | /* model-specific configuration of outputs/inputs */ |
22 | #define PLAYBACK_0_TO_I2S 0x001 | 22 | #define PLAYBACK_0_TO_I2S 0x0001 |
23 | #define PLAYBACK_1_TO_SPDIF 0x004 | 23 | /* PLAYBACK_0_TO_AC97_0 not implemented */ |
24 | #define PLAYBACK_2_TO_AC97_1 0x008 | 24 | #define PLAYBACK_1_TO_SPDIF 0x0004 |
25 | #define CAPTURE_0_FROM_I2S_1 0x010 | 25 | #define PLAYBACK_2_TO_AC97_1 0x0008 |
26 | #define CAPTURE_0_FROM_I2S_2 0x020 | 26 | #define CAPTURE_0_FROM_I2S_1 0x0010 |
27 | #define CAPTURE_1_FROM_SPDIF 0x080 | 27 | #define CAPTURE_0_FROM_I2S_2 0x0020 |
28 | #define CAPTURE_2_FROM_I2S_2 0x100 | 28 | /* CAPTURE_0_FROM_AC97_0 not implemented */ |
29 | #define CAPTURE_2_FROM_AC97_1 0x200 | 29 | #define CAPTURE_1_FROM_SPDIF 0x0080 |
30 | #define CAPTURE_2_FROM_I2S_2 0x0100 | ||
31 | #define CAPTURE_2_FROM_AC97_1 0x0200 | ||
32 | /* CAPTURE_3_FROM_I2S_3 not implemented */ | ||
33 | #define MIDI_OUTPUT 0x0800 | ||
34 | #define MIDI_INPUT 0x1000 | ||
30 | 35 | ||
31 | enum { | 36 | enum { |
32 | CONTROL_SPDIF_PCM, | 37 | CONTROL_SPDIF_PCM, |
diff --git a/sound/pci/oxygen/oxygen_lib.c b/sound/pci/oxygen/oxygen_lib.c index 02191c6a4e7b..b1997216b4af 100644 --- a/sound/pci/oxygen/oxygen_lib.c +++ b/sound/pci/oxygen/oxygen_lib.c | |||
@@ -502,10 +502,15 @@ int oxygen_pci_probe(struct pci_dev *pci, int index, char *id, | |||
502 | if (err < 0) | 502 | if (err < 0) |
503 | goto err_card; | 503 | goto err_card; |
504 | 504 | ||
505 | if (chip->model.misc_flags & OXYGEN_MISC_MIDI) { | 505 | if (chip->model.device_config & (MIDI_OUTPUT | MIDI_INPUT)) { |
506 | unsigned int info_flags = MPU401_INFO_INTEGRATED; | ||
507 | if (chip->model.device_config & MIDI_OUTPUT) | ||
508 | info_flags |= MPU401_INFO_OUTPUT; | ||
509 | if (chip->model.device_config & MIDI_INPUT) | ||
510 | info_flags |= MPU401_INFO_INPUT; | ||
506 | err = snd_mpu401_uart_new(card, 0, MPU401_HW_CMIPCI, | 511 | err = snd_mpu401_uart_new(card, 0, MPU401_HW_CMIPCI, |
507 | chip->addr + OXYGEN_MPU401, | 512 | chip->addr + OXYGEN_MPU401, |
508 | MPU401_INFO_INTEGRATED, 0, 0, | 513 | info_flags, 0, 0, |
509 | &chip->midi); | 514 | &chip->midi); |
510 | if (err < 0) | 515 | if (err < 0) |
511 | goto err_card; | 516 | goto err_card; |
diff --git a/sound/pci/oxygen/virtuoso.c b/sound/pci/oxygen/virtuoso.c index f416e68338e2..befada742ae8 100644 --- a/sound/pci/oxygen/virtuoso.c +++ b/sound/pci/oxygen/virtuoso.c | |||
@@ -569,7 +569,9 @@ static const struct oxygen_model model_xonar_d2 = { | |||
569 | .device_config = PLAYBACK_0_TO_I2S | | 569 | .device_config = PLAYBACK_0_TO_I2S | |
570 | PLAYBACK_1_TO_SPDIF | | 570 | PLAYBACK_1_TO_SPDIF | |
571 | CAPTURE_0_FROM_I2S_2 | | 571 | CAPTURE_0_FROM_I2S_2 | |
572 | CAPTURE_1_FROM_SPDIF, | 572 | CAPTURE_1_FROM_SPDIF | |
573 | MIDI_OUTPUT | | ||
574 | MIDI_INPUT, | ||
573 | .dac_channels = 8, | 575 | .dac_channels = 8, |
574 | .dac_volume_min = 0x0f, | 576 | .dac_volume_min = 0x0f, |
575 | .dac_volume_max = 0xff, | 577 | .dac_volume_max = 0xff, |