Changeset 756


Ignore:
Timestamp:
Dec 17, 2022, 8:47:17 AM (3 years ago)
Author:
Paul Smedley
Message:

Update source to linux 6.1

Location:
GPL/branches/uniaud32-exp
Files:
1 added
41 edited

Legend:

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

    r750 r756  
    1313#include <linux/mm.h>
    1414#include <linux/dma-mapping.h>
     15#ifndef TARGET_OS2
     16#include <linux/dma-map-ops.h>
     17#endif
    1518#include <linux/genalloc.h>
    1619#include <linux/highmem.h>
  • GPL/branches/uniaud32-exp/alsa-kernel/core/memalloc_local.h

    r736 r756  
    1414};
    1515
    16 #ifdef CONFIG_SND_DMA_SGBUF
    17 extern const struct snd_malloc_ops snd_dma_sg_ops;
    18 #endif
    19 
    2016#endif /* __MEMALLOC_LOCAL_H */
  • GPL/branches/uniaud32-exp/alsa-kernel/core/oss/pcm_oss.c

    r739 r756  
    12511251        int ret;
    12521252        while (1) {
    1253                 if (runtime->status->state == SNDRV_PCM_STATE_XRUN ||
    1254                     runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) {
     1253                if (runtime->state == SNDRV_PCM_STATE_XRUN ||
     1254                    runtime->state == SNDRV_PCM_STATE_SUSPENDED) {
    12551255#ifdef OSS_DEBUG
    12561256                        pcm_dbg(substream->pcm,
    12571257                                "pcm_oss: write: recovering from %s\n",
    1258                                 runtime->status->state == SNDRV_PCM_STATE_XRUN ?
     1258                                runtime->state == SNDRV_PCM_STATE_XRUN ?
    12591259                                "XRUN" : "SUSPEND");
    12601260#endif
     
    12711271                /* test, if we can't store new data, because the stream */
    12721272                /* has not been started */
    1273                 if (runtime->status->state == SNDRV_PCM_STATE_PREPARED)
     1273                if (runtime->state == SNDRV_PCM_STATE_PREPARED)
    12741274                        return -EAGAIN;
    12751275        }
     
    12831283        int ret;
    12841284        while (1) {
    1285                 if (runtime->status->state == SNDRV_PCM_STATE_XRUN ||
    1286                     runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) {
     1285                if (runtime->state == SNDRV_PCM_STATE_XRUN ||
     1286                    runtime->state == SNDRV_PCM_STATE_SUSPENDED) {
    12871287#ifdef OSS_DEBUG
    12881288                        pcm_dbg(substream->pcm,
    12891289                                "pcm_oss: read: recovering from %s\n",
    1290                                 runtime->status->state == SNDRV_PCM_STATE_XRUN ?
     1290                                runtime->state == SNDRV_PCM_STATE_XRUN ?
    12911291                                "XRUN" : "SUSPEND");
    12921292#endif
     
    12941294                        if (ret < 0)
    12951295                                break;
    1296                 } else if (runtime->status->state == SNDRV_PCM_STATE_SETUP) {
     1296                } else if (runtime->state == SNDRV_PCM_STATE_SETUP) {
    12971297                        ret = snd_pcm_oss_prepare(substream);
    12981298                        if (ret < 0)
     
    13071307                mutex_lock(&runtime->oss.params_lock);
    13081308                if (ret == -EPIPE) {
    1309                         if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) {
     1309                        if (runtime->state == SNDRV_PCM_STATE_DRAINING) {
    13101310                                ret = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL);
    13111311                                if (ret < 0)
     
    13261326        int ret;
    13271327        while (1) {
    1328                 if (runtime->status->state == SNDRV_PCM_STATE_XRUN ||
    1329                     runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) {
     1328                if (runtime->state == SNDRV_PCM_STATE_XRUN ||
     1329                    runtime->state == SNDRV_PCM_STATE_SUSPENDED) {
    13301330#ifdef OSS_DEBUG
    13311331                        pcm_dbg(substream->pcm,
    13321332                                "pcm_oss: writev: recovering from %s\n",
    1333                                 runtime->status->state == SNDRV_PCM_STATE_XRUN ?
     1333                                runtime->state == SNDRV_PCM_STATE_XRUN ?
    13341334                                "XRUN" : "SUSPEND");
    13351335#endif
     
    13441344                /* test, if we can't store new data, because the stream */
    13451345                /* has not been started */
    1346                 if (runtime->status->state == SNDRV_PCM_STATE_PREPARED)
     1346                if (runtime->state == SNDRV_PCM_STATE_PREPARED)
    13471347                        return -EAGAIN;
    13481348        }
     
    13551355        int ret;
    13561356        while (1) {
    1357                 if (runtime->status->state == SNDRV_PCM_STATE_XRUN ||
    1358                     runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) {
     1357                if (runtime->state == SNDRV_PCM_STATE_XRUN ||
     1358                    runtime->state == SNDRV_PCM_STATE_SUSPENDED) {
    13591359#ifdef OSS_DEBUG
    13601360                        pcm_dbg(substream->pcm,
    13611361                                "pcm_oss: readv: recovering from %s\n",
    1362                                 runtime->status->state == SNDRV_PCM_STATE_XRUN ?
     1362                                runtime->state == SNDRV_PCM_STATE_XRUN ?
    13631363                                "XRUN" : "SUSPEND");
    13641364#endif
     
    13661366                        if (ret < 0)
    13671367                                break;
    1368                 } else if (runtime->status->state == SNDRV_PCM_STATE_SETUP) {
     1368                } else if (runtime->state == SNDRV_PCM_STATE_SETUP) {
    13691369                        ret = snd_pcm_oss_prepare(substream);
    13701370                        if (ret < 0)
     
    16491649                set_current_state(TASK_INTERRUPTIBLE);
    16501650                snd_pcm_stream_lock_irq(substream);
    1651                 state = runtime->status->state;
     1651                state = runtime->state;
    16521652                snd_pcm_stream_unlock_irq(substream);
    16531653                if (state != SNDRV_PCM_STATE_RUNNING) {
     
    28682868                poll_wait(file, &runtime->sleep, wait);
    28692869                snd_pcm_stream_lock_irq(psubstream);
    2870                 if (runtime->status->state != SNDRV_PCM_STATE_DRAINING &&
    2871                     (runtime->status->state != SNDRV_PCM_STATE_RUNNING ||
     2870                if (runtime->state != SNDRV_PCM_STATE_DRAINING &&
     2871                    (runtime->state != SNDRV_PCM_STATE_RUNNING ||
    28722872                     snd_pcm_oss_playback_ready(psubstream)))
    28732873                        mask |= EPOLLOUT | EPOLLWRNORM;
     
    28792879                poll_wait(file, &runtime->sleep, wait);
    28802880                snd_pcm_stream_lock_irq(csubstream);
    2881                 ostate = runtime->status->state;
     2881                ostate = runtime->state;
    28822882                if (ostate != SNDRV_PCM_STATE_RUNNING ||
    28832883                    snd_pcm_oss_capture_ready(csubstream))
  • GPL/branches/uniaud32-exp/alsa-kernel/core/pcm.c

    r750 r756  
    391391                goto unlock;
    392392        }
    393         if (runtime->status->state == SNDRV_PCM_STATE_OPEN) {
     393        if (runtime->state == SNDRV_PCM_STATE_OPEN) {
    394394                snd_iprintf(buffer, "no setup\n");
    395395                goto unlock;
     
    428428                goto unlock;
    429429        }
    430         if (runtime->status->state == SNDRV_PCM_STATE_OPEN) {
     430        if (runtime->state == SNDRV_PCM_STATE_OPEN) {
    431431                snd_iprintf(buffer, "no setup\n");
    432432                goto unlock;
     
    978978        init_waitqueue_head(&runtime->tsleep);
    979979
    980         runtime->status->state = SNDRV_PCM_STATE_OPEN;
     980        __snd_pcm_set_state(runtime, SNDRV_PCM_STATE_OPEN);
    981981        mutex_init(&runtime->buffer_mutex);
    982982        atomic_set(&runtime->buffer_accessing, 0);
     
    11221122                                snd_pcm_stop(substream, SNDRV_PCM_STATE_DISCONNECTED);
    11231123                        /* to be sure, set the state unconditionally */
    1124                         substream->runtime->status->state = SNDRV_PCM_STATE_DISCONNECTED;
     1124                        __snd_pcm_set_state(substream->runtime,
     1125                                            SNDRV_PCM_STATE_DISCONNECTED);
    11251126                        wake_up(&substream->runtime->sleep);
    11261127                        wake_up(&substream->runtime->tsleep);
  • GPL/branches/uniaud32-exp/alsa-kernel/core/pcm_lib.c

    r739 r756  
    212212        if (avail > runtime->avail_max)
    213213                runtime->avail_max = avail;
    214         if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) {
     214        if (runtime->state == SNDRV_PCM_STATE_DRAINING) {
    215215                if (avail >= runtime->buffer_size) {
    216216                        snd_pcm_drain_done(substream);
     
    19481948                snd_pcm_stream_lock_irq(substream);
    19491949                set_current_state(TASK_INTERRUPTIBLE);
    1950                 switch (runtime->status->state) {
     1950                switch (runtime->state) {
    19511951                case SNDRV_PCM_STATE_SUSPENDED:
    19521952                        err = -ESTRPIPE;
     
    21362136        if (snd_BUG_ON(!substream->ops->copy_user && !runtime->dma_area))
    21372137                return -EINVAL;
    2138         if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
     2138        if (runtime->state == SNDRV_PCM_STATE_OPEN)
    21392139                return -EBADFD;
    21402140        return 0;
     
    21432143static int pcm_accessible_state(struct snd_pcm_runtime *runtime)
    21442144{
    2145         switch (runtime->status->state) {
     2145        switch (runtime->state) {
    21462146        case SNDRV_PCM_STATE_PREPARED:
    21472147        case SNDRV_PCM_STATE_RUNNING:
     
    22662266        runtime->twake = runtime->control->avail_min ? runtime->control->avail_min : 1;
    22672267#endif
    2268         if (runtime->status->state == SNDRV_PCM_STATE_RUNNING)
     2268        if (runtime->state == SNDRV_PCM_STATE_RUNNING)
    22692269                snd_pcm_update_hw_ptr(substream);
    22702270
     
    22742274         */
    22752275        if (!is_playback &&
    2276             runtime->status->state == SNDRV_PCM_STATE_PREPARED &&
     2276            runtime->state == SNDRV_PCM_STATE_PREPARED &&
    22772277            size >= runtime->start_threshold) {
    22782278                err = snd_pcm_start(substream);
     
    22882288                if (!avail) {
    22892289                        if (!is_playback &&
    2290                             runtime->status->state == SNDRV_PCM_STATE_DRAINING) {
     2290                            runtime->state == SNDRV_PCM_STATE_DRAINING) {
    22912291                                snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP);
    22922292                                goto _end_unlock;
     
    23612361                avail -= frames;
    23622362                if (is_playback &&
    2363                     runtime->status->state == SNDRV_PCM_STATE_PREPARED &&
     2363                    runtime->state == SNDRV_PCM_STATE_PREPARED &&
    23642364                    snd_pcm_playback_hw_avail(runtime) >= (snd_pcm_sframes_t)runtime->start_threshold) {
    23652365                        err = snd_pcm_start(substream);
  • GPL/branches/uniaud32-exp/alsa-kernel/core/pcm_native.c

    r750 r756  
    600600{
    601601        snd_pcm_stream_lock_irq(substream);
    602         if (substream->runtime->status->state != SNDRV_PCM_STATE_DISCONNECTED)
    603                 substream->runtime->status->state = state;
     602        if (substream->runtime->state != SNDRV_PCM_STATE_DISCONNECTED)
     603                __snd_pcm_set_state(substream->runtime, state);
    604604        snd_pcm_stream_unlock_irq(substream);
    605605}
     
    731731                return err;
    732732        snd_pcm_stream_lock_irq(substream);
    733         switch (runtime->status->state) {
     733        switch (runtime->state) {
    734734        case SNDRV_PCM_STATE_OPEN:
    735735        case SNDRV_PCM_STATE_SETUP:
     
    896896                return result;
    897897        snd_pcm_stream_lock_irq(substream);
    898         switch (runtime->status->state) {
     898        switch (runtime->state) {
    899899        case SNDRV_PCM_STATE_SETUP:
    900900        case SNDRV_PCM_STATE_PREPARED:
     
    927927        runtime = substream->runtime;
    928928        snd_pcm_stream_lock_irq(substream);
    929         if (runtime->status->state == SNDRV_PCM_STATE_OPEN) {
     929        if (runtime->state == SNDRV_PCM_STATE_OPEN) {
    930930                snd_pcm_stream_unlock_irq(substream);
    931931                return -EBADFD;
     
    10201020                runtime->audio_tstamp_report.valid = 1;
    10211021
    1022         status->state = runtime->status->state;
    1023         status->suspended_state = runtime->status->suspended_state;
     1022        status->state = runtime->state;
     1023        status->suspended_state = runtime->suspended_state;
    10241024        if (status->state == SNDRV_PCM_STATE_OPEN)
    10251025                goto _end;
     
    11761176        runtime = substream->runtime;
    11771177        snd_pcm_stream_lock_irq(substream);
    1178         if (runtime->status->state == SNDRV_PCM_STATE_OPEN) {
     1178        if (runtime->state == SNDRV_PCM_STATE_OPEN) {
    11791179                snd_pcm_stream_unlock_irq(substream);
    11801180                return -EBADFD;
     
    14391439{
    14401440        struct snd_pcm_runtime *runtime = substream->runtime;
    1441         if (runtime->status->state != SNDRV_PCM_STATE_PREPARED)
     1441        if (runtime->state != SNDRV_PCM_STATE_PREPARED)
    14421442                return -EBADFD;
    14431443        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
     
    14721472        runtime->hw_ptr_buffer_jiffies = (runtime->buffer_size * HZ) /
    14731473                                                            runtime->rate;
    1474         runtime->status->state = state;
     1474        __snd_pcm_set_state(runtime, state);
    14751475        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
    14761476            runtime->silence_size > 0)
     
    15131513{
    15141514        struct snd_pcm_runtime *runtime = substream->runtime;
    1515         if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
     1515        if (runtime->state == SNDRV_PCM_STATE_OPEN)
    15161516                return -EBADFD;
    15171517        runtime->trigger_master = substream;
     
    15341534{
    15351535        struct snd_pcm_runtime *runtime = substream->runtime;
    1536         if (runtime->status->state != state) {
     1536        if (runtime->state != state) {
    15371537                snd_pcm_trigger_tstamp(substream);
    1538                 runtime->status->state = state;
     1538                __snd_pcm_set_state(runtime, state);
    15391539                snd_pcm_timer_notify(substream, SNDRV_TIMER_EVENT_MSTOP);
    15401540        }
     
    16121612                return -ENOSYS;
    16131613        if (pause_pushed(state)) {
    1614                 if (runtime->status->state != SNDRV_PCM_STATE_RUNNING)
     1614                if (runtime->state != SNDRV_PCM_STATE_RUNNING)
    16151615                        return -EBADFD;
    1616         } else if (runtime->status->state != SNDRV_PCM_STATE_PAUSED)
     1616        } else if (runtime->state != SNDRV_PCM_STATE_PAUSED)
    16171617                return -EBADFD;
    16181618        runtime->trigger_master = substream;
     
    16561656        snd_pcm_trigger_tstamp(substream);
    16571657        if (pause_pushed(state)) {
    1658                 runtime->status->state = SNDRV_PCM_STATE_PAUSED;
     1658                __snd_pcm_set_state(runtime, SNDRV_PCM_STATE_PAUSED);
    16591659                snd_pcm_timer_notify(substream, SNDRV_TIMER_EVENT_MPAUSE);
    16601660                wake_up(&runtime->sleep);
    16611661                wake_up(&runtime->tsleep);
    16621662        } else {
    1663                 runtime->status->state = SNDRV_PCM_STATE_RUNNING;
     1663                __snd_pcm_set_state(runtime, SNDRV_PCM_STATE_RUNNING);
    16641664                snd_pcm_timer_notify(substream, SNDRV_TIMER_EVENT_MCONTINUE);
    16651665        }
     
    16961696{
    16971697        struct snd_pcm_runtime *runtime = substream->runtime;
    1698         switch (runtime->status->state) {
     1698        switch (runtime->state) {
    16991699        case SNDRV_PCM_STATE_SUSPENDED:
    17001700                return -EBUSY;
     
    17271727        struct snd_pcm_runtime *runtime = substream->runtime;
    17281728        snd_pcm_trigger_tstamp(substream);
    1729         runtime->status->suspended_state = runtime->status->state;
    1730         runtime->status->state = SNDRV_PCM_STATE_SUSPENDED;
     1729        runtime->suspended_state = runtime->state;
     1730        runtime->status->suspended_state = runtime->suspended_state;
     1731        __snd_pcm_set_state(runtime, SNDRV_PCM_STATE_SUSPENDED);
    17311732        snd_pcm_timer_notify(substream, SNDRV_TIMER_EVENT_MSUSPEND);
    17321733        wake_up(&runtime->sleep);
     
    18191820                return 0;
    18201821        /* DMA not running previously? */
    1821         if (runtime->status->suspended_state != SNDRV_PCM_STATE_RUNNING &&
    1822             (runtime->status->suspended_state != SNDRV_PCM_STATE_DRAINING ||
     1822        if (runtime->suspended_state != SNDRV_PCM_STATE_RUNNING &&
     1823            (runtime->suspended_state != SNDRV_PCM_STATE_DRAINING ||
    18231824             substream->stream != SNDRV_PCM_STREAM_PLAYBACK))
    18241825                return 0;
     
    18391840        struct snd_pcm_runtime *runtime = substream->runtime;
    18401841        snd_pcm_trigger_tstamp(substream);
    1841         runtime->status->state = runtime->status->suspended_state;
     1842        __snd_pcm_set_state(runtime, runtime->suspended_state);
    18421843        snd_pcm_timer_notify(substream, SNDRV_TIMER_EVENT_MRESUME);
    18431844}
     
    18761877
    18771878        snd_pcm_stream_lock_irq(substream);
    1878         switch (runtime->status->state) {
     1879        switch (runtime->state) {
    18791880        case SNDRV_PCM_STATE_XRUN:
    18801881                result = 0;     /* already there */
     
    18991900{
    19001901        struct snd_pcm_runtime *runtime = substream->runtime;
    1901         switch (runtime->status->state) {
     1902        switch (runtime->state) {
    19021903        case SNDRV_PCM_STATE_RUNNING:
    19031904        case SNDRV_PCM_STATE_PREPARED:
     
    19611962        int f_flags = (__force int)state;
    19621963
    1963         if (runtime->status->state == SNDRV_PCM_STATE_OPEN ||
    1964             runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED)
     1964        if (runtime->state == SNDRV_PCM_STATE_OPEN ||
     1965            runtime->state == SNDRV_PCM_STATE_DISCONNECTED)
    19651966                return -EBADFD;
    19661967        if (snd_pcm_running(substream))
     
    20132014
    20142015        snd_pcm_stream_lock_irq(substream);
    2015         switch (substream->runtime->status->state) {
     2016        switch (substream->runtime->state) {
    20162017        case SNDRV_PCM_STATE_PAUSED:
    20172018                snd_pcm_pause(substream, false);
     
    20372038{
    20382039        struct snd_pcm_runtime *runtime = substream->runtime;
    2039         switch (runtime->status->state) {
     2040        switch (runtime->state) {
    20402041        case SNDRV_PCM_STATE_OPEN:
    20412042        case SNDRV_PCM_STATE_DISCONNECTED:
     
    20522053        struct snd_pcm_runtime *runtime = substream->runtime;
    20532054        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
    2054                 switch (runtime->status->state) {
     2055                switch (runtime->state) {
    20552056                case SNDRV_PCM_STATE_PREPARED:
    20562057                        /* start playback stream if possible */
     
    20592060                                snd_pcm_post_start(substream, SNDRV_PCM_STATE_DRAINING);
    20602061                        } else {
    2061                                 runtime->status->state = SNDRV_PCM_STATE_SETUP;
     2062                                __snd_pcm_set_state(runtime, SNDRV_PCM_STATE_SETUP);
    20622063                        }
    20632064                        break;
    20642065                case SNDRV_PCM_STATE_RUNNING:
    2065                         runtime->status->state = SNDRV_PCM_STATE_DRAINING;
     2066                        __snd_pcm_set_state(runtime, SNDRV_PCM_STATE_DRAINING);
    20662067                        break;
    20672068                case SNDRV_PCM_STATE_XRUN:
    2068                         runtime->status->state = SNDRV_PCM_STATE_SETUP;
     2069                        __snd_pcm_set_state(runtime, SNDRV_PCM_STATE_SETUP);
    20692070                        break;
    20702071                default:
     
    20732074        } else {
    20742075                /* stop running stream */
    2075                 if (runtime->status->state == SNDRV_PCM_STATE_RUNNING) {
     2076                if (runtime->state == SNDRV_PCM_STATE_RUNNING) {
    20762077                        snd_pcm_state_t new_state;
    20772078
     
    20832084        }
    20842085
    2085         if (runtime->status->state == SNDRV_PCM_STATE_DRAINING &&
     2086        if (runtime->state == SNDRV_PCM_STATE_DRAINING &&
    20862087            runtime->trigger_master == substream &&
    20872088            (runtime->hw.info & SNDRV_PCM_INFO_DRAIN_TRIGGER))
     
    21242125        runtime = substream->runtime;
    21252126
    2126         if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
     2127        if (runtime->state == SNDRV_PCM_STATE_OPEN)
    21272128                return -EBADFD;
    21282129
     
    21352136        snd_pcm_stream_lock_irq(substream);
    21362137        /* resume pause */
    2137         if (runtime->status->state == SNDRV_PCM_STATE_PAUSED)
     2138        if (runtime->state == SNDRV_PCM_STATE_PAUSED)
    21382139                snd_pcm_pause(substream, false);
    21392140
     
    21632164                                continue;
    21642165                        runtime = s->runtime;
    2165                         if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) {
     2166                        if (runtime->state == SNDRV_PCM_STATE_DRAINING) {
    21662167                                to_check = runtime;
    21672168                                break;
     
    22022203                }
    22032204                if (tout == 0) {
    2204                         if (substream->runtime->status->state == SNDRV_PCM_STATE_SUSPENDED)
     2205                        if (substream->runtime->state == SNDRV_PCM_STATE_SUSPENDED)
    22052206                                result = -ESTRPIPE;
    22062207                        else {
     
    22342235        runtime = substream->runtime;
    22352236
    2236         if (runtime->status->state == SNDRV_PCM_STATE_OPEN ||
    2237             runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED)
     2237        if (runtime->state == SNDRV_PCM_STATE_OPEN ||
     2238            runtime->state == SNDRV_PCM_STATE_DISCONNECTED)
    22382239                return -EBADFD;
    22392240
    22402241        snd_pcm_stream_lock_irq(substream);
    22412242        /* resume pause */
    2242         if (runtime->status->state == SNDRV_PCM_STATE_PAUSED)
     2243        if (runtime->state == SNDRV_PCM_STATE_PAUSED)
    22432244                snd_pcm_pause(substream, false);
    22442245
     
    23082309
    23092310        down_write(&snd_pcm_link_rwsem);
    2310         if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN ||
    2311             substream->runtime->status->state != substream1->runtime->status->state ||
     2311        if (substream->runtime->state == SNDRV_PCM_STATE_OPEN ||
     2312            substream->runtime->state != substream1->runtime->state ||
    23122313            substream->pcm->nonatomic != substream1->pcm->nonatomic) {
    23132314                res = -EBADFD;
     
    27382739        snd_pcm_drop(substream);
    27392740        if (substream->hw_opened) {
    2740                 if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
     2741                if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
    27412742                        do_hw_free(substream);
    27422743                substream->ops->close(substream);
     
    29422943static int do_pcm_hwsync(struct snd_pcm_substream *substream)
    29432944{
    2944         switch (substream->runtime->status->state) {
     2945        switch (substream->runtime->state) {
    29452946        case SNDRV_PCM_STATE_DRAINING:
    29462947                if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
     
    32583259        snd_pcm_sframes_t result;
    32593260
    3260         if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
     3261        if (runtime->state == SNDRV_PCM_STATE_OPEN)
    32613262                return -EBADFD;
    32623263        if (put_user(0, &_xferi->result))
     
    32813282        snd_pcm_sframes_t result;
    32823283
    3283         if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
     3284        if (runtime->state == SNDRV_PCM_STATE_OPEN)
    32843285                return -EBADFD;
    32853286        if (runtime->channels > 128)
     
    33453346                return -ENXIO;
    33463347
    3347         if (substream->runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED)
     3348        if (substream->runtime->state == SNDRV_PCM_STATE_DISCONNECTED)
    33483349                return -EBADFD;
    33493350
     
    34763477        snd_pcm_sframes_t result;
    34773478       
    3478         if (substream->runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED)
     3479        if (substream->runtime->state == SNDRV_PCM_STATE_DISCONNECTED)
    34793480                return -EBADFD;
    34803481
     
    35213522                return -ENXIO;
    35223523        runtime = substream->runtime;
    3523         if (runtime->status->state == SNDRV_PCM_STATE_OPEN ||
    3524             runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED)
     3524        if (runtime->state == SNDRV_PCM_STATE_OPEN ||
     3525            runtime->state == SNDRV_PCM_STATE_DISCONNECTED)
    35253526                return -EBADFD;
    35263527        if (!frame_aligned(runtime, count))
     
    35463547                return -ENXIO;
    35473548        runtime = substream->runtime;
    3548         if (runtime->status->state == SNDRV_PCM_STATE_OPEN ||
    3549             runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED)
     3549        if (runtime->state == SNDRV_PCM_STATE_OPEN ||
     3550            runtime->state == SNDRV_PCM_STATE_DISCONNECTED)
    35503551                return -EBADFD;
    35513552        if (!frame_aligned(runtime, count))
     
    35773578                return -ENXIO;
    35783579        runtime = substream->runtime;
    3579         if (runtime->status->state == SNDRV_PCM_STATE_OPEN ||
    3580             runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED)
     3580        if (runtime->state == SNDRV_PCM_STATE_OPEN ||
     3581            runtime->state == SNDRV_PCM_STATE_DISCONNECTED)
    35813582                return -EBADFD;
    35823583        if (!iter_is_iovec(to))
     
    36143615                return -ENXIO;
    36153616        runtime = substream->runtime;
    3616         if (runtime->status->state == SNDRV_PCM_STATE_OPEN ||
    3617             runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED)
     3617        if (runtime->state == SNDRV_PCM_STATE_OPEN ||
     3618            runtime->state == SNDRV_PCM_STATE_DISCONNECTED)
    36183619                return -EBADFD;
    36193620        if (!iter_is_iovec(from))
     
    36543655
    36553656        runtime = substream->runtime;
    3656         if (runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED)
     3657        if (runtime->state == SNDRV_PCM_STATE_DISCONNECTED)
    36573658                return ok | EPOLLERR;
    36583659
     
    36623663        snd_pcm_stream_lock_irq(substream);
    36633664        avail = snd_pcm_avail(substream);
    3664         switch (runtime->status->state) {
     3665        switch (runtime->state) {
    36653666        case SNDRV_PCM_STATE_RUNNING:
    36663667        case SNDRV_PCM_STATE_PREPARED:
     
    37283729        area->vm_private_data = substream;
    37293730        area->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
     3731        area->vm_flags &= ~(VM_WRITE | VM_MAYWRITE);
    37303732        return 0;
    37313733}
     
    39353937        }
    39363938        runtime = substream->runtime;
    3937         if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
     3939        if (runtime->state == SNDRV_PCM_STATE_OPEN)
    39383940                return -EBADFD;
    39393941        if (!(runtime->info & SNDRV_PCM_INFO_MMAP))
     
    39723974        if (PCM_RUNTIME_CHECK(substream))
    39733975                return -ENXIO;
    3974         if (substream->runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED)
     3976        if (substream->runtime->state == SNDRV_PCM_STATE_DISCONNECTED)
    39753977                return -EBADFD;
    39763978
     
    40114013                return -ENXIO;
    40124014        runtime = substream->runtime;
    4013         if (runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED)
     4015        if (runtime->state == SNDRV_PCM_STATE_DISCONNECTED)
    40144016                return -EBADFD;
    40154017        return snd_fasync_helper(fd, file, on, &runtime->fasync);
  • GPL/branches/uniaud32-exp/alsa-kernel/core/seq/seq_memory.c

    r697 r756  
    114114 */
    115115
    116 static int seq_copy_in_kernel(char **bufptr, const void *src, int size)
    117 {
     116static int seq_copy_in_kernel(void *ptr, void *src, int size)
     117{
     118        char **bufptr = ptr;
     119
    118120        memcpy(*bufptr, src, size);
    119121        *bufptr += size;
     
    121123}
    122124
    123 static int seq_copy_in_user(char __user **bufptr, const void *src, int size)
    124 {
     125static int seq_copy_in_user(void *ptr, void *src, int size)
     126{
     127        char __user **bufptr = ptr;
     128
    125129        if (copy_to_user(*bufptr, src, size))
    126130                return -EFAULT;
     
    152156        }
    153157        err = snd_seq_dump_var_event(event,
    154                                      in_kernel ? (snd_seq_dump_func_t)seq_copy_in_kernel :
    155                                      (snd_seq_dump_func_t)seq_copy_in_user,
     158                                     in_kernel ? seq_copy_in_kernel : seq_copy_in_user,
    156159                                     &buf);
    157160        return err < 0 ? err : newlen;
  • GPL/branches/uniaud32-exp/alsa-kernel/hda/ext/hdac_ext_bus.c

    r629 r756  
    6060}
    6161EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_exit);
    62 
    63 static void default_release(struct device *dev)
    64 {
    65         snd_hdac_ext_bus_device_exit(dev_to_hdac_dev(dev));
    66 }
    67 
    68 /**
    69  * snd_hdac_ext_bus_device_init - initialize the HDA extended codec base device
    70  * @bus: hdac bus to attach to
    71  * @addr: codec address
    72  * @hdev: hdac device to init
    73  * @type: codec type (HDAC_DEV_*) to use for this device
    74  *
    75  * Returns zero for success or a negative error code.
    76  */
    77 int snd_hdac_ext_bus_device_init(struct hdac_bus *bus, int addr,
    78                                  struct hdac_device *hdev, int type)
    79 {
    80         char name[15];
    81         int ret;
    82 
    83         hdev->bus = bus;
    84 
    85         snprintf(name, sizeof(name), "ehdaudio%dD%d", bus->idx, addr);
    86 
    87         ret  = snd_hdac_device_init(hdev, bus, name, addr);
    88         if (ret < 0) {
    89                 dev_err(bus->dev, "device init failed for hdac device\n");
    90                 return ret;
    91         }
    92         hdev->type = type;
    93         hdev->dev.release = default_release;
    94 
    95         ret = snd_hdac_device_register(hdev);
    96         if (ret) {
    97                 dev_err(bus->dev, "failed to register hdac device\n");
    98                 snd_hdac_ext_bus_device_exit(hdev);
    99                 return ret;
    100         }
    101 
    102         return 0;
    103 }
    104 EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_device_init);
    105 
    106 /**
    107  * snd_hdac_ext_bus_device_exit - clean up a HD-audio extended codec base device
    108  * @hdev: hdac device to clean up
    109  */
    110 void snd_hdac_ext_bus_device_exit(struct hdac_device *hdev)
    111 {
    112         snd_hdac_device_exit(hdev);
    113 }
    114 EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_device_exit);
    11562
    11663/**
  • GPL/branches/uniaud32-exp/alsa-kernel/hda/ext/hdac_ext_controller.c

    r750 r756  
    171171        int timeout;
    172172        u32 val;
    173         int mask = (1 << AZX_MLCTL_CPA_SHIFT);
     173        int mask = (1 << AZX_ML_LCTL_CPA_SHIFT);
    174174
    175175        udelay(3);
     
    179179                val = readl(link->ml_addr + AZX_REG_ML_LCTL);
    180180                if (enable) {
    181                         if (((val & mask) >> AZX_MLCTL_CPA_SHIFT))
     181                        if (((val & mask) >> AZX_ML_LCTL_CPA_SHIFT))
    182182                                return 0;
    183183                } else {
    184                         if (!((val & mask) >> AZX_MLCTL_CPA_SHIFT))
     184                        if (!((val & mask) >> AZX_ML_LCTL_CPA_SHIFT))
    185185                                return 0;
    186186                }
     
    198198{
    199199        snd_hdac_updatel(link->ml_addr, AZX_REG_ML_LCTL,
    200                          AZX_MLCTL_SPA, AZX_MLCTL_SPA);
     200                         AZX_ML_LCTL_SPA, AZX_ML_LCTL_SPA);
    201201
    202202        return check_hdac_link_power_active(link, true);
     
    210210int snd_hdac_ext_bus_link_power_down(struct hdac_ext_link *link)
    211211{
    212         snd_hdac_updatel(link->ml_addr, AZX_REG_ML_LCTL, AZX_MLCTL_SPA, 0);
     212        snd_hdac_updatel(link->ml_addr, AZX_REG_ML_LCTL, AZX_ML_LCTL_SPA, 0);
    213213
    214214        return check_hdac_link_power_active(link, false);
     
    227227        list_for_each_entry(hlink, &bus->hlink_list, list) {
    228228                snd_hdac_updatel(hlink->ml_addr, AZX_REG_ML_LCTL,
    229                                  AZX_MLCTL_SPA, AZX_MLCTL_SPA);
     229                                 AZX_ML_LCTL_SPA, AZX_ML_LCTL_SPA);
    230230                ret = check_hdac_link_power_active(hlink, true);
    231231                if (ret < 0)
     
    248248        list_for_each_entry(hlink, &bus->hlink_list, list) {
    249249                snd_hdac_updatel(hlink->ml_addr, AZX_REG_ML_LCTL,
    250                                  AZX_MLCTL_SPA, 0);
     250                                 AZX_ML_LCTL_SPA, 0);
    251251                ret = check_hdac_link_power_active(hlink, false);
    252252                if (ret < 0)
     
    282282                 */
    283283                snd_hdac_updatew(link->ml_addr, AZX_REG_ML_LOSIDV,
    284                                  ML_LOSIDV_STREAM_MASK, 0);
     284                                 AZX_ML_LOSIDV_STREAM_MASK, 0);
    285285                /*
    286286                 *  wait for 521usec for codec to report status
  • GPL/branches/uniaud32-exp/alsa-kernel/hda/ext/hdac_ext_stream.c

    r737 r756  
    2727 * invoke hdac stream initialization routine
    2828 */
    29 void snd_hdac_ext_stream_init(struct hdac_bus *bus,
    30                               struct hdac_ext_stream *hext_stream,
    31                               int idx, int direction, int tag)
     29static void snd_hdac_ext_stream_init(struct hdac_bus *bus,
     30                                     struct hdac_ext_stream *hext_stream,
     31                                     int idx, int direction, int tag)
    3232{
    3333        if (bus->ppcap) {
     
    5757        snd_hdac_stream_init(bus, &hext_stream->hstream, idx, direction, tag);
    5858}
    59 EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_init);
    6059
    6160/**
     
    8988
    9089/**
    91  * snd_hdac_stream_free_all - free hdac extended stream objects
    92  *
    93  * @bus: HD-audio core bus
    94  */
    95 void snd_hdac_stream_free_all(struct hdac_bus *bus)
     90 * snd_hdac_ext_stream_free_all - free hdac extended stream objects
     91 *
     92 * @bus: HD-audio core bus
     93 */
     94void snd_hdac_ext_stream_free_all(struct hdac_bus *bus)
    9695{
    9796        struct hdac_stream *s, *_s;
     
    105104        }
    106105}
    107 EXPORT_SYMBOL_GPL(snd_hdac_stream_free_all);
     106EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_free_all);
    108107
    109108void snd_hdac_ext_stream_decouple_locked(struct hdac_bus *bus,
     
    269268                        continue;
    270269
    271                 /* check if decoupled stream and not in use is available */
    272                 if (hext_stream->decoupled && !hext_stream->link_locked) {
     270                /* check if link stream is available */
     271                if (!hext_stream->link_locked) {
    273272                        res = hext_stream;
    274273                        break;
    275274                }
    276275
    277                 if (!hext_stream->link_locked) {
    278                         snd_hdac_ext_stream_decouple_locked(bus, hext_stream, true);
    279                         res = hext_stream;
    280                         break;
    281                 }
    282276        }
    283277        if (res) {
     278                snd_hdac_ext_stream_decouple_locked(bus, res, true);
    284279                res->link_locked = 1;
    285280                res->link_substream = substream;
     
    310305
    311306                if (!hstream->opened) {
    312                         if (!hext_stream->decoupled)
    313                                 snd_hdac_ext_stream_decouple_locked(bus, hext_stream, true);
    314307                        res = hext_stream;
    315308                        break;
     
    317310        }
    318311        if (res) {
     312                snd_hdac_ext_stream_decouple_locked(bus, res, true);
    319313                res->hstream.opened = 1;
    320314                res->hstream.running = 0;
     
    389383        case HDAC_EXT_STREAM_TYPE_HOST:
    390384                spin_lock_irq(&bus->reg_lock);
    391                 if (hext_stream->decoupled && !hext_stream->link_locked)
     385                /* couple link only if not in use */
     386                if (!hext_stream->link_locked)
    392387                        snd_hdac_ext_stream_decouple_locked(bus, hext_stream, false);
     388                snd_hdac_stream_release_locked(&hext_stream->hstream);
    393389                spin_unlock_irq(&bus->reg_lock);
    394                 snd_hdac_stream_release(&hext_stream->hstream);
    395390                break;
    396391
    397392        case HDAC_EXT_STREAM_TYPE_LINK:
    398393                spin_lock_irq(&bus->reg_lock);
    399                 if (hext_stream->decoupled && !hext_stream->hstream.opened)
     394                /* couple host only if not in use */
     395                if (!hext_stream->hstream.opened)
    400396                        snd_hdac_ext_stream_decouple_locked(bus, hext_stream, false);
    401397                hext_stream->link_locked = 0;
  • GPL/branches/uniaud32-exp/alsa-kernel/hda/hdac_stream.c

    r737 r756  
    1919#endif
    2020
     21/*
     22 * the hdac_stream library is intended to be used with the following
     23 * transitions. The states are not formally defined in the code but loosely
     24 * inspired by boolean variables. Note that the 'prepared' field is not used
     25 * in this library but by the callers during the hw_params/prepare transitions
     26 *
     27 *                         |
     28 *      stream_init()      |
     29 *                         v
     30 *                      +--+-------+
     31 *                      |  unused  |
     32 *                      +--+----+--+
     33 *                         |    ^
     34 *      stream_assign()    |    |    stream_release()
     35 *                         v    |
     36 *                      +--+----+--+
     37 *                      |  opened  |
     38 *                      +--+----+--+
     39 *                         |    ^
     40 *      stream_reset()     |    |
     41 *      stream_setup()     |    |    stream_cleanup()
     42 *                         v    |
     43 *                      +--+----+--+
     44 *                      | prepared |
     45 *                      +--+----+--+
     46 *                         |    ^
     47 *      stream_start()     |    |    stream_stop()
     48 *                         v    |
     49 *                      +--+----+--+
     50 *                      |  running |
     51 *                      +----------+
     52 */
     53
    2154/**
    2255 * snd_hdac_get_stream_stripe_ctl - get stripe control value
     
    118151
    119152/**
    120  * snd_hdac_stream_clear - stop a stream DMA
     153 * snd_hdac_stream_clear - helper to clear stream registers and stop DMA transfers
    121154 * @azx_dev: HD-audio core stream to stop
    122155 */
    123 void snd_hdac_stream_clear(struct hdac_stream *azx_dev)
     156static void snd_hdac_stream_clear(struct hdac_stream *azx_dev)
    124157{
    125158        snd_hdac_stream_updateb(azx_dev, SD_CTL,
     
    130163        azx_dev->running = false;
    131164}
    132 EXPORT_SYMBOL_GPL(snd_hdac_stream_clear);
    133165
    134166/**
     
    149181
    150182/**
     183 * snd_hdac_stop_streams - stop all streams
     184 * @bus: HD-audio core bus
     185 */
     186void snd_hdac_stop_streams(struct hdac_bus *bus)
     187{
     188        struct hdac_stream *stream;
     189
     190        list_for_each_entry(stream, &bus->stream_list, list, struct hdac_stream)
     191                snd_hdac_stream_stop(stream);
     192}
     193EXPORT_SYMBOL_GPL(snd_hdac_stop_streams);
     194
     195/**
    151196 * snd_hdac_stop_streams_and_chip - stop all streams and chip if running
    152197 * @bus: HD-audio core bus
     
    154199void snd_hdac_stop_streams_and_chip(struct hdac_bus *bus)
    155200{
    156         struct hdac_stream *stream;
    157 
    158201        if (bus->chip_init) {
    159                 list_for_each_entry(stream, &bus->stream_list, list, struct hdac_stream)
    160                         snd_hdac_stream_stop(stream);
     202                snd_hdac_stop_streams(bus);
    161203                snd_hdac_bus_stop_chip(bus);
    162204        }
     
    171213{
    172214        unsigned char val;
     215#ifdef TARGET_OS2
    173216        int timeout;
     217#endif
    174218        int dma_run_state;
    175219
     
    179223
    180224        snd_hdac_stream_updateb(azx_dev, SD_CTL, 0, SD_CTL_STREAM_RESET);
     225
     226#ifndef TARGET_OS2
     227        /* wait for hardware to report that the stream entered reset */
     228        snd_hdac_stream_readb_poll(azx_dev, SD_CTL, val, (val & SD_CTL_STREAM_RESET), 3, 300);
     229#else
    181230        udelay(3);
    182231        timeout = 300;
     
    187236                        break;
    188237        } while (--timeout);
    189 
     238#endif
    190239        if (azx_dev->bus->dma_stop_delay && dma_run_state)
    191240                udelay(azx_dev->bus->dma_stop_delay);
    192241
    193         val &= ~SD_CTL_STREAM_RESET;
    194         snd_hdac_stream_writeb(azx_dev, SD_CTL, val);
     242        snd_hdac_stream_updateb(azx_dev, SD_CTL, SD_CTL_STREAM_RESET, 0);
     243
     244#ifndef TARGET_OS2
     245        /* wait for hardware to report that the stream is out of reset */
     246        snd_hdac_stream_readb_poll(azx_dev, SD_CTL, val, !(val & SD_CTL_STREAM_RESET), 3, 300);
     247#else
    195248        udelay(3);
    196249
     
    203256                        break;
    204257        } while (--timeout);
    205 
     258#endif
    206259        /* reset first position - may not be synced with hw at this time */
    207260        if (azx_dev->posbuf)
     
    343396
    344397/**
    345  * snd_hdac_stream_release - release the assigned stream
     398 * snd_hdac_stream_release_locked - release the assigned stream
    346399 * @azx_dev: HD-audio core stream to release
    347400 *
    348401 * Release the stream that has been assigned by snd_hdac_stream_assign().
    349  */
    350 void snd_hdac_stream_release(struct hdac_stream *azx_dev)
    351 {
    352         struct hdac_bus *bus = azx_dev->bus;
    353 
    354         spin_lock_irq(&bus->reg_lock);
     402 * The bus->reg_lock needs to be taken at a higher level
     403 */
     404void snd_hdac_stream_release_locked(struct hdac_stream *azx_dev)
     405{
    355406        azx_dev->opened = 0;
    356407        azx_dev->running = 0;
    357408        azx_dev->substream = NULL;
     409}
     410EXPORT_SYMBOL_GPL(snd_hdac_stream_release_locked);
     411
     412/**
     413 * snd_hdac_stream_release - release the assigned stream
     414 * @azx_dev: HD-audio core stream to release
     415 *
     416 * Release the stream that has been assigned by snd_hdac_stream_assign().
     417 */
     418void snd_hdac_stream_release(struct hdac_stream *azx_dev)
     419{
     420        struct hdac_bus *bus = azx_dev->bus;
     421
     422        spin_lock_irq(&bus->reg_lock);
     423        snd_hdac_stream_release_locked(azx_dev);
    358424        spin_unlock_irq(&bus->reg_lock);
    359425}
  • GPL/branches/uniaud32-exp/alsa-kernel/hda/hdmi_chmap.c

    r708 r756  
    782782        if (!substream || !substream->runtime)
    783783                return 0; /* just for avoiding error from alsactl restore */
    784         switch (substream->runtime->status->state) {
     784        switch (substream->runtime->state) {
    785785        case SNDRV_PCM_STATE_OPEN:
    786786        case SNDRV_PCM_STATE_SETUP:
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/hda_codec.h

    r750 r756  
    259259        unsigned int relaxed_resume:1;  /* don't resume forcibly for jack */
    260260        unsigned int forced_resume:1; /* forced resume for jack */
    261         unsigned int mst_no_extra_pcms:1; /* no backup PCMs for DP-MST */
    262261
    263262#ifdef CONFIG_PM
     
    294293#define hda_codec_dev(_dev)     (&(_dev)->core.dev)
    295294
    296 #define hdac_to_hda_priv(_hdac) \
    297                         container_of(_hdac, struct hdac_hda_priv, codec.core)
    298295#define hdac_to_hda_codec(_hdac) container_of(_hdac, struct hda_codec, core)
    299296
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/hda_register.h

    r694 r756  
    261261#define AZX_REG_ML_LCAP                 0x00
    262262#define AZX_REG_ML_LCTL                 0x04
     263
     264#define AZX_ML_LCTL_CPA                 BIT(23)
     265#define AZX_ML_LCTL_CPA_SHIFT           23
     266#define AZX_ML_LCTL_SPA                 BIT(16)
     267#define AZX_ML_LCTL_SPA_SHIFT           16
     268#define AZX_ML_LCTL_SCF                 GENMASK(3, 0)
     269
    263270#define AZX_REG_ML_LOSIDV               0x08
     271
     272/* bit0 is reserved, with BIT(1) mapping to stream1 */
     273#define AZX_ML_LOSIDV_STREAM_MASK       0xFFFE
     274
    264275#define AZX_REG_ML_LSDIID               0x0C
    265276#define AZX_REG_ML_LPSOO                0x10
     
    268279#define AZX_REG_ML_LOUTPAY              0x20
    269280#define AZX_REG_ML_LINPAY               0x30
    270 
    271 /* bit0 is reserved, with BIT(1) mapping to stream1 */
    272 #define ML_LOSIDV_STREAM_MASK           0xFFFE
    273 
    274 #define ML_LCTL_SCF_MASK                        0xF
    275 #define AZX_MLCTL_SPA                           (0x1 << 16)
    276 #define AZX_MLCTL_CPA                           (0x1 << 23)
    277 #define AZX_MLCTL_SPA_SHIFT                     16
    278 #define AZX_MLCTL_CPA_SHIFT                     23
    279281
    280282/* registers for DMA Resume Capability Structure */
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/hdaudio.h

    r750 r756  
    1111#include <linux/io.h>
    1212#include <linux/io-64-nonatomic-lo-hi.h>
     13#include <linux/iopoll.h>
    1314#include <linux/pm_runtime.h>
    1415#include <linux/timecounter.h>
     
    565566struct hdac_stream *snd_hdac_stream_assign(struct hdac_bus *bus,
    566567                                           struct snd_pcm_substream *substream);
     568void snd_hdac_stream_release_locked(struct hdac_stream *azx_dev);
    567569void snd_hdac_stream_release(struct hdac_stream *azx_dev);
    568570struct hdac_stream *snd_hdac_get_stream(struct hdac_bus *bus,
     
    575577                                unsigned int format_val);
    576578void snd_hdac_stream_start(struct hdac_stream *azx_dev, bool fresh_start);
    577 void snd_hdac_stream_clear(struct hdac_stream *azx_dev);
    578579void snd_hdac_stream_stop(struct hdac_stream *azx_dev);
     580void snd_hdac_stop_streams(struct hdac_bus *bus);
    579581void snd_hdac_stop_streams_and_chip(struct hdac_bus *bus);
    580582void snd_hdac_stream_reset(struct hdac_stream *azx_dev);
     
    604606#define snd_hdac_stream_readb(dev, reg) \
    605607        snd_hdac_reg_readb((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
     608#define snd_hdac_stream_readb_poll(dev, reg, val, cond, delay_us, timeout_us) \
     609        read_poll_timeout_atomic(snd_hdac_reg_readb, val, cond, delay_us, timeout_us, \
     610                                 false, (dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
     611#define snd_hdac_stream_readl_poll(dev, reg, val, cond, delay_us, timeout_us) \
     612        read_poll_timeout_atomic(snd_hdac_reg_readl, val, cond, delay_us, timeout_us, \
     613                                 false, (dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
    606614
    607615/* update a register, pass without AZX_REG_ prefix */
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/hdaudio_ext.h

    r738 r756  
    1212
    1313void snd_hdac_ext_bus_exit(struct hdac_bus *bus);
    14 int snd_hdac_ext_bus_device_init(struct hdac_bus *bus, int addr,
    15                                 struct hdac_device *hdev, int type);
    16 void snd_hdac_ext_bus_device_exit(struct hdac_device *hdev);
    1714void snd_hdac_ext_bus_device_remove(struct hdac_bus *bus);
    1815
     
    8178        container_of(s, struct hdac_ext_stream, hstream)
    8279
    83 void snd_hdac_ext_stream_init(struct hdac_bus *bus,
    84                               struct hdac_ext_stream *hext_stream, int idx,
    85                               int direction, int tag);
    8680int snd_hdac_ext_stream_init_all(struct hdac_bus *bus, int start_idx,
    8781                                 int num_stream, int dir);
    88 void snd_hdac_stream_free_all(struct hdac_bus *bus);
     82void snd_hdac_ext_stream_free_all(struct hdac_bus *bus);
    8983void snd_hdac_link_free_all(struct hdac_bus *bus);
    9084struct hdac_ext_stream *snd_hdac_ext_stream_assign(struct hdac_bus *bus,
     
    189183        readq_poll_timeout((chip)->dsp_ba + (reg), val, cond, \
    190184                           delay_us, timeout_us)
    191 #define snd_hdac_stream_readb_poll(strm, reg, val, cond, delay_us, timeout_us) \
    192         readb_poll_timeout((strm)->sd_addr + AZX_REG_ ## reg, val, cond, \
    193                            delay_us, timeout_us)
    194 #define snd_hdac_stream_readl_poll(strm, reg, val, cond, delay_us, timeout_us) \
    195         readl_poll_timeout((strm)->sd_addr + AZX_REG_ ## reg, val, cond, \
    196                            delay_us, timeout_us)
    197185
    198186struct hdac_ext_device;
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/intel-nhlt.h

    r739 r756  
    137137int intel_nhlt_ssp_endpoint_mask(struct nhlt_acpi_table *nhlt, u8 device_type);
    138138
     139int intel_nhlt_ssp_mclk_mask(struct nhlt_acpi_table *nhlt, int ssp_num);
     140
    139141struct nhlt_specific_cfg *
    140142intel_nhlt_get_endpoint_blob(struct device *dev, struct nhlt_acpi_table *nhlt,
     
    170172}
    171173
     174static inline int intel_nhlt_ssp_mclk_mask(struct nhlt_acpi_table *nhlt, int ssp_num)
     175{
     176        return 0;
     177}
     178
    172179static inline struct nhlt_specific_cfg *
    173180intel_nhlt_get_endpoint_blob(struct device *dev, struct nhlt_acpi_table *nhlt,
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/memalloc.h

    r737 r756  
    2626        struct device *dev;             /* generic device */
    2727};
    28 
    29 #define snd_dma_continuous_data(x)      ((struct device *)(__force unsigned long)(x))
    30 
    3128
    3229/*
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/pcm.h

    r750 r756  
    347347struct snd_pcm_runtime {
    348348        /* -- Status -- */
     349        snd_pcm_state_t state;          /* stream state */
     350        snd_pcm_state_t suspended_state; /* suspended stream state */
    349351        struct snd_pcm_substream *trigger_master;
    350352        struct timespec64 trigger_tstamp;       /* trigger timestamp */
     
    686688static inline int snd_pcm_running(struct snd_pcm_substream *substream)
    687689{
    688         return (substream->runtime->status->state == SNDRV_PCM_STATE_RUNNING ||
    689                 (substream->runtime->status->state == SNDRV_PCM_STATE_DRAINING &&
     690        return (substream->runtime->state == SNDRV_PCM_STATE_RUNNING ||
     691                (substream->runtime->state == SNDRV_PCM_STATE_DRAINING &&
    690692                 substream->stream == SNDRV_PCM_STREAM_PLAYBACK));
     693}
     694
     695/**
     696 * __snd_pcm_set_state - Change the current PCM state
     697 * @runtime: PCM runtime to set
     698 * @state: the current state to set
     699 *
     700 * Call within the stream lock
     701 */
     702static inline void __snd_pcm_set_state(struct snd_pcm_runtime *runtime,
     703                                       snd_pcm_state_t state)
     704{
     705        runtime->state = state;
     706        runtime->status->state = state; /* copy for mmap */
    691707}
    692708
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/simple_card_utils.h

    r750 r756  
    4040        u32 convert_rate;
    4141        u32 convert_channels;
     42        const char *convert_sample_format;
    4243};
    4344
     
    177178void asoc_simple_parse_convert(struct device_node *np, char *prefix,
    178179                               struct asoc_simple_data *data);
     180bool asoc_simple_is_convert_required(const struct asoc_simple_data *data);
    179181
    180182int asoc_simple_parse_routing(struct snd_soc_card *card,
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/soc-acpi-intel-match.h

    r755 r756  
    1515 * pdata or machine ops
    1616 */
    17 extern struct snd_soc_acpi_mach snd_soc_acpi_intel_haswell_machines[];
    1817extern struct snd_soc_acpi_mach snd_soc_acpi_intel_broadwell_machines[];
    1918extern struct snd_soc_acpi_mach snd_soc_acpi_intel_baytrail_machines[];
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/soc.h

    r750 r756  
    3232        ((unsigned long)&(struct soc_mixer_control) \
    3333        {.reg = xreg, .rreg = xreg, .shift = shift_left, \
    34         .rshift = shift_right, .max = xmax, .platform_max = xmax, \
     34        .rshift = shift_right, .max = xmax, \
    3535        .invert = xinvert, .autodisable = xautodisable})
    3636#define SOC_DOUBLE_S_VALUE(xreg, shift_left, shift_right, xmin, xmax, xsign_bit, xinvert, xautodisable) \
    3737        ((unsigned long)&(struct soc_mixer_control) \
    3838        {.reg = xreg, .rreg = xreg, .shift = shift_left, \
    39         .rshift = shift_right, .min = xmin, .max = xmax, .platform_max = xmax, \
     39        .rshift = shift_right, .min = xmin, .max = xmax, \
    4040        .sign_bit = xsign_bit, .invert = xinvert, .autodisable = xautodisable})
    4141#define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert, xautodisable) \
     
    4343#define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \
    4444        ((unsigned long)&(struct soc_mixer_control) \
    45         {.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert})
     45        {.reg = xreg, .max = xmax, .invert = xinvert})
    4646#define SOC_DOUBLE_R_VALUE(xlreg, xrreg, xshift, xmax, xinvert) \
    4747        ((unsigned long)&(struct soc_mixer_control) \
    4848        {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \
    49         .max = xmax, .platform_max = xmax, .invert = xinvert})
     49        .max = xmax, .invert = xinvert})
    5050#define SOC_DOUBLE_R_S_VALUE(xlreg, xrreg, xshift, xmin, xmax, xsign_bit, xinvert) \
    5151        ((unsigned long)&(struct soc_mixer_control) \
    5252        {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \
    53         .max = xmax, .min = xmin, .platform_max = xmax, .sign_bit = xsign_bit, \
     53        .max = xmax, .min = xmin, .sign_bit = xsign_bit, \
    5454        .invert = xinvert})
    5555#define SOC_DOUBLE_R_RANGE_VALUE(xlreg, xrreg, xshift, xmin, xmax, xinvert) \
    5656        ((unsigned long)&(struct soc_mixer_control) \
    5757        {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \
    58         .min = xmin, .max = xmax, .platform_max = xmax, .invert = xinvert})
     58        .min = xmin, .max = xmax, .invert = xinvert})
    5959#define SOC_SINGLE(xname, reg, shift, max, invert) \
    6060{       .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
     
    6969                {.reg = xreg, .rreg = xreg, .shift = xshift, \
    7070                 .rshift = xshift,  .min = xmin, .max = xmax, \
    71                  .platform_max = xmax, .invert = xinvert} }
     71                 .invert = xinvert} }
    7272#define SOC_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \
    7373{       .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
     
    100100                {.reg = xreg, .rreg = xreg, .shift = xshift, \
    101101                 .rshift = xshift, .min = xmin, .max = xmax, \
    102                  .platform_max = xmax, .invert = xinvert} }
     102                 .invert = xinvert} }
    103103#define SOC_DOUBLE(xname, reg, shift_left, shift_right, max, invert) \
    104104{       .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
     
    200200        .private_value = (unsigned long)&(struct soc_mixer_control) \
    201201        {.reg = xreg, .rreg = xreg,  \
    202          .min = xmin, .max = xmax, .platform_max = xmax, \
     202         .min = xmin, .max = xmax, \
    203203        .sign_bit = 7,} }
    204204#define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \
     
    274274                {.reg = xreg, .rreg = xreg, .shift = xshift, \
    275275                 .rshift = xshift, .min = xmin, .max = xmax, \
    276                  .platform_max = xmax, .invert = xinvert} }
     276                 .invert = xinvert} }
    277277#define SOC_DOUBLE_EXT_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert,\
    278278         xhandler_get, xhandler_put, tlv_array) \
     
    10631063
    10641064        /* Dynamic PCM BE runtime data */
    1065         struct snd_soc_dpcm_runtime dpcm[2];
     1065        struct snd_soc_dpcm_runtime dpcm[SNDRV_PCM_STREAM_LAST + 1];
     1066        struct snd_soc_dapm_widget *c2c_widget[SNDRV_PCM_STREAM_LAST + 1];
    10661067
    10671068        long pmdown_time;
     
    10791080         */
    10801081        struct snd_soc_dai **dais;
    1081         unsigned int num_codecs;
    1082         unsigned int num_cpus;
    1083 
    1084         struct snd_soc_dapm_widget *playback_widget;
    1085         struct snd_soc_dapm_widget *capture_widget;
    10861082
    10871083        struct delayed_work delayed_work;
     
    11091105/* see soc_new_pcm_runtime()  */
    11101106#define asoc_rtd_to_cpu(rtd, n)   (rtd)->dais[n]
    1111 #define asoc_rtd_to_codec(rtd, n) (rtd)->dais[n + (rtd)->num_cpus]
     1107#define asoc_rtd_to_codec(rtd, n) (rtd)->dais[n + (rtd)->dai_link->num_cpus]
    11121108#define asoc_substream_to_rtd(substream) \
    11131109        (struct snd_soc_pcm_runtime *)snd_pcm_substream_chip(substream)
     
    11191115#define for_each_rtd_cpu_dais(rtd, i, dai)                              \
    11201116        for ((i) = 0;                                                   \
    1121              ((i) < rtd->num_cpus) && ((dai) = asoc_rtd_to_cpu(rtd, i)); \
     1117             ((i) < rtd->dai_link->num_cpus) && ((dai) = asoc_rtd_to_cpu(rtd, i)); \
    11221118             (i)++)
    11231119#define for_each_rtd_codec_dais(rtd, i, dai)                            \
    11241120        for ((i) = 0;                                                   \
    1125              ((i) < rtd->num_codecs) && ((dai) = asoc_rtd_to_codec(rtd, i)); \
     1121             ((i) < rtd->dai_link->num_codecs) && ((dai) = asoc_rtd_to_codec(rtd, i)); \
    11261122             (i)++)
    11271123#define for_each_rtd_dais(rtd, i, dai)                                  \
    11281124        for ((i) = 0;                                                   \
    1129              ((i) < (rtd)->num_cpus + (rtd)->num_codecs) &&             \
     1125             ((i) < (rtd)->dai_link->num_cpus + (rtd)->dai_link->num_codecs) && \
    11301126                     ((dai) = (rtd)->dais[i]);                          \
    11311127             (i)++)
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/sof.h

    r750 r756  
    9090        struct platform_device *pdev_mach;
    9191        const struct snd_soc_acpi_mach *machine;
     92        const struct snd_sof_of_mach *of_machine;
    9293
    9394        void *hw_pdata;
     
    103104        /* list of machines using this configuration */
    104105        struct snd_soc_acpi_mach *machines;
     106        struct snd_sof_of_mach *of_machines;
    105107
    106108        /* alternate list of machines using this configuration */
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/version.h

    r755 r756  
    11/* include/version.h */
    2 #define CONFIG_SND_VERSION "6.0.7"
     2#define CONFIG_SND_VERSION "6.1.0"
    33#define CONFIG_SND_DATE ""
  • GPL/branches/uniaud32-exp/alsa-kernel/include/uapi/sound/asequencer.h

    r615 r756  
    44 *  Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
    55 *            (c) 1998-1999 by Jaroslav Kysela <perex@perex.cz>
    6  *
    7  *
    8  *   This program is free software; you can redistribute it and/or modify
    9  *   it under the terms of the GNU General Public License as published by
    10  *   the Free Software Foundation; either version 2 of the License, or
    11  *   (at your option) any later version.
    12  *
    13  *   This program is distributed in the hope that it will be useful,
    14  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
    15  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16  *   GNU General Public License for more details.
    17  *
    18  *   You should have received a copy of the GNU General Public License
    19  *   along with this program; if not, write to the Free Software
    20  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
    21  *
    226 */
    237#ifndef _UAPI__SOUND_ASEQUENCER_H
  • GPL/branches/uniaud32-exp/alsa-kernel/include/uapi/sound/asoc.h

    r736 r756  
    55 * Copyright (C) 2012 Texas Instruments Inc.
    66 * Copyright (C) 2015 Intel Corporation.
    7  *
    8  * This program is free software; you can redistribute it and/or modify
    9  * it under the terms of the GNU General Public License version 2 as
    10  * published by the Free Software Foundation.
    117 *
    128 * Simple file API to load FW that includes mixers, coefficients, DAPM graphs,
  • GPL/branches/uniaud32-exp/alsa-kernel/include/uapi/sound/asound.h

    r750 r756  
    44 *  Copyright (c) 1994-2003 by Jaroslav Kysela <perex@perex.cz>,
    55 *                             Abramo Bagnara <abramo@alsa-project.org>
    6  *
    7  *
    8  *   This program is free software; you can redistribute it and/or modify
    9  *   it under the terms of the GNU General Public License as published by
    10  *   the Free Software Foundation; either version 2 of the License, or
    11  *   (at your option) any later version.
    12  *
    13  *   This program is distributed in the hope that it will be useful,
    14  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
    15  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16  *   GNU General Public License for more details.
    17  *
    18  *   You should have received a copy of the GNU General Public License
    19  *   along with this program; if not, write to the Free Software
    20  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
    21  *
    226 */
    237
  • GPL/branches/uniaud32-exp/alsa-kernel/include/uapi/sound/asound_fm.h

    r615 r756  
    1111 *
    1212 *  Direct FM control
    13  *
    14  *   This program is free software; you can redistribute it and/or modify
    15  *   it under the terms of the GNU General Public License as published by
    16  *   the Free Software Foundation; either version 2 of the License, or
    17  *   (at your option) any later version.
    18  *
    19  *   This program is distributed in the hope that it will be useful,
    20  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
    21  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    22  *   GNU General Public License for more details.
    23  *
    24  *   You should have received a copy of the GNU General Public License
    25  *   along with this program; if not, write to the Free Software
    26  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
    27  *
    2813 */
    2914
  • GPL/branches/uniaud32-exp/alsa-kernel/include/uapi/sound/compress_offload.h

    r750 r756  
    66 *  Authors:    Vinod Koul <vinod.koul@linux.intel.com>
    77 *              Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    8  *  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    9  *
    10  *  This program is free software; you can redistribute it and/or modify
    11  *  it under the terms of the GNU General Public License as published by
    12  *  the Free Software Foundation; version 2 of the License.
    13  *
    14  *  This program is distributed in the hope that it will be useful, but
    15  *  WITHOUT ANY WARRANTY; without even the implied warranty of
    16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    17  *  General Public License for more details.
    18  *
    19  *  You should have received a copy of the GNU General Public License along
    20  *  with this program; if not, write to the Free Software Foundation, Inc.,
    21  *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
    22  *
    23  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    24  *
    258 */
    269#ifndef __COMPRESS_OFFLOAD_H
  • GPL/branches/uniaud32-exp/alsa-kernel/include/uapi/sound/compress_params.h

    r750 r756  
    88 *              Vinod Koul <vinod.koul@linux.intel.com>
    99 *
    10  *  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    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; version 2 of the License.
    15  *
    16  *  This program is distributed in the hope that it will be useful, but
    17  *  WITHOUT ANY WARRANTY; without even the implied warranty of
    18  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    19  *  General Public License for more details.
    20  *
    21  *  You should have received a copy of the GNU General Public License along
    22  *  with this program; if not, write to the Free Software Foundation, Inc.,
    23  *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
    24  *
    2510 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    2611 *
    2712 * The definitions in this file are derived from the OpenMAX AL version 1.1
    28  * and OpenMAX IL v 1.1.2 header files which contain the copyright notice below.
     13 * and OpenMAX IL v 1.1.2 header files which contain the copyright notice below
     14 * and are licensed under the MIT license.
    2915 *
    3016 * Copyright (c) 2007-2010 The Khronos Group Inc.
    31  *
    32  * Permission is hereby granted, free of charge, to any person obtaining
    33  * a copy of this software and/or associated documentation files (the
    34  * "Materials "), to deal in the Materials without restriction, including
    35  * without limitation the rights to use, copy, modify, merge, publish,
    36  * distribute, sublicense, and/or sell copies of the Materials, and to
    37  * permit persons to whom the Materials are furnished to do so, subject to
    38  * the following conditions:
    39  *
    40  * The above copyright notice and this permission notice shall be included
    41  * in all copies or substantial portions of the Materials.
    42  *
    43  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
    44  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    45  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    46  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
    47  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
    48  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
    49  * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
    50  *
    5117 */
    5218#ifndef __SND_COMPRESS_PARAMS_H
  • GPL/branches/uniaud32-exp/alsa-kernel/include/uapi/sound/emu10k1.h

    r629 r756  
    44 *                   Creative Labs, Inc.
    55 *  Definitions for EMU10K1 (SB Live!) chips
    6  *
    7  *
    8  *   This program is free software; you can redistribute it and/or modify
    9  *   it under the terms of the GNU General Public License as published by
    10  *   the Free Software Foundation; either version 2 of the License, or
    11  *   (at your option) any later version.
    12  *
    13  *   This program is distributed in the hope that it will be useful,
    14  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
    15  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16  *   GNU General Public License for more details.
    17  *
    18  *   You should have received a copy of the GNU General Public License
    19  *   along with this program; if not, write to the Free Software
    20  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
    21  *
    226 */
    237#ifndef _UAPI__SOUND_EMU10K1_H
  • GPL/branches/uniaud32-exp/alsa-kernel/include/uapi/sound/tlv.h

    r615 r756  
    11/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
    2 /*
    3  *   This program is free software; you can redistribute it and/or modify
    4  *   it under the terms of the GNU General Public License as published by
    5  *   the Free Software Foundation; either version 2 of the License, or
    6  *   (at your option) any later version.
    7  *
    8  *   This program is distributed in the hope that it will be useful,
    9  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
    10  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    11  *   GNU General Public License for more details.
    12  */
    132
    143#ifndef __UAPI_SOUND_TLV_H
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_codec.c

    r755 r756  
    896896        kfree(codec->modelname);
    897897        kfree(codec->wcaps);
    898 
    899         /*
    900          * In the case of ASoC HD-audio, hda_codec is device managed.
    901          * It will be freed when the ASoC device is removed.
    902          */
    903         if (codec->core.type == HDA_DEV_LEGACY)
    904                 kfree(codec);
     898        kfree(codec);
    905899}
    906900
     
    944938
    945939        codec->bus = bus;
    946         codec->core.type = HDA_DEV_LEGACY;
    947 
    948         return codec;
    949 }
    950 EXPORT_SYMBOL_GPL(snd_hda_codec_device_init);
    951 
    952 /**
    953  * snd_hda_codec_new - create a HDA codec
    954  * @bus: the bus to assign
    955  * @card: card for this codec
    956  * @codec_addr: the codec address
    957  * @codecp: the pointer to store the generated codec
    958  *
    959  * Returns 0 if successful, or a negative error code.
    960  */
    961 int snd_hda_codec_new(struct hda_bus *bus, struct snd_card *card,
    962                       unsigned int codec_addr, struct hda_codec **codecp)
    963 {
    964         struct hda_codec *codec;
    965         int ret;
    966 
    967         codec = snd_hda_codec_device_init(bus, codec_addr, "hdaudioC%dD%d",
    968                                           card->number, codec_addr);
    969         if (IS_ERR(codec))
    970                 return PTR_ERR(codec);
    971         *codecp = codec;
    972 
    973         ret = snd_hda_codec_device_new(bus, card, codec_addr, *codecp, true);
    974         if (ret)
    975                 put_device(hda_codec_dev(*codecp));
    976 
    977         return ret;
    978 }
    979 EXPORT_SYMBOL_GPL(snd_hda_codec_new);
    980 
    981 int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card,
    982                         unsigned int codec_addr, struct hda_codec *codec,
    983                         bool snddev_managed)
    984 {
    985         char component[31];
    986         hda_nid_t fg;
    987         int err;
    988         static const struct snd_device_ops dev_ops = {
    989                 .dev_register = snd_hda_codec_dev_register,
    990                 .dev_free = snd_hda_codec_dev_free,
    991         };
    992 
    993         dev_dbg(card->dev, "%s: entry\n", __func__);
    994 
    995         if (snd_BUG_ON(!bus))
    996                 return -EINVAL;
    997         if (snd_BUG_ON(codec_addr > HDA_MAX_CODEC_ADDRESS))
    998                 return -EINVAL;
    999 
     940        codec->depop_delay = -1;
     941        codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
    1000942        codec->core.dev.release = snd_hda_codec_dev_release;
    1001943        codec->core.exec_verb = codec_exec_verb;
    1002 
    1003         codec->card = card;
    1004         codec->addr = codec_addr;
     944        codec->core.type = HDA_DEV_LEGACY;
     945
    1005946        mutex_init(&codec->spdif_mutex);
    1006947        mutex_init(&codec->control_mutex);
     
    1015956        INIT_LIST_HEAD(&codec->conn_list);
    1016957        INIT_LIST_HEAD(&codec->pcm_list_head);
     958        INIT_DELAYED_WORK(&codec->jackpoll_work, hda_jackpoll_work);
    1017959        refcount_set(&codec->pcm_ref, 1);
    1018960        init_waitqueue_head(&codec->remove_sleep);
    1019961
    1020         INIT_DELAYED_WORK(&codec->jackpoll_work, hda_jackpoll_work);
    1021         codec->depop_delay = -1;
    1022         codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
     962        return codec;
     963}
     964EXPORT_SYMBOL_GPL(snd_hda_codec_device_init);
     965
     966/**
     967 * snd_hda_codec_new - create a HDA codec
     968 * @bus: the bus to assign
     969 * @card: card for this codec
     970 * @codec_addr: the codec address
     971 * @codecp: the pointer to store the generated codec
     972 *
     973 * Returns 0 if successful, or a negative error code.
     974 */
     975int snd_hda_codec_new(struct hda_bus *bus, struct snd_card *card,
     976                      unsigned int codec_addr, struct hda_codec **codecp)
     977{
     978        struct hda_codec *codec;
     979        int ret;
     980
     981        codec = snd_hda_codec_device_init(bus, codec_addr, "hdaudioC%dD%d",
     982                                          card->number, codec_addr);
     983        if (IS_ERR(codec))
     984                return PTR_ERR(codec);
     985        *codecp = codec;
     986
     987        ret = snd_hda_codec_device_new(bus, card, codec_addr, *codecp, true);
     988        if (ret)
     989                put_device(hda_codec_dev(*codecp));
     990
     991        return ret;
     992}
     993EXPORT_SYMBOL_GPL(snd_hda_codec_new);
     994
     995int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card,
     996                        unsigned int codec_addr, struct hda_codec *codec,
     997                        bool snddev_managed)
     998{
     999        char component[31];
     1000        hda_nid_t fg;
     1001        int err;
     1002        static const struct snd_device_ops dev_ops = {
     1003                .dev_register = snd_hda_codec_dev_register,
     1004                .dev_free = snd_hda_codec_dev_free,
     1005        };
     1006
     1007        dev_dbg(card->dev, "%s: entry\n", __func__);
     1008
     1009        if (snd_BUG_ON(!bus))
     1010                return -EINVAL;
     1011        if (snd_BUG_ON(codec_addr > HDA_MAX_CODEC_ADDRESS))
     1012                return -EINVAL;
     1013
     1014        codec->card = card;
     1015        codec->addr = codec_addr;
    10231016
    10241017#ifdef CONFIG_PM
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_controller.c

    r711 r756  
    10581058{
    10591059        struct hdac_bus *bus = azx_bus(chip);
    1060         struct hdac_stream *s;
    1061 
    1062         list_for_each_entry(s, &bus->stream_list, list, struct hdac_stream)
    1063                 snd_hdac_stream_stop(s);
     1060
     1061        snd_hdac_stop_streams(bus);
    10641062}
    10651063EXPORT_SYMBOL_GPL(azx_stop_all_streams);
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_eld.c

    r743 r756  
    451451
    452452void snd_hdmi_print_eld_info(struct hdmi_eld *eld,
    453                              struct snd_info_buffer *buffer)
     453                             struct snd_info_buffer *buffer,
     454                             hda_nid_t pin_nid, int dev_id, hda_nid_t cvt_nid)
    454455{
    455456        struct parsed_hdmi_eld *e = &eld->info;
     
    510511        snd_iprintf(buffer, "monitor_present\t\t%d\n", eld->monitor_present);
    511512        snd_iprintf(buffer, "eld_valid\t\t%d\n", eld->eld_valid);
     513        snd_iprintf(buffer, "codec_pin_nid\t\t0x%x\n", pin_nid);
     514        snd_iprintf(buffer, "codec_dev_id\t\t0x%x\n", dev_id);
     515        snd_iprintf(buffer, "codec_cvt_nid\t\t0x%x\n", cvt_nid);
    512516        if (!eld->eld_valid)
    513517                return;
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_intel.c

    r751 r756  
    9797#define INTEL_SCH_HDA_DEVC_NOSNOOP       (0x1<<11)
    9898
    99 /* Define VIA HD Audio Device ID*/
    100 #define VIA_HDAC_DEVICE_ID              0x3288
    101 
    10299/* max number of SDs */
    103100/* ICH, ATI and VIA have 4 playback and 4 capture */
     
    112109#define ATIHDMI_NUM_CAPTURE     0
    113110#define ATIHDMI_NUM_PLAYBACK    8
    114 
    115 /* TERA has 4 playback and 3 capture */
    116 #define TERA_NUM_CAPTURE        3
    117 #define TERA_NUM_PLAYBACK       4
    118111
    119112
     
    511504
    512505        /*
    513          * the codecs are sharing the first link setting by default
    514          * If other links are enabled for stream, they need similar fix
     506         * Changes to LCTL.SCF are only needed for the first multi-link dealing
     507         * with external codecs
    515508         */
    516509        val = readl(bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCTL);
    517         val &= ~AZX_MLCTL_SPA;
    518         val |= state << AZX_MLCTL_SPA_SHIFT;
     510        val &= ~AZX_ML_LCTL_SPA;
     511        val |= state << AZX_ML_LCTL_SPA_SHIFT;
    519512        writel(val, bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCTL);
    520513        /* wait for CPA */
     
    522515        while (timeout) {
    523516                if (((readl(bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCTL)) &
    524                     AZX_MLCTL_CPA) == (state << AZX_MLCTL_CPA_SHIFT))
     517                    AZX_ML_LCTL_CPA) == (state << AZX_ML_LCTL_CPA_SHIFT))
    525518                        return 0;
    526519                timeout--;
     
    539532        /* 0. check lctl register value is correct or not */
    540533        val = readl(bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCTL);
    541         /* if SCF is already set, let's use it */
    542         if ((val & ML_LCTL_SCF_MASK) != 0)
     534        /* only perform additional configurations if the SCF is initially based on 6MHz */
     535        if ((val & AZX_ML_LCTL_SCF) != 0)
    543536                return;
    544537
     
    547540         * Any deviation may result in undefined behavior.
    548541         */
    549         if (((val & AZX_MLCTL_SPA) >> AZX_MLCTL_SPA_SHIFT) !=
    550                 ((val & AZX_MLCTL_CPA) >> AZX_MLCTL_CPA_SHIFT))
     542        if (((val & AZX_ML_LCTL_SPA) >> AZX_ML_LCTL_SPA_SHIFT) !=
     543                ((val & AZX_ML_LCTL_CPA) >> AZX_ML_LCTL_CPA_SHIFT))
    551544                return;
    552545
     
    557550                goto set_spa;
    558551
    559         /* 2. update SCF to select a properly audio clock*/
    560         val &= ~ML_LCTL_SCF_MASK;
     552        /* 2. update SCF to select an audio clock different from 6MHz */
     553        val &= ~AZX_ML_LCTL_SCF;
    561554        val |= intel_get_lctl_scf(chip);
    562555        writel(val, bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCTL);
     
    27702763          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS |
    27712764          AZX_DCAPS_PM_RUNTIME },
     2765        { PCI_DEVICE(0x1002, 0xab30),
     2766          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS |
     2767          AZX_DCAPS_PM_RUNTIME },
    27722768        { PCI_DEVICE(0x1002, 0xab38),
    27732769          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS |
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_local.h

    r738 r756  
    727727#ifdef CONFIG_SND_PROC_FS
    728728void snd_hdmi_print_eld_info(struct hdmi_eld *eld,
    729                              struct snd_info_buffer *buffer);
     729                             struct snd_info_buffer *buffer,
     730                             hda_nid_t pin_nid, int dev_id, hda_nid_t cvt_nid);
    730731void snd_hdmi_write_eld_info(struct hdmi_eld *eld,
    731732                             struct snd_info_buffer *buffer);
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_sysfs.c

    r750 r756  
    375375        return pin_configs_show(codec, &codec->user_pins, buf);
    376376}
    377 
    378 #define MAX_PIN_CONFIGS         32
    379377
    380378static int parse_user_pin_configs(struct hda_codec *codec, const char *buf)
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/patch_ca0132.c

    r749 r756  
    13121312        SND_PCI_QUIRK(0x1458, 0xA036, "Gigabyte GA-Z170X-Gaming 7", QUIRK_R3DI),
    13131313        SND_PCI_QUIRK(0x3842, 0x1038, "EVGA X99 Classified", QUIRK_R3DI),
     1314        SND_PCI_QUIRK(0x3842, 0x1055, "EVGA Z390 DARK", QUIRK_R3DI),
    13141315        SND_PCI_QUIRK(0x1102, 0x0013, "Recon3D", QUIRK_R3D),
    13151316        SND_PCI_QUIRK(0x1102, 0x0018, "Recon3D", QUIRK_R3D),
     
    29682969                        unsigned int *port_map)
    29692970{
    2970         int status;
    29712971        unsigned int num_chans;
    29722972
     
    29822982        num_chans = get_hdafmt_chs(fmt) + 1;
    29832983
    2984         status = dsp_allocate_ports(codec, num_chans, rate_multi, port_map);
    2985 
    2986         return status;
     2984        return dsp_allocate_ports(codec, num_chans, rate_multi, port_map);
    29872985}
    29882986
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/patch_hdmi.c

    r754 r756  
    164164        int dev_num;
    165165        struct snd_array pins; /* struct hdmi_spec_per_pin */
    166         struct hdmi_pcm pcm_rec[16];
     166        struct hdmi_pcm pcm_rec[8];
    167167        struct mutex pcm_lock;
    168168        struct mutex bind_lock; /* for audio component binding */
     
    180180
    181181        bool dyn_pin_out;
    182         bool dyn_pcm_assign;
    183         bool dyn_pcm_no_legacy;
    184182        /* hdmi interrupt trigger control flag for Nvidia codec */
    185183        bool hdmi_intr_trig_ctrl;
     
    245243        struct hdmi_audio_infoframe hdmi;
    246244        struct dp_audio_infoframe dp;
     245#ifndef TARGET_OS2
     246        DECLARE_FLEX_ARRAY(u8, bytes);
     247#else
    247248        u8 bytes[1];
     249#endif
    248250};
    249251
     
    509511
    510512        mutex_lock(&per_pin->lock);
    511         snd_hdmi_print_eld_info(&per_pin->sink_eld, buffer);
     513        snd_hdmi_print_eld_info(&per_pin->sink_eld, buffer, per_pin->pin_nid,
     514                                per_pin->dev_id, per_pin->cvt_nid);
    512515        mutex_unlock(&per_pin->lock);
    513516}
     
    12001203}
    12011204
    1202 /* called in hdmi_pcm_open when no pin is assigned to the PCM
    1203  * in dyn_pcm_assign mode.
    1204  */
     1205/* called in hdmi_pcm_open when no pin is assigned to the PCM */
    12051206static int hdmi_pcm_open_no_pin(struct hda_pcm_stream *hinfo,
    12061207                         struct hda_codec *codec,
     
    12701271        mutex_lock(&spec->pcm_lock);
    12711272        pin_idx = hinfo_to_pin_index(codec, hinfo);
    1272         if (!spec->dyn_pcm_assign) {
    1273                 if (snd_BUG_ON(pin_idx < 0)) {
    1274                         err = -EINVAL;
    1275                         goto unlock;
    1276                 }
    1277         } else {
    1278                 /* no pin is assigned to the PCM
    1279                  * PA need pcm open successfully when probe
    1280                  */
    1281                 if (pin_idx < 0) {
    1282                         err = hdmi_pcm_open_no_pin(hinfo, codec, substream);
    1283                         goto unlock;
    1284                 }
     1273        /* no pin is assigned to the PCM
     1274         * PA need pcm open successfully when probe
     1275         */
     1276        if (pin_idx < 0) {
     1277                err = hdmi_pcm_open_no_pin(hinfo, codec, substream);
     1278                goto unlock;
    12851279        }
    12861280
     
    13871381        int i;
    13881382
    1389         /* on the new machines, try to assign the pcm slot dynamically,
    1390          * not use the preferred fixed map (legacy way) anymore.
    1391          */
    1392         if (spec->dyn_pcm_no_legacy)
    1393                 goto last_try;
    1394 
    1395         /*
    1396          * generic_hdmi_build_pcms() may allocate extra PCMs on some
    1397          * platforms (with maximum of 'num_nids + dev_num - 1')
    1398          *
    1399          * The per_pin of pin_nid_idx=n and dev_id=m prefers to get pcm-n
    1400          * if m==0. This guarantees that dynamic pcm assignments are compatible
    1401          * with the legacy static per_pin-pcm assignment that existed in the
    1402          * days before DP-MST.
    1403          *
    1404          * Intel DP-MST prefers this legacy behavior for compatibility, too.
    1405          *
    1406          * per_pin of m!=0 prefers to get pcm=(num_nids + (m - 1)).
    1407          */
    1408 
    1409         if (per_pin->dev_id == 0 || spec->intel_hsw_fixup) {
    1410                 if (!test_bit(per_pin->pin_nid_idx, &spec->pcm_bitmap))
    1411                         return per_pin->pin_nid_idx;
    1412         } else {
    1413                 i = spec->num_nids + (per_pin->dev_id - 1);
    1414                 if (i < spec->pcm_used && !(test_bit(i, &spec->pcm_bitmap)))
    1415                         return i;
    1416         }
    1417 
    1418         /* have a second try; check the area over num_nids */
    1419         for (i = spec->num_nids; i < spec->pcm_used; i++) {
    1420                 if (!test_bit(i, &spec->pcm_bitmap))
    1421                         return i;
    1422         }
    1423 
    1424  last_try:
    1425         /* the last try; check the empty slots in pins */
    14261383        for (i = 0; i < spec->pcm_used; i++) {
    14271384                if (!test_bit(i, &spec->pcm_bitmap))
     
    14851442        bool non_pcm;
    14861443
    1487         if (per_pin->pcm_idx >= 0 && per_pin->pcm_idx < spec->pcm_used)
    1488                 pcm = get_pcm_rec(spec, per_pin->pcm_idx);
    1489         else
     1444        if (per_pin->pcm_idx < 0 || per_pin->pcm_idx >= spec->pcm_used)
    14901445                return;
     1446        pcm = get_pcm_rec(spec, per_pin->pcm_idx);
    14911447        if (!pcm->pcm)
    14921448                return;
     
    15861542        pcm_jack = pin_idx_to_pcm_jack(codec, per_pin);
    15871543
    1588         if (spec->dyn_pcm_assign) {
    1589                 if (eld->eld_valid) {
    1590                         hdmi_attach_hda_pcm(spec, per_pin);
    1591                         hdmi_pcm_setup_pin(spec, per_pin);
    1592                 } else {
    1593                         hdmi_pcm_reset_pin(spec, per_pin);
    1594                         hdmi_detach_hda_pcm(spec, per_pin);
    1595                 }
     1544        if (eld->eld_valid) {
     1545                hdmi_attach_hda_pcm(spec, per_pin);
     1546                hdmi_pcm_setup_pin(spec, per_pin);
     1547        } else {
     1548                hdmi_pcm_reset_pin(spec, per_pin);
     1549                hdmi_detach_hda_pcm(spec, per_pin);
    15961550        }
    15971551        /* if pcm_idx == -1, it means this is in monitor connection event
     
    19551909                 */
    19561910                dev_num = spec->dev_num;
    1957         } else if (spec->dyn_pcm_assign && codec->dp_mst) {
     1911        } else if (codec->dp_mst) {
    19581912                dev_num = snd_hda_get_num_devices(codec, pin_nid) + 1;
    19591913                /*
     
    19801934                        return -ENOMEM;
    19811935
    1982                 if (spec->dyn_pcm_assign) {
    1983                         per_pin->pcm = NULL;
    1984                         per_pin->pcm_idx = -1;
    1985                 } else {
    1986                         per_pin->pcm = get_hdmi_pcm(spec, pin_idx);
    1987                         per_pin->pcm_idx = pin_idx;
    1988                 }
     1936                per_pin->pcm = NULL;
     1937                per_pin->pcm_idx = -1;
    19891938                per_pin->pin_nid = pin_nid;
    19901939                per_pin->pin_nid_idx = spec->num_nids;
     
    19951944                if (err < 0)
    19961945                        return err;
     1946                if (!is_jack_detectable(codec, pin_nid))
     1947                        codec_warn(codec, "HDMI: pin NID 0x%x - jack not detectable\n", pin_nid);
    19971948                spec->num_pins++;
    19981949        }
     
    21422093        mutex_lock(&spec->pcm_lock);
    21432094        pin_idx = hinfo_to_pin_index(codec, hinfo);
    2144         if (spec->dyn_pcm_assign && pin_idx < 0) {
    2145                 /* when dyn_pcm_assign and pcm is not bound to a pin
    2146                  * skip pin setup and return 0 to make audio playback
    2147                  * be ongoing
     2095        if (pin_idx < 0) {
     2096                /* when pcm is not bound to a pin skip pin setup and return 0
     2097                 * to make audio playback be ongoing
    21482098                 */
    21492099                pin_cvt_fixup(codec, NULL, cvt_nid);
     
    22482198                clear_bit(pcm_idx, &spec->pcm_in_use);
    22492199                pin_idx = hinfo_to_pin_index(codec, hinfo);
    2250                 if (spec->dyn_pcm_assign && pin_idx < 0)
     2200                if (pin_idx < 0)
    22512201                        goto unlock;
    22522202
     
    23462296        int idx, pcm_num;
    23472297
    2348         /*
    2349          * for non-mst mode, pcm number is the same as before
    2350          * for DP MST mode without extra PCM, pcm number is same
    2351          * for DP MST mode with extra PCMs, pcm number is
    2352          *  (nid number + dev_num - 1)
    2353          * dev_num is the device entry number in a pin
    2354          */
    2355 
    2356         if (spec->dyn_pcm_no_legacy && codec->mst_no_extra_pcms)
    2357                 pcm_num = spec->num_cvts;
    2358         else if (codec->mst_no_extra_pcms)
    2359                 pcm_num = spec->num_nids;
    2360         else
    2361                 pcm_num = spec->num_nids + spec->dev_num - 1;
    2362 
     2298        /* limit the PCM devices to the codec converters */
     2299        pcm_num = spec->num_cvts;
    23632300        codec_dbg(codec, "hdmi: pcm_num set to %d\n", pcm_num);
    23642301
     
    23792316                pstr->substreams = 1;
    23802317                pstr->ops = generic_ops;
    2381                 /* pcm number is less than 16 */
    2382                 if (spec->pcm_used >= 16)
     2318                /* pcm number is less than pcm_rec array size */
     2319                if (spec->pcm_used >= ARRAY_SIZE(spec->pcm_rec))
    23832320                        break;
    23842321                /* other pstr fields are set in open */
     
    23992336        char hdmi_str[32] = "HDMI/DP";
    24002337        struct hdmi_spec *spec = codec->spec;
    2401         struct hdmi_spec_per_pin *per_pin = get_pin(spec, pcm_idx);
    24022338        struct snd_jack *jack;
    24032339        int pcmdev = get_pcm_rec(spec, pcm_idx)->device;
     
    24062342        if (pcmdev > 0)
    24072343                sprintf(hdmi_str + strlen(hdmi_str), ",pcm=%d", pcmdev);
    2408         if (!spec->dyn_pcm_assign &&
    2409             !is_jack_detectable(codec, per_pin->pin_nid))
    2410                 strncat(hdmi_str, " Phantom",
    2411                         sizeof(hdmi_str) - strlen(hdmi_str) - 1);
    24122344
    24132345        err = snd_jack_new(codec->card, hdmi_str, SND_JACK_AVOUT, &jack,
     
    24422374                 * pin will be bound when monitor is connected
    24432375                 */
    2444                 if (spec->dyn_pcm_assign)
    2445                         err = snd_hda_create_dig_out_ctls(codec,
     2376                err = snd_hda_create_dig_out_ctls(codec,
    24462377                                          0, spec->cvt_nids[0],
    24472378                                          HDA_PCM_TYPE_HDMI);
    2448                 else {
    2449                         struct hdmi_spec_per_pin *per_pin =
    2450                                 get_pin(spec, pcm_idx);
    2451                         err = snd_hda_create_dig_out_ctls(codec,
    2452                                                   per_pin->pin_nid,
    2453                                                   per_pin->mux_nids[0],
    2454                                                   HDA_PCM_TYPE_HDMI);
    2455                 }
    24562379                if (err < 0)
    24572380                        return err;
     
    25732496                if (spec->pcm_rec[pcm_idx].jack == NULL)
    25742497                        continue;
    2575                 if (spec->dyn_pcm_assign)
    2576                         snd_device_free(codec->card,
    2577                                         spec->pcm_rec[pcm_idx].jack);
    2578                 else
    2579                         spec->pcm_rec[pcm_idx].jack = NULL;
     2498                snd_device_free(codec->card, spec->pcm_rec[pcm_idx].jack);
    25802499        }
    25812500
     
    30552974        spec = codec->spec;
    30562975        codec->dp_mst = true;
    3057         spec->dyn_pcm_assign = true;
    30582976        spec->vendor_nid = vendor_nid;
    30592977        spec->port_map = port_map;
     
    31193037         */
    31203038        static const int map[] = {0x4, 0x6, 0x8, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf};
    3121         int ret;
    3122 
    3123         ret = intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 4,
    3124                                     enable_silent_stream);
    3125         if (!ret) {
    3126                 struct hdmi_spec *spec = codec->spec;
    3127 
    3128                 spec->dyn_pcm_no_legacy = true;
    3129         }
    3130 
    3131         return ret;
     3039
     3040        return intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 4,
     3041                                     enable_silent_stream);
    31323042}
    31333043
     
    37693679
    37703680        spec = codec->spec;
    3771         spec->dyn_pcm_assign = true;
    37723681
    37733682        err = hdmi_parse_codec(codec);
     
    40493958
    40503959        codec->dp_mst = true;
    4051         codec->mst_no_extra_pcms = true;
    40523960        spec = codec->spec;
    40533961        spec->dyn_pin_out = true;
    4054         spec->dyn_pcm_assign = true;
    40553962        spec->hdmi_intr_trig_ctrl = true;
    40563963
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/patch_realtek.c

    r755 r756  
    1919#include <linux/input.h>
    2020#include <linux/leds.h>
     21#include <linux/ctype.h>
    2122#include <sound/core.h>
    2223#include <sound/jack.h>
     
    37553756        snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
    37563757
    3757         for (i = 0; i < HDA_MAX_COMPONENTS; i++)
    3758                 if (spec->comps[i].resume_hook)
    3759                         spec->comps[i].resume_hook(spec->comps[i].dev);
    3760 
    37613758        return 0;
    37623759
     
    46804677{
    46814678        //NOT_USED struct alc_spec *spec = codec->spec;
    4682         int i;
    46834679
    46844680#ifndef TARGET_OS2
     
    46864682                alc5505_dsp_suspend(codec);
    46874683
    4688         for (i = 0; i < HDA_MAX_COMPONENTS; i++)
    4689                 if (spec->comps[i].suspend_hook)
    4690                         spec->comps[i].suspend_hook(spec->comps[i].dev);
    46914684#endif
    46924685        return alc_suspend(codec);
     
    46964689{
    46974690        struct alc_spec *spec = codec->spec;
    4698         int i;
    46994691
    47004692        if (spec->codec_variant == ALC269_TYPE_ALC269VB)
     
    73647356        struct hda_codec *cdc = dev_to_hda_codec(dev);
    73657357        struct alc_spec *spec = cdc->spec;
    7366         int ret, i;
    7367 
    7368         ret = component_bind_all(dev, spec->comps);
    7369         if (ret)
    7370                 return ret;
    7371 
    7372         if (snd_hdac_is_power_on(&cdc->core)) {
    7373                 codec_dbg(cdc, "Resuming after bind.\n");
    7374                 for (i = 0; i < HDA_MAX_COMPONENTS; i++)
    7375                         if (spec->comps[i].resume_hook)
    7376                                 spec->comps[i].resume_hook(spec->comps[i].dev);
    7377         }
    7378 
    7379         return 0;
     7358
     7359        return component_bind_all(dev, spec->comps);
    73807360}
    73817361
     
    74057385}
    74067386
     7387struct cs35l41_dev_name {
     7388        const char *bus;
     7389        const char *hid;
     7390        int index;
     7391};
     7392
     7393/* match the device name in a slightly relaxed manner */
     7394static int comp_match_cs35l41_dev_name(struct device *dev, void *data)
     7395{
     7396        struct cs35l41_dev_name *p = data;
     7397        const char *d = dev_name(dev);
     7398        int n = strlen(p->bus);
     7399        char tmp[32];
     7400
     7401        /* check the bus name */
     7402        if (strncmp(d, p->bus, n))
     7403                return 0;
     7404        /* skip the bus number */
     7405        if (isdigit(d[n]))
     7406                n++;
     7407        /* the rest must be exact matching */
     7408        snprintf(tmp, sizeof(tmp), "-%s:00-cs35l41-hda.%d", p->hid, p->index);
     7409        return !strcmp(d + n, tmp);
     7410}
     7411
    74077412static void cs35l41_generic_fixup(struct hda_codec *cdc, int action, const char *bus,
    74087413                                  const char *hid, int count)
     
    74107415        struct device *dev = hda_codec_dev(cdc);
    74117416        struct alc_spec *spec = cdc->spec;
    7412         char *name;
     7417        struct cs35l41_dev_name *rec;
    74137418        int ret, i;
    74147419
     
    74167421        case HDA_FIXUP_ACT_PRE_PROBE:
    74177422                for (i = 0; i < count; i++) {
    7418                         name = devm_kasprintf(dev, GFP_KERNEL,
    7419                                               "%s-%s:00-cs35l41-hda.%d", bus, hid, i);
    7420                         if (!name)
     7423                        rec = devm_kmalloc(dev, sizeof(*rec), GFP_KERNEL);
     7424                        if (!rec)
    74217425                                return;
     7426                        rec->bus = bus;
     7427                        rec->hid = hid;
     7428                        rec->index = i;
    74227429                        spec->comps[i].codec = cdc;
    7423                         component_match_add(dev, &spec->match, component_compare_dev_name, name);
     7430                        component_match_add(dev, &spec->match,
     7431                                            comp_match_cs35l41_dev_name, rec);
    74247432                }
    74257433                ret = component_master_add_with_match(dev, &comp_master_ops, spec->match);
     
    74397447static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action)
    74407448{
    7441         cs35l41_generic_fixup(codec, action, "spi0", "CSC3551", 2);
    7442 }
    7443 
    7444 static void cs35l41_fixup_spi1_two(struct hda_codec *codec, const struct hda_fixup *fix, int action)
    7445 {
    7446         cs35l41_generic_fixup(codec, action, "spi1", "CSC3551", 2);
     7449        cs35l41_generic_fixup(codec, action, "spi", "CSC3551", 2);
    74477450}
    74487451
    74497452static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fixup *fix, int action)
    74507453{
    7451         cs35l41_generic_fixup(codec, action, "spi0", "CSC3551", 4);
     7454        cs35l41_generic_fixup(codec, action, "spi", "CSC3551", 4);
    74527455}
    74537456
     
    78387841        ALC245_FIXUP_CS35L41_SPI_2,
    78397842        ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED,
    7840         ALC245_FIXUP_CS35L41_SPI1_2,
    7841         ALC245_FIXUP_CS35L41_SPI1_2_HP_GPIO_LED,
    78427843        ALC245_FIXUP_CS35L41_SPI_4,
    78437844        ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED,
     
    1000710008                .type = HDA_FIXUP_FUNC,
    1000810009                .v.func = cs35l41_fixup_spi_two,
    10009                 .chained = true,
    10010                 .chain_id = ALC285_FIXUP_HP_GPIO_LED,
    10011         },
    10012         [ALC245_FIXUP_CS35L41_SPI1_2] = {
    10013                 .type = HDA_FIXUP_FUNC,
    10014                 .v.func = cs35l41_fixup_spi1_two,
    10015         },
    10016         [ALC245_FIXUP_CS35L41_SPI1_2_HP_GPIO_LED] = {
    10017                 .type = HDA_FIXUP_FUNC,
    10018                 .v.func = cs35l41_fixup_spi1_two,
    1001910010                .chained = true,
    1002010011                .chain_id = ALC285_FIXUP_HP_GPIO_LED,
     
    1038710378        SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED),
    1038810379        SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED),
    10389          SND_PCI_QUIRK(0x103c, 0x8abb, "HP ZBook Firefly 14 G9", ALC245_FIXUP_CS35L41_SPI1_2_HP_GPIO_LED),
     10380         SND_PCI_QUIRK(0x103c, 0x8abb, "HP ZBook Firefly 14 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
    1039010381        SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
    1039110382        SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     
    1044010431        SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401),
    1044110432        SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
     10433        SND_PCI_QUIRK(0x1043, 0x1f12, "ASUS UM5302", ALC287_FIXUP_CS35L41_I2C_2),
    1044210434        SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401),
    1044310435        SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
     
    1047110463        SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
    1047210464        SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
     10465        SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP),
     10466        SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP),
    1047310467        SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
    1047410468        SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP),
     
    1064410638        SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
    1064510639        SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
     10640        SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC),
    1064610641        SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
    1064710642        SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
Note: See TracChangeset for help on using the changeset viewer.