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

TOMOYO Linux Cross Reference
Linux/sound/drivers/vx/vx_hwdep.c

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ 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.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /sound/drivers/vx/vx_hwdep.c (Architecture sparc64) and /sound/drivers/vx/vx_hwdep.c (Architecture ppc)


  1 // SPDX-License-Identifier: GPL-2.0-or-later        1 // SPDX-License-Identifier: GPL-2.0-or-later
  2 /*                                                  2 /*
  3  * Driver for Digigram VX soundcards                3  * Driver for Digigram VX soundcards
  4  *                                                  4  *
  5  * DSP firmware management                          5  * DSP firmware management
  6  *                                                  6  *
  7  * Copyright (c) 2002 by Takashi Iwai <tiwai@s      7  * Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de>
  8  */                                                 8  */
  9                                                     9 
 10 #include <linux/device.h>                          10 #include <linux/device.h>
 11 #include <linux/firmware.h>                        11 #include <linux/firmware.h>
 12 #include <linux/slab.h>                            12 #include <linux/slab.h>
 13 #include <linux/vmalloc.h>                         13 #include <linux/vmalloc.h>
 14 #include <linux/module.h>                          14 #include <linux/module.h>
 15 #include <sound/core.h>                            15 #include <sound/core.h>
 16 #include <sound/hwdep.h>                           16 #include <sound/hwdep.h>
 17 #include <sound/vx_core.h>                         17 #include <sound/vx_core.h>
 18                                                    18 
 19 MODULE_FIRMWARE("vx/bx_1_vxp.b56");                19 MODULE_FIRMWARE("vx/bx_1_vxp.b56");
 20 MODULE_FIRMWARE("vx/bx_1_vp4.b56");                20 MODULE_FIRMWARE("vx/bx_1_vp4.b56");
 21 MODULE_FIRMWARE("vx/x1_1_vx2.xlx");                21 MODULE_FIRMWARE("vx/x1_1_vx2.xlx");
 22 MODULE_FIRMWARE("vx/x1_2_v22.xlx");                22 MODULE_FIRMWARE("vx/x1_2_v22.xlx");
 23 MODULE_FIRMWARE("vx/x1_1_vxp.xlx");                23 MODULE_FIRMWARE("vx/x1_1_vxp.xlx");
 24 MODULE_FIRMWARE("vx/x1_1_vp4.xlx");                24 MODULE_FIRMWARE("vx/x1_1_vp4.xlx");
 25 MODULE_FIRMWARE("vx/bd56002.boot");                25 MODULE_FIRMWARE("vx/bd56002.boot");
 26 MODULE_FIRMWARE("vx/bd563v2.boot");                26 MODULE_FIRMWARE("vx/bd563v2.boot");
 27 MODULE_FIRMWARE("vx/bd563s3.boot");                27 MODULE_FIRMWARE("vx/bd563s3.boot");
 28 MODULE_FIRMWARE("vx/l_1_vx2.d56");                 28 MODULE_FIRMWARE("vx/l_1_vx2.d56");
 29 MODULE_FIRMWARE("vx/l_1_v22.d56");                 29 MODULE_FIRMWARE("vx/l_1_v22.d56");
 30 MODULE_FIRMWARE("vx/l_1_vxp.d56");                 30 MODULE_FIRMWARE("vx/l_1_vxp.d56");
 31 MODULE_FIRMWARE("vx/l_1_vp4.d56");                 31 MODULE_FIRMWARE("vx/l_1_vp4.d56");
 32                                                    32 
 33 int snd_vx_setup_firmware(struct vx_core *chip     33 int snd_vx_setup_firmware(struct vx_core *chip)
 34 {                                                  34 {
 35         static const char * const fw_files[VX_     35         static const char * const fw_files[VX_TYPE_NUMS][4] = {
 36                 [VX_TYPE_BOARD] = {                36                 [VX_TYPE_BOARD] = {
 37                         NULL, "x1_1_vx2.xlx",      37                         NULL, "x1_1_vx2.xlx", "bd56002.boot", "l_1_vx2.d56",
 38                 },                                 38                 },
 39                 [VX_TYPE_V2] = {                   39                 [VX_TYPE_V2] = {
 40                         NULL, "x1_2_v22.xlx",      40                         NULL, "x1_2_v22.xlx", "bd563v2.boot", "l_1_v22.d56",
 41                 },                                 41                 },
 42                 [VX_TYPE_MIC] = {                  42                 [VX_TYPE_MIC] = {
 43                         NULL, "x1_2_v22.xlx",      43                         NULL, "x1_2_v22.xlx", "bd563v2.boot", "l_1_v22.d56",
 44                 },                                 44                 },
 45                 [VX_TYPE_VXPOCKET] = {             45                 [VX_TYPE_VXPOCKET] = {
 46                         "bx_1_vxp.b56", "x1_1_     46                         "bx_1_vxp.b56", "x1_1_vxp.xlx", "bd563s3.boot", "l_1_vxp.d56"
 47                 },                                 47                 },
 48                 [VX_TYPE_VXP440] = {               48                 [VX_TYPE_VXP440] = {
 49                         "bx_1_vp4.b56", "x1_1_     49                         "bx_1_vp4.b56", "x1_1_vp4.xlx", "bd563s3.boot", "l_1_vp4.d56"
 50                 },                                 50                 },
 51         };                                         51         };
 52                                                    52 
 53         int i, err;                                53         int i, err;
 54                                                    54 
 55         for (i = 0; i < 4; i++) {                  55         for (i = 0; i < 4; i++) {
 56                 char path[32];                     56                 char path[32];
 57                 const struct firmware *fw;         57                 const struct firmware *fw;
 58                 if (! fw_files[chip->type][i])     58                 if (! fw_files[chip->type][i])
 59                         continue;                  59                         continue;
 60                 sprintf(path, "vx/%s", fw_file     60                 sprintf(path, "vx/%s", fw_files[chip->type][i]);
 61                 if (request_firmware(&fw, path     61                 if (request_firmware(&fw, path, chip->card->dev)) {
 62                         dev_err(chip->card->de     62                         dev_err(chip->card->dev, "vx: can't load firmware %s\n", path);
 63                         return -ENOENT;            63                         return -ENOENT;
 64                 }                                  64                 }
 65                 err = chip->ops->load_dsp(chip     65                 err = chip->ops->load_dsp(chip, i, fw);
 66                 if (err < 0) {                     66                 if (err < 0) {
 67                         release_firmware(fw);      67                         release_firmware(fw);
 68                         return err;                68                         return err;
 69                 }                                  69                 }
 70                 if (i == 1)                        70                 if (i == 1)
 71                         chip->chip_status |= V     71                         chip->chip_status |= VX_STAT_XILINX_LOADED;
 72 #ifdef CONFIG_PM                                   72 #ifdef CONFIG_PM
 73                 chip->firmware[i] = fw;            73                 chip->firmware[i] = fw;
 74 #else                                              74 #else
 75                 release_firmware(fw);              75                 release_firmware(fw);
 76 #endif                                             76 #endif
 77         }                                          77         }
 78                                                    78 
 79         /* ok, we reached to the last one */       79         /* ok, we reached to the last one */
 80         /* create the devices if not built yet     80         /* create the devices if not built yet */
 81         err = snd_vx_pcm_new(chip);                81         err = snd_vx_pcm_new(chip);
 82         if (err < 0)                               82         if (err < 0)
 83                 return err;                        83                 return err;
 84                                                    84 
 85         err = snd_vx_mixer_new(chip);              85         err = snd_vx_mixer_new(chip);
 86         if (err < 0)                               86         if (err < 0)
 87                 return err;                        87                 return err;
 88                                                    88 
 89         if (chip->ops->add_controls) {             89         if (chip->ops->add_controls) {
 90                 err = chip->ops->add_controls(     90                 err = chip->ops->add_controls(chip);
 91                 if (err < 0)                       91                 if (err < 0)
 92                         return err;                92                         return err;
 93         }                                          93         }
 94                                                    94 
 95         chip->chip_status |= VX_STAT_DEVICE_IN     95         chip->chip_status |= VX_STAT_DEVICE_INIT;
 96         chip->chip_status |= VX_STAT_CHIP_INIT     96         chip->chip_status |= VX_STAT_CHIP_INIT;
 97                                                    97 
 98         return snd_card_register(chip->card);      98         return snd_card_register(chip->card);
 99 }                                                  99 }
100                                                   100 
101 /* exported */                                    101 /* exported */
102 void snd_vx_free_firmware(struct vx_core *chip    102 void snd_vx_free_firmware(struct vx_core *chip)
103 {                                                 103 {
104 #ifdef CONFIG_PM                                  104 #ifdef CONFIG_PM
105         int i;                                    105         int i;
106         for (i = 0; i < 4; i++)                   106         for (i = 0; i < 4; i++)
107                 release_firmware(chip->firmwar    107                 release_firmware(chip->firmware[i]);
108 #endif                                            108 #endif
109 }                                                 109 }
110                                                   110 
111 EXPORT_SYMBOL(snd_vx_setup_firmware);             111 EXPORT_SYMBOL(snd_vx_setup_firmware);
112 EXPORT_SYMBOL(snd_vx_free_firmware);              112 EXPORT_SYMBOL(snd_vx_free_firmware);
113                                                   113 

~ [ 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