• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/sound/isa/opti9xx/

Lines Matching refs:miro

44 #include "miro.h"
66 MODULE_PARM_DESC(index, "Index value for miro soundcard.");
68 MODULE_PARM_DESC(id, "ID string for miro soundcard.");
70 MODULE_PARM_DESC(port, "WSS port # for miro driver.");
72 MODULE_PARM_DESC(mpu_port, "MPU-401 port # for miro driver.");
74 MODULE_PARM_DESC(fm_port, "FM Port # for miro driver.");
76 MODULE_PARM_DESC(irq, "WSS irq # for miro driver.");
78 MODULE_PARM_DESC(mpu_irq, "MPU-401 irq # for miro driver.");
80 MODULE_PARM_DESC(dma1, "1st dma # for miro driver.");
82 MODULE_PARM_DESC(dma2, "2nd dma # for miro driver.");
138 static void snd_miro_proc_init(struct snd_miro * miro);
151 static int aci_busy_wait(struct snd_miro * miro)
157 if (((byte=inb(miro->aci_port + ACI_REG_BUSY)) & 1) == 0) {
183 static inline int aci_write(struct snd_miro * miro, unsigned char byte)
185 if (aci_busy_wait(miro) >= 0) {
186 outb(byte, miro->aci_port + ACI_REG_COMMAND);
194 static inline int aci_read(struct snd_miro * miro)
198 if (aci_busy_wait(miro) >= 0) {
199 byte=inb(miro->aci_port + ACI_REG_STATUS);
207 static int aci_cmd(struct snd_miro * miro, int write1, int write2, int write3)
212 if (mutex_lock_interruptible(&miro->aci_mutex))
219 value = aci_write(miro, write[i]);
225 value = aci_read(miro);
227 out: mutex_unlock(&miro->aci_mutex);
231 static int aci_getvalue(struct snd_miro * miro, unsigned char index)
233 return aci_cmd(miro, ACI_STATUS, index, -1);
236 static int aci_setvalue(struct snd_miro * miro, unsigned char index, int value)
238 return aci_cmd(miro, index, value, -1);
257 struct snd_miro *miro = snd_kcontrol_chip(kcontrol);
260 if ((value = aci_getvalue(miro, ACI_S_GENERAL)) < 0) {
273 struct snd_miro *miro = snd_kcontrol_chip(kcontrol);
278 if ((error = aci_setvalue(miro, ACI_SET_SOLOMODE, value)) < 0) {
283 change = (value != miro->aci_solomode);
284 miro->aci_solomode = value;
303 struct snd_miro *miro = snd_kcontrol_chip(kcontrol);
306 if (miro->aci_version <= 176) {
314 ucontrol->value.integer.value[0] = miro->aci_preamp;
318 if ((value = aci_getvalue(miro, ACI_GET_PREAMP)) < 0) {
331 struct snd_miro *miro = snd_kcontrol_chip(kcontrol);
336 if ((error = aci_setvalue(miro, ACI_SET_PREAMP, value)) < 0) {
341 change = (value != miro->aci_preamp);
342 miro->aci_preamp = value;
359 struct snd_miro *miro = snd_kcontrol_chip(kcontrol);
360 ucontrol->value.integer.value[0] = miro->aci_amp;
368 struct snd_miro *miro = snd_kcontrol_chip(kcontrol);
373 if ((error = aci_setvalue(miro, ACI_SET_POWERAMP, value)) < 0) {
378 change = (value != miro->aci_amp);
379 miro->aci_amp = value;
422 struct snd_miro *miro = snd_kcontrol_chip(kcontrol);
428 if ((right_val = aci_getvalue(miro, right_reg)) < 0) {
433 if ((left_val = aci_getvalue(miro, left_reg)) < 0) {
468 struct snd_miro *miro = snd_kcontrol_chip(kcontrol);
486 if ((left_old = aci_getvalue(miro, getreg_left)) < 0) {
491 if ((right_old = aci_getvalue(miro, getreg_right)) < 0) {
506 if ((error = aci_setvalue(miro, setreg_left, left)) < 0) {
512 if ((error = aci_setvalue(miro, setreg_left, 0x80 - left)) < 0) {
520 if ((error = aci_setvalue(miro, setreg_right, right)) < 0) {
526 if ((error = aci_setvalue(miro, setreg_right, 0x80 - right)) < 0) {
540 if ((error = aci_setvalue(miro, setreg_left, 0x20 - left)) < 0) {
545 if ((error = aci_setvalue(miro, setreg_right, 0x20 - right)) < 0) {
640 static int __devinit snd_set_aci_init_values(struct snd_miro *miro)
646 if ((miro->aci_product == 'A') && wss) {
647 if ((error = aci_setvalue(miro, ACI_SET_WSS, wss)) < 0) {
656 if ((error = aci_setvalue(miro, ACI_SET_IDE, ide)) < 0) {
665 if ((error = aci_setvalue(miro, aci_init_values[idx][0],
672 miro->aci_amp = 0;
673 miro->aci_preamp = 0;
674 miro->aci_solomode = 1;
679 static int snd_miro_mixer(struct snd_miro *miro)
685 snd_assert(miro != NULL && miro->card != NULL, return -EINVAL);
687 card = miro->card;
689 switch (miro->hardware) {
702 if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_miro_controls[idx], miro))) < 0)
706 if ((miro->aci_product == 'A') || (miro->aci_product == 'B')) {
708 if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_miro_line_control[0], miro))) < 0)
710 if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_miro_amp_control[0], miro))) < 0)
714 if ((miro->aci_product == 'B') || (miro->aci_product == 'C')) {
716 if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_miro_preamp_control[0], miro))) < 0)
718 if (miro->aci_version >= 176)
719 if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_miro_capture_control[0], miro))) < 0)
723 if (miro->aci_product == 'C') {
725 if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_miro_radio_control[0], miro))) < 0)
728 if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_miro_eq_controls[idx], miro))) < 0)
861 struct snd_miro *miro = (struct snd_miro *) entry->private_data;
866 if ((miro->hardware == OPTi9XX_HW_82C929) &&
867 (miro->aci_vendor == 'm') &&
868 (miro->aci_product == 'A')) {
869 switch(miro->aci_version) {
881 if ((miro->hardware == OPTi9XX_HW_82C924) &&
882 (miro->aci_vendor == 'm') &&
883 (miro->aci_product == 'B')) {
884 switch(miro->aci_version) {
899 if ((miro->hardware == OPTi9XX_HW_82C924) &&
900 (miro->aci_vendor == 'm') &&
901 (miro->aci_product == 'C')) {
902 switch(miro->aci_version) {
914 snd_iprintf(buffer, " opti : %s\n", miro->name);
915 snd_iprintf(buffer, " codec : %s\n", miro->pcm->name);
916 snd_iprintf(buffer, " port : 0x%lx\n", miro->wss_base);
917 snd_iprintf(buffer, " irq : %d\n", miro->irq);
918 snd_iprintf(buffer, " dma : %d,%d\n\n", miro->dma1, miro->dma2);
921 snd_iprintf(buffer, " port : 0x%lx\n", miro->mpu_port);
922 snd_iprintf(buffer, " irq : %d\n\n", miro->mpu_irq);
926 switch(miro->aci_vendor) {
931 snd_iprintf(buffer, "unknown (0x%x)\n", miro->aci_vendor);
936 switch(miro->aci_product) {
947 snd_iprintf(buffer, "unknown (0x%x)\n", miro->aci_product);
952 miro->aci_version, miro->aci_version);
954 miro->aci_port, miro->aci_port+2);
957 snd_iprintf(buffer, " solomode: 0x%x\n", miro->aci_solomode);
958 snd_iprintf(buffer, " amp : 0x%x\n", miro->aci_amp);
959 snd_iprintf(buffer, " preamp : 0x%x\n", miro->aci_preamp);
962 static void __devinit snd_miro_proc_init(struct snd_miro * miro)
966 if (! snd_card_proc_new(miro->card, "miro", &entry))
967 snd_info_set_text_ops(entry, miro, snd_miro_proc_read);
1159 struct snd_miro * miro)
1164 mutex_init(&miro->aci_mutex);
1168 miro->mc_base = 0xf8c;
1169 regval=inb(miro->mc_base + 4);
1170 miro->aci_port = (regval & 0x10) ? 0x344: 0x354;
1172 if ((miro->res_aci_port = request_region(miro->aci_port, 3, "miro aci")) == NULL) {
1174 miro->aci_port, miro->aci_port+2);
1180 if (aci_cmd(miro, ACI_ERROR_OP, -1, -1) < 0) {
1185 if ((miro->aci_vendor=aci_cmd(miro, ACI_READ_IDCODE, -1, -1)) < 0 ||
1186 (miro->aci_product=aci_cmd(miro, ACI_READ_IDCODE, -1, -1)) < 0) {
1187 snd_printk(KERN_ERR "can't read aci id on 0x%lx.\n", miro->aci_port);
1191 if ((miro->aci_version=aci_cmd(miro, ACI_READ_VERSION, -1, -1)) < 0) {
1193 miro->aci_port);
1197 if (aci_cmd(miro, ACI_INIT, -1, -1) < 0 ||
1198 aci_cmd(miro, ACI_ERROR_OP, ACI_ERROR_OP, ACI_ERROR_OP) < 0 ||
1199 aci_cmd(miro, ACI_ERROR_OP, ACI_ERROR_OP, ACI_ERROR_OP) < 0) {
1209 struct snd_miro *miro = card->private_data;
1211 release_and_free_resource(miro->res_aci_port);
1212 release_and_free_resource(miro->res_mc_base);
1230 struct snd_miro *miro;
1242 miro = card->private_data;
1243 miro->card = card;
1245 if ((error = snd_card_miro_aci_detect(card, miro)) < 0) {
1252 snd_miro_proc_init(miro);
1254 if ((error = snd_card_miro_detect(card, miro)) < 0) {
1260 if (! miro->res_mc_base &&
1261 (miro->res_mc_base = request_region(miro->mc_base, miro->mc_base_size,
1262 "miro (OPTi9xx MC)")) == NULL) {
1268 miro->wss_base = port;
1269 miro->fm_port = fm_port;
1270 miro->mpu_port = mpu_port;
1271 miro->irq = irq;
1272 miro->mpu_irq = mpu_irq;
1273 miro->dma1 = dma1;
1274 miro->dma2 = dma2;
1276 if (miro->wss_base == SNDRV_AUTO_PORT) {
1277 if ((miro->wss_base = snd_legacy_find_free_ioport(possible_ports, 4)) < 0) {
1284 if (miro->mpu_port == SNDRV_AUTO_PORT) {
1285 if ((miro->mpu_port = snd_legacy_find_free_ioport(possible_mpu_ports, 2)) < 0) {
1291 if (miro->irq == SNDRV_AUTO_IRQ) {
1292 if ((miro->irq = snd_legacy_find_free_irq(possible_irqs)) < 0) {
1298 if (miro->mpu_irq == SNDRV_AUTO_IRQ) {
1299 if ((miro->mpu_irq = snd_legacy_find_free_irq(possible_mpu_irqs)) < 0) {
1305 if (miro->dma1 == SNDRV_AUTO_DMA) {
1306 if ((miro->dma1 = snd_legacy_find_free_dma(possible_dma1s)) < 0) {
1312 if (miro->dma2 == SNDRV_AUTO_DMA) {
1313 if ((miro->dma2 = snd_legacy_find_free_dma(possible_dma2s[miro->dma1 % 4])) < 0) {
1320 if ((error = snd_miro_configure(miro))) {
1325 if ((error = snd_cs4231_create(card, miro->wss_base + 4, -1,
1326 miro->irq, miro->dma1, miro->dma2,
1347 miro->pcm = pcm;
1349 if ((error = snd_miro_mixer(miro)) < 0) {
1354 if (miro->aci_vendor == 'm') {
1355 /* It looks like a miro sound card. */
1356 switch (miro->aci_product) {
1371 "unknown miro");
1372 snd_printk(KERN_INFO "unknown miro aci id\n");
1380 strcpy(card->driver, "miro");
1382 card->shortname, miro->name, pcm->name, miro->wss_base + 4,
1383 miro->irq, miro->dma1, miro->dma2);
1385 if (miro->mpu_port <= 0 || miro->mpu_port == SNDRV_AUTO_PORT)
1389 miro->mpu_port, 0, miro->mpu_irq, IRQF_DISABLED,
1391 snd_printk(KERN_WARNING "no MPU-401 device at 0x%lx?\n", miro->mpu_port);
1393 if (miro->fm_port > 0 && miro->fm_port != SNDRV_AUTO_PORT) {
1396 if (snd_opl4_create(card, miro->fm_port, miro->fm_port - 8,
1398 snd_printk(KERN_WARNING "no OPL4 device at 0x%lx\n", miro->fm_port);
1401 if ((error = snd_set_aci_init_values(miro)) < 0) {
1424 #define DEV_NAME "miro"