From 105c74d893269c1ff01cf1dc99a72d1df0fe6096 Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Mon, 22 Sep 2008 09:03:42 +0200 Subject: [PATCH] --- yaml --- r: 111021 b: refs/heads/master c: dbbbd6744439d95d2b0dc23c5cdca2c477377f76 h: refs/heads/master i: 111019: a9d267eddf7f8f2dd0be17f242a7c61feba6e144 v: v3 --- [refs] | 2 +- trunk/sound/pci/oxygen/oxygen.c | 1 + trunk/sound/pci/oxygen/oxygen.h | 21 +++++++++++++-------- trunk/sound/pci/oxygen/oxygen_lib.c | 9 +++++++-- trunk/sound/pci/oxygen/virtuoso.c | 4 +++- 5 files changed, 25 insertions(+), 12 deletions(-) diff --git a/[refs] b/[refs] index ba1ec65509e4..b51a11d10cb5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d76596b1ee7f5cdbd0b73d374ba72372a2c8b725 +refs/heads/master: dbbbd6744439d95d2b0dc23c5cdca2c477377f76 diff --git a/trunk/sound/pci/oxygen/oxygen.c b/trunk/sound/pci/oxygen/oxygen.c index bb2e7d82d832..62888c7b61d4 100644 --- a/trunk/sound/pci/oxygen/oxygen.c +++ b/trunk/sound/pci/oxygen/oxygen.c @@ -297,6 +297,7 @@ static int generic_probe(struct oxygen *chip, unsigned long driver_data) CAPTURE_0_FROM_I2S_2 | CAPTURE_1_FROM_SPDIF; chip->model.misc_flags = OXYGEN_MISC_MIDI; + chip->model.device_config |= MIDI_OUTPUT | MIDI_INPUT; } return 0; } diff --git a/trunk/sound/pci/oxygen/oxygen.h b/trunk/sound/pci/oxygen/oxygen.h index 30cd996d3661..f82a96290f72 100644 --- a/trunk/sound/pci/oxygen/oxygen.h +++ b/trunk/sound/pci/oxygen/oxygen.h @@ -19,14 +19,19 @@ #define OXYGEN_IO_SIZE 0x100 /* model-specific configuration of outputs/inputs */ -#define PLAYBACK_0_TO_I2S 0x001 -#define PLAYBACK_1_TO_SPDIF 0x004 -#define PLAYBACK_2_TO_AC97_1 0x008 -#define CAPTURE_0_FROM_I2S_1 0x010 -#define CAPTURE_0_FROM_I2S_2 0x020 -#define CAPTURE_1_FROM_SPDIF 0x080 -#define CAPTURE_2_FROM_I2S_2 0x100 -#define CAPTURE_2_FROM_AC97_1 0x200 +#define PLAYBACK_0_TO_I2S 0x0001 + /* PLAYBACK_0_TO_AC97_0 not implemented */ +#define PLAYBACK_1_TO_SPDIF 0x0004 +#define PLAYBACK_2_TO_AC97_1 0x0008 +#define CAPTURE_0_FROM_I2S_1 0x0010 +#define CAPTURE_0_FROM_I2S_2 0x0020 + /* CAPTURE_0_FROM_AC97_0 not implemented */ +#define CAPTURE_1_FROM_SPDIF 0x0080 +#define CAPTURE_2_FROM_I2S_2 0x0100 +#define CAPTURE_2_FROM_AC97_1 0x0200 + /* CAPTURE_3_FROM_I2S_3 not implemented */ +#define MIDI_OUTPUT 0x0800 +#define MIDI_INPUT 0x1000 enum { CONTROL_SPDIF_PCM, diff --git a/trunk/sound/pci/oxygen/oxygen_lib.c b/trunk/sound/pci/oxygen/oxygen_lib.c index 02191c6a4e7b..b1997216b4af 100644 --- a/trunk/sound/pci/oxygen/oxygen_lib.c +++ b/trunk/sound/pci/oxygen/oxygen_lib.c @@ -502,10 +502,15 @@ int oxygen_pci_probe(struct pci_dev *pci, int index, char *id, if (err < 0) goto err_card; - if (chip->model.misc_flags & OXYGEN_MISC_MIDI) { + if (chip->model.device_config & (MIDI_OUTPUT | MIDI_INPUT)) { + unsigned int info_flags = MPU401_INFO_INTEGRATED; + if (chip->model.device_config & MIDI_OUTPUT) + info_flags |= MPU401_INFO_OUTPUT; + if (chip->model.device_config & MIDI_INPUT) + info_flags |= MPU401_INFO_INPUT; err = snd_mpu401_uart_new(card, 0, MPU401_HW_CMIPCI, chip->addr + OXYGEN_MPU401, - MPU401_INFO_INTEGRATED, 0, 0, + info_flags, 0, 0, &chip->midi); if (err < 0) goto err_card; diff --git a/trunk/sound/pci/oxygen/virtuoso.c b/trunk/sound/pci/oxygen/virtuoso.c index f416e68338e2..befada742ae8 100644 --- a/trunk/sound/pci/oxygen/virtuoso.c +++ b/trunk/sound/pci/oxygen/virtuoso.c @@ -569,7 +569,9 @@ static const struct oxygen_model model_xonar_d2 = { .device_config = PLAYBACK_0_TO_I2S | PLAYBACK_1_TO_SPDIF | CAPTURE_0_FROM_I2S_2 | - CAPTURE_1_FROM_SPDIF, + CAPTURE_1_FROM_SPDIF | + MIDI_OUTPUT | + MIDI_INPUT, .dac_channels = 8, .dac_volume_min = 0x0f, .dac_volume_max = 0xff,