Ignore:
Timestamp:
Mar 18, 2021, 8:57:36 PM (5 years ago)
Author:
David Azarewicz
Message:

Merge changes from Paul's uniaud32next branch.

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/pci/emu10k1/io.c

    r598 r679  
     1// SPDX-License-Identifier: GPL-2.0-or-later
    12/*
    23 *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
     
    910 *  TODO:
    1011 *    --
    11  *
    12  *   This program is free software; you can redistribute it and/or modify
    13  *   it under the terms of the GNU General Public License as published by
    14  *   the Free Software Foundation; either version 2 of the License, or
    15  *   (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 of
    19  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    20  *   GNU General Public License for more details.
    21  *
    22  *   You should have received a copy of the GNU General Public License
    23  *   along with this program; if not, write to the Free Software
    24  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
    25  *
    2612 */
    2713
     
    3016#include <sound/emu10k1.h>
    3117#include <linux/delay.h>
     18#include <linux/export.h>
    3219#include "p17v.h"
    3320
     
    7158        unsigned int mask;
    7259
    73         if (!emu) {
    74                 snd_printk(KERN_ERR "ptr_write: emu is null!\n");
    75                 dump_stack();
     60        if (snd_BUG_ON(!emu))
    7661                return;
    77         }
    7862        mask = emu->audigy ? A_PTR_ADDRESS_MASK : PTR_ADDRESS_MASK;
    7963        regptr = ((reg << 16) & mask) | (chn & PTR_CHANNELNUM_MASK);
     
    10286EXPORT_SYMBOL(snd_emu10k1_ptr_write);
    10387
    104 unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu,
    105                                           unsigned int reg,
     88unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu, 
     89                                          unsigned int reg, 
    10690                                          unsigned int chn)
    10791{
    10892        unsigned long flags;
    10993        unsigned int regptr, val;
    110 
     94 
    11195        regptr = (reg << 16) | chn;
    11296
     
    118102}
    119103
    120 void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu,
    121                                    unsigned int reg,
    122                                    unsigned int chn,
     104void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu, 
     105                                   unsigned int reg, 
     106                                   unsigned int chn, 
    123107                                   unsigned int data)
    124108{
     
    199183
    200184        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");
    202186                return -EINVAL;
    203187        }
     
    227211
    228212                        if (timeout > 1000) {
    229                                 snd_printk(KERN_WARNING
     213                                dev_warn(emu->card->dev,
    230214                                           "emu10k1:I2C:timeout status=0x%x\n",
    231215                                           status);
     
    239223
    240224        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",
    243227                        status, reg, value);
    244228                /* dump_stack(); */
    245229                err = -EINVAL;
    246230        }
    247 
     231   
    248232        spin_unlock(&emu->i2c_lock);
    249233        return err;
     
    527511unsigned int snd_emu10k1_rate_to_pitch(unsigned int rate)
    528512{
    529         static u32 logMagTable[128] = {
     513        static const u32 logMagTable[128] = {
    530514                0x00000, 0x02dfc, 0x05b9e, 0x088e6, 0x0b5d6, 0x0e26f, 0x10eb3, 0x13aa2,
    531515                0x1663f, 0x1918a, 0x1bc84, 0x1e72e, 0x2118b, 0x23b9a, 0x2655d, 0x28ed5,
     
    545529                0xf4463, 0xf5c2a, 0xf73da, 0xf8b71, 0xfa2f0, 0xfba57, 0xfd1a7, 0xfe8df
    546530        };
    547         static char logSlopeTable[128] = {
     531        static const char logSlopeTable[128] = {
    548532                0x5c, 0x5c, 0x5b, 0x5a, 0x5a, 0x59, 0x58, 0x58,
    549533                0x57, 0x56, 0x56, 0x55, 0x55, 0x54, 0x53, 0x53,
Note: See TracChangeset for help on using the changeset viewer.