Changeset 739


Ignore:
Timestamp:
Sep 18, 2022, 8:05:09 AM (3 years ago)
Author:
Paul Smedley
Message:

Initial commit of 5.19.9

Location:
GPL/branches/uniaud32-exp/alsa-kernel
Files:
33 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/uniaud32-exp/alsa-kernel/core/control.c

    r736 r739  
    130130                                control->vd[idx].owner = NULL;
    131131        up_write(&card->controls_rwsem);
     132        snd_fasync_free(ctl->fasync);
    132133        snd_ctl_empty_read_queue(ctl);
    133134        put_pid(ctl->pid);
     
    184185                wake_up(&ctl->change_sleep);
    185186                spin_unlock(&ctl->read_lock);
    186                 kill_fasync(&ctl->fasync, SIGIO, POLL_IN);
     187                snd_kill_fasync(ctl->fasync, SIGIO, POLL_IN);
    187188        }
    188189        read_unlock_irqrestore(&card->ctl_files_rwlock, flags);
     
    20152016
    20162017        ctl = file->private_data;
    2017         return fasync_helper(fd, file, on, &ctl->fasync);
     2018        return snd_fasync_helper(fd, file, on, &ctl->fasync);
    20182019}
    20192020
     
    21832184        list_for_each_entry(ctl, &card->ctl_files, list, struct snd_ctl_file) {
    21842185                wake_up(&ctl->change_sleep);
    2185                 kill_fasync(&ctl->fasync, SIGIO, POLL_ERR);
     2186                snd_kill_fasync(ctl->fasync, SIGIO, POLL_ERR);
    21862187        }
    21872188        read_unlock_irqrestore(&card->ctl_files_rwlock, flags);
  • GPL/branches/uniaud32-exp/alsa-kernel/core/info.c

    r737 r739  
    113113        mutex_lock(&entry->access);
    114114        if (entry->c.ops->llseek) {
    115                 offset = entry->c.ops->llseek(entry,
    116                                               data->file_private_data,
    117                                               file, offset, orig);
     115                ret = entry->c.ops->llseek(entry,
     116                                           data->file_private_data,
     117                                           file, offset, orig);
    118118                goto out;
    119119        }
  • GPL/branches/uniaud32-exp/alsa-kernel/core/misc.c

    r736 r739  
    1111#include <linux/slab.h>
    1212#include <linux/ioport.h>
     13#include <linux/fs.h>
    1314#include <sound/core.h>
    1415
     
    146147EXPORT_SYMBOL(snd_pci_quirk_lookup);
    147148#endif
     149
     150/*
     151 * Deferred async signal helpers
     152 *
     153 * Below are a few helper functions to wrap the async signal handling
     154 * in the deferred work.  The main purpose is to avoid the messy deadlock
     155 * around tasklist_lock and co at the kill_fasync() invocation.
     156 * fasync_helper() and kill_fasync() are replaced with snd_fasync_helper()
     157 * and snd_kill_fasync(), respectively.  In addition, snd_fasync_free() has
     158 * to be called at releasing the relevant file object.
     159 */
     160struct snd_fasync {
     161        struct fasync_struct *fasync;
     162        int signal;
     163        int poll;
     164        int on;
     165        struct list_head list;
     166};
     167
     168static DEFINE_SPINLOCK(snd_fasync_lock);
     169static LIST_HEAD(snd_fasync_list);
     170
     171static void snd_fasync_work_fn(struct work_struct *work)
     172{
     173        struct snd_fasync *fasync;
     174
     175        spin_lock_irq(&snd_fasync_lock);
     176        while (!list_empty(&snd_fasync_list)) {
     177                fasync = list_first_entry(&snd_fasync_list, struct snd_fasync, list);
     178                list_del_init(&fasync->list);
     179                spin_unlock_irq(&snd_fasync_lock);
     180                if (fasync->on)
     181                        kill_fasync(&fasync->fasync, fasync->signal, fasync->poll);
     182                spin_lock_irq(&snd_fasync_lock);
     183        }
     184        spin_unlock_irq(&snd_fasync_lock);
     185}
     186
     187static DECLARE_WORK(snd_fasync_work, snd_fasync_work_fn);
     188
     189int snd_fasync_helper(int fd, struct file *file, int on,
     190                      struct snd_fasync **fasyncp)
     191{
     192        struct snd_fasync *fasync = NULL;
     193
     194        if (on) {
     195                fasync = kzalloc(sizeof(*fasync), GFP_KERNEL);
     196                if (!fasync)
     197                        return -ENOMEM;
     198                INIT_LIST_HEAD(&fasync->list);
     199        }
     200
     201        spin_lock_irq(&snd_fasync_lock);
     202        if (*fasyncp) {
     203                kfree(fasync);
     204                fasync = *fasyncp;
     205        } else {
     206                if (!fasync) {
     207                        spin_unlock_irq(&snd_fasync_lock);
     208                        return 0;
     209                }
     210                *fasyncp = fasync;
     211        }
     212        fasync->on = on;
     213        spin_unlock_irq(&snd_fasync_lock);
     214        return fasync_helper(fd, file, on, &fasync->fasync);
     215}
     216EXPORT_SYMBOL_GPL(snd_fasync_helper);
     217
     218void snd_kill_fasync(struct snd_fasync *fasync, int signal, int poll)
     219{
     220        unsigned long flags;
     221
     222        if (!fasync || !fasync->on)
     223                return;
     224        spin_lock_irqsave(&snd_fasync_lock, flags);
     225        fasync->signal = signal;
     226        fasync->poll = poll;
     227        list_move(&fasync->list, &snd_fasync_list);
     228        schedule_work(&snd_fasync_work);
     229        spin_unlock_irqrestore(&snd_fasync_lock, flags);
     230}
     231EXPORT_SYMBOL_GPL(snd_kill_fasync);
     232
     233void snd_fasync_free(struct snd_fasync *fasync)
     234{
     235        if (!fasync)
     236                return;
     237        fasync->on = 0;
     238        flush_work(&snd_fasync_work);
     239        kfree(fasync);
     240}
     241EXPORT_SYMBOL_GPL(snd_fasync_free);
  • GPL/branches/uniaud32-exp/alsa-kernel/core/oss/pcm_oss.c

    r738 r739  
    16861686                if (atomic_read(&substream->mmap_count))
    16871687                        goto __direct;
    1688                 err = snd_pcm_oss_make_ready(substream);
    1689                 if (err < 0)
    1690                         return err;
    16911688                atomic_inc(&runtime->oss.rw_ref);
    16921689                if (mutex_lock_interruptible(&runtime->oss.params_lock)) {
     
    16941691                        return -ERESTARTSYS;
    16951692                }
     1693                err = snd_pcm_oss_make_ready_locked(substream);
     1694                if (err < 0)
     1695                        goto unlock;
    16961696                format = snd_pcm_oss_format_from(runtime->oss.format);
    16971697                width = snd_pcm_format_physical_width(format);
  • GPL/branches/uniaud32-exp/alsa-kernel/core/pcm.c

    r711 r739  
    10131013        }
    10141014        mutex_destroy(&runtime->buffer_mutex);
     1015        snd_fasync_free(runtime->fasync);
    10151016        kfree(runtime);
    10161017        put_pid(substream->pid);
  • GPL/branches/uniaud32-exp/alsa-kernel/core/pcm_lib.c

    r737 r739  
    18591859#endif
    18601860 _end:
    1861         kill_fasync(&runtime->fasync, SIGIO, POLL_IN);
     1861        snd_kill_fasync(runtime->fasync, SIGIO, POLL_IN);
    18621862}
    18631863EXPORT_SYMBOL(snd_pcm_period_elapsed_under_stream_lock);
  • GPL/branches/uniaud32-exp/alsa-kernel/core/pcm_native.c

    r737 r739  
    40074007        if (runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED)
    40084008                return -EBADFD;
    4009         return fasync_helper(fd, file, on, &runtime->fasync);
     4009        return snd_fasync_helper(fd, file, on, &runtime->fasync);
    40104010}
    40114011
  • GPL/branches/uniaud32-exp/alsa-kernel/core/seq/oss/seq_oss_midi.c

    r697 r739  
    271271snd_seq_oss_midi_setup(struct seq_oss_devinfo *dp)
    272272{
     273        spin_lock_irq(&register_lock);
    273274        dp->max_mididev = max_midi_devs;
     275        spin_unlock_irq(&register_lock);
    274276}
    275277
  • GPL/branches/uniaud32-exp/alsa-kernel/core/seq/seq_clientmgr.c

    r697 r739  
    122122#ifdef CONFIG_MODULES
    123123        if (!in_interrupt()) {
    124                 static char client_requested[SNDRV_SEQ_GLOBAL_CLIENTS];
    125                 static char card_requested[SNDRV_CARDS];
     124                static DECLARE_BITMAP(client_requested, SNDRV_SEQ_GLOBAL_CLIENTS);
     125                static DECLARE_BITMAP(card_requested, SNDRV_CARDS);
     126
    126127                if (clientid < SNDRV_SEQ_GLOBAL_CLIENTS) {
    127128                        int idx;
    128129                       
    129                         if (!client_requested[clientid]) {
    130                                 client_requested[clientid] = 1;
     130                        if (!test_and_set_bit(clientid, client_requested)) {
    131131                                for (idx = 0; idx < 15; idx++) {
    132132                                        if (seq_client_load[idx] < 0)
     
    143143                                SNDRV_SEQ_CLIENTS_PER_CARD;
    144144                        if (card < snd_ecards_limit) {
    145                                 if (! card_requested[card]) {
    146                                         card_requested[card] = 1;
     145                                if (!test_and_set_bit(card, card_requested))
    147146                                        snd_request_card(card);
    148                                 }
    149147                                snd_seq_device_load_drivers();
    150148                        }
  • GPL/branches/uniaud32-exp/alsa-kernel/core/seq/seq_ports.c

    r694 r739  
    140140        snd_use_lock_use(&new_port->use_lock);
    141141
    142         num = port >= 0 ? port : 0;
     142        num = max(port, 0);
    143143        mutex_lock(&client->ports_mutex);
    144144        write_lock_irq(&client->ports_lock);
  • GPL/branches/uniaud32-exp/alsa-kernel/core/timer.c

    r736 r739  
    8585        struct timespec64 tstamp;               /* trigger tstamp */
    8686        wait_queue_head_t qchange_sleep;
    87         struct fasync_struct *fasync;
     87        struct snd_fasync *fasync;
    8888        struct mutex ioctl_lock;
    8989};
     
    13621362      __wake:
    13631363        spin_unlock(&tu->qlock);
    1364         kill_fasync(&tu->fasync, SIGIO, POLL_IN);
     1364        snd_kill_fasync(tu->fasync, SIGIO, POLL_IN);
    13651365        wake_up(&tu->qchange_sleep);
    13661366}
     
    14001400        snd_timer_user_append_to_tqueue(tu, &r1);
    14011401        spin_unlock_irqrestore(&tu->qlock, flags);
    1402         kill_fasync(&tu->fasync, SIGIO, POLL_IN);
     1402        snd_kill_fasync(tu->fasync, SIGIO, POLL_IN);
    14031403        wake_up(&tu->qchange_sleep);
    14041404}
     
    14701470        if (append == 0)
    14711471                return;
    1472         kill_fasync(&tu->fasync, SIGIO, POLL_IN);
     1472        snd_kill_fasync(tu->fasync, SIGIO, POLL_IN);
    14731473        wake_up(&tu->qchange_sleep);
    14741474}
     
    15381538                }
    15391539                mutex_unlock(&tu->ioctl_lock);
     1540                snd_fasync_free(tu->fasync);
    15401541                kfree(tu->queue);
    15411542                kfree(tu->tqueue);
     
    21522153
    21532154        tu = file->private_data;
    2154         return fasync_helper(fd, file, on, &tu->fasync);
     2155        return snd_fasync_helper(fd, file, on, &tu->fasync);
    21552156}
    21562157
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/control.h

    r736 r739  
    110110        wait_queue_head_t change_sleep;
    111111        spinlock_t read_lock;
    112         struct fasync_struct *fasync;
     112        struct snd_fasync *fasync;
    113113        int subscribed;                 /* read interface is activated */
    114114        struct list_head events;        /* waiting events for read */
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/core.h

    r737 r739  
    543543#endif
    544544
     545/* async signal helpers */
     546struct snd_fasync;
     547
     548int snd_fasync_helper(int fd, struct file *file, int on,
     549                      struct snd_fasync **fasyncp);
     550void snd_kill_fasync(struct snd_fasync *fasync, int signal, int poll);
     551void snd_fasync_free(struct snd_fasync *fasync);
     552
    545553#endif /* __SOUND_CORE_H */
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/hda_codec.h

    r738 r739  
    6060        unsigned int bus_probing :1;    /* during probing process */
    6161        unsigned int keep_power:1;      /* keep power up for notification */
     62        unsigned int jackpoll_in_suspend:1; /* keep jack polling during
     63                                             * runtime suspend
     64                                             */
    6265
    6366        int primary_dig_out_type;       /* primary digital out PCM type */
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/intel-dsp-config.h

    r692 r739  
    1616        SND_INTEL_DSP_DRIVER_SST,
    1717        SND_INTEL_DSP_DRIVER_SOF,
    18         SND_INTEL_DSP_DRIVER_LAST = SND_INTEL_DSP_DRIVER_SOF
     18        SND_INTEL_DSP_DRIVER_AVS,
     19        SND_INTEL_DSP_DRIVER_LAST = SND_INTEL_DSP_DRIVER_AVS
    1920};
    2021
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/intel-nhlt.h

    r737 r739  
    2525        NHLT_DEVICE_INVALID
    2626};
    27 
    28 #if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_SND_INTEL_NHLT)
    2927
    3028struct wav_fmt {
     
    127125};
    128126
     127#if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_SND_INTEL_NHLT)
     128
    129129struct nhlt_acpi_table *intel_nhlt_init(struct device *dev);
    130130
     
    143143
    144144#else
    145 
    146 struct nhlt_acpi_table;
    147145
    148146static inline struct nhlt_acpi_table *intel_nhlt_init(struct device *dev)
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/pcm.h

    r737 r739  
    400400        wait_queue_head_t sleep;        /* poll sleep */
    401401        wait_queue_head_t tsleep;       /* transfer sleep */
    402         struct fasync_struct *fasync;
     402        struct snd_fasync *fasync;
    403403        bool stop_operating;            /* sync_stop will be called */
    404404        struct mutex buffer_mutex;      /* protect for buffer changes */
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/pxa2xx-lib.h

    r710 r739  
    5353extern void pxa2xx_ac97_hw_remove(struct platform_device *dev);
    5454
     55/* modem registers, used by touchscreen driver */
     56u32 pxa2xx_ac97_read_modr(void);
     57u32 pxa2xx_ac97_read_misr(void);
     58
    5559#endif
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/soc-acpi.h

    r738 r739  
    157157 * @drv_name: machine driver name
    158158 * @fw_filename: firmware file name. Used when SOF is not enabled.
     159 * @tplg_filename: topology file name. Used when SOF is not enabled.
    159160 * @board: board name
    160161 * @machine_quirk: pointer to quirk, usually based on DMI information when
     
    175176        const char *drv_name;
    176177        const char *fw_filename;
     178        const char *tplg_filename;
    177179        const char *board;
    178180        struct snd_soc_acpi_mach * (*machine_quirk)(void *arg);
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/soc-component.h

    r738 r739  
    170170        unsigned int suspend_bias_off:1;
    171171        unsigned int use_pmdown_time:1; /* care pmdown_time at stop */
     172        /*
     173         * Indicates that the component does not care about the endianness of
     174         * PCM audio data and the core will ensure that both LE and BE variants
     175         * of each used format are present. Typically this is because the
     176         * component sits behind a bus that abstracts away the endian of the
     177         * original data, ie. one for which the transmission endian is defined
     178         * (I2S/SLIMbus/SoundWire), or the concept of endian doesn't exist (PDM,
     179         * analogue).
     180         */
    172181        unsigned int endianness:1;
    173182        unsigned int non_legacy_dai_naming:1;
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/soc-dpcm.h

    r737 r739  
    104104
    105105        int be_start; /* refcount protected by BE stream pcm lock */
     106        int be_pause; /* refcount protected by BE stream pcm lock */
     107        bool fe_pause; /* used to track STOP after PAUSE */
    106108};
    107109
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/soc.h

    r737 r739  
    177177        .private_value = SOC_DOUBLE_R_S_VALUE(reg_left, reg_right, xshift, \
    178178                                            xmin, xmax, xsign_bit, xinvert) }
     179#define SOC_SINGLE_S_TLV(xname, xreg, xshift, xmin, xmax, xsign_bit, xinvert, tlv_array) \
     180        SOC_DOUBLE_R_S_TLV(xname, xreg, xreg, xshift, xmin, xmax, xsign_bit, xinvert, tlv_array)
    179181#define SOC_SINGLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \
    180182{       .iface  = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
     
    281283        .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \
    282284                                            xmax, xinvert) }
     285#define SOC_DOUBLE_R_S_EXT_TLV(xname, reg_left, reg_right, xshift, xmin, xmax, \
     286                               xsign_bit, xinvert, xhandler_get, xhandler_put, \
     287                               tlv_array) \
     288{       .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
     289        .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
     290                  SNDRV_CTL_ELEM_ACCESS_READWRITE, \
     291        .tlv.p = (tlv_array), \
     292        .info = snd_soc_info_volsw, \
     293        .get = xhandler_get, .put = xhandler_put, \
     294        .private_value = SOC_DOUBLE_R_S_VALUE(reg_left, reg_right, xshift, \
     295                                              xmin, xmax, xsign_bit, xinvert) }
     296#define SOC_SINGLE_S_EXT_TLV(xname, xreg, xshift, xmin, xmax, \
     297                             xsign_bit, xinvert, xhandler_get, xhandler_put, \
     298                             tlv_array) \
     299        SOC_DOUBLE_R_S_EXT_TLV(xname, xreg, xreg, xshift, xmin, xmax, \
     300                               xsign_bit, xinvert, xhandler_get, xhandler_put, \
     301                               tlv_array)
    283302#define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \
    284303{       .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
     
    390409struct snd_soc_jack_gpio;
    391410
    392 typedef int (*hw_write_t)(void *,const char* ,int);
    393 
    394411enum snd_soc_pcm_subclass {
    395412        SND_SOC_PCM_CLASS_PCM   = 0,
     
    486503int snd_soc_calc_bclk(int fs, int sample_size, int channels, int tdm_slots);
    487504int snd_soc_params_to_bclk(struct snd_pcm_hw_params *parms);
     505int snd_soc_tdm_params_to_bclk(struct snd_pcm_hw_params *params,
     506                               int tdm_width, int tdm_slots, int slot_multiple);
    488507
    489508/* set runtime hw params */
     
    12391258int snd_soc_of_parse_aux_devs(struct snd_soc_card *card, const char *propname);
    12401259
    1241 unsigned int snd_soc_daifmt_clock_provider_fliped(unsigned int dai_fmt);
     1260unsigned int snd_soc_daifmt_clock_provider_flipped(unsigned int dai_fmt);
    12421261unsigned int snd_soc_daifmt_clock_provider_from_bitmap(unsigned int bit_frame);
    12431262
     
    12641283                                   struct snd_soc_dai_link *dai_link);
    12651284void snd_soc_of_put_dai_link_codecs(struct snd_soc_dai_link *dai_link);
     1285int snd_soc_of_get_dai_link_cpus(struct device *dev,
     1286                                 struct device_node *of_node,
     1287                                 struct snd_soc_dai_link *dai_link);
     1288void snd_soc_of_put_dai_link_cpus(struct snd_soc_dai_link *dai_link);
    12661289
    12671290int snd_soc_add_pcm_runtime(struct snd_soc_card *card,
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/sof.h

    r738 r739  
    1717
    1818struct snd_sof_dsp_ops;
     19struct snd_sof_dev;
    1920
    2021/**
     
    4647        SOF_DSP_PM_D2,
    4748        SOF_DSP_PM_D3,
     49};
     50
     51/* Definitions for multiple IPCs */
     52enum sof_ipc_type {
     53        SOF_IPC,
     54        SOF_INTEL_IPC4,
     55        SOF_IPC_TYPE_COUNT
    4856};
    4957
     
    8492
    8593        void *hw_pdata;
     94
     95        enum sof_ipc_type ipc_type;
    8696};
    8797
     
    116126        const char *nocodec_tplg_filename;
    117127
     128        /* information on supported IPCs */
     129        unsigned int ipc_supported_mask;
     130        enum sof_ipc_type ipc_default;
     131
    118132        /* defaults paths for firmware and topology files */
    119         const char *default_fw_path;
    120         const char *default_tplg_path;
     133        const char *default_fw_path[SOF_IPC_TYPE_COUNT];
     134        const char *default_tplg_path[SOF_IPC_TYPE_COUNT];
    121135
    122136        /* default firmware name */
    123         const char *default_fw_filename;
     137        const char *default_fw_filename[SOF_IPC_TYPE_COUNT];
    124138
    125         const struct snd_sof_dsp_ops *ops;
     139        struct snd_sof_dsp_ops *ops;
     140        int (*ops_init)(struct snd_sof_dev *sdev);
    126141};
    127142
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/version.h

    r738 r739  
    11/* include/version.h */
    2 #define CONFIG_SND_VERSION "5.18.19"
     2#define CONFIG_SND_VERSION "5.19.9"
    33#define CONFIG_SND_DATE ""
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/cs5535audio/cs5535audio_pcm.c

    r697 r739  
    130130
    131131        /* the u32 cast is okay because in snd*create we successfully told
    132            pci alloc that we're only 32 bit capable so the uppper will be 0 */
     132           pci alloc that we're only 32 bit capable so the upper will be 0 */
    133133        addr = (u32) substream->runtime->dma_addr;
    134134        desc_addr = (u32) dma->desc_buf.addr;
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/emu10k1/emu10k1_main.c

    r710 r739  
    17611761        emu->iommu_workaround = false;
    17621762
    1763         if (!iommu_present(emu->card->dev->bus))
    1764                 return;
    1765 
    17661763        domain = iommu_get_domain_for_dev(emu->card->dev);
    1767         if (domain && domain->type == IOMMU_DOMAIN_IDENTITY)
     1764        if (!domain || domain->type == IOMMU_DOMAIN_IDENTITY)
    17681765                return;
    17691766
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/emu10k1/emupcm.c

    r697 r739  
    125125        if (voices > 1) {
    126126                for (i = 1; i < voices; i++) {
    127                         epcm->voices[i] = &epcm->emu->voices[epcm->voices[0]->number + i];
     127                        epcm->voices[i] = &epcm->emu->voices[(epcm->voices[0]->number + i) % NUM_G];
    128128                        epcm->voices[i]->epcm = epcm;
    129129                }
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_codec.c

    r738 r739  
    29542954
    29552955        cancel_delayed_work_sync(&codec->jackpoll_work);
     2956
    29562957        state = hda_call_codec_suspend(codec);
    29572958        if (codec->link_down_at_suspend ||
     
    29602961                snd_hdac_codec_link_down(&codec->core);
    29612962        snd_hda_codec_display_power(codec, false);
     2963
     2964        if (codec->bus->jackpoll_in_suspend /*&&
     2965                (dev->power.power_state.event != PM_EVENT_SUSPEND)*/)
     2966                schedule_delayed_work(&codec->jackpoll_work,
     2967                                        codec->jackpoll_interval);
    29622968        return 0;
    29632969}
     
    29832989static int hda_codec_pm_prepare(struct device *dev)
    29842990{
     2991        struct hda_codec *codec = dev_to_hda_codec(dev);
     2992
     2993        cancel_delayed_work_sync(&codec->jackpoll_work);
    29852994        dev->power.power_state = PMSG_SUSPEND;
    29862995        return pm_runtime_suspended(dev);
     
    30163025static int hda_codec_pm_freeze(struct device *dev)
    30173026{
     3027        struct hda_codec *codec = dev_to_hda_codec(dev);
     3028
     3029        cancel_delayed_work_sync(&codec->jackpoll_work);
    30183030        dev->power.power_state = PMSG_FREEZE;
    30193031        return pm_runtime_force_suspend(dev);
     
    30583070                return;
    30593071
     3072        cancel_delayed_work_sync(&codec->jackpoll_work);
    30603073        list_for_each_entry(cpcm, &codec->pcm_list_head, list, struct hda_pcm)
    30613074                snd_pcm_suspend_all(cpcm->pcm);
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_intel.c

    r738 r739  
    18511851        /* use the non-cached pages in non-snoop mode */
    18521852        if (!azx_snoop(chip))
    1853                 azx_bus(chip)->dma_type = SNDRV_DMA_TYPE_DEV_WC;
     1853                azx_bus(chip)->dma_type = SNDRV_DMA_TYPE_DEV_WC_SG;
    18541854
    18551855        if (chip->driver_type == AZX_DRIVER_NVIDIA) {
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/patch_conexant.c

    r738 r739  
    11851185static const struct hda_device_id snd_hda_id_conexant[] = {
    11861186        HDA_CODEC_ENTRY(0x14f11f86, "CX8070", patch_conexant_auto),
     1187        HDA_CODEC_ENTRY(0x14f11f87, "SN6140", patch_conexant_auto),
    11871188        HDA_CODEC_ENTRY(0x14f12008, "CX8200", patch_conexant_auto),
    11881189        HDA_CODEC_ENTRY(0x14f120d0, "CX11970", patch_conexant_auto),
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/patch_realtek.c

    r738 r739  
    53775377        alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
    53785378        alc236_fixup_hp_micmute_led_vref(codec, fix, action);
     5379}
     5380
     5381static inline void alc298_samsung_write_coef_pack(struct hda_codec *codec,
     5382                                                  const unsigned short coefs[2])
     5383{
     5384        alc_write_coef_idx(codec, 0x23, coefs[0]);
     5385        alc_write_coef_idx(codec, 0x25, coefs[1]);
     5386        alc_write_coef_idx(codec, 0x26, 0xb011);
     5387}
     5388
     5389struct alc298_samsung_amp_desc {
     5390        unsigned char nid;
     5391        unsigned short init_seq[2][2];
     5392};
     5393
     5394static void alc298_fixup_samsung_amp(struct hda_codec *codec,
     5395                                     const struct hda_fixup *fix, int action)
     5396{
     5397        int i, j;
     5398        static const unsigned short init_seq[][2] = {
     5399                { 0x19, 0x00 }, { 0x20, 0xc0 }, { 0x22, 0x44 }, { 0x23, 0x08 },
     5400                { 0x24, 0x85 }, { 0x25, 0x41 }, { 0x35, 0x40 }, { 0x36, 0x01 },
     5401                { 0x38, 0x81 }, { 0x3a, 0x03 }, { 0x3b, 0x81 }, { 0x40, 0x3e },
     5402                { 0x41, 0x07 }, { 0x400, 0x1 }
     5403        };
     5404        static const struct alc298_samsung_amp_desc amps[] = {
     5405                { 0x3a, { { 0x18, 0x1 }, { 0x26, 0x0 } } },
     5406                { 0x39, { { 0x18, 0x2 }, { 0x26, 0x1 } } }
     5407        };
     5408
     5409        if (action != HDA_FIXUP_ACT_INIT)
     5410                return;
     5411
     5412        for (i = 0; i < ARRAY_SIZE(amps); i++) {
     5413                alc_write_coef_idx(codec, 0x22, amps[i].nid);
     5414
     5415                for (j = 0; j < ARRAY_SIZE(amps[i].init_seq); j++)
     5416                        alc298_samsung_write_coef_pack(codec, amps[i].init_seq[j]);
     5417
     5418                for (j = 0; j < ARRAY_SIZE(init_seq); j++)
     5419                        alc298_samsung_write_coef_pack(codec, init_seq[j]);
     5420        }
    53795421}
    53805422
     
    73087350}
    73097351
    7310 static int find_comp_by_dev_name(struct alc_spec *spec, const char *name)
    7311 {
    7312         int i;
    7313 
    7314         for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
    7315                 if (strcmp(spec->comps[i].name, name) == 0)
    7316                         return i;
    7317         }
    7318 
    7319         return -ENODEV;
    7320 }
    7321 
    73227352static int comp_bind(struct device *dev)
    73237353{
     
    73947424}
    73957425
    7396 static void alc287_legion_16achg6_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc,
    7397                                                 struct snd_pcm_substream *sub, int action)
    7398 {
    7399         struct alc_spec *spec = cdc->spec;
    7400         unsigned int rx_slot;
    7401         int i;
    7402 
    7403         switch (action) {
    7404         case HDA_GEN_PCM_ACT_PREPARE:
    7405                 rx_slot = 0;
    7406                 i = find_comp_by_dev_name(spec, "i2c-CLSA0100:00-cs35l41-hda.0");
    7407                 if (i >= 0)
    7408                         spec->comps[i].set_channel_map(spec->comps[i].dev, 0, NULL, 1, &rx_slot);
    7409 
    7410                 rx_slot = 1;
    7411                 i = find_comp_by_dev_name(spec, "i2c-CLSA0100:00-cs35l41-hda.1");
    7412                 if (i >= 0)
    7413                         spec->comps[i].set_channel_map(spec->comps[i].dev, 0, NULL, 1, &rx_slot);
    7414                 break;
    7415         }
    7416 
    7417         comp_generic_playback_hook(hinfo, cdc, sub, action);
    7418 }
    7419 
    74207426static void alc287_fixup_legion_16achg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
    74217427                                                 int action)
    74227428{
    7423         struct device *dev = hda_codec_dev(cdc);
    7424         struct alc_spec *spec = cdc->spec;
    7425         int ret;
    7426 
    7427         switch (action) {
    7428         case HDA_FIXUP_ACT_PRE_PROBE:
    7429                 component_match_add(dev, &spec->match, component_compare_dev_name,
    7430                                     "i2c-CLSA0100:00-cs35l41-hda.0");
    7431                 component_match_add(dev, &spec->match, component_compare_dev_name,
    7432                                     "i2c-CLSA0100:00-cs35l41-hda.1");
    7433                 ret = component_master_add_with_match(dev, &comp_master_ops, spec->match);
    7434                 if (ret)
    7435                         codec_err(cdc, "Fail to register component aggregator %d\n", ret);
    7436                 else
    7437                         spec->gen.pcm_playback_hook = alc287_legion_16achg6_playback_hook;
    7438                 break;
    7439         }
     7429        cs35l41_generic_fixup(cdc, action, "i2c", "CLSA0100", 2);
    74407430}
    74417431
     
    77547744        ALC236_FIXUP_HP_MUTE_LED,
    77557745        ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
     7746        ALC298_FIXUP_SAMSUNG_AMP,
    77567747        ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
    77577748        ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
     
    94419432                .type = HDA_FIXUP_FUNC,
    94429433                .v.func = alc236_fixup_hp_mute_led_micmute_vref,
     9434        },
     9435        [ALC298_FIXUP_SAMSUNG_AMP] = {
     9436                .type = HDA_FIXUP_FUNC,
     9437                .v.func = alc298_fixup_samsung_amp,
     9438                .chained = true,
     9439                .chain_id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
    94439440        },
    94449441#ifdef TARGET_OS2xxx
     
    1031110308        SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED),
    1031210309        SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED),
     10310        SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     10311        SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
    1031310312        SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
    1031410313        SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
     
    1032310322        SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
    1032410323        SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
     10324        SND_PCI_QUIRK(0x1043, 0x12af, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
    1032510325        SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
    1032610326        SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
     
    1034310343        SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
    1034410344        SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
     10345        SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
    1034510346        SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
    1034610347        SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
     
    1038010381        SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
    1038110382        SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
    10382         SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
    10383         SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
    10384         SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
    10385         SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
     10383        SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
     10384        SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
     10385        SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
     10386        SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
    1038610387        SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
    10387         SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
    10388         SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
     10388        SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP),
     10389        SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
    1038910390        SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
    1039010391        SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
     
    1042910430        SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1043010431        SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     10432        SND_PCI_QUIRK(0x1558, 0x7717, "Clevo NS70PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1043110433        SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1043210434        SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     
    1075110753        {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
    1075210754        {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
    10753         {.id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc298-samsung-headphone"},
     10755        {.id = ALC298_FIXUP_SAMSUNG_AMP, .name = "alc298-samsung-amp"},
    1075410756        {.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"},
    1075510757        {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/patch_via.c

    r738 r739  
    458458                snd_hda_codec_set_pincfg(codec, nid, def_conf);
    459459        }
    460 
    461         return;
    462460}
    463461
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/rme9652/hdsp.c

    r737 r739  
    33153315                /* RPM Bypass, Disconnect and Input switches */
    33163316                for (idx = 0; idx < ARRAY_SIZE(snd_hdsp_rpm_controls); idx++) {
    3317                         err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_hdsp_rpm_controls[idx], hdsp));
     3317                        err = snd_ctl_add(card, snd_ctl_new1(&snd_hdsp_rpm_controls[idx], hdsp));
    33183318                        if (err < 0)
    33193319                                return err;
Note: See TracChangeset for help on using the changeset viewer.