Changeset 737 for GPL/branches


Ignore:
Timestamp:
Sep 18, 2022, 7:39:50 AM (3 years ago)
Author:
Paul Smedley
Message:

Initial commit of 5.17.15

Location:
GPL/branches/uniaud32-exp
Files:
4 added
71 edited

Legend:

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

    r736 r737  
    236236static int snd_info_entry_open(struct inode *inode, struct file *file)
    237237{
    238         struct snd_info_entry *entry = PDE_DATA(inode);
     238        struct snd_info_entry *entry = pde_data(inode);
    239239        struct snd_info_private_data *data;
    240240        int mode, err;
     
    367367static int snd_info_text_entry_open(struct inode *inode, struct file *file)
    368368{
    369         struct snd_info_entry *entry = PDE_DATA(inode);
     369        struct snd_info_entry *entry = pde_data(inode);
    370370        struct snd_info_private_data *data;
    371371        int err;
  • GPL/branches/uniaud32-exp/alsa-kernel/core/info_oss.c

    r697 r737  
    3333        if (string == NULL) {
    3434                x = snd_sndstat_strings[num][dev];
    35                 if (x) {
    36                         kfree(x);
    37                         x = NULL;
    38                 }
     35                kfree(x);
     36                x = NULL;
    3937        } else {
    4038                x = kstrdup(string, GFP_KERNEL);
  • GPL/branches/uniaud32-exp/alsa-kernel/core/init.c

    r736 r737  
    214214 * is added automatically.  In that way, the resource disconnection is assured
    215215 * at first, then released in the expected order.
     216 *
     217 * If an error happens at the probe before snd_card_register() is called and
     218 * there have been other devres resources, you'd need to free the card manually
     219 * via snd_card_free() call in the error; otherwise it may lead to UAF due to
     220 * devres call orders.  You can use snd_card_free_on_error() helper for
     221 * handling it more easily.
    216222 */
    217223int snd_devm_card_new(struct device *parent, int idx, const char *xid,
     
    239245}
    240246EXPORT_SYMBOL_GPL(snd_devm_card_new);
     247
     248/**
     249 * snd_card_free_on_error - a small helper for handling devm probe errors
     250 * @dev: the managed device object
     251 * @ret: the return code from the probe callback
     252 *
     253 * This function handles the explicit snd_card_free() call at the error from
     254 * the probe callback.  It's just a small helper for simplifying the error
     255 * handling with the managed devices.
     256 */
     257int snd_card_free_on_error(struct device *dev, int ret)
     258{
     259        struct snd_card *card;
     260
     261        if (!ret)
     262                return 0;
     263        card = devres_find(dev, __snd_card_release, NULL, NULL);
     264        if (card)
     265                snd_card_free(card);
     266        return ret;
     267}
     268EXPORT_SYMBOL_GPL(snd_card_free_on_error);
    241269
    242270static int snd_card_init(struct snd_card *card, struct device *parent,
     
    11211149int snd_power_ref_and_wait(struct snd_card *card)
    11221150{
    1123         wait_queue_entry_t wait;
    1124         int result = 0;
    1125 
    11261151        snd_power_ref(card);
    1127         /* fastpath */
    11281152        if (snd_power_get_state(card) == SNDRV_CTL_POWER_D0)
    11291153                return 0;
    1130         init_waitqueue_entry(&wait, current);
    1131         add_wait_queue(&card->power_sleep, &wait);
    1132         while (1) {
    1133                 if (card->shutdown) {
    1134                         result = -ENODEV;
    1135                         break;
    1136                 }
    1137                 if (snd_power_get_state(card) == SNDRV_CTL_POWER_D0)
    1138                         break;
    1139                 snd_power_unref(card);
    1140                 set_current_state(TASK_UNINTERRUPTIBLE);
    1141                 schedule_timeout(30 * HZ);
    1142                 snd_power_ref(card);
    1143         }
    1144         remove_wait_queue(&card->power_sleep, &wait);
    1145         return result;
     1154        wait_event_cmd(card->power_sleep,
     1155                       card->shutdown ||
     1156                       snd_power_get_state(card) == SNDRV_CTL_POWER_D0,
     1157                       snd_power_unref(card), snd_power_ref(card));
     1158        return card->shutdown ? -ENODEV : 0;
    11461159}
    11471160EXPORT_SYMBOL_GPL(snd_power_ref_and_wait);
  • GPL/branches/uniaud32-exp/alsa-kernel/core/jack.c

    r736 r737  
    4343        struct snd_jack *jack = device->device_data;
    4444
    45         if (!jack->input_dev)
     45        mutex_lock(&jack->input_dev_lock);
     46        if (!jack->input_dev) {
     47                mutex_unlock(&jack->input_dev_lock);
    4648                return 0;
     49        }
    4750
    4851        /* If the input device is registered with the input subsystem
     
    5356                input_free_device(jack->input_dev);
    5457        jack->input_dev = NULL;
     58        mutex_unlock(&jack->input_dev_lock);
    5559#endif /* CONFIG_SND_JACK_INPUT_DEV */
    5660        return 0;
     
    9195                 card->shortname, jack->id);
    9296
    93         if (!jack->input_dev)
     97        mutex_lock(&jack->input_dev_lock);
     98        if (!jack->input_dev) {
     99                mutex_unlock(&jack->input_dev_lock);
    94100                return 0;
     101        }
    95102
    96103        jack->input_dev->name = jack->name;
     
    117124                jack->registered = 1;
    118125
     126        mutex_unlock(&jack->input_dev_lock);
    119127        return err;
    120128}
     
    518526        }
    519527
    520         /* don't creat input device for phantom jack */
     528#ifdef CONFIG_SND_JACK_INPUT_DEV
     529        mutex_init(&jack->input_dev_lock);
     530
     531        /* don't create input device for phantom jack */
    521532        if (!phantom_jack) {
    522 #ifdef CONFIG_SND_JACK_INPUT_DEV
    523533                int i;
    524534
     
    538548                                                     jack_switch_types[i]);
    539549
     550        }
    540551#endif /* CONFIG_SND_JACK_INPUT_DEV */
    541         }
    542552
    543553        err = snd_device_new(card, SNDRV_DEV_JACK, jack, &ops);
     
    579589{
    580590        WARN_ON(jack->registered);
    581         if (!jack->input_dev)
     591        mutex_lock(&jack->input_dev_lock);
     592        if (!jack->input_dev) {
     593                mutex_unlock(&jack->input_dev_lock);
    582594                return;
     595        }
    583596
    584597        jack->input_dev->dev.parent = parent;
     598        mutex_unlock(&jack->input_dev_lock);
    585599}
    586600EXPORT_SYMBOL(snd_jack_set_parent);
     
    630644/**
    631645 * snd_jack_report - Report the current status of a jack
     646 * Note: This function uses mutexes and should be called from a
     647 * context which can sleep (such as a workqueue).
    632648 *
    633649 * @jack:   The jack to report status for
     
    655671
    656672#ifdef CONFIG_SND_JACK_INPUT_DEV
    657         if (!jack->input_dev)
     673        mutex_lock(&jack->input_dev_lock);
     674        if (!jack->input_dev) {
     675                mutex_unlock(&jack->input_dev_lock);
    658676                return;
     677        }
    659678
    660679        for (i = 0; i < ARRAY_SIZE(jack->key); i++) {
     
    676695
    677696        input_sync(jack->input_dev);
     697        mutex_unlock(&jack->input_dev_lock);
    678698#endif /* CONFIG_SND_JACK_INPUT_DEV */
    679699}
  • GPL/branches/uniaud32-exp/alsa-kernel/core/memalloc.c

    r736 r737  
    325325};
    326326
     327#ifdef CONFIG_SND_DMA_SGBUF
     328static void *snd_dma_sg_fallback_alloc(struct snd_dma_buffer *dmab, size_t size);
     329#endif
     330
    327331/*
    328332 * return the physical address at the corresponding offset
  • GPL/branches/uniaud32-exp/alsa-kernel/core/pcm_lib.c

    r736 r737  
    21652165        struct snd_pcm_runtime *runtime = substream->runtime;
    21662166        snd_pcm_uframes_t old_appl_ptr = runtime->control->appl_ptr;
     2167        snd_pcm_sframes_t diff;
    21672168        int ret;
    21682169
    21692170        if (old_appl_ptr == appl_ptr)
    21702171                return 0;
     2172
     2173        if (appl_ptr >= runtime->boundary)
     2174                return -EINVAL;
     2175        /*
     2176         * check if a rewind is requested by the application
     2177         */
     2178        if (substream->runtime->info & SNDRV_PCM_INFO_NO_REWINDS) {
     2179                diff = appl_ptr - old_appl_ptr;
     2180                if (diff >= 0) {
     2181                        if (diff > runtime->buffer_size)
     2182                                return -EINVAL;
     2183                } else {
     2184                        if (runtime->boundary + diff > runtime->buffer_size)
     2185                                return -EINVAL;
     2186                }
     2187        }
    21712188
    21722189        runtime->control->appl_ptr = appl_ptr;
  • GPL/branches/uniaud32-exp/alsa-kernel/core/pcm_memory.c

    r736 r737  
    466466int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream)
    467467{
    468         struct snd_card *card = substream->pcm->card;
    469468        struct snd_pcm_runtime *runtime;
    470469
     
    475474                return 0;
    476475        if (runtime->dma_buffer_p != &substream->dma_buffer) {
     476                struct snd_card *card = substream->pcm->card;
     477
    477478                /* it's a newly allocated buffer.  release it now. */
    478479                do_free_pages(card, runtime->dma_buffer_p);
  • GPL/branches/uniaud32-exp/alsa-kernel/core/pcm_misc.c

    r736 r737  
    434434        width = pcm_formats[(INT)format].phys; /* physical width */
    435435        pat = pcm_formats[(INT)format].silence;
    436         if (! width)
     436        if (!width || !pat)
    437437                return -EINVAL;
    438438        /* signed or 1 byte data */
  • GPL/branches/uniaud32-exp/alsa-kernel/core/pcm_native.c

    r736 r737  
    176176}
    177177EXPORT_SYMBOL_GPL(_snd_pcm_stream_lock_irqsave);
     178
     179unsigned long _snd_pcm_stream_lock_irqsave_nested(struct snd_pcm_substream *substream)
     180{
     181        unsigned long flags = 0;
     182        if (substream->pcm->nonatomic)
     183                mutex_lock_nested(&substream->self_group.mutex,
     184                                  SINGLE_DEPTH_NESTING);
     185        else
     186                spin_lock_irqsave_nested(&substream->self_group.lock, flags,
     187                                         SINGLE_DEPTH_NESTING);
     188        return flags;
     189}
     190EXPORT_SYMBOL_GPL(_snd_pcm_stream_lock_irqsave_nested);
    178191
    179192/**
  • GPL/branches/uniaud32-exp/alsa-kernel/hda/Makefile

    r708 r737  
    1313#
    1414#===================================================================
    15 FILES = hdac_device.obj array.obj hdac_stream.obj hdac_controller.obj hdac_bus.obj hda_bus_type.obj hdac_regmap.obj hdmi_chmap.obj
     15FILES = hdac_device.obj array.obj hdac_stream.obj hdac_controller.obj hdac_bus.obj hda_bus_type.obj hdac_regmap.obj hdmi_chmap.obj hdac_component.obj
    1616
    1717TARGET = hdac
  • GPL/branches/uniaud32-exp/alsa-kernel/hda/ext/hdac_ext_stream.c

    r711 r737  
    1919 * snd_hdac_ext_stream_init - initialize each stream (aka device)
    2020 * @bus: HD-audio core bus
    21  * @stream: HD-audio ext core stream object to initialize
     21 * @hext_stream: HD-audio ext core stream object to initialize
    2222 * @idx: stream index number
    2323 * @direction: stream direction (SNDRV_PCM_STREAM_PLAYBACK or SNDRV_PCM_STREAM_CAPTURE)
     
    2828 */
    2929void snd_hdac_ext_stream_init(struct hdac_bus *bus,
    30                                 struct hdac_ext_stream *stream,
    31                                 int idx, int direction, int tag)
     30                              struct hdac_ext_stream *hext_stream,
     31                              int idx, int direction, int tag)
    3232{
    3333        if (bus->ppcap) {
    34                 stream->pphc_addr = bus->ppcap + AZX_PPHC_BASE +
     34                hext_stream->pphc_addr = bus->ppcap + AZX_PPHC_BASE +
    3535                                AZX_PPHC_INTERVAL * idx;
    3636
    37                 stream->pplc_addr = bus->ppcap + AZX_PPLC_BASE +
     37                hext_stream->pplc_addr = bus->ppcap + AZX_PPLC_BASE +
    3838                                AZX_PPLC_MULTI * bus->num_streams +
    3939                                AZX_PPLC_INTERVAL * idx;
     
    4141
    4242        if (bus->spbcap) {
    43                 stream->spib_addr = bus->spbcap + AZX_SPB_BASE +
     43                hext_stream->spib_addr = bus->spbcap + AZX_SPB_BASE +
    4444                                        AZX_SPB_INTERVAL * idx +
    4545                                        AZX_SPB_SPIB;
    4646
    47                 stream->fifo_addr = bus->spbcap + AZX_SPB_BASE +
     47                hext_stream->fifo_addr = bus->spbcap + AZX_SPB_BASE +
    4848                                        AZX_SPB_INTERVAL * idx +
    4949                                        AZX_SPB_MAXFIFO;
     
    5151
    5252        if (bus->drsmcap)
    53                 stream->dpibr_addr = bus->drsmcap + AZX_DRSM_BASE +
     53                hext_stream->dpibr_addr = bus->drsmcap + AZX_DRSM_BASE +
    5454                                        AZX_DRSM_INTERVAL * idx;
    5555
    56         stream->decoupled = false;
    57         snd_hdac_stream_init(bus, &stream->hstream, idx, direction, tag);
     56        hext_stream->decoupled = false;
     57        snd_hdac_stream_init(bus, &hext_stream->hstream, idx, direction, tag);
    5858}
    5959EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_init);
     
    6868 */
    6969int snd_hdac_ext_stream_init_all(struct hdac_bus *bus, int start_idx,
    70                 int num_stream, int dir)
     70                                 int num_stream, int dir)
    7171{
    7272        int stream_tag = 0;
     
    7474
    7575        for (i = 0; i < num_stream; i++) {
    76                 struct hdac_ext_stream *stream =
    77                                 kzalloc(sizeof(*stream), GFP_KERNEL);
    78                 if (!stream)
     76                struct hdac_ext_stream *hext_stream =
     77                                kzalloc(sizeof(*hext_stream), GFP_KERNEL);
     78                if (!hext_stream)
    7979                        return -ENOMEM;
    8080                tag = ++stream_tag;
    81                 snd_hdac_ext_stream_init(bus, stream, idx, dir, tag);
     81                snd_hdac_ext_stream_init(bus, hext_stream, idx, dir, tag);
    8282                idx++;
    8383        }
     
    9696{
    9797        struct hdac_stream *s, *_s;
    98         struct hdac_ext_stream *stream;
     98        struct hdac_ext_stream *hext_stream;
    9999
    100100        list_for_each_entry_safe(s, _s, &bus->stream_list, list) {
    101                 stream = stream_to_hdac_ext_stream(s);
    102                 snd_hdac_ext_stream_decouple(bus, stream, false);
     101                hext_stream = stream_to_hdac_ext_stream(s);
     102                snd_hdac_ext_stream_decouple(bus, hext_stream, false);
    103103                list_del(&s->list);
    104                 kfree(stream);
     104                kfree(hext_stream);
    105105        }
    106106}
     
    108108
    109109void snd_hdac_ext_stream_decouple_locked(struct hdac_bus *bus,
    110                                          struct hdac_ext_stream *stream,
     110                                         struct hdac_ext_stream *hext_stream,
    111111                                         bool decouple)
    112112{
    113         struct hdac_stream *hstream = &stream->hstream;
     113        struct hdac_stream *hstream = &hext_stream->hstream;
    114114        u32 val;
    115115        int mask = AZX_PPCTL_PROCEN(hstream->index);
     
    122122                snd_hdac_updatel(bus->ppcap, AZX_REG_PP_PPCTL, mask, 0);
    123123
    124         stream->decoupled = decouple;
     124        hext_stream->decoupled = decouple;
    125125}
    126126EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_decouple_locked);
     
    129129 * snd_hdac_ext_stream_decouple - decouple the hdac stream
    130130 * @bus: HD-audio core bus
    131  * @stream: HD-audio ext core stream object to initialize
     131 * @hext_stream: HD-audio ext core stream object to initialize
    132132 * @decouple: flag to decouple
    133133 */
    134134void snd_hdac_ext_stream_decouple(struct hdac_bus *bus,
    135                                   struct hdac_ext_stream *stream, bool decouple)
     135                                  struct hdac_ext_stream *hext_stream, bool decouple)
    136136{
    137137        spin_lock_irq(&bus->reg_lock);
    138         snd_hdac_ext_stream_decouple_locked(bus, stream, decouple);
     138        snd_hdac_ext_stream_decouple_locked(bus, hext_stream, decouple);
    139139        spin_unlock_irq(&bus->reg_lock);
    140140}
     
    143143/**
    144144 * snd_hdac_ext_link_stream_start - start a stream
    145  * @stream: HD-audio ext core stream to start
    146  */
    147 void snd_hdac_ext_link_stream_start(struct hdac_ext_stream *stream)
    148 {
    149         snd_hdac_updatel(stream->pplc_addr, AZX_REG_PPLCCTL,
     145 * @hext_stream: HD-audio ext core stream to start
     146 */
     147void snd_hdac_ext_link_stream_start(struct hdac_ext_stream *hext_stream)
     148{
     149        snd_hdac_updatel(hext_stream->pplc_addr, AZX_REG_PPLCCTL,
    150150                         AZX_PPLCCTL_RUN, AZX_PPLCCTL_RUN);
    151151}
     
    154154/**
    155155 * snd_hdac_ext_link_stream_clear - stop a stream DMA
    156  * @stream: HD-audio ext core stream to stop
    157  */
    158 void snd_hdac_ext_link_stream_clear(struct hdac_ext_stream *stream)
    159 {
    160         snd_hdac_updatel(stream->pplc_addr, AZX_REG_PPLCCTL, AZX_PPLCCTL_RUN, 0);
     156 * @hext_stream: HD-audio ext core stream to stop
     157 */
     158void snd_hdac_ext_link_stream_clear(struct hdac_ext_stream *hext_stream)
     159{
     160        snd_hdac_updatel(hext_stream->pplc_addr, AZX_REG_PPLCCTL, AZX_PPLCCTL_RUN, 0);
    161161}
    162162EXPORT_SYMBOL_GPL(snd_hdac_ext_link_stream_clear);
     
    164164/**
    165165 * snd_hdac_ext_link_stream_reset - reset a stream
    166  * @stream: HD-audio ext core stream to reset
    167  */
    168 void snd_hdac_ext_link_stream_reset(struct hdac_ext_stream *stream)
     166 * @hext_stream: HD-audio ext core stream to reset
     167 */
     168void snd_hdac_ext_link_stream_reset(struct hdac_ext_stream *hext_stream)
    169169{
    170170        unsigned char val;
    171171        int timeout;
    172172
    173         snd_hdac_ext_link_stream_clear(stream);
    174 
    175         snd_hdac_updatel(stream->pplc_addr, AZX_REG_PPLCCTL,
     173        snd_hdac_ext_link_stream_clear(hext_stream);
     174
     175        snd_hdac_updatel(hext_stream->pplc_addr, AZX_REG_PPLCCTL,
    176176                         AZX_PPLCCTL_STRST, AZX_PPLCCTL_STRST);
    177177        udelay(3);
    178178        timeout = 50;
    179179        do {
    180                 val = readl(stream->pplc_addr + AZX_REG_PPLCCTL) &
     180                val = readl(hext_stream->pplc_addr + AZX_REG_PPLCCTL) &
    181181                                AZX_PPLCCTL_STRST;
    182182                if (val)
     
    185185        } while (--timeout);
    186186        val &= ~AZX_PPLCCTL_STRST;
    187         writel(val, stream->pplc_addr + AZX_REG_PPLCCTL);
     187        writel(val, hext_stream->pplc_addr + AZX_REG_PPLCCTL);
    188188        udelay(3);
    189189
     
    191191        /* waiting for hardware to report that the stream is out of reset */
    192192        do {
    193                 val = readl(stream->pplc_addr + AZX_REG_PPLCCTL) & AZX_PPLCCTL_STRST;
     193                val = readl(hext_stream->pplc_addr + AZX_REG_PPLCCTL) & AZX_PPLCCTL_STRST;
    194194                if (!val)
    195195                        break;
     
    202202/**
    203203 * snd_hdac_ext_link_stream_setup -  set up the SD for streaming
    204  * @stream: HD-audio ext core stream to set up
     204 * @hext_stream: HD-audio ext core stream to set up
    205205 * @fmt: stream format
    206206 */
    207 int snd_hdac_ext_link_stream_setup(struct hdac_ext_stream *stream, int fmt)
    208 {
    209         struct hdac_stream *hstream = &stream->hstream;
     207int snd_hdac_ext_link_stream_setup(struct hdac_ext_stream *hext_stream, int fmt)
     208{
     209        struct hdac_stream *hstream = &hext_stream->hstream;
    210210        unsigned int val;
    211211
    212212        /* make sure the run bit is zero for SD */
    213         snd_hdac_ext_link_stream_clear(stream);
     213        snd_hdac_ext_link_stream_clear(hext_stream);
    214214        /* program the stream_tag */
    215         val = readl(stream->pplc_addr + AZX_REG_PPLCCTL);
     215        val = readl(hext_stream->pplc_addr + AZX_REG_PPLCCTL);
    216216        val = (val & ~AZX_PPLCCTL_STRM_MASK) |
    217217                (hstream->stream_tag << AZX_PPLCCTL_STRM_SHIFT);
    218         writel(val, stream->pplc_addr + AZX_REG_PPLCCTL);
     218        writel(val, hext_stream->pplc_addr + AZX_REG_PPLCCTL);
    219219
    220220        /* program the stream format */
    221         writew(fmt, stream->pplc_addr + AZX_REG_PPLCFMT);
     221        writew(fmt, hext_stream->pplc_addr + AZX_REG_PPLCFMT);
    222222
    223223        return 0;
     
    231231 */
    232232void snd_hdac_ext_link_set_stream_id(struct hdac_ext_link *link,
    233                                  int stream)
     233                                     int stream)
    234234{
    235235        snd_hdac_updatew(link->ml_addr, AZX_REG_ML_LOSIDV, (1 << stream), 1 << stream);
     
    251251static struct hdac_ext_stream *
    252252hdac_ext_link_stream_assign(struct hdac_bus *bus,
    253                                 struct snd_pcm_substream *substream)
     253                            struct snd_pcm_substream *substream)
    254254{
    255255        struct hdac_ext_stream *res = NULL;
    256         struct hdac_stream *stream = NULL;
     256        struct hdac_stream *hstream = NULL;
    257257
    258258        if (!bus->ppcap) {
     
    262262
    263263        spin_lock_irq(&bus->reg_lock);
    264         list_for_each_entry(stream, &bus->stream_list, list) {
    265                 struct hdac_ext_stream *hstream = container_of(stream,
    266                                                 struct hdac_ext_stream,
    267                                                 hstream);
    268                 if (stream->direction != substream->stream)
     264        list_for_each_entry(hstream, &bus->stream_list, list) {
     265                struct hdac_ext_stream *hext_stream = container_of(hstream,
     266                                                                 struct hdac_ext_stream,
     267                                                                 hstream);
     268                if (hstream->direction != substream->stream)
    269269                        continue;
    270270
    271271                /* check if decoupled stream and not in use is available */
    272                 if (hstream->decoupled && !hstream->link_locked) {
    273                         res = hstream;
     272                if (hext_stream->decoupled && !hext_stream->link_locked) {
     273                        res = hext_stream;
    274274                        break;
    275275                }
    276276
    277                 if (!hstream->link_locked) {
    278                         snd_hdac_ext_stream_decouple_locked(bus, hstream, true);
    279                         res = hstream;
     277                if (!hext_stream->link_locked) {
     278                        snd_hdac_ext_stream_decouple_locked(bus, hext_stream, true);
     279                        res = hext_stream;
    280280                        break;
    281281                }
     
    291291static struct hdac_ext_stream *
    292292hdac_ext_host_stream_assign(struct hdac_bus *bus,
    293                                 struct snd_pcm_substream *substream)
     293                            struct snd_pcm_substream *substream)
    294294{
    295295        struct hdac_ext_stream *res = NULL;
    296         struct hdac_stream *stream = NULL;
     296        struct hdac_stream *hstream = NULL;
    297297
    298298        if (!bus->ppcap) {
     
    302302
    303303        spin_lock_irq(&bus->reg_lock);
    304         list_for_each_entry(stream, &bus->stream_list, list) {
    305                 struct hdac_ext_stream *hstream = container_of(stream,
    306                                                 struct hdac_ext_stream,
    307                                                 hstream);
    308                 if (stream->direction != substream->stream)
     304        list_for_each_entry(hstream, &bus->stream_list, list) {
     305                struct hdac_ext_stream *hext_stream = container_of(hstream,
     306                                                                 struct hdac_ext_stream,
     307                                                                 hstream);
     308                if (hstream->direction != substream->stream)
    309309                        continue;
    310310
    311                 if (!stream->opened) {
    312                         if (!hstream->decoupled)
    313                                 snd_hdac_ext_stream_decouple_locked(bus, hstream, true);
    314                         res = hstream;
     311                if (!hstream->opened) {
     312                        if (!hext_stream->decoupled)
     313                                snd_hdac_ext_stream_decouple_locked(bus, hext_stream, true);
     314                        res = hext_stream;
    315315                        break;
    316316                }
     
    347347                                           int type)
    348348{
    349         struct hdac_ext_stream *hstream = NULL;
    350         struct hdac_stream *stream = NULL;
     349        struct hdac_ext_stream *hext_stream = NULL;
     350        struct hdac_stream *hstream = NULL;
    351351
    352352        switch (type) {
    353353        case HDAC_EXT_STREAM_TYPE_COUPLED:
    354                 stream = snd_hdac_stream_assign(bus, substream);
    355                 if (stream)
    356                         hstream = container_of(stream,
    357                                         struct hdac_ext_stream, hstream);
    358                 return hstream;
     354                hstream = snd_hdac_stream_assign(bus, substream);
     355                if (hstream)
     356                        hext_stream = container_of(hstream,
     357                                                   struct hdac_ext_stream,
     358                                                   hstream);
     359                return hext_stream;
    359360
    360361        case HDAC_EXT_STREAM_TYPE_HOST:
     
    372373/**
    373374 * snd_hdac_ext_stream_release - release the assigned stream
    374  * @stream: HD-audio ext core stream to release
     375 * @hext_stream: HD-audio ext core stream to release
    375376 * @type: type of stream (coupled, host or link stream)
    376377 *
    377378 * Release the stream that has been assigned by snd_hdac_ext_stream_assign().
    378379 */
    379 void snd_hdac_ext_stream_release(struct hdac_ext_stream *stream, int type)
    380 {
    381         struct hdac_bus *bus = stream->hstream.bus;
     380void snd_hdac_ext_stream_release(struct hdac_ext_stream *hext_stream, int type)
     381{
     382        struct hdac_bus *bus = hext_stream->hstream.bus;
    382383
    383384        switch (type) {
    384385        case HDAC_EXT_STREAM_TYPE_COUPLED:
    385                 snd_hdac_stream_release(&stream->hstream);
     386                snd_hdac_stream_release(&hext_stream->hstream);
    386387                break;
    387388
    388389        case HDAC_EXT_STREAM_TYPE_HOST:
    389390                spin_lock_irq(&bus->reg_lock);
    390                 if (stream->decoupled && !stream->link_locked)
    391                         snd_hdac_ext_stream_decouple_locked(bus, stream, false);
     391                if (hext_stream->decoupled && !hext_stream->link_locked)
     392                        snd_hdac_ext_stream_decouple_locked(bus, hext_stream, false);
    392393                spin_unlock_irq(&bus->reg_lock);
    393                 snd_hdac_stream_release(&stream->hstream);
     394                snd_hdac_stream_release(&hext_stream->hstream);
    394395                break;
    395396
    396397        case HDAC_EXT_STREAM_TYPE_LINK:
    397398                spin_lock_irq(&bus->reg_lock);
    398                 if (stream->decoupled && !stream->hstream.opened)
    399                         snd_hdac_ext_stream_decouple_locked(bus, stream, false);
    400                 stream->link_locked = 0;
    401                 stream->link_substream = NULL;
     399                if (hext_stream->decoupled && !hext_stream->hstream.opened)
     400                        snd_hdac_ext_stream_decouple_locked(bus, hext_stream, false);
     401                hext_stream->link_locked = 0;
     402                hext_stream->link_substream = NULL;
    402403                spin_unlock_irq(&bus->reg_lock);
    403404                break;
     
    438439 * snd_hdac_ext_stream_set_spib - sets the spib value of a stream
    439440 * @bus: HD-audio core bus
    440  * @stream: hdac_ext_stream
     441 * @hext_stream: hdac_ext_stream
    441442 * @value: spib value to set
    442443 */
    443444int snd_hdac_ext_stream_set_spib(struct hdac_bus *bus,
    444                                  struct hdac_ext_stream *stream, u32 value)
     445                                 struct hdac_ext_stream *hext_stream, u32 value)
    445446{
    446447
     
    450451        }
    451452
    452         writel(value, stream->spib_addr);
     453        writel(value, hext_stream->spib_addr);
    453454
    454455        return 0;
     
    459460 * snd_hdac_ext_stream_get_spbmaxfifo - gets the spib value of a stream
    460461 * @bus: HD-audio core bus
    461  * @stream: hdac_ext_stream
     462 * @hext_stream: hdac_ext_stream
    462463 *
    463464 * Return maxfifo for the stream
    464465 */
    465466int snd_hdac_ext_stream_get_spbmaxfifo(struct hdac_bus *bus,
    466                                  struct hdac_ext_stream *stream)
     467                                 struct hdac_ext_stream *hext_stream)
    467468{
    468469
     
    472473        }
    473474
    474         return readl(stream->fifo_addr);
     475        return readl(hext_stream->fifo_addr);
    475476}
    476477EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_get_spbmaxfifo);
    477 
    478 
    479 /**
    480  * snd_hdac_ext_stop_streams - stop all stream if running
    481  * @bus: HD-audio core bus
    482  */
    483 void snd_hdac_ext_stop_streams(struct hdac_bus *bus)
    484 {
    485         struct hdac_stream *stream;
    486 
    487         if (bus->chip_init) {
    488                 list_for_each_entry(stream, &bus->stream_list, list)
    489                         snd_hdac_stream_stop(stream);
    490                 snd_hdac_bus_stop_chip(bus);
    491         }
    492 }
    493 EXPORT_SYMBOL_GPL(snd_hdac_ext_stop_streams);
    494478
    495479/**
     
    521505 * snd_hdac_ext_stream_set_dpibr - sets the dpibr value of a stream
    522506 * @bus: HD-audio core bus
    523  * @stream: hdac_ext_stream
     507 * @hext_stream: hdac_ext_stream
    524508 * @value: dpib value to set
    525509 */
    526510int snd_hdac_ext_stream_set_dpibr(struct hdac_bus *bus,
    527                                  struct hdac_ext_stream *stream, u32 value)
     511                                  struct hdac_ext_stream *hext_stream, u32 value)
    528512{
    529513
     
    533517        }
    534518
    535         writel(value, stream->dpibr_addr);
     519        writel(value, hext_stream->dpibr_addr);
    536520
    537521        return 0;
     
    541525/**
    542526 * snd_hdac_ext_stream_set_lpib - sets the lpib value of a stream
    543  * @stream: hdac_ext_stream
     527 * @hext_stream: hdac_ext_stream
    544528 * @value: lpib value to set
    545529 */
    546 int snd_hdac_ext_stream_set_lpib(struct hdac_ext_stream *stream, u32 value)
    547 {
    548         snd_hdac_stream_writel(&stream->hstream, SD_LPIB, value);
     530int snd_hdac_ext_stream_set_lpib(struct hdac_ext_stream *hext_stream, u32 value)
     531{
     532        snd_hdac_stream_writel(&hext_stream->hstream, SD_LPIB, value);
    549533
    550534        return 0;
  • GPL/branches/uniaud32-exp/alsa-kernel/hda/hdac_stream.c

    r711 r737  
    147147}
    148148EXPORT_SYMBOL_GPL(snd_hdac_stream_stop);
     149
     150/**
     151 * snd_hdac_stop_streams_and_chip - stop all streams and chip if running
     152 * @bus: HD-audio core bus
     153 */
     154void snd_hdac_stop_streams_and_chip(struct hdac_bus *bus)
     155{
     156        struct hdac_stream *stream;
     157
     158        if (bus->chip_init) {
     159                list_for_each_entry(stream, &bus->stream_list, list, struct hdac_stream)
     160                        snd_hdac_stream_stop(stream);
     161                snd_hdac_bus_stop_chip(bus);
     162        }
     163}
     164EXPORT_SYMBOL_GPL(snd_hdac_stop_streams_and_chip);
    149165
    150166/**
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/config.h

    r730 r737  
    3636#define CONFIG_SND_HDA_CODEC_SI3054
    3737#define CONFIG_SND_HDA_CODEC_VIA
     38#define CONFIG_SND_HDA_COMPONENT
    3839#define CONFIG_SND_HDA_GENERIC
    3940#define CONFIG_SND_HDA_HWDEP
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/core.h

    r736 r737  
    288288int snd_card_free(struct snd_card *card);
    289289int snd_card_free_when_closed(struct snd_card *card);
     290int snd_card_free_on_error(struct device *dev, int ret);
    290291void snd_card_set_id(struct snd_card *card, const char *id);
    291292int snd_card_register(struct snd_card *card);
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/dmaengine_pcm.h

    r693 r737  
    6161 * src_addr_width member, not bytes) that can be send to or received from the
    6262 * DAI in one burst.
    63  * @slave_id: Slave requester id for the DMA channel.
    6463 * @filter_data: Custom DMA channel filter data, this will usually be used when
    6564 * requesting the DMA channel.
     
    7574        enum dma_slave_buswidth addr_width;
    7675        u32 maxburst;
    77         unsigned int slave_id;
    7876        void *filter_data;
    7977        const char *chan_name;
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/hdaudio.h

    r693 r737  
    573573void snd_hdac_stream_clear(struct hdac_stream *azx_dev);
    574574void snd_hdac_stream_stop(struct hdac_stream *azx_dev);
     575void snd_hdac_stop_streams_and_chip(struct hdac_bus *bus);
    575576void snd_hdac_stream_reset(struct hdac_stream *azx_dev);
    576577void snd_hdac_stream_sync_trigger(struct hdac_stream *azx_dev, bool set,
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/hdaudio_ext.h

    r711 r737  
    7979
    8080void snd_hdac_ext_stream_init(struct hdac_bus *bus,
    81                                 struct hdac_ext_stream *stream, int idx,
    82                                 int direction, int tag);
     81                              struct hdac_ext_stream *hext_stream, int idx,
     82                              int direction, int tag);
    8383int snd_hdac_ext_stream_init_all(struct hdac_bus *bus, int start_idx,
    84                 int num_stream, int dir);
     84                                 int num_stream, int dir);
    8585void snd_hdac_stream_free_all(struct hdac_bus *bus);
    8686void snd_hdac_link_free_all(struct hdac_bus *bus);
     
    8888                                           struct snd_pcm_substream *substream,
    8989                                           int type);
    90 void snd_hdac_ext_stream_release(struct hdac_ext_stream *azx_dev, int type);
     90void snd_hdac_ext_stream_release(struct hdac_ext_stream *hext_stream, int type);
    9191void snd_hdac_ext_stream_decouple_locked(struct hdac_bus *bus,
    92                                   struct hdac_ext_stream *azx_dev, bool decouple);
     92                                         struct hdac_ext_stream *hext_stream, bool decouple);
    9393void snd_hdac_ext_stream_decouple(struct hdac_bus *bus,
    9494                                struct hdac_ext_stream *azx_dev, bool decouple);
    95 void snd_hdac_ext_stop_streams(struct hdac_bus *bus);
    9695
    9796int snd_hdac_ext_stream_set_spib(struct hdac_bus *bus,
    98                                  struct hdac_ext_stream *stream, u32 value);
     97                                 struct hdac_ext_stream *hext_stream, u32 value);
    9998int snd_hdac_ext_stream_get_spbmaxfifo(struct hdac_bus *bus,
    100                                  struct hdac_ext_stream *stream);
     99                                       struct hdac_ext_stream *hext_stream);
    101100void snd_hdac_ext_stream_drsm_enable(struct hdac_bus *bus,
    102101                                bool enable, int index);
    103102int snd_hdac_ext_stream_set_dpibr(struct hdac_bus *bus,
    104                                 struct hdac_ext_stream *stream, u32 value);
    105 int snd_hdac_ext_stream_set_lpib(struct hdac_ext_stream *stream, u32 value);
     103                                struct hdac_ext_stream *hext_stream, u32 value);
     104int snd_hdac_ext_stream_set_lpib(struct hdac_ext_stream *hext_stream, u32 value);
    106105
    107 void snd_hdac_ext_link_stream_start(struct hdac_ext_stream *hstream);
    108 void snd_hdac_ext_link_stream_clear(struct hdac_ext_stream *hstream);
    109 void snd_hdac_ext_link_stream_reset(struct hdac_ext_stream *hstream);
    110 int snd_hdac_ext_link_stream_setup(struct hdac_ext_stream *stream, int fmt);
     106void snd_hdac_ext_link_stream_start(struct hdac_ext_stream *hext_stream);
     107void snd_hdac_ext_link_stream_clear(struct hdac_ext_stream *hext_stream);
     108void snd_hdac_ext_link_stream_reset(struct hdac_ext_stream *hext_stream);
     109int snd_hdac_ext_link_stream_setup(struct hdac_ext_stream *hext_stream, int fmt);
    111110
    112111struct hdac_ext_link {
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/intel-nhlt.h

    r682 r737  
    1010
    1111#include <linux/acpi.h>
     12
     13enum nhlt_link_type {
     14        NHLT_LINK_HDA = 0,
     15        NHLT_LINK_DSP = 1,
     16        NHLT_LINK_DMIC = 2,
     17        NHLT_LINK_SSP = 3,
     18        NHLT_LINK_INVALID
     19};
     20
     21enum nhlt_device_type {
     22        NHLT_DEVICE_BT = 0,
     23        NHLT_DEVICE_DMIC = 1,
     24        NHLT_DEVICE_I2S = 4,
     25        NHLT_DEVICE_INVALID
     26};
    1227
    1328#if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_SND_INTEL_NHLT)
     
    3348        u8 sub_fmt[16];
    3449} __packed;
    35 
    36 enum nhlt_link_type {
    37         NHLT_LINK_HDA = 0,
    38         NHLT_LINK_DSP = 1,
    39         NHLT_LINK_DMIC = 2,
    40         NHLT_LINK_SSP = 3,
    41         NHLT_LINK_INVALID
    42 };
    43 
    44 enum nhlt_device_type {
    45         NHLT_DEVICE_BT = 0,
    46         NHLT_DEVICE_DMIC = 1,
    47         NHLT_DEVICE_I2S = 4,
    48         NHLT_DEVICE_INVALID
    49 };
    5050
    5151struct nhlt_specific_cfg {
     
    133133int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt);
    134134
     135bool intel_nhlt_has_endpoint_type(struct nhlt_acpi_table *nhlt, u8 link_type);
     136
     137int intel_nhlt_ssp_endpoint_mask(struct nhlt_acpi_table *nhlt, u8 device_type);
     138
     139struct nhlt_specific_cfg *
     140intel_nhlt_get_endpoint_blob(struct device *dev, struct nhlt_acpi_table *nhlt,
     141                             u32 bus_id, u8 link_type, u8 vbps, u8 bps,
     142                             u8 num_ch, u32 rate, u8 dir, u8 dev_type);
     143
    135144#else
    136145
     
    151160        return 0;
    152161}
     162
     163static inline bool intel_nhlt_has_endpoint_type(struct nhlt_acpi_table *nhlt,
     164                                                u8 link_type)
     165{
     166        return false;
     167}
     168
     169static inline int intel_nhlt_ssp_endpoint_mask(struct nhlt_acpi_table *nhlt, u8 device_type)
     170{
     171        return 0;
     172}
     173
     174static inline struct nhlt_specific_cfg *
     175intel_nhlt_get_endpoint_blob(struct device *dev, struct nhlt_acpi_table *nhlt,
     176                             u32 bus_id, u8 link_type, u8 vbps, u8 bps,
     177                             u8 num_ch, u32 rate, u8 dir, u8 dev_type)
     178{
     179        return NULL;
     180}
     181
    153182#endif
    154183
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/jack.h

    r736 r737  
    6363#ifdef CONFIG_SND_JACK_INPUT_DEV
    6464        struct input_dev *input_dev;
     65        struct mutex input_dev_lock;
    6566        int registered;
    6667        int type;
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/memalloc.h

    r736 r737  
    3737#define SNDRV_DMA_TYPE_DEV              2       /* generic device continuous */
    3838#define SNDRV_DMA_TYPE_DEV_WC           5       /* continuous write-combined */
    39 #ifdef CONFIG_SND_DMA_SGBUF
    40 #define SNDRV_DMA_TYPE_DEV_SG           3       /* generic device SG-buffer */
    41 #define SNDRV_DMA_TYPE_DEV_WC_SG        6       /* SG write-combined */
    42 #else
    43 #define SNDRV_DMA_TYPE_DEV_SG   SNDRV_DMA_TYPE_DEV /* no SG-buf support */
    44 #define SNDRV_DMA_TYPE_DEV_WC_SG        SNDRV_DMA_TYPE_DEV_WC
    45 #endif
    4639#ifdef CONFIG_GENERIC_ALLOCATOR
    4740#define SNDRV_DMA_TYPE_DEV_IRAM         4       /* generic device iram-buffer */
     
    5245#define SNDRV_DMA_TYPE_NONCONTIG        8       /* non-coherent SG buffer */
    5346#define SNDRV_DMA_TYPE_NONCOHERENT      9       /* non-coherent buffer */
     47#ifdef CONFIG_SND_DMA_SGBUF
     48#define SNDRV_DMA_TYPE_DEV_SG           SNDRV_DMA_TYPE_NONCONTIG
     49#define SNDRV_DMA_TYPE_DEV_WC_SG        6       /* SG write-combined */
     50#else
     51#define SNDRV_DMA_TYPE_DEV_SG   SNDRV_DMA_TYPE_DEV /* no SG-buf support */
     52#define SNDRV_DMA_TYPE_DEV_WC_SG        SNDRV_DMA_TYPE_DEV_WC
     53#endif
     54/* fallback types, don't use those directly */
     55#ifdef CONFIG_SND_DMA_SGBUF
     56#define SNDRV_DMA_TYPE_DEV_SG_FALLBACK          10
     57#define SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK       11
     58#endif
    5459
    5560/*
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/pcm.h

    r711 r737  
    148148#define SNDRV_PCM_FMTBIT_U24_LE         _SNDRV_PCM_FMTBIT(U24_LE)
    149149#define SNDRV_PCM_FMTBIT_U24_BE         _SNDRV_PCM_FMTBIT(U24_BE)
     150// For S32/U32 formats, 'msbits' hardware parameter is often used to deliver information about the
     151// available bit count in most significant bit. It's for the case of so-called 'left-justified' or
     152// `right-padding` sample which has less width than 32 bit.
    150153#define SNDRV_PCM_FMTBIT_S32_LE         _SNDRV_PCM_FMTBIT(S32_LE)
    151154#define SNDRV_PCM_FMTBIT_S32_BE         _SNDRV_PCM_FMTBIT(S32_BE)
     
    617620void snd_pcm_stream_unlock_irq(struct snd_pcm_substream *substream);
    618621unsigned long _snd_pcm_stream_lock_irqsave(struct snd_pcm_substream *substream);
     622unsigned long _snd_pcm_stream_lock_irqsave_nested(struct snd_pcm_substream *substream);
    619623
    620624/**
     
    641645void snd_pcm_stream_unlock_irqrestore(struct snd_pcm_substream *substream,
    642646                                      unsigned long flags);
     647
     648/**
     649 * snd_pcm_stream_lock_irqsave_nested - Single-nested PCM stream locking
     650 * @substream: PCM substream
     651 * @flags: irq flags
     652 *
     653 * This locks the PCM stream like snd_pcm_stream_lock_irqsave() but with
     654 * the single-depth lockdep subclass.
     655 */
     656#define snd_pcm_stream_lock_irqsave_nested(substream, flags)            \
     657        do {                                                            \
     658                typecheck(unsigned long, flags);                        \
     659                flags = _snd_pcm_stream_lock_irqsave_nested(substream); \
     660        } while (0)
    643661
    644662/**
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/soc-component.h

    r736 r737  
    149149        int (*ack)(struct snd_soc_component *component,
    150150                   struct snd_pcm_substream *substream);
     151        snd_pcm_sframes_t (*delay)(struct snd_soc_component *component,
     152                                   struct snd_pcm_substream *substream);
    151153
    152154        const struct snd_compress_ops *compress_ops;
     
    506508                                          void *stream, int rollback);
    507509int snd_soc_pcm_component_ack(struct snd_pcm_substream *substream);
     510void snd_soc_pcm_component_delay(struct snd_pcm_substream *substream,
     511                                 snd_pcm_sframes_t *cpu_delay, snd_pcm_sframes_t *codec_delay);
    508512
    509513#endif /* __SOC_COMPONENT_H */
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/soc-dai.h

    r697 r737  
    209209void snd_soc_dai_shutdown(struct snd_soc_dai *dai,
    210210                          struct snd_pcm_substream *substream, int rollback);
    211 snd_pcm_sframes_t snd_soc_dai_delay(struct snd_soc_dai *dai,
    212                                     struct snd_pcm_substream *substream);
    213211void snd_soc_dai_suspend(struct snd_soc_dai *dai);
    214212void snd_soc_dai_resume(struct snd_soc_dai *dai);
     
    239237int snd_soc_pcm_dai_bespoke_trigger(struct snd_pcm_substream *substream,
    240238                                    int cmd);
     239void snd_soc_pcm_dai_delay(struct snd_pcm_substream *substream,
     240                           snd_pcm_sframes_t *cpu_delay, snd_pcm_sframes_t *codec_delay);
    241241
    242242int snd_soc_dai_compr_startup(struct snd_soc_dai *dai,
     
    296296        int (*set_tristate)(struct snd_soc_dai *dai, int tristate);
    297297
    298         int (*set_sdw_stream)(struct snd_soc_dai *dai,
    299                         void *stream, int direction);
    300         void *(*get_sdw_stream)(struct snd_soc_dai *dai, int direction);
     298        int (*set_stream)(struct snd_soc_dai *dai,
     299                          void *stream, int direction);
     300        void *(*get_stream)(struct snd_soc_dai *dai, int direction);
    301301
    302302        /*
     
    516516
    517517/**
    518  * snd_soc_dai_set_sdw_stream() - Configures a DAI for SDW stream operation
     518 * snd_soc_dai_set_stream() - Configures a DAI for stream operation
    519519 * @dai: DAI
    520  * @stream: STREAM
     520 * @stream: STREAM (opaque structure depending on DAI type)
    521521 * @direction: Stream direction(Playback/Capture)
    522  * SoundWire subsystem doesn't have a notion of direction and we reuse
     522 * Some subsystems, such as SoundWire, don't have a notion of direction and we reuse
    523523 * the ASoC stream direction to configure sink/source ports.
    524524 * Playback maps to source ports and Capture for sink ports.
     
    527527 * Returns 0 on success, a negative error code otherwise.
    528528 */
    529 static inline int snd_soc_dai_set_sdw_stream(struct snd_soc_dai *dai,
    530                                 void *stream, int direction)
    531 {
    532         if (dai->driver->ops->set_sdw_stream)
    533                 return dai->driver->ops->set_sdw_stream(dai, stream, direction);
     529static inline int snd_soc_dai_set_stream(struct snd_soc_dai *dai,
     530                                         void *stream, int direction)
     531{
     532        if (dai->driver->ops->set_stream)
     533                return dai->driver->ops->set_stream(dai, stream, direction);
    534534        else
    535535                return -ENOTSUPP;
     
    537537
    538538/**
    539  * snd_soc_dai_get_sdw_stream() - Retrieves SDW stream from DAI
     539 * snd_soc_dai_get_stream() - Retrieves stream from DAI
    540540 * @dai: DAI
    541541 * @direction: Stream direction(Playback/Capture)
    542542 *
    543543 * This routine only retrieves that was previously configured
    544  * with snd_soc_dai_get_sdw_stream()
     544 * with snd_soc_dai_get_stream()
    545545 *
    546546 * Returns pointer to stream or an ERR_PTR value, e.g.
    547547 * ERR_PTR(-ENOTSUPP) if callback is not supported;
    548548 */
    549 static inline void *snd_soc_dai_get_sdw_stream(struct snd_soc_dai *dai,
    550                                                int direction)
    551 {
    552         if (dai->driver->ops->get_sdw_stream)
    553                 return dai->driver->ops->get_sdw_stream(dai, direction);
     549static inline void *snd_soc_dai_get_stream(struct snd_soc_dai *dai,
     550                                           int direction)
     551{
     552        if (dai->driver->ops->get_stream)
     553                return dai->driver->ops->get_stream(dai, direction);
    554554        else
    555555                return ERR_PTR(-ENOTSUPP);
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/soc-dpcm.h

    r736 r737  
    102102
    103103        int trigger_pending; /* trigger cmd + 1 if pending, 0 if not */
     104
     105        int be_start; /* refcount protected by BE stream pcm lock */
    104106};
    105107
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/soc.h

    r697 r737  
    894894        enum snd_soc_pcm_subclass pcm_subclass;
    895895
    896         spinlock_t dpcm_lock;
    897 
    898896        int (*probe)(struct snd_soc_card *card);
    899897        int (*late_probe)(struct snd_soc_card *card);
     
    12141212int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card,
    12151213                                          const char *propname);
     1214int snd_soc_of_parse_pin_switches(struct snd_soc_card *card, const char *prop);
    12161215int snd_soc_of_get_slot_mask(struct device_node *np,
    12171216                             const char *prop_name,
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/sof.h

    r736 r737  
    1717
    1818struct snd_sof_dsp_ops;
     19
     20/**
     21 * enum sof_fw_state - DSP firmware state definitions
     22 * @SOF_FW_BOOT_NOT_STARTED:    firmware boot is not yet started
     23 * @SOF_FW_BOOT_PREPARE:        preparing for boot (firmware loading for exaqmple)
     24 * @SOF_FW_BOOT_IN_PROGRESS:    firmware boot is in progress
     25 * @SOF_FW_BOOT_FAILED:         firmware boot failed
     26 * @SOF_FW_BOOT_READY_FAILED:   firmware booted but fw_ready op failed
     27 * @SOF_FW_BOOT_READY_OK:       firmware booted and fw_ready op passed
     28 * @SOF_FW_BOOT_COMPLETE:       firmware is booted up and functional
     29 * @SOF_FW_CRASHED:             firmware crashed after successful boot
     30 */
     31enum sof_fw_state {
     32        SOF_FW_BOOT_NOT_STARTED = 0,
     33        SOF_FW_BOOT_PREPARE,
     34        SOF_FW_BOOT_IN_PROGRESS,
     35        SOF_FW_BOOT_FAILED,
     36        SOF_FW_BOOT_READY_FAILED,
     37        SOF_FW_BOOT_READY_OK,
     38        SOF_FW_BOOT_COMPLETE,
     39        SOF_FW_CRASHED,
     40};
    1941
    2042/*
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/version.h

    r736 r737  
    11/* include/version.h */
    2 #define CONFIG_SND_VERSION "5.16.20"
     2#define CONFIG_SND_VERSION "5.17.15"
    33#define CONFIG_SND_DATE ""
  • GPL/branches/uniaud32-exp/alsa-kernel/include/uapi/sound/asound.h

    r736 r737  
    229229#define SNDRV_PCM_FORMAT_U24_LE ((__force snd_pcm_format_t) 8) /* low three bytes */
    230230#define SNDRV_PCM_FORMAT_U24_BE ((__force snd_pcm_format_t) 9) /* low three bytes */
     231/*
     232 * For S32/U32 formats, 'msbits' hardware parameter is often used to deliver information about the
     233 * available bit count in most significant bit. It's for the case of so-called 'left-justified' or
     234 * `right-padding` sample which has less width than 32 bit.
     235 */
    231236#define SNDRV_PCM_FORMAT_S32_LE ((__force snd_pcm_format_t) 10)
    232237#define SNDRV_PCM_FORMAT_S32_BE ((__force snd_pcm_format_t) 11)
     
    327332#define SNDRV_PCM_INFO_HAS_LINK_SYNCHRONIZED_ATIME 0x08000000  /* report synchronized audio/system time */
    328333#define SNDRV_PCM_INFO_EXPLICIT_SYNC    0x10000000      /* needs explicit sync of pointers and data */
    329 
     334#define SNDRV_PCM_INFO_NO_REWINDS       0x20000000      /* hardware can only support monotonic changes of appl_ptr */
    330335#define SNDRV_PCM_INFO_DRAIN_TRIGGER    0x40000000              /* internal kernel flag - trigger in drain */
    331336#define SNDRV_PCM_INFO_FIFO_IN_FRAMES   0x80000000      /* internal kernel flag - FIFO size is in frames */
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/ac97/ac97_pcm.c

    r629 r737  
    232232 * for SPDIF).
    233233 *
    234  * The valid registers are AC97_PMC_MIC_ADC_RATE,
     234 * The valid registers are AC97_PCM_MIC_ADC_RATE,
    235235 * AC97_PCM_FRONT_DAC_RATE, AC97_PCM_LR_ADC_RATE.
    236236 * AC97_PCM_SURR_DAC_RATE and AC97_PCM_LFE_DAC_RATE are accepted
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/ali5451/ali5451.c

    r736 r737  
    21322132}
    21332133
    2134 static int snd_ali_probe(struct pci_dev *pci,
    2135                          const struct pci_device_id *pci_id)
     2134static int __snd_ali_probe(struct pci_dev *pci,
     2135                           const struct pci_device_id *pci_id)
    21362136{
    21372137        struct snd_card *card;
     
    21762176        pci_set_drvdata(pci, card);
    21772177        return 0;
     2178}
     2179
     2180static int snd_ali_probe(struct pci_dev *pci,
     2181                         const struct pci_device_id *pci_id)
     2182{
     2183        return snd_card_free_on_error(&pci->dev, __snd_ali_probe(pci, pci_id));
    21782184}
    21792185
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/als4000.c

    r736 r737  
    810810}
    811811
    812 static int snd_card_als4000_probe(struct pci_dev *pci,
    813                                   const struct pci_device_id *pci_id)
     812static int __snd_card_als4000_probe(struct pci_dev *pci,
     813                                    const struct pci_device_id *pci_id)
    814814{
    815815        static int dev;
     
    934934}
    935935
     936static int snd_card_als4000_probe(struct pci_dev *pci,
     937                                  const struct pci_device_id *pci_id)
     938{
     939        return snd_card_free_on_error(&pci->dev, __snd_card_als4000_probe(pci, pci_id));
     940}
     941
    936942#ifdef CONFIG_PM_SLEEP
    937943static int snd_als4000_suspend(struct device *dev)
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/atiixp.c

    r736 r737  
    15951595
    15961596
    1597 static int snd_atiixp_probe(struct pci_dev *pci,
    1598                             const struct pci_device_id *pci_id)
     1597static int __snd_atiixp_probe(struct pci_dev *pci,
     1598                              const struct pci_device_id *pci_id)
    15991599{
    16001600        struct snd_card *card;
     
    16501650}
    16511651
     1652static int snd_atiixp_probe(struct pci_dev *pci,
     1653                            const struct pci_device_id *pci_id)
     1654{
     1655        return snd_card_free_on_error(&pci->dev, __snd_atiixp_probe(pci, pci_id));
     1656}
     1657
    16521658static struct pci_driver atiixp_driver = {
    16531659        .name = KBUILD_MODNAME,
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/au88x0/au88x0.c

    r736 r737  
    194194// constructor -- see "Constructor" sub-section
    195195static int
    196 snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
     196__snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
    197197{
    198198        static int dev;
     
    311311}
    312312
     313static int
     314snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
     315{
     316        return snd_card_free_on_error(&pci->dev, __snd_vortex_probe(pci, pci_id));
     317}
     318
    313319// pci_driver definition
    314320static struct pci_driver vortex_driver = {
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/bt87x.c

    r736 r737  
    824824}
    825825
    826 static int snd_bt87x_probe(struct pci_dev *pci,
    827                            const struct pci_device_id *pci_id)
     826static int __snd_bt87x_probe(struct pci_dev *pci,
     827                             const struct pci_device_id *pci_id)
    828828{
    829829        static int dev;
     
    908908}
    909909
     910static int snd_bt87x_probe(struct pci_dev *pci,
     911                           const struct pci_device_id *pci_id)
     912{
     913        return snd_card_free_on_error(&pci->dev, __snd_bt87x_probe(pci, pci_id));
     914}
     915
    910916/* default entries for all Bt87x cards - it's not exported */
    911917/* driver_data is set to 0 to call detection */
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/ca0106/ca0106_main.c

    r736 r737  
    17291729
    17301730
    1731 static int snd_ca0106_probe(struct pci_dev *pci,
    1732                                         const struct pci_device_id *pci_id)
     1731static int __snd_ca0106_probe(struct pci_dev *pci,
     1732                              const struct pci_device_id *pci_id)
    17331733{
    17341734        static int dev;
     
    17881788        dev++;
    17891789        return 0;
     1790}
     1791
     1792static int snd_ca0106_probe(struct pci_dev *pci,
     1793                            const struct pci_device_id *pci_id)
     1794{
     1795        return snd_card_free_on_error(&pci->dev, __snd_ca0106_probe(pci, pci_id));
    17901796}
    17911797
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/cmipci.c

    r736 r737  
    32683268        err = snd_cmipci_create(card, pci, dev);
    32693269        if (err < 0)
    3270                 return err;
     3270                goto error;
    32713271
    32723272        err = snd_card_register(card);
    32733273        if (err < 0)
    3274                 return err;
     3274                goto error;
    32753275
    32763276        pci_set_drvdata(pci, card);
    32773277        dev++;
    32783278        return 0;
     3279
     3280 error:
     3281        snd_card_free(card);
     3282        return err;
    32793283}
    32803284
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/cs4281.c

    r736 r737  
    18441844}
    18451845
    1846 static int snd_cs4281_probe(struct pci_dev *pci,
    1847                             const struct pci_device_id *pci_id)
     1846static int __snd_cs4281_probe(struct pci_dev *pci,
     1847                              const struct pci_device_id *pci_id)
    18481848{
    18491849        static int dev;
     
    19051905}
    19061906
     1907static int snd_cs4281_probe(struct pci_dev *pci,
     1908                            const struct pci_device_id *pci_id)
     1909{
     1910        return snd_card_free_on_error(&pci->dev, __snd_cs4281_probe(pci, pci_id));
     1911}
     1912
    19071913/*
    19081914 * Power Management
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/cs5535audio/cs5535audio.c

    r736 r737  
    286286}
    287287
    288 static int snd_cs5535audio_probe(struct pci_dev *pci,
    289                                  const struct pci_device_id *pci_id)
     288static int __snd_cs5535audio_probe(struct pci_dev *pci,
     289                                   const struct pci_device_id *pci_id)
    290290{
    291291        static int dev;
     
    334334        dev++;
    335335        return 0;
     336}
     337
     338static int snd_cs5535audio_probe(struct pci_dev *pci,
     339                                 const struct pci_device_id *pci_id)
     340{
     341        return snd_card_free_on_error(&pci->dev, __snd_cs5535audio_probe(pci, pci_id));
    336342}
    337343
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/emu10k1/emu10k1x.c

    r736 r737  
    14991499}
    15001500
    1501 static int snd_emu10k1x_probe(struct pci_dev *pci,
    1502                               const struct pci_device_id *pci_id)
     1501static int __snd_emu10k1x_probe(struct pci_dev *pci,
     1502                                const struct pci_device_id *pci_id)
    15031503{
    15041504        static int dev;
     
    15621562}
    15631563
     1564static int snd_emu10k1x_probe(struct pci_dev *pci,
     1565                              const struct pci_device_id *pci_id)
     1566{
     1567        return snd_card_free_on_error(&pci->dev, __snd_emu10k1x_probe(pci, pci_id));
     1568}
     1569
    15641570// PCI IDs
    15651571static const struct pci_device_id snd_emu10k1x_ids[] = {
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/ens1370.c

    r736 r737  
    23202320}
    23212321
    2322 static int snd_audiopci_probe(struct pci_dev *pci,
    2323                               const struct pci_device_id *pci_id)
     2322static int __snd_audiopci_probe(struct pci_dev *pci,
     2323                                const struct pci_device_id *pci_id)
    23242324{
    23252325        static int dev;
     
    23852385}
    23862386
     2387static int snd_audiopci_probe(struct pci_dev *pci,
     2388                              const struct pci_device_id *pci_id)
     2389{
     2390        return snd_card_free_on_error(&pci->dev, __snd_audiopci_probe(pci, pci_id));
     2391}
     2392
    23872393static struct pci_driver ens137x_driver = {
    23882394        .name = KBUILD_MODNAME,
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/es1938.c

    r736 r737  
    17521752       
    17531753
    1754 static int snd_es1938_probe(struct pci_dev *pci,
    1755                             const struct pci_device_id *pci_id)
     1754static int __snd_es1938_probe(struct pci_dev *pci,
     1755                              const struct pci_device_id *pci_id)
    17561756{
    17571757        static int dev;
     
    18321832}
    18331833
     1834static int snd_es1938_probe(struct pci_dev *pci,
     1835                            const struct pci_device_id *pci_id)
     1836{
     1837        return snd_card_free_on_error(&pci->dev, __snd_es1938_probe(pci, pci_id));
     1838}
     1839
    18341840static struct pci_driver es1938_driver = {
    18351841        .name = KBUILD_MODNAME,
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/es1968.c

    r736 r737  
    27782778/*
    27792779 */
    2780 static int snd_es1968_probe(struct pci_dev *pci,
    2781                             const struct pci_device_id *pci_id)
     2780static int __snd_es1968_probe(struct pci_dev *pci,
     2781                              const struct pci_device_id *pci_id)
    27822782{
    27832783        static int dev;
     
    28852885}
    28862886
     2887static int snd_es1968_probe(struct pci_dev *pci,
     2888                            const struct pci_device_id *pci_id)
     2889{
     2890        return snd_card_free_on_error(&pci->dev, __snd_es1968_probe(pci, pci_id));
     2891}
     2892
    28872893static struct pci_driver es1968_driver = {
    28882894        .name = KBUILD_MODNAME,
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/fm801.c

    r736 r737  
    12921292}
    12931293
    1294 static int snd_card_fm801_probe(struct pci_dev *pci,
    1295                                 const struct pci_device_id *pci_id)
     1294static int __snd_card_fm801_probe(struct pci_dev *pci,
     1295                                  const struct pci_device_id *pci_id)
    12961296{
    12971297        static int dev;
     
    13551355        dev++;
    13561356        return 0;
     1357}
     1358
     1359static int snd_card_fm801_probe(struct pci_dev *pci,
     1360                                const struct pci_device_id *pci_id)
     1361{
     1362        return snd_card_free_on_error(&pci->dev, __snd_card_fm801_probe(pci, pci_id));
    13571363}
    13581364
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_auto_parser.c

    r736 r737  
    8888}
    8989
     90#ifdef TARGET_OS2
     91/**
     92 * swap - swap values of @a and @b
     93 * @a: first value
     94 * @b: second value
     95 */
     96#define swap(a, b) \
     97        do { u16 __tmp = (a); (a) = (b); (b) = __tmp; } while (0)
     98#endif
    9099/* Reorder the surround channels
    91100 * ALSA sequence is front/surr/clfe/side
     
    97106static void reorder_outputs(unsigned int nums, hda_nid_t *pins)
    98107{
    99         hda_nid_t nid;
    100 
    101108        switch (nums) {
    102109        case 3:
    103110        case 4:
    104                 nid = pins[1];
    105                 pins[1] = pins[2];
    106                 pins[2] = nid;
     111                swap(pins[1], pins[2]);
    107112                break;
    108113        }
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_bind.c

    r733 r737  
    1515#include <sound/hda_codec.h>
    1616#include "hda_local.h"
     17#include "hda_jack.h"
    1718
    1819#pragma disable_message (201)
     
    161162        refcount_dec(&codec->pcm_ref);
    162163        snd_hda_codec_disconnect_pcms(codec);
     164        snd_hda_jack_tbl_disconnect(codec);
    163165        wait_event(codec->remove_sleep, !refcount_read(&codec->pcm_ref));
    164166        snd_power_sync_ref(codec->bus->card);
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_generic.h

    r711 r737  
    184184
    185185        /* for pin sensing */
    186         /* current status; set in hda_geneic.c */
     186        /* current status; set in hda_generic.c */
    187187        unsigned int hp_jack_present:1;
    188188        unsigned int line_jack_present:1;
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_intel.c

    r736 r737  
    13821382                return;
    13831383
    1384         if (azx_has_pm_runtime(chip) && chip->running)
     1384        if (azx_has_pm_runtime(chip) && chip->running) {
    13851385                pm_runtime_get_noresume(&pci->dev);
     1386                pm_runtime_forbid(&pci->dev);
     1387                pm_runtime_dont_use_autosuspend(&pci->dev);
     1388        }
     1389
    13861390        chip->running = 0;
    13871391
     
    19781982        if (dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(dma_bits)))
    19791983                dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(32));
     1984        dma_set_max_seg_size(&pci->dev, UINT_MAX);
    19801985
    19811986        /* read number of streams from GCAP register instead of using
     
    25432548        { PCI_DEVICE(0x8086, 0x51c8),
    25442549          .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
     2550        { PCI_DEVICE(0x8086, 0x51cd),
     2551          .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
    25452552        /* Alderlake-M */
    25462553        { PCI_DEVICE(0x8086, 0x51cc),
     2554          .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
     2555        /* Alderlake-N */
     2556        { PCI_DEVICE(0x8086, 0x54c8),
    25472557          .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
    25482558        /* Elkhart Lake */
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_jack.c

    r694 r737  
    157157
    158158        return jack;
     159}
     160
     161void snd_hda_jack_tbl_disconnect(struct hda_codec *codec)
     162{
     163        struct hda_jack_tbl *jack = codec->jacktbl.list;
     164        int i;
     165
     166        for (i = 0; i < codec->jacktbl.used; i++, jack++) {
     167                if (!codec->bus->shutdown && jack->jack)
     168                        snd_device_disconnect(codec->card, jack->jack);
     169        }
    159170}
    160171
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_jack.h

    r694 r737  
    7070                              unsigned char tag, int dev_id);
    7171
     72void snd_hda_jack_tbl_disconnect(struct hda_codec *codec);
    7273void snd_hda_jack_tbl_clear(struct hda_codec *codec);
    7374
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/patch_conexant.c

    r736 r737  
    11131113                                   cxt5051_fixups, cxt_fixups);
    11141114                break;
     1115        case 0x14f15098:
     1116                codec->pin_amp_workaround = 1;
     1117                spec->gen.mixer_nid = 0x22;
     1118                spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO;
     1119                snd_hda_pick_fixup(codec, cxt5066_fixup_models,
     1120                                   cxt5066_fixups, cxt_fixups);
     1121                break;
    11151122        case 0x14f150f2:
    11161123                codec->power_save_node = 1;
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/patch_hdmi.c

    r736 r737  
    14001400 last_try:
    14011401        /* the last try; check the empty slots in pins */
    1402         for (i = 0; i < spec->num_nids; i++) {
     1402        for (i = 0; i < spec->pcm_used; i++) {
    14031403                if (!test_bit(i, &spec->pcm_bitmap))
    14041404                        return i;
     
    15481548        }
    15491549
    1550         if (!eld->eld_valid || eld->eld_size <= 0) {
     1550        if (!eld->eld_valid || eld->eld_size <= 0 || eld->info.sad_count <= 0) {
    15511551                eld->eld_valid = false;
    15521552                eld->eld_size = 0;
     
    22762276         */
    22772277
    2278         if (codec->mst_no_extra_pcms)
     2278        if (spec->dyn_pcm_no_legacy && codec->mst_no_extra_pcms)
     2279                pcm_num = spec->num_cvts;
     2280        else if (codec->mst_no_extra_pcms)
    22792281                pcm_num = spec->num_nids;
    22802282        else
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/patch_realtek.c

    r736 r737  
    2626#include "hda_jack.h"
    2727#include "hda_generic.h"
     28#ifndef TARGET_OS2
     29#include "hda_component.h"
     30#else
     31#include "hda_component2.h"
     32#endif
    2833
    2934#ifdef TARGET_OS2
     
    133138        struct input_dev *kb_dev;
    134139        u8 alc_mute_keycode_map[1];
     140
     141        /* component binding */
     142        struct component_match *match;
     143        struct hda_component comps[HDA_MAX_COMPONENTS];
    135144};
    136145
     
    941950}
    942951
     952#define alc_free        snd_hda_gen_free
     953
     954#ifdef CONFIG_PM
    943955static inline void alc_shutup(struct hda_codec *codec)
    944956{
     
    954966}
    955967
    956 #define alc_free        snd_hda_gen_free
    957 
    958 #ifdef CONFIG_PM
    959968static void alc_power_eapd(struct hda_codec *codec)
    960969{
     
    970979        return 0;
    971980}
    972 #endif
    973 
    974 #ifdef CONFIG_PM
     981
    975982static int alc_resume(struct hda_codec *codec)
    976983{
     
    23392346        ALC887_FIXUP_ASUS_AUDIO,
    23402347        ALC887_FIXUP_ASUS_HMIC,
     2348        ALCS1200A_FIXUP_MIC_VREF,
    23412349};
    23422350
     
    30723080                .chain_id = ALC887_FIXUP_ASUS_AUDIO,
    30733081        },
     3082#ifdef TARGET_OS2xxx
     3083        [ALCS1200A_FIXUP_MIC_VREF] = {
     3084                .type = HDA_FIXUP_PINCTLS,
     3085                .v.pins = (const struct hda_pintbl[]) {
     3086                        { 0x18, PIN_VREF50 }, /* rear mic */
     3087                        { 0x19, PIN_VREF50 }, /* front mic */
     3088                        {}
     3089                }
     3090        },
     3091#endif
    30743092};
    30753093
     
    31093127        SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
    31103128        SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
     3129        SND_PCI_QUIRK(0x1043, 0x8797, "ASUS TUF B550M-PLUS", ALCS1200A_FIXUP_MIC_VREF),
    31113130        SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
    31123131        SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
     
    31633182        SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
    31643183        SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
     3184        SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
    31653185        SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
    31663186        SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
     
    37693789        ALC269_TYPE_ALC215,
    37703790        ALC269_TYPE_ALC225,
     3791        ALC269_TYPE_ALC245,
    37713792        ALC269_TYPE_ALC287,
    37723793        ALC269_TYPE_ALC294,
     
    38063827        case ALC269_TYPE_ALC215:
    38073828        case ALC269_TYPE_ALC225:
     3829        case ALC269_TYPE_ALC245:
    38083830        case ALC269_TYPE_ALC287:
    38093831        case ALC269_TYPE_ALC294:
     
    43354357        bool hp1_pin_sense, hp2_pin_sense;
    43364358
    4337         if (spec->codec_variant != ALC269_TYPE_ALC287)
     4359        if (spec->codec_variant != ALC269_TYPE_ALC287 &&
     4360                spec->codec_variant != ALC269_TYPE_ALC245)
    43384361                /* required only at boot or S3 and S4 resume time */
    43394362#ifndef TARGET_OS2
     
    72727295}
    72737296
     7297static int comp_match_dev_name(struct device *dev, void *data)
     7298{
     7299        return strcmp(dev_name(dev), data) == 0;
     7300}
     7301
     7302static int find_comp_by_dev_name(struct alc_spec *spec, const char *name)
     7303{
     7304        int i;
     7305
     7306        for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
     7307                if (strcmp(spec->comps[i].name, name) == 0)
     7308                        return i;
     7309        }
     7310
     7311        return -ENODEV;
     7312}
     7313
     7314static int comp_bind(struct device *dev)
     7315{
     7316        struct hda_codec *cdc = dev_to_hda_codec(dev);
     7317        struct alc_spec *spec = cdc->spec;
     7318
     7319        return component_bind_all(dev, spec->comps);
     7320}
     7321
     7322static void comp_unbind(struct device *dev)
     7323{
     7324        struct hda_codec *cdc = dev_to_hda_codec(dev);
     7325        struct alc_spec *spec = cdc->spec;
     7326
     7327        component_unbind_all(dev, spec->comps);
     7328}
     7329
     7330static const struct component_master_ops comp_master_ops = {
     7331        .bind = comp_bind,
     7332        .unbind = comp_unbind,
     7333};
     7334
     7335static void comp_generic_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc,
     7336                                       struct snd_pcm_substream *sub, int action)
     7337{
     7338        struct alc_spec *spec = cdc->spec;
     7339        int i;
     7340
     7341        for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
     7342                if (spec->comps[i].dev)
     7343                        spec->comps[i].playback_hook(spec->comps[i].dev, action);
     7344        }
     7345}
     7346
     7347static void cs35l41_generic_fixup(struct hda_codec *cdc, int action, const char *bus,
     7348                                  const char *hid, int count)
     7349{
     7350        struct device *dev = hda_codec_dev(cdc);
     7351        struct alc_spec *spec = cdc->spec;
     7352        char *name;
     7353        int ret, i;
     7354
     7355        switch (action) {
     7356        case HDA_FIXUP_ACT_PRE_PROBE:
     7357                for (i = 0; i < count; i++) {
     7358                        name = devm_kasprintf(dev, GFP_KERNEL,
     7359                                              "%s-%s:00-cs35l41-hda.%d", bus, hid, i);
     7360                        if (!name)
     7361                                return;
     7362                        component_match_add(dev, &spec->match, comp_match_dev_name, name);
     7363                }
     7364                ret = component_master_add_with_match(dev, &comp_master_ops, spec->match);
     7365                if (ret)
     7366                        codec_err(cdc, "Fail to register component aggregator %d\n", ret);
     7367                else
     7368                        spec->gen.pcm_playback_hook = comp_generic_playback_hook;
     7369                break;
     7370        }
     7371}
     7372
     7373static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
     7374{
     7375        cs35l41_generic_fixup(cdc, action, "i2c", "CSC3551", 2);
     7376}
     7377
     7378static void alc287_legion_16achg6_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc,
     7379                                                struct snd_pcm_substream *sub, int action)
     7380{
     7381        struct alc_spec *spec = cdc->spec;
     7382        unsigned int rx_slot;
     7383        int i;
     7384
     7385        switch (action) {
     7386        case HDA_GEN_PCM_ACT_PREPARE:
     7387                rx_slot = 0;
     7388                i = find_comp_by_dev_name(spec, "i2c-CLSA0100:00-cs35l41-hda.0");
     7389                if (i >= 0)
     7390                        spec->comps[i].set_channel_map(spec->comps[i].dev, 0, NULL, 1, &rx_slot);
     7391
     7392                rx_slot = 1;
     7393                i = find_comp_by_dev_name(spec, "i2c-CLSA0100:00-cs35l41-hda.1");
     7394                if (i >= 0)
     7395                        spec->comps[i].set_channel_map(spec->comps[i].dev, 0, NULL, 1, &rx_slot);
     7396                break;
     7397        }
     7398
     7399        comp_generic_playback_hook(hinfo, cdc, sub, action);
     7400}
     7401
     7402static void alc287_fixup_legion_16achg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
     7403                                                 int action)
     7404{
     7405        struct device *dev = hda_codec_dev(cdc);
     7406        struct alc_spec *spec = cdc->spec;
     7407        int ret;
     7408
     7409        switch (action) {
     7410        case HDA_FIXUP_ACT_PRE_PROBE:
     7411                component_match_add(dev, &spec->match, comp_match_dev_name,
     7412                                    "i2c-CLSA0100:00-cs35l41-hda.0");
     7413                component_match_add(dev, &spec->match, comp_match_dev_name,
     7414                                    "i2c-CLSA0100:00-cs35l41-hda.1");
     7415                ret = component_master_add_with_match(dev, &comp_master_ops, spec->match);
     7416                if (ret)
     7417                        codec_err(cdc, "Fail to register component aggregator %d\n", ret);
     7418                else
     7419                        spec->gen.pcm_playback_hook = alc287_legion_16achg6_playback_hook;
     7420                break;
     7421        }
     7422}
     7423
    72747424/* for alc295_fixup_hp_top_speakers */
    72757425#include "hp_x360_helper.c"
     
    73357485        } else {
    73367486                snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
     7487        }
     7488}
     7489
     7490static void alc_fixup_dell4_mic_no_presence_quiet(struct hda_codec *codec,
     7491                                                  const struct hda_fixup *fix,
     7492                                                  int action)
     7493{
     7494        struct alc_spec *spec = codec->spec;
     7495        struct hda_input_mux *imux = &spec->gen.input_mux;
     7496        int i;
     7497
     7498        alc269_fixup_limit_int_mic_boost(codec, fix, action);
     7499
     7500        switch (action) {
     7501        case HDA_FIXUP_ACT_PRE_PROBE:
     7502                /**
     7503                 * Set the vref of pin 0x19 (Headset Mic) and pin 0x1b (Headphone Mic)
     7504                 * to Hi-Z to avoid pop noises at startup and when plugging and
     7505                 * unplugging headphones.
     7506                 */
     7507                snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
     7508                snd_hda_codec_set_pin_target(codec, 0x1b, PIN_VREFHIZ);
     7509                break;
     7510        case HDA_FIXUP_ACT_PROBE:
     7511                /**
     7512                 * Make the internal mic (0x12) the default input source to
     7513                 * prevent pop noises on cold boot.
     7514                 */
     7515                for (i = 0; i < imux->num_items; i++) {
     7516                        if (spec->gen.imux_pins[i] == 0x12) {
     7517                                spec->gen.cur_mux[0] = i;
     7518                                break;
     7519                        }
     7520                }
     7521                break;
    73377522        }
    73387523}
     
    73797564        ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
    73807565        ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
     7566        ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET,
    73817567        ALC269_FIXUP_HEADSET_MODE,
    73827568        ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
     
    75627748        ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
    75637749        ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
     7750        ALC287_FIXUP_LEGION_16ACHG6,
     7751        ALC287_FIXUP_CS35L41_I2C_2,
     7752        ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
     7753        ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE,
    75647754};
    75657755
     
    96299819                .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
    96309820        },
     9821        [ALC287_FIXUP_LEGION_16ACHG6] = {
     9822                .type = HDA_FIXUP_FUNC,
     9823                .v.func = alc287_fixup_legion_16achg6_speakers,
     9824        },
     9825        [ALC287_FIXUP_CS35L41_I2C_2] = {
     9826                .type = HDA_FIXUP_FUNC,
     9827                .v.func = cs35l41_fixup_i2c_two,
     9828                .chained = true,
     9829                .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
     9830        },
     9831#ifdef TARGET_OS2xxx
     9832        [ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
     9833                .type = HDA_FIXUP_VERBS,
     9834                .v.verbs = (const struct hda_verb[]) {
     9835                         { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 },
     9836                         { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 },
     9837                         { }
     9838                },
     9839                .chained = true,
     9840                .chain_id = ALC285_FIXUP_HP_MUTE_LED,
     9841        },
     9842#endif
     9843        [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET] = {
     9844                .type = HDA_FIXUP_FUNC,
     9845                .v.func = alc_fixup_dell4_mic_no_presence_quiet,
     9846                .chained = true,
     9847                .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
     9848        },
     9849#ifdef TARGET_OS2xxx
     9850        [ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE] = {
     9851                .type = HDA_FIXUP_PINS,
     9852                .v.pins = (const struct hda_pintbl[]) {
     9853                        { 0x19, 0x02a1112c }, /* use as headset mic, without its own jack detect */
     9854                        { }
     9855                },
     9856                .chained = true,
     9857                .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
     9858        },
     9859#endif
    96319860};
    96329861
     
    97199948        SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
    97209949        SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
     9950        SND_PCI_QUIRK(0x1028, 0x0a38, "Dell Latitude 7520", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET),
    97219951        SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
    97229952        SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
     
    97249954        SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
    97259955        SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
     9956        SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK),
    97269957        SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
    97279958        SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
     
    984210073        SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
    984310074        SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
     10075        SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
    984410076        SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
    984510077        SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
     
    984710079        SND_PCI_QUIRK(0x103c, 0x89c3, "HP", ALC285_FIXUP_HP_GPIO_LED),
    984810080        SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     10081        SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
    984910082        SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
    985010083        SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
     
    997410207        SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    997510208        SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     10209        SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    997610210        SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    997710211        SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     
    1003110265        SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
    1003210266        SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
     10267        SND_PCI_QUIRK(0x17aa, 0x22f1, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2),
     10268        SND_PCI_QUIRK(0x17aa, 0x22f2, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2),
     10269        SND_PCI_QUIRK(0x17aa, 0x22f3, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2),
    1003310270        SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
    1003410271        SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
     
    1004210279        SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
    1004310280        SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
     10281        SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga DuetITL 2021", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
    1004410282        SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
    1004510283        SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME),
    1004610284        SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
     10285        SND_PCI_QUIRK(0x17aa, 0x3820, "Yoga Duet 7 13ITL6", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
    1004710286        SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
    1004810287        SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
     
    1005010289        SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
    1005110290        SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
     10291        SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6),
    1005210292        SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
    1005310293        SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
     
    1007210312        SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
    1007310313        SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
     10314        SND_PCI_QUIRK(0x17aa, 0x508b, "Thinkpad X12 Gen 1", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
    1007410315        SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
    1007510316        SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
     
    1008510326        SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
    1008610327        SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
     10328        SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP),
     10329        SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP),
     10330        SND_PCI_QUIRK(0x1d05, 0x1111, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
     10331        SND_PCI_QUIRK(0x1d05, 0x1119, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
     10332        SND_PCI_QUIRK(0x1d05, 0x1129, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
     10333        SND_PCI_QUIRK(0x1d05, 0x1147, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
     10334        SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
     10335        SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP),
    1008710336        SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
    1008810337        SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
     
    1009210341        SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
    1009310342        SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
     10343        SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
    1009410344
    1009510345#if 0
     
    1088611136        case 0x10ec0285:
    1088711137        case 0x10ec0289:
    10888                 spec->codec_variant = ALC269_TYPE_ALC215;
     11138                if (alc_get_coef0(codec) & 0x0010)
     11139                        spec->codec_variant = ALC269_TYPE_ALC245;
     11140                else
     11141                        spec->codec_variant = ALC269_TYPE_ALC215;
    1088911142                spec->shutup = alc225_shutup;
    1089011143                spec->init_hook = alc225_init;
     
    1218712440        SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
    1218812441        SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
     12442        SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN),
    1218912443        SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
    1219012444        SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/intel8x0.c

    r736 r737  
    31333133}
    31343134
    3135 static int snd_intel8x0_probe(struct pci_dev *pci,
    3136                               const struct pci_device_id *pci_id)
     3135static int __snd_intel8x0_probe(struct pci_dev *pci,
     3136                                const struct pci_device_id *pci_id)
    31373137{
    31383138        struct snd_card *card;
     
    32133213}
    32143214
     3215static int snd_intel8x0_probe(struct pci_dev *pci,
     3216                              const struct pci_device_id *pci_id)
     3217{
     3218        return snd_card_free_on_error(&pci->dev, __snd_intel8x0_probe(pci, pci_id));
     3219}
     3220
    32153221static struct pci_driver intel8x0_driver = {
    32163222        .name = KBUILD_MODNAME,
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/korg1212/korg1212.c

    r736 r737  
    23562356        err = snd_korg1212_create(card, pci);
    23572357        if (err < 0)
    2358                 return err;
     2358                goto error;
    23592359
    23602360        strcpy(card->driver, "korg1212");
     
    23672367        err = snd_card_register(card);
    23682368        if (err < 0)
    2369                 return err;
     2369                goto error;
    23702370        pci_set_drvdata(pci, card);
    23712371        dev++;
    23722372        return 0;
     2373
     2374 error:
     2375        snd_card_free(card);
     2376        return err;
    23732377}
    23742378
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/maestro3.c

    r736 r737  
    26492649 */
    26502650static int
    2651 snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
     2651__snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
    26522652{
    26532653        static int dev;
     
    27142714}
    27152715
     2716static int
     2717snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
     2718{
     2719        return snd_card_free_on_error(&pci->dev, __snd_m3_probe(pci, pci_id));
     2720}
     2721
    27162722static struct pci_driver m3_driver = {
    27172723        .name = KBUILD_MODNAME,
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/nm256/nm256.c

    r736 r737  
    15781578
    15791579        snd_nm256_init_chip(chip);
    1580         card->private_free = snd_nm256_free;
    15811580
    15821581        // pci_set_master(pci); /* needed? */
     
    16851684        if (err < 0)
    16861685                return err;
     1686        card->private_free = snd_nm256_free;
    16871687
    16881688        pci_set_drvdata(pci, card);
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/rme9652/hdsp.c

    r736 r737  
    54455445        err = snd_hdsp_create(card, hdsp);
    54465446        if (err)
    5447                 return err;
     5447                goto error;
    54485448
    54495449        strcpy(card->shortname, "Hammerfall DSP");
     
    54525452        err = snd_card_register(card);
    54535453        if (err)
    5454                 return err;
     5454                goto error;
    54555455        pci_set_drvdata(pci, card);
    54565456        dev++;
    54575457        return 0;
     5458
     5459 error:
     5460        snd_card_free(card);
     5461        return err;
    54585462}
    54595463
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/rme9652/hdspm.c

    r736 r737  
    68966896        err = snd_hdspm_create(card, hdspm);
    68976897        if (err < 0)
    6898                 return err;
     6898                goto error;
    68996899
    69006900        if (hdspm->io_type != MADIface) {
     
    69156915        err = snd_card_register(card);
    69166916        if (err < 0)
    6917                 return err;
     6917                goto error;
    69186918
    69196919        pci_set_drvdata(pci, card);
     
    69216921        dev++;
    69226922        return 0;
     6923
     6924 error:
     6925        snd_card_free(card);
     6926        return err;
    69236927}
    69246928
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/rme9652/rme9652.c

    r736 r737  
    25732573        err = snd_rme9652_create(card, rme9652, precise_ptr[dev]);
    25742574        if (err)
    2575                 return err;
     2575                goto error;
    25762576
    25772577        strcpy(card->shortname, rme9652->card_name);
     
    25812581        err = snd_card_register(card);
    25822582        if (err)
    2583                 return err;
     2583                goto error;
    25842584        pci_set_drvdata(pci, card);
    25852585        dev++;
    25862586        return 0;
     2587
     2588 error:
     2589        snd_card_free(card);
     2590        return err;
    25872591}
    25882592
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/via82xx.c

    r736 r737  
    24632463};
    24642464
    2465 static int snd_via82xx_probe(struct pci_dev *pci,
    2466                              const struct pci_device_id *pci_id)
     2465static int __snd_via82xx_probe(struct pci_dev *pci,
     2466                               const struct pci_device_id *pci_id)
    24672467{
    24682468        struct snd_card *card;
     
    25742574}
    25752575
     2576static int snd_via82xx_probe(struct pci_dev *pci,
     2577                             const struct pci_device_id *pci_id)
     2578{
     2579        return snd_card_free_on_error(&pci->dev, __snd_via82xx_probe(pci, pci_id));
     2580}
     2581
    25762582static struct pci_driver via82xx_driver = {
    25772583        .name = KBUILD_MODNAME,
  • GPL/branches/uniaud32-exp/include/linux/device.h

    r730 r737  
    4242
    4343        const struct dev_pm_ops *pm;
     44};
     45
     46struct device_dma_parameters {
     47        /*
     48         * a low level driver may set these to teach IOMMU code about
     49         * sg limitations.
     50         */
     51        unsigned int max_segment_size;
     52        unsigned int min_align_mask;
     53        unsigned long segment_boundary_mask;
    4454};
    4555
     
    6777  void *platform_data;
    6878  struct dev_pm_info    power;
     79        struct device_dma_parameters *dma_parms;
    6980  struct list_head      dma_pools;      /* dma pools (if dma'ble) */
    7081  struct device_driver *driver;
     
    333344}
    334345
     346/* Generic device matching functions that all busses can use to match with */
     347int device_match_name(struct device *dev, const void *name);
     348int device_match_of_node(struct device *dev, const void *np);
     349
    335350#endif /* _LINUX_DEVICE_H */
    336351
  • GPL/branches/uniaud32-exp/include/linux/dma-mapping.h

    r736 r737  
    135135}
    136136#define pci_set_consistent_dma_mask(p,x) pci_set_dma_mask(p,x)
     137
     138static inline int dma_set_max_seg_size(struct device *dev, unsigned int size)
     139{
     140        if (dev->dma_parms) {
     141                dev->dma_parms->max_segment_size = size;
     142                return 0;
     143        }
     144        return -EIO;
     145}
    137146#endif
  • GPL/branches/uniaud32-exp/include/linux/errno.h

    r615 r737  
    1313#define ERESTARTNOHAND  514     /* restart if no handler.. */
    1414#define ENOIOCTLCMD     515     /* No ioctl command */
     15#define EPROBE_DEFER    517     /* Driver requests probe retry */
    1516#define ENOTSUPP        524     /* Operation is not supported */
    1617
  • GPL/branches/uniaud32-exp/include/linux/of.h

    r615 r737  
    2828
    2929
     30struct device_node {
     31        const char *name;
     32//      phandle phandle;
     33        const char *full_name;
     34//      struct fwnode_handle fwnode;
     35
     36        struct  property *properties;
     37        struct  property *deadprops;    /* removed properties */
     38        struct  device_node *parent;
     39        struct  device_node *child;
     40        struct  device_node *sibling;
     41        struct  kobject kobj;
     42        unsigned long _flags;
     43        void    *data;
     44};
    3045struct property {
    3146        char    *name;
     
    6075        return prop ? true : false;
    6176}
     77extern void of_node_put(struct device_node *node);
    6278
    6379#endif /* _LINUX_OF_H */
  • GPL/branches/uniaud32-exp/include/linux/stddef.h

    r305 r737  
    1010
    1111#undef offsetof
    12 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
     12#define offsetof(__typ,__id) ((size_t)&(((__typ*)0)->__id))
    1313
    1414#endif
  • GPL/branches/uniaud32-exp/include/linux/string.h

    r720 r737  
    3131#define scnprintf snprintf
    3232ssize_t strscpy(char *dest, const char *src, size_t count);
     33extern bool sysfs_streq(const char *s1, const char *s2);
    3334
    3435#endif
  • GPL/branches/uniaud32-exp/include/linux/wait.h

    r697 r737  
    133133#define wait_event(wq_head, condition)
    134134#define wake_up_all(x)                 
     135
     136#define wait_event_cmd(wq_head, condition, cmd1, cmd2)
     137
    135138#endif
  • GPL/branches/uniaud32-exp/lib32/Makefile

    r675 r737  
    3030  strncmp.obj timer.obj kobject.obj driver.obj drivers_base.obj &
    3131  instropl2.obj instropl3.obj vsprintf.obj bitmap.obj find_next_bit.obj &
    32   regmap.obj regcache.obj regcache-flat.obj regcache-rbtree.obj
     32  regmap.obj regcache.obj regcache-flat.obj regcache-rbtree.obj component.obj
    3333
    3434TARGET = linuxlib
  • GPL/branches/uniaud32-exp/lib32/devres.c

    r720 r737  
    472472}
    473473EXPORT_SYMBOL(devm_ioremap);
     474
     475/**
     476 * devm_kvasprintf - Allocate resource managed space and format a string
     477 *                   into that.
     478 * @dev: Device to allocate memory for
     479 * @gfp: the GFP mask used in the devm_kmalloc() call when
     480 *       allocating memory
     481 * @fmt: The printf()-style format string
     482 * @ap: Arguments for the format string
     483 * RETURNS:
     484 * Pointer to allocated string on success, NULL on failure.
     485 */
     486char *devm_kvasprintf(struct device *dev, gfp_t gfp, const char *fmt,
     487                      va_list ap)
     488{
     489        unsigned int len;
     490        char *p;
     491        va_list aq;
     492
     493        va_copy(aq, ap);
     494        len = vsnprintf(NULL, 0, fmt, aq);
     495        va_end(aq);
     496
     497        p = devm_kmalloc(dev, len+1, gfp);
     498        if (!p)
     499                return NULL;
     500
     501        vsnprintf(p, len+1, fmt, ap);
     502
     503        return p;
     504}
     505EXPORT_SYMBOL(devm_kvasprintf);
     506/**
     507 * devm_kasprintf - Allocate resource managed space and format a string
     508 *                  into that.
     509 * @dev: Device to allocate memory for
     510 * @gfp: the GFP mask used in the devm_kmalloc() call when
     511 *       allocating memory
     512 * @fmt: The printf()-style format string
     513 * @...: Arguments for the format string
     514 * RETURNS:
     515 * Pointer to allocated string on success, NULL on failure.
     516 */
     517char *devm_kasprintf(struct device *dev, gfp_t gfp, const char *fmt, ...)
     518{
     519        va_list ap;
     520        char *p;
     521
     522        va_start(ap, fmt);
     523        p = devm_kvasprintf(dev, gfp, fmt, ap);
     524        va_end(ap);
     525
     526        return p;
     527}
     528EXPORT_SYMBOL_GPL(devm_kasprintf);
  • GPL/branches/uniaud32-exp/lib32/drivers_base.c

    r718 r737  
    181181#endif
    182182}
     183
     184int device_match_name(struct device *dev, const void *name)
     185{
     186        return sysfs_streq(dev_name(dev), name);
     187}
     188EXPORT_SYMBOL_GPL(device_match_name);
     189
     190int device_match_of_node(struct device *dev, const void *np)
     191{
     192        return dev->of_node == np;
     193}
     194EXPORT_SYMBOL_GPL(device_match_of_node);
  • GPL/branches/uniaud32-exp/lib32/misc.c

    r639 r737  
    2828#include <linux/init.h>
    2929#include <linux/fs.h>
     30#include <linux/of.h>
    3031#include <linux/poll.h>
    3132#define CONFIG_PROC_FS 1
     
    784785        free_pages((unsigned long) ptr, pg);
    785786}
     787
     788/**
     789 * of_node_put() - Decrement refcount of a node
     790 * @node:       Node to dec refcount, NULL is supported to simplify writing of
     791 *              callers
     792 */
     793void of_node_put(struct device_node *node)
     794{
     795        if (node)
     796                kobject_put(&node->kobj);
     797}
     798
     799/**
     800 * sysfs_streq - return true if strings are equal, modulo trailing newline
     801 * @s1: one string
     802 * @s2: another string
     803 *
     804 * This routine returns true iff two strings are equal, treating both
     805 * NUL and newline-then-NUL as equivalent string terminations.  It's
     806 * geared for use with sysfs input strings, which generally terminate
     807 * with newlines but are compared against values without newlines.
     808 */
     809bool sysfs_streq(const char *s1, const char *s2)
     810{
     811        while (*s1 && *s1 == *s2) {
     812                s1++;
     813                s2++;
     814        }
     815
     816        if (*s1 == *s2)
     817                return true;
     818        if (!*s1 && *s2 == '\n' && !s2[1])
     819                return true;
     820        if (*s1 == '\n' && !s1[1] && !*s2)
     821                return true;
     822        return false;
     823}
     824EXPORT_SYMBOL(sysfs_streq);
Note: See TracChangeset for help on using the changeset viewer.