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

Lines Matching refs:chip

44 int snd_sbdsp_command(struct snd_sb *chip, unsigned char val)
51 if ((inb(SBP(chip, STATUS)) & 0x80) == 0) {
52 outb(val, SBP(chip, COMMAND));
55 snd_printd("%s [0x%lx]: timeout (0x%x)\n", __FUNCTION__, chip->port, val);
59 int snd_sbdsp_get_byte(struct snd_sb *chip)
64 if (inb(SBP(chip, DATA_AVAIL)) & 0x80) {
65 val = inb(SBP(chip, READ));
72 snd_printd("%s [0x%lx]: timeout\n", __FUNCTION__, chip->port);
76 int snd_sbdsp_reset(struct snd_sb *chip)
80 outb(1, SBP(chip, RESET));
82 outb(0, SBP(chip, RESET));
85 if (inb(SBP(chip, DATA_AVAIL)) & 0x80) {
86 if (inb(SBP(chip, READ)) == 0xaa)
91 snd_printdd("%s [0x%lx] failed...\n", __FUNCTION__, chip->port);
95 static int snd_sbdsp_version(struct snd_sb * chip)
99 snd_sbdsp_command(chip, SB_DSP_GET_VERSION);
100 result = (short) snd_sbdsp_get_byte(chip) << 8;
101 result |= (short) snd_sbdsp_get_byte(chip);
105 static int snd_sbdsp_probe(struct snd_sb * chip)
116 spin_lock_irqsave(&chip->reg_lock, flags);
117 if (snd_sbdsp_reset(chip) < 0) {
118 spin_unlock_irqrestore(&chip->reg_lock, flags);
121 version = snd_sbdsp_version(chip);
123 spin_unlock_irqrestore(&chip->reg_lock, flags);
126 spin_unlock_irqrestore(&chip->reg_lock, flags);
129 snd_printdd("SB [0x%lx]: DSP chip found, version = %i.%i\n",
130 chip->port, major, minor);
132 switch (chip->hardware) {
136 chip->hardware = SB_HW_10;
141 chip->hardware = SB_HW_201;
144 chip->hardware = SB_HW_20;
149 chip->hardware = SB_HW_PRO;
153 chip->hardware = SB_HW_16;
157 snd_printk(KERN_INFO "SB [0x%lx]: unknown DSP chip version %i.%i\n",
158 chip->port, major, minor);
174 sprintf(chip->name, "Sound Blaster %s", str);
175 chip->version = (major << 8) | minor;
179 static int snd_sbdsp_free(struct snd_sb *chip)
181 if (chip->res_port)
182 release_and_free_resource(chip->res_port);
183 if (chip->irq >= 0)
184 free_irq(chip->irq, (void *) chip);
186 if (chip->dma8 >= 0) {
187 disable_dma(chip->dma8);
188 free_dma(chip->dma8);
190 if (chip->dma16 >= 0 && chip->dma16 != chip->dma8) {
191 disable_dma(chip->dma16);
192 free_dma(chip->dma16);
195 kfree(chip);
201 struct snd_sb *chip = device->device_data;
202 return snd_sbdsp_free(chip);
214 struct snd_sb *chip;
222 chip = kzalloc(sizeof(*chip), GFP_KERNEL);
223 if (chip == NULL)
225 spin_lock_init(&chip->reg_lock);
226 spin_lock_init(&chip->open_lock);
227 spin_lock_init(&chip->midi_input_lock);
228 spin_lock_init(&chip->mixer_lock);
229 chip->irq = -1;
230 chip->dma8 = -1;
231 chip->dma16 = -1;
232 chip->port = port;
236 "SoundBlaster", (void *) chip)) {
238 snd_sbdsp_free(chip);
241 chip->irq = irq;
246 if ((chip->res_port = request_region(port, 16, "SoundBlaster")) == NULL) {
248 snd_sbdsp_free(chip);
255 snd_sbdsp_free(chip);
258 chip->dma8 = dma8;
265 snd_sbdsp_free(chip);
269 chip->dma16 = dma16;
273 chip->card = card;
274 chip->hardware = hardware;
275 if ((err = snd_sbdsp_probe(chip)) < 0) {
276 snd_sbdsp_free(chip);
279 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
280 snd_sbdsp_free(chip);
283 *r_chip = chip;