Changeset 679 for GPL/trunk/alsa-kernel/pci/emu10k1/io.c
- Timestamp:
- Mar 18, 2021, 8:57:36 PM (5 years ago)
- Location:
- GPL/trunk
- Files:
-
- 2 edited
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/pci/emu10k1/io.c
r598 r679 1 // SPDX-License-Identifier: GPL-2.0-or-later 1 2 /* 2 3 * Copyright (c) by Jaroslav Kysela <perex@perex.cz> … … 9 10 * TODO: 10 11 * -- 11 *12 * This program is free software; you can redistribute it and/or modify13 * it under the terms of the GNU General Public License as published by14 * the Free Software Foundation; either version 2 of the License, or15 * (at your option) any later version.16 *17 * This program is distributed in the hope that it will be useful,18 * but WITHOUT ANY WARRANTY; without even the implied warranty of19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the20 * GNU General Public License for more details.21 *22 * You should have received a copy of the GNU General Public License23 * along with this program; if not, write to the Free Software24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA25 *26 12 */ 27 13 … … 30 16 #include <sound/emu10k1.h> 31 17 #include <linux/delay.h> 18 #include <linux/export.h> 32 19 #include "p17v.h" 33 20 … … 71 58 unsigned int mask; 72 59 73 if (!emu) { 74 snd_printk(KERN_ERR "ptr_write: emu is null!\n"); 75 dump_stack(); 60 if (snd_BUG_ON(!emu)) 76 61 return; 77 }78 62 mask = emu->audigy ? A_PTR_ADDRESS_MASK : PTR_ADDRESS_MASK; 79 63 regptr = ((reg << 16) & mask) | (chn & PTR_CHANNELNUM_MASK); … … 102 86 EXPORT_SYMBOL(snd_emu10k1_ptr_write); 103 87 104 unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu, 105 unsigned int reg, 88 unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu, 89 unsigned int reg, 106 90 unsigned int chn) 107 91 { 108 92 unsigned long flags; 109 93 unsigned int regptr, val; 110 94 111 95 regptr = (reg << 16) | chn; 112 96 … … 118 102 } 119 103 120 void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu, 121 unsigned int reg, 122 unsigned int chn, 104 void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu, 105 unsigned int reg, 106 unsigned int chn, 123 107 unsigned int data) 124 108 { … … 199 183 200 184 if ((reg > 0x7f) || (value > 0x1ff)) { 201 snd_printk(KERN_ERR"i2c_write: invalid values.\n");185 dev_err(emu->card->dev, "i2c_write: invalid values.\n"); 202 186 return -EINVAL; 203 187 } … … 227 211 228 212 if (timeout > 1000) { 229 snd_printk(KERN_WARNING 213 dev_warn(emu->card->dev, 230 214 "emu10k1:I2C:timeout status=0x%x\n", 231 215 status); … … 239 223 240 224 if (retry == 10) { 241 snd_printk(KERN_ERR"Writing to ADC failed!\n");242 snd_printk(KERN_ERR"status=0x%x, reg=%d, value=%d\n",225 dev_err(emu->card->dev, "Writing to ADC failed!\n"); 226 dev_err(emu->card->dev, "status=0x%x, reg=%d, value=%d\n", 243 227 status, reg, value); 244 228 /* dump_stack(); */ 245 229 err = -EINVAL; 246 230 } 247 231 248 232 spin_unlock(&emu->i2c_lock); 249 233 return err; … … 527 511 unsigned int snd_emu10k1_rate_to_pitch(unsigned int rate) 528 512 { 529 static u32 logMagTable[128] = {513 static const u32 logMagTable[128] = { 530 514 0x00000, 0x02dfc, 0x05b9e, 0x088e6, 0x0b5d6, 0x0e26f, 0x10eb3, 0x13aa2, 531 515 0x1663f, 0x1918a, 0x1bc84, 0x1e72e, 0x2118b, 0x23b9a, 0x2655d, 0x28ed5, … … 545 529 0xf4463, 0xf5c2a, 0xf73da, 0xf8b71, 0xfa2f0, 0xfba57, 0xfd1a7, 0xfe8df 546 530 }; 547 static c har logSlopeTable[128] = {531 static const char logSlopeTable[128] = { 548 532 0x5c, 0x5c, 0x5b, 0x5a, 0x5a, 0x59, 0x58, 0x58, 549 533 0x57, 0x56, 0x56, 0x55, 0x55, 0x54, 0x53, 0x53,
Note:
See TracChangeset
for help on using the changeset viewer.