Lines Matching +full:version +full:- +full:minor
1 // SPDX-License-Identifier: GPL-2.0-or-later
4 * Uros Bizjak <uros@kss-loka.si>
34 dev_dbg(chip->card->dev, "command 0x%x\n", val); in snd_sbdsp_command()
36 for (i = BUSY_LOOPS; i; i--) in snd_sbdsp_command()
41 dev_dbg(chip->card->dev, "%s [0x%lx]: timeout (0x%x)\n", __func__, chip->port, val); in snd_sbdsp_command()
49 for (i = BUSY_LOOPS; i; i--) { in snd_sbdsp_get_byte()
53 dev_dbg(chip->card->dev, "get_byte 0x%x\n", val); in snd_sbdsp_get_byte()
58 dev_dbg(chip->card->dev, "%s [0x%lx]: timeout\n", __func__, chip->port); in snd_sbdsp_get_byte()
59 return -ENODEV; in snd_sbdsp_get_byte()
70 for (i = BUSY_LOOPS; i; i--) in snd_sbdsp_reset()
77 if (chip->card) in snd_sbdsp_reset()
78 dev_dbg(chip->card->dev, "%s [0x%lx] failed...\n", __func__, chip->port); in snd_sbdsp_reset()
79 return -ENODEV; in snd_sbdsp_reset()
94 int version; in snd_sbdsp_probe() local
95 int major, minor; in snd_sbdsp_probe() local
103 spin_lock_irqsave(&chip->reg_lock, flags); in snd_sbdsp_probe()
105 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_sbdsp_probe()
106 return -ENODEV; in snd_sbdsp_probe()
108 version = snd_sbdsp_version(chip); in snd_sbdsp_probe()
109 if (version < 0) { in snd_sbdsp_probe()
110 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_sbdsp_probe()
111 return -ENODEV; in snd_sbdsp_probe()
113 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_sbdsp_probe()
114 major = version >> 8; in snd_sbdsp_probe()
115 minor = version & 0xff; in snd_sbdsp_probe()
116 dev_dbg(chip->card->dev, "SB [0x%lx]: DSP chip found, version = %i.%i\n", in snd_sbdsp_probe()
117 chip->port, major, minor); in snd_sbdsp_probe()
119 switch (chip->hardware) { in snd_sbdsp_probe()
123 chip->hardware = SB_HW_10; in snd_sbdsp_probe()
127 if (minor) { in snd_sbdsp_probe()
128 chip->hardware = SB_HW_201; in snd_sbdsp_probe()
131 chip->hardware = SB_HW_20; in snd_sbdsp_probe()
136 chip->hardware = SB_HW_PRO; in snd_sbdsp_probe()
140 chip->hardware = SB_HW_16; in snd_sbdsp_probe()
144 dev_info(chip->card->dev, "SB [0x%lx]: unknown DSP chip version %i.%i\n", in snd_sbdsp_probe()
145 chip->port, major, minor); in snd_sbdsp_probe()
146 return -ENODEV; in snd_sbdsp_probe()
150 str = "16 (ALS-100)"; in snd_sbdsp_probe()
153 str = "16 (ALS-4000)"; in snd_sbdsp_probe()
165 return -ENODEV; in snd_sbdsp_probe()
167 sprintf(chip->name, "Sound Blaster %s", str); in snd_sbdsp_probe()
168 chip->version = (major << 8) | minor; in snd_sbdsp_probe()
185 return -EINVAL; in snd_sbdsp_create()
187 chip = devm_kzalloc(card->dev, sizeof(*chip), GFP_KERNEL); in snd_sbdsp_create()
189 return -ENOMEM; in snd_sbdsp_create()
190 spin_lock_init(&chip->reg_lock); in snd_sbdsp_create()
191 spin_lock_init(&chip->open_lock); in snd_sbdsp_create()
192 spin_lock_init(&chip->midi_input_lock); in snd_sbdsp_create()
193 spin_lock_init(&chip->mixer_lock); in snd_sbdsp_create()
194 chip->irq = -1; in snd_sbdsp_create()
195 chip->dma8 = -1; in snd_sbdsp_create()
196 chip->dma16 = -1; in snd_sbdsp_create()
197 chip->port = port; in snd_sbdsp_create()
199 if (devm_request_irq(card->dev, irq, irq_handler, in snd_sbdsp_create()
204 dev_err(card->dev, "sb: can't grab irq %d\n", irq); in snd_sbdsp_create()
205 return -EBUSY; in snd_sbdsp_create()
207 chip->irq = irq; in snd_sbdsp_create()
208 card->sync_irq = chip->irq; in snd_sbdsp_create()
213 chip->res_port = devm_request_region(card->dev, port, 16, in snd_sbdsp_create()
215 if (!chip->res_port) { in snd_sbdsp_create()
216 dev_err(card->dev, "sb: can't grab port 0x%lx\n", port); in snd_sbdsp_create()
217 return -EBUSY; in snd_sbdsp_create()
221 if (dma8 >= 0 && snd_devm_request_dma(card->dev, dma8, in snd_sbdsp_create()
222 "SoundBlaster - 8bit")) { in snd_sbdsp_create()
223 dev_err(card->dev, "sb: can't grab DMA8 %d\n", dma8); in snd_sbdsp_create()
224 return -EBUSY; in snd_sbdsp_create()
226 chip->dma8 = dma8; in snd_sbdsp_create()
230 dma16 = -1; in snd_sbdsp_create()
231 } else if (snd_devm_request_dma(card->dev, dma16, in snd_sbdsp_create()
232 "SoundBlaster - 16bit")) { in snd_sbdsp_create()
233 dev_err(card->dev, "sb: can't grab DMA16 %d\n", dma16); in snd_sbdsp_create()
234 return -EBUSY; in snd_sbdsp_create()
237 chip->dma16 = dma16; in snd_sbdsp_create()
241 chip->card = card; in snd_sbdsp_create()
242 chip->hardware = hardware; in snd_sbdsp_create()