Changeset 679 for GPL/trunk/alsa-kernel/isa/cs423x
- Timestamp:
- Mar 18, 2021, 8:57:36 PM (5 years ago)
- Location:
- GPL/trunk
- Files:
-
- 4 edited
-
. (modified) (1 prop)
-
alsa-kernel/isa/cs423x/cs4231.c (modified) (12 diffs)
-
alsa-kernel/isa/cs423x/cs4236.c (modified) (31 diffs)
-
alsa-kernel/isa/cs423x/cs4236_lib.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-linux-3.2.102 (added) merged: 611-614 /GPL/branches/uniaud32-next (added) merged: 615-678
- Property svn:mergeinfo changed
-
GPL/trunk/alsa-kernel/isa/cs423x/cs4231.c
r410 r679 1 // SPDX-License-Identifier: GPL-2.0-or-later 1 2 /* 2 3 * Generic driver for CS4231 chips … … 4 5 * Originally the CS4232/CS4232A driver, modified for use on CS4231 by 5 6 * Tugrul Galatali <galatalt@stuy.edu> 6 *7 * This program is free software; you can redistribute it and/or modify8 * it under the terms of the GNU General Public License as published by9 * the Free Software Foundation; either version 2 of the License, or10 * (at your option) any later version.11 *12 * This program is distributed in the hope that it will be useful,13 * but WITHOUT ANY WARRANTY; without even the implied warranty of14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15 * GNU General Public License for more details.16 *17 * You should have received a copy of the GNU General Public License18 * along with this program; if not, write to the Free Software19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA20 *21 7 */ 22 8 … … 26 12 #include <linux/time.h> 27 13 #include <linux/wait.h> 28 #include <linux/module param.h>14 #include <linux/module.h> 29 15 #include <sound/core.h> 30 16 #include <sound/wss.h> … … 42 28 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 43 29 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 44 static intenable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */30 static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ 45 31 static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ 46 32 static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ … … 56 42 module_param_array(enable, bool, NULL, 0444); 57 43 MODULE_PARM_DESC(enable, "Enable " CRD_NAME " soundcard."); 58 module_param_ array(port, long, NULL, 0444);44 module_param_hw_array(port, long, ioport, NULL, 0444); 59 45 MODULE_PARM_DESC(port, "Port # for " CRD_NAME " driver."); 60 module_param_ array(mpu_port, long, NULL, 0444);46 module_param_hw_array(mpu_port, long, ioport, NULL, 0444); 61 47 MODULE_PARM_DESC(mpu_port, "MPU-401 port # for " CRD_NAME " driver."); 62 module_param_ array(irq, int, NULL, 0444);48 module_param_hw_array(irq, int, irq, NULL, 0444); 63 49 MODULE_PARM_DESC(irq, "IRQ # for " CRD_NAME " driver."); 64 module_param_ array(mpu_irq, int, NULL, 0444);50 module_param_hw_array(mpu_irq, int, irq, NULL, 0444); 65 51 MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for " CRD_NAME " driver."); 66 module_param_ array(dma1, int, NULL, 0444);52 module_param_hw_array(dma1, int, dma, NULL, 0444); 67 53 MODULE_PARM_DESC(dma1, "DMA1 # for " CRD_NAME " driver."); 68 module_param_ array(dma2, int, NULL, 0444);54 module_param_hw_array(dma2, int, dma, NULL, 0444); 69 55 MODULE_PARM_DESC(dma2, "DMA2 # for " CRD_NAME " driver."); 70 56 71 static int __devinitsnd_cs4231_match(struct device *dev, unsigned int n)57 static int snd_cs4231_match(struct device *dev, unsigned int n) 72 58 { 73 59 if (!enable[n]) … … 89 75 } 90 76 91 static int __devinitsnd_cs4231_probe(struct device *dev, unsigned int n)77 static int snd_cs4231_probe(struct device *dev, unsigned int n) 92 78 { 93 79 struct snd_card *card; 94 80 struct snd_wss *chip; 95 struct snd_pcm *pcm;96 81 int error; 97 82 98 error = snd_card_ create(index[n], id[n], THIS_MODULE, 0, &card);83 error = snd_card_new(dev, index[n], id[n], THIS_MODULE, 0, &card); 99 84 if (error < 0) 100 85 return error; … … 107 92 card->private_data = chip; 108 93 109 error = snd_wss_pcm(chip, 0 , &pcm);94 error = snd_wss_pcm(chip, 0); 110 95 if (error < 0) 111 96 goto out; 112 97 113 str cpy(card->driver, "CS4231");114 str cpy(card->shortname, pcm->name);98 strlcpy(card->driver, "CS4231", sizeof(card->driver)); 99 strlcpy(card->shortname, chip->pcm->name, sizeof(card->shortname)); 115 100 116 sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d", 117 pcm->name, chip->port, irq[n], dma1[n]); 118 if (dma2[n] >= 0) 119 sprintf(card->longname + strlen(card->longname), "&%d", dma2[n]); 101 if (dma2[n] < 0) 102 snprintf(card->longname, sizeof(card->longname), 103 "%s at 0x%lx, irq %d, dma %d", 104 chip->pcm->name, chip->port, irq[n], dma1[n]); 105 else 106 snprintf(card->longname, sizeof(card->longname), 107 "%s at 0x%lx, irq %d, dma %d&%d", 108 chip->pcm->name, chip->port, irq[n], dma1[n], dma2[n]); 120 109 121 110 error = snd_wss_mixer(chip); … … 123 112 goto out; 124 113 125 error = snd_wss_timer(chip, 0 , NULL);114 error = snd_wss_timer(chip, 0); 126 115 if (error < 0) 127 116 goto out; … … 132 121 if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232, 133 122 mpu_port[n], 0, mpu_irq[n], 134 mpu_irq[n] >= 0 ? IRQF_DISABLED : 0,135 123 NULL) < 0) 136 124 dev_warn(dev, "MPU401 not detected\n"); 137 125 } 138 139 snd_card_set_dev(card, dev);140 126 141 127 error = snd_card_register(card); … … 150 136 } 151 137 152 static int __devexitsnd_cs4231_remove(struct device *dev, unsigned int n)138 static int snd_cs4231_remove(struct device *dev, unsigned int n) 153 139 { 154 140 snd_card_free(dev_get_drvdata(dev)); 155 dev_set_drvdata(dev, NULL);156 141 return 0; 157 142 } … … 182 167 .match = snd_cs4231_match, 183 168 .probe = snd_cs4231_probe, 184 .remove = __devexit_p(snd_cs4231_remove),169 .remove = snd_cs4231_remove, 185 170 #ifdef CONFIG_PM 186 171 .suspend = snd_cs4231_suspend, … … 192 177 }; 193 178 194 static int __init alsa_card_cs4231_init(void) 195 { 196 return isa_register_driver(&snd_cs4231_driver, SNDRV_CARDS); 197 } 198 199 static void __exit alsa_card_cs4231_exit(void) 200 { 201 isa_unregister_driver(&snd_cs4231_driver); 202 } 203 204 module_init(alsa_card_cs4231_init); 205 module_exit(alsa_card_cs4231_exit); 179 module_isa_driver(snd_cs4231_driver, SNDRV_CARDS); -
GPL/trunk/alsa-kernel/isa/cs423x/cs4236.c
r598 r679 1 // SPDX-License-Identifier: GPL-2.0-or-later 1 2 /* 2 3 * Driver for generic CS4232/CS4235/CS4236/CS4236B/CS4237B/CS4238B/CS4239 chips 3 4 * Copyright (c) by Jaroslav Kysela <perex@perex.cz> 4 *5 *6 * This program is free software; you can redistribute it and/or modify7 * it under the terms of the GNU General Public License as published by8 * the Free Software Foundation; either version 2 of the License, or9 * (at your option) any later version.10 *11 * This program is distributed in the hope that it will be useful,12 * but WITHOUT ANY WARRANTY; without even the implied warranty of13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14 * GNU General Public License for more details.15 *16 * You should have received a copy of the GNU General Public License17 * along with this program; if not, write to the Free Software18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA19 *20 5 */ 21 6 … … 24 9 #include <linux/isa.h> 25 10 #include <linux/pnp.h> 26 #include <linux/module param.h>11 #include <linux/module.h> 27 12 #include <sound/core.h> 28 13 #include <sound/wss.h> … … 75 60 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 76 61 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 77 static intenable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */78 #ifdef CONFIG_PNP 79 static intisapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};62 static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ 63 #ifdef CONFIG_PNP 64 static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; 80 65 #endif 81 66 static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ … … 99 84 MODULE_PARM_DESC(isapnp, "ISA PnP detection for specified soundcard."); 100 85 #endif 101 module_param_ array(port, long, NULL, 0444);86 module_param_hw_array(port, long, ioport, NULL, 0444); 102 87 MODULE_PARM_DESC(port, "Port # for " IDENT " driver."); 103 module_param_ array(cport, long, NULL, 0444);88 module_param_hw_array(cport, long, ioport, NULL, 0444); 104 89 MODULE_PARM_DESC(cport, "Control port # for " IDENT " driver."); 105 module_param_ array(mpu_port, long, NULL, 0444);90 module_param_hw_array(mpu_port, long, ioport, NULL, 0444); 106 91 MODULE_PARM_DESC(mpu_port, "MPU-401 port # for " IDENT " driver."); 107 module_param_ array(fm_port, long, NULL, 0444);92 module_param_hw_array(fm_port, long, ioport, NULL, 0444); 108 93 MODULE_PARM_DESC(fm_port, "FM port # for " IDENT " driver."); 109 module_param_ array(sb_port, long, NULL, 0444);94 module_param_hw_array(sb_port, long, ioport, NULL, 0444); 110 95 MODULE_PARM_DESC(sb_port, "SB port # for " IDENT " driver (optional)."); 111 module_param_ array(irq, int, NULL, 0444);96 module_param_hw_array(irq, int, irq, NULL, 0444); 112 97 MODULE_PARM_DESC(irq, "IRQ # for " IDENT " driver."); 113 module_param_ array(mpu_irq, int, NULL, 0444);98 module_param_hw_array(mpu_irq, int, irq, NULL, 0444); 114 99 MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for " IDENT " driver."); 115 module_param_ array(dma1, int, NULL, 0444);100 module_param_hw_array(dma1, int, dma, NULL, 0444); 116 101 MODULE_PARM_DESC(dma1, "DMA1 # for " IDENT " driver."); 117 module_param_ array(dma2, int, NULL, 0444);102 module_param_hw_array(dma2, int, dma, NULL, 0444); 118 103 MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver."); 119 104 … … 150 135 151 136 #define CS423X_ISAPNP_DRIVER "cs4232_isapnp" 152 static struct pnp_card_device_id snd_cs423x_pnpids[] = {137 static const struct pnp_card_device_id snd_cs423x_pnpids[] = { 153 138 /* Philips PCA70PS */ 154 139 { .id = "CSC0d32", .devs = { { "CSC0000" }, { "CSC0010" }, { "PNPb006" } } }, … … 252 237 253 238 /* WSS initialization */ 254 static int __devinitsnd_cs423x_pnp_init_wss(int dev, struct pnp_dev *pdev)239 static int snd_cs423x_pnp_init_wss(int dev, struct pnp_dev *pdev) 255 240 { 256 241 if (pnp_activate_dev(pdev) < 0) { … … 273 258 274 259 /* CTRL initialization */ 275 static int __devinitsnd_cs423x_pnp_init_ctrl(int dev, struct pnp_dev *pdev)260 static int snd_cs423x_pnp_init_ctrl(int dev, struct pnp_dev *pdev) 276 261 { 277 262 if (pnp_activate_dev(pdev) < 0) { … … 285 270 286 271 /* MPU initialization */ 287 static int __devinitsnd_cs423x_pnp_init_mpu(int dev, struct pnp_dev *pdev)272 static int snd_cs423x_pnp_init_mpu(int dev, struct pnp_dev *pdev) 288 273 { 289 274 if (pnp_activate_dev(pdev) < 0) { … … 294 279 mpu_port[dev] = pnp_port_start(pdev, 0); 295 280 if (mpu_irq[dev] >= 0 && 296 pnp_irq_valid(pdev, 0) && pnp_irq(pdev, 0) >= 0) { 281 pnp_irq_valid(pdev, 0) && 282 pnp_irq(pdev, 0) != (resource_size_t)-1) { 297 283 mpu_irq[dev] = pnp_irq(pdev, 0); 298 284 } else { … … 304 290 } 305 291 306 static int __devinitsnd_card_cs423x_pnp(int dev, struct snd_card_cs4236 *acard,307 struct pnp_dev *pdev,308 struct pnp_dev *cdev)292 static int snd_card_cs423x_pnp(int dev, struct snd_card_cs4236 *acard, 293 struct pnp_dev *pdev, 294 struct pnp_dev *cdev) 309 295 { 310 296 acard->wss = pdev; … … 318 304 } 319 305 320 static int __devinitsnd_card_cs423x_pnpc(int dev, struct snd_card_cs4236 *acard,321 struct pnp_card_link *card,322 const struct pnp_card_device_id *id)306 static int snd_card_cs423x_pnpc(int dev, struct snd_card_cs4236 *acard, 307 struct pnp_card_link *card, 308 const struct pnp_card_device_id *id) 323 309 { 324 310 acard->wss = pnp_request_card_device(card, id->devs[0].id, NULL); … … 365 351 } 366 352 367 static int snd_cs423x_card_new(int dev, struct snd_card **cardp) 353 static int snd_cs423x_card_new(struct device *pdev, int dev, 354 struct snd_card **cardp) 368 355 { 369 356 struct snd_card *card; 370 357 int err; 371 358 372 err = snd_card_ create(index[dev], id[dev], THIS_MODULE,373 sizeof(struct snd_card_cs4236), &card);359 err = snd_card_new(pdev, index[dev], id[dev], THIS_MODULE, 360 sizeof(struct snd_card_cs4236), &card); 374 361 if (err < 0) 375 362 return err; … … 379 366 } 380 367 381 static int __devinitsnd_cs423x_probe(struct snd_card *card, int dev)368 static int snd_cs423x_probe(struct snd_card *card, int dev) 382 369 { 383 370 struct snd_card_cs4236 *acard; 384 struct snd_pcm *pcm;385 371 struct snd_wss *chip; 386 372 struct snd_opl3 *opl3; … … 404 390 if (chip->hardware & WSS_HW_CS4236B_MASK) { 405 391 406 err = snd_cs4236_pcm(chip, 0 , &pcm);392 err = snd_cs4236_pcm(chip, 0); 407 393 if (err < 0) 408 394 return err; … … 412 398 return err; 413 399 } else { 414 err = snd_wss_pcm(chip, 0 , &pcm);400 err = snd_wss_pcm(chip, 0); 415 401 if (err < 0) 416 402 return err; … … 420 406 return err; 421 407 } 422 strcpy(card->driver, pcm->name); 423 strcpy(card->shortname, pcm->name); 424 sprintf(card->longname, "%s at 0x%lx, irq %i, dma %i", 425 pcm->name, 426 chip->port, 427 irq[dev], 428 dma1[dev]); 429 if (dma2[dev] >= 0) 430 sprintf(card->longname + strlen(card->longname), "&%d", dma2[dev]); 431 432 err = snd_wss_timer(chip, 0, NULL); 408 strlcpy(card->driver, chip->pcm->name, sizeof(card->driver)); 409 strlcpy(card->shortname, chip->pcm->name, sizeof(card->shortname)); 410 if (dma2[dev] < 0) 411 snprintf(card->longname, sizeof(card->longname), 412 "%s at 0x%lx, irq %i, dma %i", 413 chip->pcm->name, chip->port, irq[dev], dma1[dev]); 414 else 415 snprintf(card->longname, sizeof(card->longname), 416 "%s at 0x%lx, irq %i, dma %i&%d", 417 chip->pcm->name, chip->port, irq[dev], dma1[dev], 418 dma2[dev]); 419 420 err = snd_wss_timer(chip, 0); 433 421 if (err < 0) 434 422 return err; … … 450 438 if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232, 451 439 mpu_port[dev], 0, 452 mpu_irq[dev], 453 mpu_irq[dev] >= 0 ? IRQF_DISABLED : 0, NULL) < 0) 440 mpu_irq[dev], NULL) < 0) 454 441 printk(KERN_WARNING IDENT ": MPU401 not detected\n"); 455 442 } … … 458 445 } 459 446 460 static int __devinitsnd_cs423x_isa_match(struct device *pdev,461 unsigned int dev)447 static int snd_cs423x_isa_match(struct device *pdev, 448 unsigned int dev) 462 449 { 463 450 if (!enable[dev] || is_isapnp_selected(dev)) … … 483 470 } 484 471 485 static int __devinitsnd_cs423x_isa_probe(struct device *pdev,486 unsigned int dev)472 static int snd_cs423x_isa_probe(struct device *pdev, 473 unsigned int dev) 487 474 { 488 475 struct snd_card *card; 489 476 int err; 490 477 491 err = snd_cs423x_card_new( dev, &card);478 err = snd_cs423x_card_new(pdev, dev, &card); 492 479 if (err < 0) 493 480 return err; 494 snd_card_set_dev(card, pdev);495 481 if ((err = snd_cs423x_probe(card, dev)) < 0) { 496 482 snd_card_free(card); … … 502 488 } 503 489 504 static int __devexitsnd_cs423x_isa_remove(struct device *pdev,505 unsigned int dev)490 static int snd_cs423x_isa_remove(struct device *pdev, 491 unsigned int dev) 506 492 { 507 493 snd_card_free(dev_get_drvdata(pdev)); 508 dev_set_drvdata(pdev, NULL);509 494 return 0; 510 495 } … … 542 527 .match = snd_cs423x_isa_match, 543 528 .probe = snd_cs423x_isa_probe, 544 .remove = __devexit_p(snd_cs423x_isa_remove),529 .remove = snd_cs423x_isa_remove, 545 530 #ifdef CONFIG_PM 546 531 .suspend = snd_cs423x_isa_suspend, … … 554 539 555 540 #ifdef CONFIG_PNP 556 static int __devinitsnd_cs423x_pnpbios_detect(struct pnp_dev *pdev,557 const struct pnp_device_id *id)541 static int snd_cs423x_pnpbios_detect(struct pnp_dev *pdev, 542 const struct pnp_device_id *id) 558 543 { 559 544 static int dev; … … 580 565 break; 581 566 } 582 err = snd_cs423x_card_new( dev, &card);567 err = snd_cs423x_card_new(&pdev->dev, dev, &card); 583 568 if (err < 0) 584 569 return err; … … 589 574 return err; 590 575 } 591 snd_card_set_dev(card, &pdev->dev);592 576 if ((err = snd_cs423x_probe(card, dev)) < 0) { 593 577 snd_card_free(card); … … 599 583 } 600 584 601 static void __devexitsnd_cs423x_pnp_remove(struct pnp_dev *pdev)585 static void snd_cs423x_pnp_remove(struct pnp_dev *pdev) 602 586 { 603 587 snd_card_free(pnp_get_drvdata(pdev)); 604 pnp_set_drvdata(pdev, NULL);605 588 } 606 589 … … 621 604 .id_table = snd_cs423x_pnpbiosids, 622 605 .probe = snd_cs423x_pnpbios_detect, 623 .remove = __devexit_p(snd_cs423x_pnp_remove),606 .remove = snd_cs423x_pnp_remove, 624 607 #ifdef CONFIG_PM 625 608 .suspend = snd_cs423x_pnp_suspend, … … 628 611 }; 629 612 630 static int __devinitsnd_cs423x_pnpc_detect(struct pnp_card_link *pcard,631 const struct pnp_card_device_id *pid)613 static int snd_cs423x_pnpc_detect(struct pnp_card_link *pcard, 614 const struct pnp_card_device_id *pid) 632 615 { 633 616 static int dev; … … 642 625 return -ENODEV; 643 626 644 res = snd_cs423x_card_new( dev, &card);627 res = snd_cs423x_card_new(&pcard->card->dev, dev, &card); 645 628 if (res < 0) 646 629 return res; … … 651 634 return res; 652 635 } 653 snd_card_set_dev(card, &pcard->card->dev);654 636 if ((res = snd_cs423x_probe(card, dev)) < 0) { 655 637 snd_card_free(card); … … 661 643 } 662 644 663 static void __devexit snd_cs423x_pnpc_remove(struct pnp_card_link *pcard)645 static void snd_cs423x_pnpc_remove(struct pnp_card_link *pcard) 664 646 { 665 647 snd_card_free(pnp_get_card_drvdata(pcard)); … … 684 666 .id_table = snd_cs423x_pnpids, 685 667 .probe = snd_cs423x_pnpc_detect, 686 .remove = __devexit_p(snd_cs423x_pnpc_remove),668 .remove = snd_cs423x_pnpc_remove, 687 669 #ifdef CONFIG_PM 688 670 .suspend = snd_cs423x_pnpc_suspend, -
GPL/trunk/alsa-kernel/isa/cs423x/cs4236_lib.c
r598 r679 1 // SPDX-License-Identifier: GPL-2.0-or-later 1 2 /* 2 3 * Copyright (c) by Jaroslav Kysela <perex@perex.cz> … … 8 9 * Bugs: 9 10 * ----- 10 *11 * This program is free software; you can redistribute it and/or modify12 * it under the terms of the GNU General Public License as published by13 * the Free Software Foundation; either version 2 of the License, or14 * (at your option) any later version.15 *16 * This program is distributed in the hope that it will be useful,17 * but WITHOUT ANY WARRANTY; without even the implied warranty of18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the19 * GNU General Public License for more details.20 *21 * You should have received a copy of the GNU General Public License22 * along with this program; if not, write to the Free Software23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA24 *25 11 */ 26 12 … … 54 40 * D6: channels status block reset (CS4237B,CS4238B) 55 41 * D5: user bit in sub-frame of digital audio data (CS4237B,CS4238B) 56 * D4: validity bit bitin sub-frame of digital audio data (CS4237B,CS4238B)42 * D4: validity bit in sub-frame of digital audio data (CS4237B,CS4238B) 57 43 * 58 44 * C5 lower channel status (digital serial data description) (CS4237B,CS4238B) … … 80 66 */ 81 67 82 #include < asm/io.h>68 #include <linux/io.h> 83 69 #include <linux/delay.h> 84 70 #include <linux/init.h> … … 95 81 */ 96 82 97 static unsigned char snd_cs4236_ext_map[18] = {83 static const unsigned char snd_cs4236_ext_map[18] = { 98 84 /* CS4236_LEFT_LINE */ 0xff, 99 85 /* CS4236_RIGHT_LINE */ 0xff, … … 139 125 #define CLOCKS 8 140 126 141 static struct snd_ratnum clocks[CLOCKS] = {127 static const struct snd_ratnum clocks[CLOCKS] = { 142 128 { .num = 16934400, .den_min = 353, .den_max = 353, .den_step = 1 }, 143 129 { .num = 16934400, .den_min = 529, .den_max = 529, .den_step = 1 }, … … 150 136 }; 151 137 152 static struct snd_pcm_hw_constraint_ratnums hw_constraints_clocks = {138 static const struct snd_pcm_hw_constraint_ratnums hw_constraints_clocks = { 153 139 .nrats = CLOCKS, 154 140 .rats = clocks, … … 377 363 } 378 364 379 int snd_cs4236_pcm(struct snd_wss *chip, int device, struct snd_pcm **rpcm) 380 { 381 struct snd_pcm *pcm; 365 int snd_cs4236_pcm(struct snd_wss *chip, int device) 366 { 382 367 int err; 383 368 384 err = snd_wss_pcm(chip, device , &pcm);369 err = snd_wss_pcm(chip, device); 385 370 if (err < 0) 386 371 return err; 387 pcm->info_flags &= ~SNDRV_PCM_INFO_JOINT_DUPLEX; 388 if (rpcm) 389 *rpcm = pcm; 372 chip->pcm->info_flags &= ~SNDRV_PCM_INFO_JOINT_DUPLEX; 390 373 return 0; 391 374 } … … 776 759 static const DECLARE_TLV_DB_SCALE(db_scale_rec_gain, 0, 150, 0); 777 760 778 static struct snd_kcontrol_new snd_cs4236_controls[] = {761 static const struct snd_kcontrol_new snd_cs4236_controls[] = { 779 762 780 763 CS4236_DOUBLE("Master Digital Playback Switch", 0, … … 871 854 static const DECLARE_TLV_DB_SCALE(db_scale_2bit_16db_max, -2400, 800, 0); 872 855 873 static struct snd_kcontrol_new snd_cs4235_controls[] = {856 static const struct snd_kcontrol_new snd_cs4235_controls[] = { 874 857 875 858 WSS_DOUBLE("Master Playback Switch", 0, … … 1004 987 } 1005 988 1006 static struct snd_kcontrol_new snd_cs4236_iec958_controls[] = {989 static const struct snd_kcontrol_new snd_cs4236_iec958_controls[] = { 1007 990 CS4236_IEC958_ENABLE("IEC958 Output Enable", 0), 1008 991 CS4236_SINGLEC("IEC958 Output Validity", 0, 4, 4, 1, 0), … … 1013 996 }; 1014 997 1015 static struct snd_kcontrol_new snd_cs4236_3d_controls_cs4235[] = {998 static const struct snd_kcontrol_new snd_cs4236_3d_controls_cs4235[] = { 1016 999 CS4236_SINGLEC("3D Control - Switch", 0, 3, 4, 1, 0), 1017 1000 CS4236_SINGLEC("3D Control - Space", 0, 2, 4, 15, 1) 1018 1001 }; 1019 1002 1020 static struct snd_kcontrol_new snd_cs4236_3d_controls_cs4237[] = {1003 static const struct snd_kcontrol_new snd_cs4236_3d_controls_cs4237[] = { 1021 1004 CS4236_SINGLEC("3D Control - Switch", 0, 3, 7, 1, 0), 1022 1005 CS4236_SINGLEC("3D Control - Space", 0, 2, 4, 15, 1), … … 1026 1009 }; 1027 1010 1028 static struct snd_kcontrol_new snd_cs4236_3d_controls_cs4238[] = {1011 static const struct snd_kcontrol_new snd_cs4236_3d_controls_cs4238[] = { 1029 1012 CS4236_SINGLEC("3D Control - Switch", 0, 3, 4, 1, 0), 1030 1013 CS4236_SINGLEC("3D Control - Space", 0, 2, 4, 15, 1), … … 1038 1021 unsigned int idx, count; 1039 1022 int err; 1040 struct snd_kcontrol_new *kcontrol;1023 const struct snd_kcontrol_new *kcontrol; 1041 1024 1042 1025 if (snd_BUG_ON(!chip || !chip->card))
Note:
See TracChangeset
for help on using the changeset viewer.
