Lines Matching +full:auto +full:- +full:detect

1 // SPDX-License-Identifier: GPL-2.0-or-later
18 MODULE_DESCRIPTION("Yamaha DS-1 PCI");
21 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
32 MODULE_PARM_DESC(index, "Index value for the Yamaha DS-1 PCI soundcard.");
34 MODULE_PARM_DESC(id, "ID string for the Yamaha DS-1 PCI soundcard.");
36 MODULE_PARM_DESC(enable, "Enable Yamaha DS-1 soundcard.");
38 MODULE_PARM_DESC(mpu_port, "MPU-401 Port.");
40 MODULE_PARM_DESC(fm_port, "FM OPL-3 Port.");
46 MODULE_PARM_DESC(rear_switch, "Enable shared rear/line-in switch");
69 return -ENODEV; in snd_ymfpci_create_gameport()
71 if (chip->pci->device >= 0x0010) { /* YMF 744/754 */ in snd_ymfpci_create_gameport()
74 /* auto-detect */ in snd_ymfpci_create_gameport()
75 io_port = pci_resource_start(chip->pci, 2); in snd_ymfpci_create_gameport()
77 return -ENODEV; in snd_ymfpci_create_gameport()
81 /* auto-detect */ in snd_ymfpci_create_gameport()
90 dev_err(chip->card->dev, in snd_ymfpci_create_gameport()
92 return -EBUSY; in snd_ymfpci_create_gameport()
102 dev_err(chip->card->dev, in snd_ymfpci_create_gameport()
104 chip->card->shortname, (unsigned int)io_port); in snd_ymfpci_create_gameport()
105 return -EINVAL; in snd_ymfpci_create_gameport()
110 r = devm_request_region(&chip->pci->dev, io_port, 1, in snd_ymfpci_create_gameport()
113 dev_err(chip->card->dev, in snd_ymfpci_create_gameport()
115 return -EBUSY; in snd_ymfpci_create_gameport()
119 chip->gameport = gp = gameport_allocate_port(); in snd_ymfpci_create_gameport()
121 dev_err(chip->card->dev, in snd_ymfpci_create_gameport()
123 return -ENOMEM; in snd_ymfpci_create_gameport()
128 gameport_set_phys(gp, "pci%s/gameport0", pci_name(chip->pci)); in snd_ymfpci_create_gameport()
129 gameport_set_dev_parent(gp, &chip->pci->dev); in snd_ymfpci_create_gameport()
130 gp->io = io_port; in snd_ymfpci_create_gameport()
132 if (chip->pci->device >= 0x0010) /* YMF 744/754 */ in snd_ymfpci_create_gameport()
133 pci_write_config_word(chip->pci, PCIR_DSXG_JOYBASE, io_port); in snd_ymfpci_create_gameport()
135 pci_write_config_word(chip->pci, PCIR_DSXG_LEGACY, legacy_ctrl | YMFPCI_LEGACY_JPEN); in snd_ymfpci_create_gameport()
136 pci_write_config_word(chip->pci, PCIR_DSXG_ELEGACY, legacy_ctrl2); in snd_ymfpci_create_gameport()
138 gameport_register_port(chip->gameport); in snd_ymfpci_create_gameport()
145 if (chip->gameport) { in snd_ymfpci_free_gameport()
146 gameport_unregister_port(chip->gameport); in snd_ymfpci_free_gameport()
147 chip->gameport = NULL; in snd_ymfpci_free_gameport()
151 …int snd_ymfpci_create_gameport(struct snd_ymfpci *chip, int dev, int l, int l2) { return -ENOSYS; } in snd_ymfpci_create_gameport()
169 return -ENODEV; in __snd_card_ymfpci_probe()
172 return -ENOENT; in __snd_card_ymfpci_probe()
175 err = snd_devm_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, in __snd_card_ymfpci_probe()
179 chip = card->private_data; in __snd_card_ymfpci_probe()
181 switch (pci_id->device) { in __snd_card_ymfpci_probe()
182 case 0x0004: str = "YMF724"; model = "DS-1"; break; in __snd_card_ymfpci_probe()
183 case 0x000d: str = "YMF724F"; model = "DS-1"; break; in __snd_card_ymfpci_probe()
184 case 0x000a: str = "YMF740"; model = "DS-1L"; break; in __snd_card_ymfpci_probe()
185 case 0x000c: str = "YMF740C"; model = "DS-1L"; break; in __snd_card_ymfpci_probe()
186 case 0x0010: str = "YMF744"; model = "DS-1S"; break; in __snd_card_ymfpci_probe()
187 case 0x0012: str = "YMF754"; model = "DS-1E"; break; in __snd_card_ymfpci_probe()
191 strcpy(card->driver, str); in __snd_card_ymfpci_probe()
192 sprintf(card->shortname, "Yamaha %s (%s)", model, str); in __snd_card_ymfpci_probe()
193 sprintf(card->longname, "%s at 0x%lx, irq %i", in __snd_card_ymfpci_probe()
194 card->shortname, in __snd_card_ymfpci_probe()
195 chip->reg_area_phys, in __snd_card_ymfpci_probe()
196 chip->irq); in __snd_card_ymfpci_probe()
201 if (pci_id->device >= 0x0010) { /* YMF 744/754 */ in __snd_card_ymfpci_probe()
203 /* auto-detect */ in __snd_card_ymfpci_probe()
207 fm_res = devm_request_region(&pci->dev, fm_port[dev], in __snd_card_ymfpci_probe()
214 /* auto-detect */ in __snd_card_ymfpci_probe()
218 mpu_res = devm_request_region(&pci->dev, mpu_port[dev], in __snd_card_ymfpci_probe()
232 dev_err(card->dev, in __snd_card_ymfpci_probe()
234 card->shortname, (unsigned int)fm_port[dev]); in __snd_card_ymfpci_probe()
239 fm_res = devm_request_region(&pci->dev, fm_port[dev], in __snd_card_ymfpci_probe()
254 dev_err(card->dev, in __snd_card_ymfpci_probe()
255 "The %s does not support arbitrary IO ports for MPU-401 (requested 0x%x)\n", in __snd_card_ymfpci_probe()
256 card->shortname, (unsigned int)mpu_port[dev]); in __snd_card_ymfpci_probe()
261 mpu_res = devm_request_region(&pci->dev, mpu_port[dev], in __snd_card_ymfpci_probe()
293 if (chip->ac97->ext_id & AC97_EI_SDAC) { in __snd_card_ymfpci_probe()
311 -1, &chip->rawmidi); in __snd_card_ymfpci_probe()
313 dev_warn(card->dev, in __snd_card_ymfpci_probe()
326 dev_warn(card->dev, in __snd_card_ymfpci_probe()
334 dev_err(card->dev, "cannot create opl3 hwdep\n"); in __snd_card_ymfpci_probe()
354 return snd_card_free_on_error(&pci->dev, __snd_card_ymfpci_probe(pci, pci_id)); in snd_card_ymfpci_probe()