Skip to content

Commit

Permalink
[ALSA] ice1712 - Provides specified midi port names instead of defaults
Browse files Browse the repository at this point in the history
Patch provides for the ice1712 card driver to overwrite the midi port name
string given by default in mpu401_uart, with one specified in
snd_ice1712_card_info.

Signed-off-by: Alan Horstmann <gineera@aspect135.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Alan Horstmann authored and Jaroslav Kysela committed Jun 22, 2006
1 parent 78fc030 commit 3bef229
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions sound/pci/ice1712/ews.c
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,8 @@ struct snd_ice1712_card_info snd_ice1712_ews_cards[] __devinitdata = {
.model = "dmx6fire",
.chip_init = snd_ice1712_ews_init,
.build_controls = snd_ice1712_ews_add_controls,
.mpu401_1_name = "MIDI-Front DMX6fire",
.mpu401_2_name = "Wavetable DMX6fire",
},
{ } /* terminator */
};
17 changes: 15 additions & 2 deletions sound/pci/ice1712/ice1712.c
Original file line number Diff line number Diff line change
Expand Up @@ -2743,15 +2743,28 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
snd_card_free(card);
return err;
}

if (ice->eeprom.data[ICE_EEP1_CODEC] & ICE1712_CFG_2xMPU401)
if (c->mpu401_1_name)
/* Prefered name available in card_info */
snprintf(ice->rmidi[0]->name,
sizeof(ice->rmidi[0]->name),
"%s %d", c->mpu401_1_name, card->number);

if (ice->eeprom.data[ICE_EEP1_CODEC] & ICE1712_CFG_2xMPU401) {
/* 2nd port used */
if ((err = snd_mpu401_uart_new(card, 1, MPU401_HW_ICE1712,
ICEREG(ice, MPU2_CTRL), 1,
ice->irq, 0,
&ice->rmidi[1])) < 0) {
snd_card_free(card);
return err;
}
if (c->mpu401_2_name)
/* Prefered name available in card_info */
snprintf(ice->rmidi[1]->name,
sizeof(ice->rmidi[1]->name),
"%s %d", c->mpu401_2_name,
card->number);
}
}

snd_ice1712_set_input_clock_source(ice, 0);
Expand Down
2 changes: 2 additions & 0 deletions sound/pci/ice1712/ice1712.h
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ struct snd_ice1712_card_info {
int (*chip_init)(struct snd_ice1712 *);
int (*build_controls)(struct snd_ice1712 *);
unsigned int no_mpu401: 1;
const char *mpu401_1_name;
const char *mpu401_2_name;
unsigned int eeprom_size;
unsigned char *eeprom_data;
};
Expand Down

0 comments on commit 3bef229

Please sign in to comment.