~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/isa/adlib.c

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /sound/isa/adlib.c (Architecture sparc) and /sound/isa/adlib.c (Architecture i386)


  1 // SPDX-License-Identifier: GPL-2.0-only            1 // SPDX-License-Identifier: GPL-2.0-only
  2 /*                                                  2 /*
  3  * AdLib FM card driver.                            3  * AdLib FM card driver.
  4  */                                                 4  */
  5                                                     5 
  6 #include <linux/kernel.h>                           6 #include <linux/kernel.h>
  7 #include <linux/module.h>                           7 #include <linux/module.h>
  8 #include <linux/isa.h>                              8 #include <linux/isa.h>
  9 #include <sound/core.h>                             9 #include <sound/core.h>
 10 #include <sound/initval.h>                         10 #include <sound/initval.h>
 11 #include <sound/opl3.h>                            11 #include <sound/opl3.h>
 12                                                    12 
 13 #define CRD_NAME "AdLib FM"                        13 #define CRD_NAME "AdLib FM"
 14 #define DEV_NAME "adlib"                           14 #define DEV_NAME "adlib"
 15                                                    15 
 16 MODULE_DESCRIPTION(CRD_NAME);                      16 MODULE_DESCRIPTION(CRD_NAME);
 17 MODULE_AUTHOR("Rene Herman");                      17 MODULE_AUTHOR("Rene Herman");
 18 MODULE_LICENSE("GPL");                             18 MODULE_LICENSE("GPL");
 19                                                    19 
 20 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_     20 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
 21 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_S     21 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
 22 static bool enable[SNDRV_CARDS] = SNDRV_DEFAUL     22 static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;
 23 static long port[SNDRV_CARDS] = SNDRV_DEFAULT_     23 static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
 24                                                    24 
 25 module_param_array(index, int, NULL, 0444);        25 module_param_array(index, int, NULL, 0444);
 26 MODULE_PARM_DESC(index, "Index value for " CRD     26 MODULE_PARM_DESC(index, "Index value for " CRD_NAME " soundcard.");
 27 module_param_array(id, charp, NULL, 0444);         27 module_param_array(id, charp, NULL, 0444);
 28 MODULE_PARM_DESC(id, "ID string for " CRD_NAME     28 MODULE_PARM_DESC(id, "ID string for " CRD_NAME " soundcard.");
 29 module_param_array(enable, bool, NULL, 0444);      29 module_param_array(enable, bool, NULL, 0444);
 30 MODULE_PARM_DESC(enable, "Enable " CRD_NAME "      30 MODULE_PARM_DESC(enable, "Enable " CRD_NAME " soundcard.");
 31 module_param_hw_array(port, long, ioport, NULL     31 module_param_hw_array(port, long, ioport, NULL, 0444);
 32 MODULE_PARM_DESC(port, "Port # for " CRD_NAME      32 MODULE_PARM_DESC(port, "Port # for " CRD_NAME " driver.");
 33                                                    33 
 34 static int snd_adlib_match(struct device *dev,     34 static int snd_adlib_match(struct device *dev, unsigned int n)
 35 {                                                  35 {
 36         if (!enable[n])                            36         if (!enable[n])
 37                 return 0;                          37                 return 0;
 38                                                    38 
 39         if (port[n] == SNDRV_AUTO_PORT) {          39         if (port[n] == SNDRV_AUTO_PORT) {
 40                 dev_err(dev, "please specify p     40                 dev_err(dev, "please specify port\n");
 41                 return 0;                          41                 return 0;
 42         }                                          42         }
 43         return 1;                                  43         return 1;
 44 }                                                  44 }
 45                                                    45 
 46 static int snd_adlib_probe(struct device *dev,     46 static int snd_adlib_probe(struct device *dev, unsigned int n)
 47 {                                                  47 {
 48         struct snd_card *card;                     48         struct snd_card *card;
 49         struct snd_opl3 *opl3;                     49         struct snd_opl3 *opl3;
 50         int error;                                 50         int error;
 51                                                    51 
 52         error = snd_devm_card_new(dev, index[n     52         error = snd_devm_card_new(dev, index[n], id[n], THIS_MODULE, 0, &card);
 53         if (error < 0) {                           53         if (error < 0) {
 54                 dev_err(dev, "could not create     54                 dev_err(dev, "could not create card\n");
 55                 return error;                      55                 return error;
 56         }                                          56         }
 57                                                    57 
 58         card->private_data = devm_request_regi     58         card->private_data = devm_request_region(dev, port[n], 4, CRD_NAME);
 59         if (!card->private_data) {                 59         if (!card->private_data) {
 60                 dev_err(dev, "could not grab p     60                 dev_err(dev, "could not grab ports\n");
 61                 return -EBUSY;                     61                 return -EBUSY;
 62         }                                          62         }
 63                                                    63 
 64         strcpy(card->driver, DEV_NAME);            64         strcpy(card->driver, DEV_NAME);
 65         strcpy(card->shortname, CRD_NAME);         65         strcpy(card->shortname, CRD_NAME);
 66         sprintf(card->longname, CRD_NAME " at      66         sprintf(card->longname, CRD_NAME " at %#lx", port[n]);
 67                                                    67 
 68         error = snd_opl3_create(card, port[n],     68         error = snd_opl3_create(card, port[n], port[n] + 2, OPL3_HW_AUTO, 1, &opl3);
 69         if (error < 0) {                           69         if (error < 0) {
 70                 dev_err(dev, "could not create     70                 dev_err(dev, "could not create OPL\n");
 71                 return error;                      71                 return error;
 72         }                                          72         }
 73                                                    73 
 74         error = snd_opl3_hwdep_new(opl3, 0, 0,     74         error = snd_opl3_hwdep_new(opl3, 0, 0, NULL);
 75         if (error < 0) {                           75         if (error < 0) {
 76                 dev_err(dev, "could not create     76                 dev_err(dev, "could not create FM\n");
 77                 return error;                      77                 return error;
 78         }                                          78         }
 79                                                    79 
 80         error = snd_card_register(card);           80         error = snd_card_register(card);
 81         if (error < 0) {                           81         if (error < 0) {
 82                 dev_err(dev, "could not regist     82                 dev_err(dev, "could not register card\n");
 83                 return error;                      83                 return error;
 84         }                                          84         }
 85                                                    85 
 86         dev_set_drvdata(dev, card);                86         dev_set_drvdata(dev, card);
 87         return 0;                                  87         return 0;
 88 }                                                  88 }
 89                                                    89 
 90 static struct isa_driver snd_adlib_driver = {      90 static struct isa_driver snd_adlib_driver = {
 91         .match          = snd_adlib_match,         91         .match          = snd_adlib_match,
 92         .probe          = snd_adlib_probe,         92         .probe          = snd_adlib_probe,
 93                                                    93 
 94         .driver         = {                        94         .driver         = {
 95                 .name   = DEV_NAME                 95                 .name   = DEV_NAME
 96         }                                          96         }
 97 };                                                 97 };
 98                                                    98 
 99 module_isa_driver(snd_adlib_driver, SNDRV_CARD     99 module_isa_driver(snd_adlib_driver, SNDRV_CARDS);
100                                                   100 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php