Changeset 756
- Timestamp:
- Dec 17, 2022, 8:47:17 AM (3 years ago)
- Location:
- GPL/branches/uniaud32-exp
- Files:
-
- 1 added
- 41 edited
-
alsa-kernel/core/memalloc.c (modified) (1 diff)
-
alsa-kernel/core/memalloc_local.h (modified) (1 diff)
-
alsa-kernel/core/oss/pcm_oss.c (modified) (12 diffs)
-
alsa-kernel/core/pcm.c (modified) (4 diffs)
-
alsa-kernel/core/pcm_lib.c (modified) (8 diffs)
-
alsa-kernel/core/pcm_native.c (modified) (47 diffs)
-
alsa-kernel/core/seq/seq_memory.c (modified) (3 diffs)
-
alsa-kernel/hda/ext/hdac_ext_bus.c (modified) (1 diff)
-
alsa-kernel/hda/ext/hdac_ext_controller.c (modified) (7 diffs)
-
alsa-kernel/hda/ext/hdac_ext_stream.c (modified) (8 diffs)
-
alsa-kernel/hda/hdac_stream.c (modified) (10 diffs)
-
alsa-kernel/hda/hdmi_chmap.c (modified) (1 diff)
-
alsa-kernel/include/sound/hda_codec.h (modified) (2 diffs)
-
alsa-kernel/include/sound/hda_register.h (modified) (2 diffs)
-
alsa-kernel/include/sound/hdaudio.h (modified) (4 diffs)
-
alsa-kernel/include/sound/hdaudio_ext.h (modified) (3 diffs)
-
alsa-kernel/include/sound/intel-nhlt.h (modified) (2 diffs)
-
alsa-kernel/include/sound/memalloc.h (modified) (1 diff)
-
alsa-kernel/include/sound/pcm.h (modified) (2 diffs)
-
alsa-kernel/include/sound/simple_card_utils.h (modified) (2 diffs)
-
alsa-kernel/include/sound/soc-acpi-intel-match.h (modified) (1 diff)
-
alsa-kernel/include/sound/soc.h (modified) (10 diffs)
-
alsa-kernel/include/sound/sof.h (modified) (2 diffs)
-
alsa-kernel/include/sound/version.h (modified) (1 diff)
-
alsa-kernel/include/uapi/sound/asequencer.h (modified) (1 diff)
-
alsa-kernel/include/uapi/sound/asoc.h (modified) (1 diff)
-
alsa-kernel/include/uapi/sound/asound.h (modified) (1 diff)
-
alsa-kernel/include/uapi/sound/asound_fm.h (modified) (1 diff)
-
alsa-kernel/include/uapi/sound/compress_offload.h (modified) (1 diff)
-
alsa-kernel/include/uapi/sound/compress_params.h (modified) (1 diff)
-
alsa-kernel/include/uapi/sound/emu10k1.h (modified) (1 diff)
-
alsa-kernel/include/uapi/sound/tlv.h (modified) (1 diff)
-
alsa-kernel/pci/hda/hda_codec.c (modified) (3 diffs)
-
alsa-kernel/pci/hda/hda_controller.c (modified) (1 diff)
-
alsa-kernel/pci/hda/hda_eld.c (modified) (2 diffs)
-
alsa-kernel/pci/hda/hda_intel.c (modified) (8 diffs)
-
alsa-kernel/pci/hda/hda_local.h (modified) (1 diff)
-
alsa-kernel/pci/hda/hda_sysfs.c (modified) (1 diff)
-
alsa-kernel/pci/hda/patch_ca0132.c (modified) (3 diffs)
-
alsa-kernel/pci/hda/patch_hdmi.c (modified) (24 diffs)
-
alsa-kernel/pci/hda/patch_realtek.c (modified) (16 diffs)
-
include/linux/iopoll.h (added)
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/uniaud32-exp/alsa-kernel/core/memalloc.c
r750 r756 13 13 #include <linux/mm.h> 14 14 #include <linux/dma-mapping.h> 15 #ifndef TARGET_OS2 16 #include <linux/dma-map-ops.h> 17 #endif 15 18 #include <linux/genalloc.h> 16 19 #include <linux/highmem.h> -
GPL/branches/uniaud32-exp/alsa-kernel/core/memalloc_local.h
r736 r756 14 14 }; 15 15 16 #ifdef CONFIG_SND_DMA_SGBUF17 extern const struct snd_malloc_ops snd_dma_sg_ops;18 #endif19 20 16 #endif /* __MEMALLOC_LOCAL_H */ -
GPL/branches/uniaud32-exp/alsa-kernel/core/oss/pcm_oss.c
r739 r756 1251 1251 int ret; 1252 1252 while (1) { 1253 if (runtime->stat us->state == SNDRV_PCM_STATE_XRUN ||1254 runtime->stat us->state == SNDRV_PCM_STATE_SUSPENDED) {1253 if (runtime->state == SNDRV_PCM_STATE_XRUN || 1254 runtime->state == SNDRV_PCM_STATE_SUSPENDED) { 1255 1255 #ifdef OSS_DEBUG 1256 1256 pcm_dbg(substream->pcm, 1257 1257 "pcm_oss: write: recovering from %s\n", 1258 runtime->stat us->state == SNDRV_PCM_STATE_XRUN ?1258 runtime->state == SNDRV_PCM_STATE_XRUN ? 1259 1259 "XRUN" : "SUSPEND"); 1260 1260 #endif … … 1271 1271 /* test, if we can't store new data, because the stream */ 1272 1272 /* has not been started */ 1273 if (runtime->stat us->state == SNDRV_PCM_STATE_PREPARED)1273 if (runtime->state == SNDRV_PCM_STATE_PREPARED) 1274 1274 return -EAGAIN; 1275 1275 } … … 1283 1283 int ret; 1284 1284 while (1) { 1285 if (runtime->stat us->state == SNDRV_PCM_STATE_XRUN ||1286 runtime->stat us->state == SNDRV_PCM_STATE_SUSPENDED) {1285 if (runtime->state == SNDRV_PCM_STATE_XRUN || 1286 runtime->state == SNDRV_PCM_STATE_SUSPENDED) { 1287 1287 #ifdef OSS_DEBUG 1288 1288 pcm_dbg(substream->pcm, 1289 1289 "pcm_oss: read: recovering from %s\n", 1290 runtime->stat us->state == SNDRV_PCM_STATE_XRUN ?1290 runtime->state == SNDRV_PCM_STATE_XRUN ? 1291 1291 "XRUN" : "SUSPEND"); 1292 1292 #endif … … 1294 1294 if (ret < 0) 1295 1295 break; 1296 } else if (runtime->stat us->state == SNDRV_PCM_STATE_SETUP) {1296 } else if (runtime->state == SNDRV_PCM_STATE_SETUP) { 1297 1297 ret = snd_pcm_oss_prepare(substream); 1298 1298 if (ret < 0) … … 1307 1307 mutex_lock(&runtime->oss.params_lock); 1308 1308 if (ret == -EPIPE) { 1309 if (runtime->stat us->state == SNDRV_PCM_STATE_DRAINING) {1309 if (runtime->state == SNDRV_PCM_STATE_DRAINING) { 1310 1310 ret = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL); 1311 1311 if (ret < 0) … … 1326 1326 int ret; 1327 1327 while (1) { 1328 if (runtime->stat us->state == SNDRV_PCM_STATE_XRUN ||1329 runtime->stat us->state == SNDRV_PCM_STATE_SUSPENDED) {1328 if (runtime->state == SNDRV_PCM_STATE_XRUN || 1329 runtime->state == SNDRV_PCM_STATE_SUSPENDED) { 1330 1330 #ifdef OSS_DEBUG 1331 1331 pcm_dbg(substream->pcm, 1332 1332 "pcm_oss: writev: recovering from %s\n", 1333 runtime->stat us->state == SNDRV_PCM_STATE_XRUN ?1333 runtime->state == SNDRV_PCM_STATE_XRUN ? 1334 1334 "XRUN" : "SUSPEND"); 1335 1335 #endif … … 1344 1344 /* test, if we can't store new data, because the stream */ 1345 1345 /* has not been started */ 1346 if (runtime->stat us->state == SNDRV_PCM_STATE_PREPARED)1346 if (runtime->state == SNDRV_PCM_STATE_PREPARED) 1347 1347 return -EAGAIN; 1348 1348 } … … 1355 1355 int ret; 1356 1356 while (1) { 1357 if (runtime->stat us->state == SNDRV_PCM_STATE_XRUN ||1358 runtime->stat us->state == SNDRV_PCM_STATE_SUSPENDED) {1357 if (runtime->state == SNDRV_PCM_STATE_XRUN || 1358 runtime->state == SNDRV_PCM_STATE_SUSPENDED) { 1359 1359 #ifdef OSS_DEBUG 1360 1360 pcm_dbg(substream->pcm, 1361 1361 "pcm_oss: readv: recovering from %s\n", 1362 runtime->stat us->state == SNDRV_PCM_STATE_XRUN ?1362 runtime->state == SNDRV_PCM_STATE_XRUN ? 1363 1363 "XRUN" : "SUSPEND"); 1364 1364 #endif … … 1366 1366 if (ret < 0) 1367 1367 break; 1368 } else if (runtime->stat us->state == SNDRV_PCM_STATE_SETUP) {1368 } else if (runtime->state == SNDRV_PCM_STATE_SETUP) { 1369 1369 ret = snd_pcm_oss_prepare(substream); 1370 1370 if (ret < 0) … … 1649 1649 set_current_state(TASK_INTERRUPTIBLE); 1650 1650 snd_pcm_stream_lock_irq(substream); 1651 state = runtime->stat us->state;1651 state = runtime->state; 1652 1652 snd_pcm_stream_unlock_irq(substream); 1653 1653 if (state != SNDRV_PCM_STATE_RUNNING) { … … 2868 2868 poll_wait(file, &runtime->sleep, wait); 2869 2869 snd_pcm_stream_lock_irq(psubstream); 2870 if (runtime->stat us->state != SNDRV_PCM_STATE_DRAINING &&2871 (runtime->stat us->state != SNDRV_PCM_STATE_RUNNING ||2870 if (runtime->state != SNDRV_PCM_STATE_DRAINING && 2871 (runtime->state != SNDRV_PCM_STATE_RUNNING || 2872 2872 snd_pcm_oss_playback_ready(psubstream))) 2873 2873 mask |= EPOLLOUT | EPOLLWRNORM; … … 2879 2879 poll_wait(file, &runtime->sleep, wait); 2880 2880 snd_pcm_stream_lock_irq(csubstream); 2881 ostate = runtime->stat us->state;2881 ostate = runtime->state; 2882 2882 if (ostate != SNDRV_PCM_STATE_RUNNING || 2883 2883 snd_pcm_oss_capture_ready(csubstream)) -
GPL/branches/uniaud32-exp/alsa-kernel/core/pcm.c
r750 r756 391 391 goto unlock; 392 392 } 393 if (runtime->stat us->state == SNDRV_PCM_STATE_OPEN) {393 if (runtime->state == SNDRV_PCM_STATE_OPEN) { 394 394 snd_iprintf(buffer, "no setup\n"); 395 395 goto unlock; … … 428 428 goto unlock; 429 429 } 430 if (runtime->stat us->state == SNDRV_PCM_STATE_OPEN) {430 if (runtime->state == SNDRV_PCM_STATE_OPEN) { 431 431 snd_iprintf(buffer, "no setup\n"); 432 432 goto unlock; … … 978 978 init_waitqueue_head(&runtime->tsleep); 979 979 980 runtime->status->state = SNDRV_PCM_STATE_OPEN;980 __snd_pcm_set_state(runtime, SNDRV_PCM_STATE_OPEN); 981 981 mutex_init(&runtime->buffer_mutex); 982 982 atomic_set(&runtime->buffer_accessing, 0); … … 1122 1122 snd_pcm_stop(substream, SNDRV_PCM_STATE_DISCONNECTED); 1123 1123 /* to be sure, set the state unconditionally */ 1124 substream->runtime->status->state = SNDRV_PCM_STATE_DISCONNECTED; 1124 __snd_pcm_set_state(substream->runtime, 1125 SNDRV_PCM_STATE_DISCONNECTED); 1125 1126 wake_up(&substream->runtime->sleep); 1126 1127 wake_up(&substream->runtime->tsleep); -
GPL/branches/uniaud32-exp/alsa-kernel/core/pcm_lib.c
r739 r756 212 212 if (avail > runtime->avail_max) 213 213 runtime->avail_max = avail; 214 if (runtime->stat us->state == SNDRV_PCM_STATE_DRAINING) {214 if (runtime->state == SNDRV_PCM_STATE_DRAINING) { 215 215 if (avail >= runtime->buffer_size) { 216 216 snd_pcm_drain_done(substream); … … 1948 1948 snd_pcm_stream_lock_irq(substream); 1949 1949 set_current_state(TASK_INTERRUPTIBLE); 1950 switch (runtime->stat us->state) {1950 switch (runtime->state) { 1951 1951 case SNDRV_PCM_STATE_SUSPENDED: 1952 1952 err = -ESTRPIPE; … … 2136 2136 if (snd_BUG_ON(!substream->ops->copy_user && !runtime->dma_area)) 2137 2137 return -EINVAL; 2138 if (runtime->stat us->state == SNDRV_PCM_STATE_OPEN)2138 if (runtime->state == SNDRV_PCM_STATE_OPEN) 2139 2139 return -EBADFD; 2140 2140 return 0; … … 2143 2143 static int pcm_accessible_state(struct snd_pcm_runtime *runtime) 2144 2144 { 2145 switch (runtime->stat us->state) {2145 switch (runtime->state) { 2146 2146 case SNDRV_PCM_STATE_PREPARED: 2147 2147 case SNDRV_PCM_STATE_RUNNING: … … 2266 2266 runtime->twake = runtime->control->avail_min ? runtime->control->avail_min : 1; 2267 2267 #endif 2268 if (runtime->stat us->state == SNDRV_PCM_STATE_RUNNING)2268 if (runtime->state == SNDRV_PCM_STATE_RUNNING) 2269 2269 snd_pcm_update_hw_ptr(substream); 2270 2270 … … 2274 2274 */ 2275 2275 if (!is_playback && 2276 runtime->stat us->state == SNDRV_PCM_STATE_PREPARED &&2276 runtime->state == SNDRV_PCM_STATE_PREPARED && 2277 2277 size >= runtime->start_threshold) { 2278 2278 err = snd_pcm_start(substream); … … 2288 2288 if (!avail) { 2289 2289 if (!is_playback && 2290 runtime->stat us->state == SNDRV_PCM_STATE_DRAINING) {2290 runtime->state == SNDRV_PCM_STATE_DRAINING) { 2291 2291 snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP); 2292 2292 goto _end_unlock; … … 2361 2361 avail -= frames; 2362 2362 if (is_playback && 2363 runtime->stat us->state == SNDRV_PCM_STATE_PREPARED &&2363 runtime->state == SNDRV_PCM_STATE_PREPARED && 2364 2364 snd_pcm_playback_hw_avail(runtime) >= (snd_pcm_sframes_t)runtime->start_threshold) { 2365 2365 err = snd_pcm_start(substream); -
GPL/branches/uniaud32-exp/alsa-kernel/core/pcm_native.c
r750 r756 600 600 { 601 601 snd_pcm_stream_lock_irq(substream); 602 if (substream->runtime->stat us->state != SNDRV_PCM_STATE_DISCONNECTED)603 substream->runtime->status->state = state;602 if (substream->runtime->state != SNDRV_PCM_STATE_DISCONNECTED) 603 __snd_pcm_set_state(substream->runtime, state); 604 604 snd_pcm_stream_unlock_irq(substream); 605 605 } … … 731 731 return err; 732 732 snd_pcm_stream_lock_irq(substream); 733 switch (runtime->stat us->state) {733 switch (runtime->state) { 734 734 case SNDRV_PCM_STATE_OPEN: 735 735 case SNDRV_PCM_STATE_SETUP: … … 896 896 return result; 897 897 snd_pcm_stream_lock_irq(substream); 898 switch (runtime->stat us->state) {898 switch (runtime->state) { 899 899 case SNDRV_PCM_STATE_SETUP: 900 900 case SNDRV_PCM_STATE_PREPARED: … … 927 927 runtime = substream->runtime; 928 928 snd_pcm_stream_lock_irq(substream); 929 if (runtime->stat us->state == SNDRV_PCM_STATE_OPEN) {929 if (runtime->state == SNDRV_PCM_STATE_OPEN) { 930 930 snd_pcm_stream_unlock_irq(substream); 931 931 return -EBADFD; … … 1020 1020 runtime->audio_tstamp_report.valid = 1; 1021 1021 1022 status->state = runtime->stat us->state;1023 status->suspended_state = runtime->s tatus->suspended_state;1022 status->state = runtime->state; 1023 status->suspended_state = runtime->suspended_state; 1024 1024 if (status->state == SNDRV_PCM_STATE_OPEN) 1025 1025 goto _end; … … 1176 1176 runtime = substream->runtime; 1177 1177 snd_pcm_stream_lock_irq(substream); 1178 if (runtime->stat us->state == SNDRV_PCM_STATE_OPEN) {1178 if (runtime->state == SNDRV_PCM_STATE_OPEN) { 1179 1179 snd_pcm_stream_unlock_irq(substream); 1180 1180 return -EBADFD; … … 1439 1439 { 1440 1440 struct snd_pcm_runtime *runtime = substream->runtime; 1441 if (runtime->stat us->state != SNDRV_PCM_STATE_PREPARED)1441 if (runtime->state != SNDRV_PCM_STATE_PREPARED) 1442 1442 return -EBADFD; 1443 1443 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && … … 1472 1472 runtime->hw_ptr_buffer_jiffies = (runtime->buffer_size * HZ) / 1473 1473 runtime->rate; 1474 runtime->status->state = state;1474 __snd_pcm_set_state(runtime, state); 1475 1475 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && 1476 1476 runtime->silence_size > 0) … … 1513 1513 { 1514 1514 struct snd_pcm_runtime *runtime = substream->runtime; 1515 if (runtime->stat us->state == SNDRV_PCM_STATE_OPEN)1515 if (runtime->state == SNDRV_PCM_STATE_OPEN) 1516 1516 return -EBADFD; 1517 1517 runtime->trigger_master = substream; … … 1534 1534 { 1535 1535 struct snd_pcm_runtime *runtime = substream->runtime; 1536 if (runtime->stat us->state != state) {1536 if (runtime->state != state) { 1537 1537 snd_pcm_trigger_tstamp(substream); 1538 runtime->status->state = state;1538 __snd_pcm_set_state(runtime, state); 1539 1539 snd_pcm_timer_notify(substream, SNDRV_TIMER_EVENT_MSTOP); 1540 1540 } … … 1612 1612 return -ENOSYS; 1613 1613 if (pause_pushed(state)) { 1614 if (runtime->stat us->state != SNDRV_PCM_STATE_RUNNING)1614 if (runtime->state != SNDRV_PCM_STATE_RUNNING) 1615 1615 return -EBADFD; 1616 } else if (runtime->stat us->state != SNDRV_PCM_STATE_PAUSED)1616 } else if (runtime->state != SNDRV_PCM_STATE_PAUSED) 1617 1617 return -EBADFD; 1618 1618 runtime->trigger_master = substream; … … 1656 1656 snd_pcm_trigger_tstamp(substream); 1657 1657 if (pause_pushed(state)) { 1658 runtime->status->state = SNDRV_PCM_STATE_PAUSED;1658 __snd_pcm_set_state(runtime, SNDRV_PCM_STATE_PAUSED); 1659 1659 snd_pcm_timer_notify(substream, SNDRV_TIMER_EVENT_MPAUSE); 1660 1660 wake_up(&runtime->sleep); 1661 1661 wake_up(&runtime->tsleep); 1662 1662 } else { 1663 runtime->status->state = SNDRV_PCM_STATE_RUNNING;1663 __snd_pcm_set_state(runtime, SNDRV_PCM_STATE_RUNNING); 1664 1664 snd_pcm_timer_notify(substream, SNDRV_TIMER_EVENT_MCONTINUE); 1665 1665 } … … 1696 1696 { 1697 1697 struct snd_pcm_runtime *runtime = substream->runtime; 1698 switch (runtime->stat us->state) {1698 switch (runtime->state) { 1699 1699 case SNDRV_PCM_STATE_SUSPENDED: 1700 1700 return -EBUSY; … … 1727 1727 struct snd_pcm_runtime *runtime = substream->runtime; 1728 1728 snd_pcm_trigger_tstamp(substream); 1729 runtime->status->suspended_state = runtime->status->state; 1730 runtime->status->state = SNDRV_PCM_STATE_SUSPENDED; 1729 runtime->suspended_state = runtime->state; 1730 runtime->status->suspended_state = runtime->suspended_state; 1731 __snd_pcm_set_state(runtime, SNDRV_PCM_STATE_SUSPENDED); 1731 1732 snd_pcm_timer_notify(substream, SNDRV_TIMER_EVENT_MSUSPEND); 1732 1733 wake_up(&runtime->sleep); … … 1819 1820 return 0; 1820 1821 /* DMA not running previously? */ 1821 if (runtime->s tatus->suspended_state != SNDRV_PCM_STATE_RUNNING &&1822 (runtime->s tatus->suspended_state != SNDRV_PCM_STATE_DRAINING ||1822 if (runtime->suspended_state != SNDRV_PCM_STATE_RUNNING && 1823 (runtime->suspended_state != SNDRV_PCM_STATE_DRAINING || 1823 1824 substream->stream != SNDRV_PCM_STREAM_PLAYBACK)) 1824 1825 return 0; … … 1839 1840 struct snd_pcm_runtime *runtime = substream->runtime; 1840 1841 snd_pcm_trigger_tstamp(substream); 1841 runtime->status->state = runtime->status->suspended_state;1842 __snd_pcm_set_state(runtime, runtime->suspended_state); 1842 1843 snd_pcm_timer_notify(substream, SNDRV_TIMER_EVENT_MRESUME); 1843 1844 } … … 1876 1877 1877 1878 snd_pcm_stream_lock_irq(substream); 1878 switch (runtime->stat us->state) {1879 switch (runtime->state) { 1879 1880 case SNDRV_PCM_STATE_XRUN: 1880 1881 result = 0; /* already there */ … … 1899 1900 { 1900 1901 struct snd_pcm_runtime *runtime = substream->runtime; 1901 switch (runtime->stat us->state) {1902 switch (runtime->state) { 1902 1903 case SNDRV_PCM_STATE_RUNNING: 1903 1904 case SNDRV_PCM_STATE_PREPARED: … … 1961 1962 int f_flags = (__force int)state; 1962 1963 1963 if (runtime->stat us->state == SNDRV_PCM_STATE_OPEN ||1964 runtime->stat us->state == SNDRV_PCM_STATE_DISCONNECTED)1964 if (runtime->state == SNDRV_PCM_STATE_OPEN || 1965 runtime->state == SNDRV_PCM_STATE_DISCONNECTED) 1965 1966 return -EBADFD; 1966 1967 if (snd_pcm_running(substream)) … … 2013 2014 2014 2015 snd_pcm_stream_lock_irq(substream); 2015 switch (substream->runtime->stat us->state) {2016 switch (substream->runtime->state) { 2016 2017 case SNDRV_PCM_STATE_PAUSED: 2017 2018 snd_pcm_pause(substream, false); … … 2037 2038 { 2038 2039 struct snd_pcm_runtime *runtime = substream->runtime; 2039 switch (runtime->stat us->state) {2040 switch (runtime->state) { 2040 2041 case SNDRV_PCM_STATE_OPEN: 2041 2042 case SNDRV_PCM_STATE_DISCONNECTED: … … 2052 2053 struct snd_pcm_runtime *runtime = substream->runtime; 2053 2054 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 2054 switch (runtime->stat us->state) {2055 switch (runtime->state) { 2055 2056 case SNDRV_PCM_STATE_PREPARED: 2056 2057 /* start playback stream if possible */ … … 2059 2060 snd_pcm_post_start(substream, SNDRV_PCM_STATE_DRAINING); 2060 2061 } else { 2061 runtime->status->state = SNDRV_PCM_STATE_SETUP;2062 __snd_pcm_set_state(runtime, SNDRV_PCM_STATE_SETUP); 2062 2063 } 2063 2064 break; 2064 2065 case SNDRV_PCM_STATE_RUNNING: 2065 runtime->status->state = SNDRV_PCM_STATE_DRAINING;2066 __snd_pcm_set_state(runtime, SNDRV_PCM_STATE_DRAINING); 2066 2067 break; 2067 2068 case SNDRV_PCM_STATE_XRUN: 2068 runtime->status->state = SNDRV_PCM_STATE_SETUP;2069 __snd_pcm_set_state(runtime, SNDRV_PCM_STATE_SETUP); 2069 2070 break; 2070 2071 default: … … 2073 2074 } else { 2074 2075 /* stop running stream */ 2075 if (runtime->stat us->state == SNDRV_PCM_STATE_RUNNING) {2076 if (runtime->state == SNDRV_PCM_STATE_RUNNING) { 2076 2077 snd_pcm_state_t new_state; 2077 2078 … … 2083 2084 } 2084 2085 2085 if (runtime->stat us->state == SNDRV_PCM_STATE_DRAINING &&2086 if (runtime->state == SNDRV_PCM_STATE_DRAINING && 2086 2087 runtime->trigger_master == substream && 2087 2088 (runtime->hw.info & SNDRV_PCM_INFO_DRAIN_TRIGGER)) … … 2124 2125 runtime = substream->runtime; 2125 2126 2126 if (runtime->stat us->state == SNDRV_PCM_STATE_OPEN)2127 if (runtime->state == SNDRV_PCM_STATE_OPEN) 2127 2128 return -EBADFD; 2128 2129 … … 2135 2136 snd_pcm_stream_lock_irq(substream); 2136 2137 /* resume pause */ 2137 if (runtime->stat us->state == SNDRV_PCM_STATE_PAUSED)2138 if (runtime->state == SNDRV_PCM_STATE_PAUSED) 2138 2139 snd_pcm_pause(substream, false); 2139 2140 … … 2163 2164 continue; 2164 2165 runtime = s->runtime; 2165 if (runtime->stat us->state == SNDRV_PCM_STATE_DRAINING) {2166 if (runtime->state == SNDRV_PCM_STATE_DRAINING) { 2166 2167 to_check = runtime; 2167 2168 break; … … 2202 2203 } 2203 2204 if (tout == 0) { 2204 if (substream->runtime->stat us->state == SNDRV_PCM_STATE_SUSPENDED)2205 if (substream->runtime->state == SNDRV_PCM_STATE_SUSPENDED) 2205 2206 result = -ESTRPIPE; 2206 2207 else { … … 2234 2235 runtime = substream->runtime; 2235 2236 2236 if (runtime->stat us->state == SNDRV_PCM_STATE_OPEN ||2237 runtime->stat us->state == SNDRV_PCM_STATE_DISCONNECTED)2237 if (runtime->state == SNDRV_PCM_STATE_OPEN || 2238 runtime->state == SNDRV_PCM_STATE_DISCONNECTED) 2238 2239 return -EBADFD; 2239 2240 2240 2241 snd_pcm_stream_lock_irq(substream); 2241 2242 /* resume pause */ 2242 if (runtime->stat us->state == SNDRV_PCM_STATE_PAUSED)2243 if (runtime->state == SNDRV_PCM_STATE_PAUSED) 2243 2244 snd_pcm_pause(substream, false); 2244 2245 … … 2308 2309 2309 2310 down_write(&snd_pcm_link_rwsem); 2310 if (substream->runtime->stat us->state == SNDRV_PCM_STATE_OPEN ||2311 substream->runtime->stat us->state != substream1->runtime->status->state ||2311 if (substream->runtime->state == SNDRV_PCM_STATE_OPEN || 2312 substream->runtime->state != substream1->runtime->state || 2312 2313 substream->pcm->nonatomic != substream1->pcm->nonatomic) { 2313 2314 res = -EBADFD; … … 2738 2739 snd_pcm_drop(substream); 2739 2740 if (substream->hw_opened) { 2740 if (substream->runtime->stat us->state != SNDRV_PCM_STATE_OPEN)2741 if (substream->runtime->state != SNDRV_PCM_STATE_OPEN) 2741 2742 do_hw_free(substream); 2742 2743 substream->ops->close(substream); … … 2942 2943 static int do_pcm_hwsync(struct snd_pcm_substream *substream) 2943 2944 { 2944 switch (substream->runtime->stat us->state) {2945 switch (substream->runtime->state) { 2945 2946 case SNDRV_PCM_STATE_DRAINING: 2946 2947 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) … … 3258 3259 snd_pcm_sframes_t result; 3259 3260 3260 if (runtime->stat us->state == SNDRV_PCM_STATE_OPEN)3261 if (runtime->state == SNDRV_PCM_STATE_OPEN) 3261 3262 return -EBADFD; 3262 3263 if (put_user(0, &_xferi->result)) … … 3281 3282 snd_pcm_sframes_t result; 3282 3283 3283 if (runtime->stat us->state == SNDRV_PCM_STATE_OPEN)3284 if (runtime->state == SNDRV_PCM_STATE_OPEN) 3284 3285 return -EBADFD; 3285 3286 if (runtime->channels > 128) … … 3345 3346 return -ENXIO; 3346 3347 3347 if (substream->runtime->stat us->state == SNDRV_PCM_STATE_DISCONNECTED)3348 if (substream->runtime->state == SNDRV_PCM_STATE_DISCONNECTED) 3348 3349 return -EBADFD; 3349 3350 … … 3476 3477 snd_pcm_sframes_t result; 3477 3478 3478 if (substream->runtime->stat us->state == SNDRV_PCM_STATE_DISCONNECTED)3479 if (substream->runtime->state == SNDRV_PCM_STATE_DISCONNECTED) 3479 3480 return -EBADFD; 3480 3481 … … 3521 3522 return -ENXIO; 3522 3523 runtime = substream->runtime; 3523 if (runtime->stat us->state == SNDRV_PCM_STATE_OPEN ||3524 runtime->stat us->state == SNDRV_PCM_STATE_DISCONNECTED)3524 if (runtime->state == SNDRV_PCM_STATE_OPEN || 3525 runtime->state == SNDRV_PCM_STATE_DISCONNECTED) 3525 3526 return -EBADFD; 3526 3527 if (!frame_aligned(runtime, count)) … … 3546 3547 return -ENXIO; 3547 3548 runtime = substream->runtime; 3548 if (runtime->stat us->state == SNDRV_PCM_STATE_OPEN ||3549 runtime->stat us->state == SNDRV_PCM_STATE_DISCONNECTED)3549 if (runtime->state == SNDRV_PCM_STATE_OPEN || 3550 runtime->state == SNDRV_PCM_STATE_DISCONNECTED) 3550 3551 return -EBADFD; 3551 3552 if (!frame_aligned(runtime, count)) … … 3577 3578 return -ENXIO; 3578 3579 runtime = substream->runtime; 3579 if (runtime->stat us->state == SNDRV_PCM_STATE_OPEN ||3580 runtime->stat us->state == SNDRV_PCM_STATE_DISCONNECTED)3580 if (runtime->state == SNDRV_PCM_STATE_OPEN || 3581 runtime->state == SNDRV_PCM_STATE_DISCONNECTED) 3581 3582 return -EBADFD; 3582 3583 if (!iter_is_iovec(to)) … … 3614 3615 return -ENXIO; 3615 3616 runtime = substream->runtime; 3616 if (runtime->stat us->state == SNDRV_PCM_STATE_OPEN ||3617 runtime->stat us->state == SNDRV_PCM_STATE_DISCONNECTED)3617 if (runtime->state == SNDRV_PCM_STATE_OPEN || 3618 runtime->state == SNDRV_PCM_STATE_DISCONNECTED) 3618 3619 return -EBADFD; 3619 3620 if (!iter_is_iovec(from)) … … 3654 3655 3655 3656 runtime = substream->runtime; 3656 if (runtime->stat us->state == SNDRV_PCM_STATE_DISCONNECTED)3657 if (runtime->state == SNDRV_PCM_STATE_DISCONNECTED) 3657 3658 return ok | EPOLLERR; 3658 3659 … … 3662 3663 snd_pcm_stream_lock_irq(substream); 3663 3664 avail = snd_pcm_avail(substream); 3664 switch (runtime->stat us->state) {3665 switch (runtime->state) { 3665 3666 case SNDRV_PCM_STATE_RUNNING: 3666 3667 case SNDRV_PCM_STATE_PREPARED: … … 3728 3729 area->vm_private_data = substream; 3729 3730 area->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; 3731 area->vm_flags &= ~(VM_WRITE | VM_MAYWRITE); 3730 3732 return 0; 3731 3733 } … … 3935 3937 } 3936 3938 runtime = substream->runtime; 3937 if (runtime->stat us->state == SNDRV_PCM_STATE_OPEN)3939 if (runtime->state == SNDRV_PCM_STATE_OPEN) 3938 3940 return -EBADFD; 3939 3941 if (!(runtime->info & SNDRV_PCM_INFO_MMAP)) … … 3972 3974 if (PCM_RUNTIME_CHECK(substream)) 3973 3975 return -ENXIO; 3974 if (substream->runtime->stat us->state == SNDRV_PCM_STATE_DISCONNECTED)3976 if (substream->runtime->state == SNDRV_PCM_STATE_DISCONNECTED) 3975 3977 return -EBADFD; 3976 3978 … … 4011 4013 return -ENXIO; 4012 4014 runtime = substream->runtime; 4013 if (runtime->stat us->state == SNDRV_PCM_STATE_DISCONNECTED)4015 if (runtime->state == SNDRV_PCM_STATE_DISCONNECTED) 4014 4016 return -EBADFD; 4015 4017 return snd_fasync_helper(fd, file, on, &runtime->fasync); -
GPL/branches/uniaud32-exp/alsa-kernel/core/seq/seq_memory.c
r697 r756 114 114 */ 115 115 116 static int seq_copy_in_kernel(char **bufptr, const void *src, int size) 117 { 116 static int seq_copy_in_kernel(void *ptr, void *src, int size) 117 { 118 char **bufptr = ptr; 119 118 120 memcpy(*bufptr, src, size); 119 121 *bufptr += size; … … 121 123 } 122 124 123 static int seq_copy_in_user(char __user **bufptr, const void *src, int size) 124 { 125 static int seq_copy_in_user(void *ptr, void *src, int size) 126 { 127 char __user **bufptr = ptr; 128 125 129 if (copy_to_user(*bufptr, src, size)) 126 130 return -EFAULT; … … 152 156 } 153 157 err = snd_seq_dump_var_event(event, 154 in_kernel ? (snd_seq_dump_func_t)seq_copy_in_kernel : 155 (snd_seq_dump_func_t)seq_copy_in_user, 158 in_kernel ? seq_copy_in_kernel : seq_copy_in_user, 156 159 &buf); 157 160 return err < 0 ? err : newlen; -
GPL/branches/uniaud32-exp/alsa-kernel/hda/ext/hdac_ext_bus.c
r629 r756 60 60 } 61 61 EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_exit); 62 63 static void default_release(struct device *dev)64 {65 snd_hdac_ext_bus_device_exit(dev_to_hdac_dev(dev));66 }67 68 /**69 * snd_hdac_ext_bus_device_init - initialize the HDA extended codec base device70 * @bus: hdac bus to attach to71 * @addr: codec address72 * @hdev: hdac device to init73 * @type: codec type (HDAC_DEV_*) to use for this device74 *75 * Returns zero for success or a negative error code.76 */77 int snd_hdac_ext_bus_device_init(struct hdac_bus *bus, int addr,78 struct hdac_device *hdev, int type)79 {80 char name[15];81 int ret;82 83 hdev->bus = bus;84 85 snprintf(name, sizeof(name), "ehdaudio%dD%d", bus->idx, addr);86 87 ret = snd_hdac_device_init(hdev, bus, name, addr);88 if (ret < 0) {89 dev_err(bus->dev, "device init failed for hdac device\n");90 return ret;91 }92 hdev->type = type;93 hdev->dev.release = default_release;94 95 ret = snd_hdac_device_register(hdev);96 if (ret) {97 dev_err(bus->dev, "failed to register hdac device\n");98 snd_hdac_ext_bus_device_exit(hdev);99 return ret;100 }101 102 return 0;103 }104 EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_device_init);105 106 /**107 * snd_hdac_ext_bus_device_exit - clean up a HD-audio extended codec base device108 * @hdev: hdac device to clean up109 */110 void snd_hdac_ext_bus_device_exit(struct hdac_device *hdev)111 {112 snd_hdac_device_exit(hdev);113 }114 EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_device_exit);115 62 116 63 /** -
GPL/branches/uniaud32-exp/alsa-kernel/hda/ext/hdac_ext_controller.c
r750 r756 171 171 int timeout; 172 172 u32 val; 173 int mask = (1 << AZX_ML CTL_CPA_SHIFT);173 int mask = (1 << AZX_ML_LCTL_CPA_SHIFT); 174 174 175 175 udelay(3); … … 179 179 val = readl(link->ml_addr + AZX_REG_ML_LCTL); 180 180 if (enable) { 181 if (((val & mask) >> AZX_ML CTL_CPA_SHIFT))181 if (((val & mask) >> AZX_ML_LCTL_CPA_SHIFT)) 182 182 return 0; 183 183 } else { 184 if (!((val & mask) >> AZX_ML CTL_CPA_SHIFT))184 if (!((val & mask) >> AZX_ML_LCTL_CPA_SHIFT)) 185 185 return 0; 186 186 } … … 198 198 { 199 199 snd_hdac_updatel(link->ml_addr, AZX_REG_ML_LCTL, 200 AZX_ML CTL_SPA, AZX_MLCTL_SPA);200 AZX_ML_LCTL_SPA, AZX_ML_LCTL_SPA); 201 201 202 202 return check_hdac_link_power_active(link, true); … … 210 210 int snd_hdac_ext_bus_link_power_down(struct hdac_ext_link *link) 211 211 { 212 snd_hdac_updatel(link->ml_addr, AZX_REG_ML_LCTL, AZX_ML CTL_SPA, 0);212 snd_hdac_updatel(link->ml_addr, AZX_REG_ML_LCTL, AZX_ML_LCTL_SPA, 0); 213 213 214 214 return check_hdac_link_power_active(link, false); … … 227 227 list_for_each_entry(hlink, &bus->hlink_list, list) { 228 228 snd_hdac_updatel(hlink->ml_addr, AZX_REG_ML_LCTL, 229 AZX_ML CTL_SPA, AZX_MLCTL_SPA);229 AZX_ML_LCTL_SPA, AZX_ML_LCTL_SPA); 230 230 ret = check_hdac_link_power_active(hlink, true); 231 231 if (ret < 0) … … 248 248 list_for_each_entry(hlink, &bus->hlink_list, list) { 249 249 snd_hdac_updatel(hlink->ml_addr, AZX_REG_ML_LCTL, 250 AZX_ML CTL_SPA, 0);250 AZX_ML_LCTL_SPA, 0); 251 251 ret = check_hdac_link_power_active(hlink, false); 252 252 if (ret < 0) … … 282 282 */ 283 283 snd_hdac_updatew(link->ml_addr, AZX_REG_ML_LOSIDV, 284 ML_LOSIDV_STREAM_MASK, 0);284 AZX_ML_LOSIDV_STREAM_MASK, 0); 285 285 /* 286 286 * wait for 521usec for codec to report status -
GPL/branches/uniaud32-exp/alsa-kernel/hda/ext/hdac_ext_stream.c
r737 r756 27 27 * invoke hdac stream initialization routine 28 28 */ 29 void snd_hdac_ext_stream_init(struct hdac_bus *bus,30 struct hdac_ext_stream *hext_stream,31 int idx, int direction, int tag)29 static void snd_hdac_ext_stream_init(struct hdac_bus *bus, 30 struct hdac_ext_stream *hext_stream, 31 int idx, int direction, int tag) 32 32 { 33 33 if (bus->ppcap) { … … 57 57 snd_hdac_stream_init(bus, &hext_stream->hstream, idx, direction, tag); 58 58 } 59 EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_init);60 59 61 60 /** … … 89 88 90 89 /** 91 * snd_hdac_ stream_free_all - free hdac extended stream objects92 * 93 * @bus: HD-audio core bus 94 */ 95 void snd_hdac_ stream_free_all(struct hdac_bus *bus)90 * snd_hdac_ext_stream_free_all - free hdac extended stream objects 91 * 92 * @bus: HD-audio core bus 93 */ 94 void snd_hdac_ext_stream_free_all(struct hdac_bus *bus) 96 95 { 97 96 struct hdac_stream *s, *_s; … … 105 104 } 106 105 } 107 EXPORT_SYMBOL_GPL(snd_hdac_ stream_free_all);106 EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_free_all); 108 107 109 108 void snd_hdac_ext_stream_decouple_locked(struct hdac_bus *bus, … … 269 268 continue; 270 269 271 /* check if decoupled stream and not in useis available */272 if ( hext_stream->decoupled &&!hext_stream->link_locked) {270 /* check if link stream is available */ 271 if (!hext_stream->link_locked) { 273 272 res = hext_stream; 274 273 break; 275 274 } 276 275 277 if (!hext_stream->link_locked) {278 snd_hdac_ext_stream_decouple_locked(bus, hext_stream, true);279 res = hext_stream;280 break;281 }282 276 } 283 277 if (res) { 278 snd_hdac_ext_stream_decouple_locked(bus, res, true); 284 279 res->link_locked = 1; 285 280 res->link_substream = substream; … … 310 305 311 306 if (!hstream->opened) { 312 if (!hext_stream->decoupled)313 snd_hdac_ext_stream_decouple_locked(bus, hext_stream, true);314 307 res = hext_stream; 315 308 break; … … 317 310 } 318 311 if (res) { 312 snd_hdac_ext_stream_decouple_locked(bus, res, true); 319 313 res->hstream.opened = 1; 320 314 res->hstream.running = 0; … … 389 383 case HDAC_EXT_STREAM_TYPE_HOST: 390 384 spin_lock_irq(&bus->reg_lock); 391 if (hext_stream->decoupled && !hext_stream->link_locked) 385 /* couple link only if not in use */ 386 if (!hext_stream->link_locked) 392 387 snd_hdac_ext_stream_decouple_locked(bus, hext_stream, false); 388 snd_hdac_stream_release_locked(&hext_stream->hstream); 393 389 spin_unlock_irq(&bus->reg_lock); 394 snd_hdac_stream_release(&hext_stream->hstream);395 390 break; 396 391 397 392 case HDAC_EXT_STREAM_TYPE_LINK: 398 393 spin_lock_irq(&bus->reg_lock); 399 if (hext_stream->decoupled && !hext_stream->hstream.opened) 394 /* couple host only if not in use */ 395 if (!hext_stream->hstream.opened) 400 396 snd_hdac_ext_stream_decouple_locked(bus, hext_stream, false); 401 397 hext_stream->link_locked = 0; -
GPL/branches/uniaud32-exp/alsa-kernel/hda/hdac_stream.c
r737 r756 19 19 #endif 20 20 21 /* 22 * the hdac_stream library is intended to be used with the following 23 * transitions. The states are not formally defined in the code but loosely 24 * inspired by boolean variables. Note that the 'prepared' field is not used 25 * in this library but by the callers during the hw_params/prepare transitions 26 * 27 * | 28 * stream_init() | 29 * v 30 * +--+-------+ 31 * | unused | 32 * +--+----+--+ 33 * | ^ 34 * stream_assign() | | stream_release() 35 * v | 36 * +--+----+--+ 37 * | opened | 38 * +--+----+--+ 39 * | ^ 40 * stream_reset() | | 41 * stream_setup() | | stream_cleanup() 42 * v | 43 * +--+----+--+ 44 * | prepared | 45 * +--+----+--+ 46 * | ^ 47 * stream_start() | | stream_stop() 48 * v | 49 * +--+----+--+ 50 * | running | 51 * +----------+ 52 */ 53 21 54 /** 22 55 * snd_hdac_get_stream_stripe_ctl - get stripe control value … … 118 151 119 152 /** 120 * snd_hdac_stream_clear - stop a stream DMA153 * snd_hdac_stream_clear - helper to clear stream registers and stop DMA transfers 121 154 * @azx_dev: HD-audio core stream to stop 122 155 */ 123 void snd_hdac_stream_clear(struct hdac_stream *azx_dev)156 static void snd_hdac_stream_clear(struct hdac_stream *azx_dev) 124 157 { 125 158 snd_hdac_stream_updateb(azx_dev, SD_CTL, … … 130 163 azx_dev->running = false; 131 164 } 132 EXPORT_SYMBOL_GPL(snd_hdac_stream_clear);133 165 134 166 /** … … 149 181 150 182 /** 183 * snd_hdac_stop_streams - stop all streams 184 * @bus: HD-audio core bus 185 */ 186 void snd_hdac_stop_streams(struct hdac_bus *bus) 187 { 188 struct hdac_stream *stream; 189 190 list_for_each_entry(stream, &bus->stream_list, list, struct hdac_stream) 191 snd_hdac_stream_stop(stream); 192 } 193 EXPORT_SYMBOL_GPL(snd_hdac_stop_streams); 194 195 /** 151 196 * snd_hdac_stop_streams_and_chip - stop all streams and chip if running 152 197 * @bus: HD-audio core bus … … 154 199 void snd_hdac_stop_streams_and_chip(struct hdac_bus *bus) 155 200 { 156 struct hdac_stream *stream;157 158 201 if (bus->chip_init) { 159 list_for_each_entry(stream, &bus->stream_list, list, struct hdac_stream) 160 snd_hdac_stream_stop(stream); 202 snd_hdac_stop_streams(bus); 161 203 snd_hdac_bus_stop_chip(bus); 162 204 } … … 171 213 { 172 214 unsigned char val; 215 #ifdef TARGET_OS2 173 216 int timeout; 217 #endif 174 218 int dma_run_state; 175 219 … … 179 223 180 224 snd_hdac_stream_updateb(azx_dev, SD_CTL, 0, SD_CTL_STREAM_RESET); 225 226 #ifndef TARGET_OS2 227 /* wait for hardware to report that the stream entered reset */ 228 snd_hdac_stream_readb_poll(azx_dev, SD_CTL, val, (val & SD_CTL_STREAM_RESET), 3, 300); 229 #else 181 230 udelay(3); 182 231 timeout = 300; … … 187 236 break; 188 237 } while (--timeout); 189 238 #endif 190 239 if (azx_dev->bus->dma_stop_delay && dma_run_state) 191 240 udelay(azx_dev->bus->dma_stop_delay); 192 241 193 val &= ~SD_CTL_STREAM_RESET; 194 snd_hdac_stream_writeb(azx_dev, SD_CTL, val); 242 snd_hdac_stream_updateb(azx_dev, SD_CTL, SD_CTL_STREAM_RESET, 0); 243 244 #ifndef TARGET_OS2 245 /* wait for hardware to report that the stream is out of reset */ 246 snd_hdac_stream_readb_poll(azx_dev, SD_CTL, val, !(val & SD_CTL_STREAM_RESET), 3, 300); 247 #else 195 248 udelay(3); 196 249 … … 203 256 break; 204 257 } while (--timeout); 205 258 #endif 206 259 /* reset first position - may not be synced with hw at this time */ 207 260 if (azx_dev->posbuf) … … 343 396 344 397 /** 345 * snd_hdac_stream_release - release the assigned stream398 * snd_hdac_stream_release_locked - release the assigned stream 346 399 * @azx_dev: HD-audio core stream to release 347 400 * 348 401 * Release the stream that has been assigned by snd_hdac_stream_assign(). 349 */ 350 void snd_hdac_stream_release(struct hdac_stream *azx_dev) 351 { 352 struct hdac_bus *bus = azx_dev->bus; 353 354 spin_lock_irq(&bus->reg_lock); 402 * The bus->reg_lock needs to be taken at a higher level 403 */ 404 void snd_hdac_stream_release_locked(struct hdac_stream *azx_dev) 405 { 355 406 azx_dev->opened = 0; 356 407 azx_dev->running = 0; 357 408 azx_dev->substream = NULL; 409 } 410 EXPORT_SYMBOL_GPL(snd_hdac_stream_release_locked); 411 412 /** 413 * snd_hdac_stream_release - release the assigned stream 414 * @azx_dev: HD-audio core stream to release 415 * 416 * Release the stream that has been assigned by snd_hdac_stream_assign(). 417 */ 418 void snd_hdac_stream_release(struct hdac_stream *azx_dev) 419 { 420 struct hdac_bus *bus = azx_dev->bus; 421 422 spin_lock_irq(&bus->reg_lock); 423 snd_hdac_stream_release_locked(azx_dev); 358 424 spin_unlock_irq(&bus->reg_lock); 359 425 } -
GPL/branches/uniaud32-exp/alsa-kernel/hda/hdmi_chmap.c
r708 r756 782 782 if (!substream || !substream->runtime) 783 783 return 0; /* just for avoiding error from alsactl restore */ 784 switch (substream->runtime->stat us->state) {784 switch (substream->runtime->state) { 785 785 case SNDRV_PCM_STATE_OPEN: 786 786 case SNDRV_PCM_STATE_SETUP: -
GPL/branches/uniaud32-exp/alsa-kernel/include/sound/hda_codec.h
r750 r756 259 259 unsigned int relaxed_resume:1; /* don't resume forcibly for jack */ 260 260 unsigned int forced_resume:1; /* forced resume for jack */ 261 unsigned int mst_no_extra_pcms:1; /* no backup PCMs for DP-MST */262 261 263 262 #ifdef CONFIG_PM … … 294 293 #define hda_codec_dev(_dev) (&(_dev)->core.dev) 295 294 296 #define hdac_to_hda_priv(_hdac) \297 container_of(_hdac, struct hdac_hda_priv, codec.core)298 295 #define hdac_to_hda_codec(_hdac) container_of(_hdac, struct hda_codec, core) 299 296 -
GPL/branches/uniaud32-exp/alsa-kernel/include/sound/hda_register.h
r694 r756 261 261 #define AZX_REG_ML_LCAP 0x00 262 262 #define AZX_REG_ML_LCTL 0x04 263 264 #define AZX_ML_LCTL_CPA BIT(23) 265 #define AZX_ML_LCTL_CPA_SHIFT 23 266 #define AZX_ML_LCTL_SPA BIT(16) 267 #define AZX_ML_LCTL_SPA_SHIFT 16 268 #define AZX_ML_LCTL_SCF GENMASK(3, 0) 269 263 270 #define AZX_REG_ML_LOSIDV 0x08 271 272 /* bit0 is reserved, with BIT(1) mapping to stream1 */ 273 #define AZX_ML_LOSIDV_STREAM_MASK 0xFFFE 274 264 275 #define AZX_REG_ML_LSDIID 0x0C 265 276 #define AZX_REG_ML_LPSOO 0x10 … … 268 279 #define AZX_REG_ML_LOUTPAY 0x20 269 280 #define AZX_REG_ML_LINPAY 0x30 270 271 /* bit0 is reserved, with BIT(1) mapping to stream1 */272 #define ML_LOSIDV_STREAM_MASK 0xFFFE273 274 #define ML_LCTL_SCF_MASK 0xF275 #define AZX_MLCTL_SPA (0x1 << 16)276 #define AZX_MLCTL_CPA (0x1 << 23)277 #define AZX_MLCTL_SPA_SHIFT 16278 #define AZX_MLCTL_CPA_SHIFT 23279 281 280 282 /* registers for DMA Resume Capability Structure */ -
GPL/branches/uniaud32-exp/alsa-kernel/include/sound/hdaudio.h
r750 r756 11 11 #include <linux/io.h> 12 12 #include <linux/io-64-nonatomic-lo-hi.h> 13 #include <linux/iopoll.h> 13 14 #include <linux/pm_runtime.h> 14 15 #include <linux/timecounter.h> … … 565 566 struct hdac_stream *snd_hdac_stream_assign(struct hdac_bus *bus, 566 567 struct snd_pcm_substream *substream); 568 void snd_hdac_stream_release_locked(struct hdac_stream *azx_dev); 567 569 void snd_hdac_stream_release(struct hdac_stream *azx_dev); 568 570 struct hdac_stream *snd_hdac_get_stream(struct hdac_bus *bus, … … 575 577 unsigned int format_val); 576 578 void snd_hdac_stream_start(struct hdac_stream *azx_dev, bool fresh_start); 577 void snd_hdac_stream_clear(struct hdac_stream *azx_dev);578 579 void snd_hdac_stream_stop(struct hdac_stream *azx_dev); 580 void snd_hdac_stop_streams(struct hdac_bus *bus); 579 581 void snd_hdac_stop_streams_and_chip(struct hdac_bus *bus); 580 582 void snd_hdac_stream_reset(struct hdac_stream *azx_dev); … … 604 606 #define snd_hdac_stream_readb(dev, reg) \ 605 607 snd_hdac_reg_readb((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg) 608 #define snd_hdac_stream_readb_poll(dev, reg, val, cond, delay_us, timeout_us) \ 609 read_poll_timeout_atomic(snd_hdac_reg_readb, val, cond, delay_us, timeout_us, \ 610 false, (dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg) 611 #define snd_hdac_stream_readl_poll(dev, reg, val, cond, delay_us, timeout_us) \ 612 read_poll_timeout_atomic(snd_hdac_reg_readl, val, cond, delay_us, timeout_us, \ 613 false, (dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg) 606 614 607 615 /* update a register, pass without AZX_REG_ prefix */ -
GPL/branches/uniaud32-exp/alsa-kernel/include/sound/hdaudio_ext.h
r738 r756 12 12 13 13 void snd_hdac_ext_bus_exit(struct hdac_bus *bus); 14 int snd_hdac_ext_bus_device_init(struct hdac_bus *bus, int addr,15 struct hdac_device *hdev, int type);16 void snd_hdac_ext_bus_device_exit(struct hdac_device *hdev);17 14 void snd_hdac_ext_bus_device_remove(struct hdac_bus *bus); 18 15 … … 81 78 container_of(s, struct hdac_ext_stream, hstream) 82 79 83 void snd_hdac_ext_stream_init(struct hdac_bus *bus,84 struct hdac_ext_stream *hext_stream, int idx,85 int direction, int tag);86 80 int snd_hdac_ext_stream_init_all(struct hdac_bus *bus, int start_idx, 87 81 int num_stream, int dir); 88 void snd_hdac_ stream_free_all(struct hdac_bus *bus);82 void snd_hdac_ext_stream_free_all(struct hdac_bus *bus); 89 83 void snd_hdac_link_free_all(struct hdac_bus *bus); 90 84 struct hdac_ext_stream *snd_hdac_ext_stream_assign(struct hdac_bus *bus, … … 189 183 readq_poll_timeout((chip)->dsp_ba + (reg), val, cond, \ 190 184 delay_us, timeout_us) 191 #define snd_hdac_stream_readb_poll(strm, reg, val, cond, delay_us, timeout_us) \192 readb_poll_timeout((strm)->sd_addr + AZX_REG_ ## reg, val, cond, \193 delay_us, timeout_us)194 #define snd_hdac_stream_readl_poll(strm, reg, val, cond, delay_us, timeout_us) \195 readl_poll_timeout((strm)->sd_addr + AZX_REG_ ## reg, val, cond, \196 delay_us, timeout_us)197 185 198 186 struct hdac_ext_device; -
GPL/branches/uniaud32-exp/alsa-kernel/include/sound/intel-nhlt.h
r739 r756 137 137 int intel_nhlt_ssp_endpoint_mask(struct nhlt_acpi_table *nhlt, u8 device_type); 138 138 139 int intel_nhlt_ssp_mclk_mask(struct nhlt_acpi_table *nhlt, int ssp_num); 140 139 141 struct nhlt_specific_cfg * 140 142 intel_nhlt_get_endpoint_blob(struct device *dev, struct nhlt_acpi_table *nhlt, … … 170 172 } 171 173 174 static inline int intel_nhlt_ssp_mclk_mask(struct nhlt_acpi_table *nhlt, int ssp_num) 175 { 176 return 0; 177 } 178 172 179 static inline struct nhlt_specific_cfg * 173 180 intel_nhlt_get_endpoint_blob(struct device *dev, struct nhlt_acpi_table *nhlt, -
GPL/branches/uniaud32-exp/alsa-kernel/include/sound/memalloc.h
r737 r756 26 26 struct device *dev; /* generic device */ 27 27 }; 28 29 #define snd_dma_continuous_data(x) ((struct device *)(__force unsigned long)(x))30 31 28 32 29 /* -
GPL/branches/uniaud32-exp/alsa-kernel/include/sound/pcm.h
r750 r756 347 347 struct snd_pcm_runtime { 348 348 /* -- Status -- */ 349 snd_pcm_state_t state; /* stream state */ 350 snd_pcm_state_t suspended_state; /* suspended stream state */ 349 351 struct snd_pcm_substream *trigger_master; 350 352 struct timespec64 trigger_tstamp; /* trigger timestamp */ … … 686 688 static inline int snd_pcm_running(struct snd_pcm_substream *substream) 687 689 { 688 return (substream->runtime->stat us->state == SNDRV_PCM_STATE_RUNNING ||689 (substream->runtime->stat us->state == SNDRV_PCM_STATE_DRAINING &&690 return (substream->runtime->state == SNDRV_PCM_STATE_RUNNING || 691 (substream->runtime->state == SNDRV_PCM_STATE_DRAINING && 690 692 substream->stream == SNDRV_PCM_STREAM_PLAYBACK)); 693 } 694 695 /** 696 * __snd_pcm_set_state - Change the current PCM state 697 * @runtime: PCM runtime to set 698 * @state: the current state to set 699 * 700 * Call within the stream lock 701 */ 702 static inline void __snd_pcm_set_state(struct snd_pcm_runtime *runtime, 703 snd_pcm_state_t state) 704 { 705 runtime->state = state; 706 runtime->status->state = state; /* copy for mmap */ 691 707 } 692 708 -
GPL/branches/uniaud32-exp/alsa-kernel/include/sound/simple_card_utils.h
r750 r756 40 40 u32 convert_rate; 41 41 u32 convert_channels; 42 const char *convert_sample_format; 42 43 }; 43 44 … … 177 178 void asoc_simple_parse_convert(struct device_node *np, char *prefix, 178 179 struct asoc_simple_data *data); 180 bool asoc_simple_is_convert_required(const struct asoc_simple_data *data); 179 181 180 182 int asoc_simple_parse_routing(struct snd_soc_card *card, -
GPL/branches/uniaud32-exp/alsa-kernel/include/sound/soc-acpi-intel-match.h
r755 r756 15 15 * pdata or machine ops 16 16 */ 17 extern struct snd_soc_acpi_mach snd_soc_acpi_intel_haswell_machines[];18 17 extern struct snd_soc_acpi_mach snd_soc_acpi_intel_broadwell_machines[]; 19 18 extern struct snd_soc_acpi_mach snd_soc_acpi_intel_baytrail_machines[]; -
GPL/branches/uniaud32-exp/alsa-kernel/include/sound/soc.h
r750 r756 32 32 ((unsigned long)&(struct soc_mixer_control) \ 33 33 {.reg = xreg, .rreg = xreg, .shift = shift_left, \ 34 .rshift = shift_right, .max = xmax, .platform_max = xmax,\34 .rshift = shift_right, .max = xmax, \ 35 35 .invert = xinvert, .autodisable = xautodisable}) 36 36 #define SOC_DOUBLE_S_VALUE(xreg, shift_left, shift_right, xmin, xmax, xsign_bit, xinvert, xautodisable) \ 37 37 ((unsigned long)&(struct soc_mixer_control) \ 38 38 {.reg = xreg, .rreg = xreg, .shift = shift_left, \ 39 .rshift = shift_right, .min = xmin, .max = xmax, .platform_max = xmax,\39 .rshift = shift_right, .min = xmin, .max = xmax, \ 40 40 .sign_bit = xsign_bit, .invert = xinvert, .autodisable = xautodisable}) 41 41 #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert, xautodisable) \ … … 43 43 #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ 44 44 ((unsigned long)&(struct soc_mixer_control) \ 45 {.reg = xreg, .max = xmax, . platform_max = xmax, .invert = xinvert})45 {.reg = xreg, .max = xmax, .invert = xinvert}) 46 46 #define SOC_DOUBLE_R_VALUE(xlreg, xrreg, xshift, xmax, xinvert) \ 47 47 ((unsigned long)&(struct soc_mixer_control) \ 48 48 {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ 49 .max = xmax, . platform_max = xmax, .invert = xinvert})49 .max = xmax, .invert = xinvert}) 50 50 #define SOC_DOUBLE_R_S_VALUE(xlreg, xrreg, xshift, xmin, xmax, xsign_bit, xinvert) \ 51 51 ((unsigned long)&(struct soc_mixer_control) \ 52 52 {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ 53 .max = xmax, .min = xmin, . platform_max = xmax, .sign_bit = xsign_bit, \53 .max = xmax, .min = xmin, .sign_bit = xsign_bit, \ 54 54 .invert = xinvert}) 55 55 #define SOC_DOUBLE_R_RANGE_VALUE(xlreg, xrreg, xshift, xmin, xmax, xinvert) \ 56 56 ((unsigned long)&(struct soc_mixer_control) \ 57 57 {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ 58 .min = xmin, .max = xmax, . platform_max = xmax, .invert = xinvert})58 .min = xmin, .max = xmax, .invert = xinvert}) 59 59 #define SOC_SINGLE(xname, reg, shift, max, invert) \ 60 60 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ … … 69 69 {.reg = xreg, .rreg = xreg, .shift = xshift, \ 70 70 .rshift = xshift, .min = xmin, .max = xmax, \ 71 . platform_max = xmax, .invert = xinvert} }71 .invert = xinvert} } 72 72 #define SOC_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ 73 73 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ … … 100 100 {.reg = xreg, .rreg = xreg, .shift = xshift, \ 101 101 .rshift = xshift, .min = xmin, .max = xmax, \ 102 . platform_max = xmax, .invert = xinvert} }102 .invert = xinvert} } 103 103 #define SOC_DOUBLE(xname, reg, shift_left, shift_right, max, invert) \ 104 104 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ … … 200 200 .private_value = (unsigned long)&(struct soc_mixer_control) \ 201 201 {.reg = xreg, .rreg = xreg, \ 202 .min = xmin, .max = xmax, .platform_max = xmax,\202 .min = xmin, .max = xmax, \ 203 203 .sign_bit = 7,} } 204 204 #define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \ … … 274 274 {.reg = xreg, .rreg = xreg, .shift = xshift, \ 275 275 .rshift = xshift, .min = xmin, .max = xmax, \ 276 . platform_max = xmax, .invert = xinvert} }276 .invert = xinvert} } 277 277 #define SOC_DOUBLE_EXT_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert,\ 278 278 xhandler_get, xhandler_put, tlv_array) \ … … 1063 1063 1064 1064 /* Dynamic PCM BE runtime data */ 1065 struct snd_soc_dpcm_runtime dpcm[2]; 1065 struct snd_soc_dpcm_runtime dpcm[SNDRV_PCM_STREAM_LAST + 1]; 1066 struct snd_soc_dapm_widget *c2c_widget[SNDRV_PCM_STREAM_LAST + 1]; 1066 1067 1067 1068 long pmdown_time; … … 1079 1080 */ 1080 1081 struct snd_soc_dai **dais; 1081 unsigned int num_codecs;1082 unsigned int num_cpus;1083 1084 struct snd_soc_dapm_widget *playback_widget;1085 struct snd_soc_dapm_widget *capture_widget;1086 1082 1087 1083 struct delayed_work delayed_work; … … 1109 1105 /* see soc_new_pcm_runtime() */ 1110 1106 #define asoc_rtd_to_cpu(rtd, n) (rtd)->dais[n] 1111 #define asoc_rtd_to_codec(rtd, n) (rtd)->dais[n + (rtd)-> num_cpus]1107 #define asoc_rtd_to_codec(rtd, n) (rtd)->dais[n + (rtd)->dai_link->num_cpus] 1112 1108 #define asoc_substream_to_rtd(substream) \ 1113 1109 (struct snd_soc_pcm_runtime *)snd_pcm_substream_chip(substream) … … 1119 1115 #define for_each_rtd_cpu_dais(rtd, i, dai) \ 1120 1116 for ((i) = 0; \ 1121 ((i) < rtd-> num_cpus) && ((dai) = asoc_rtd_to_cpu(rtd, i)); \1117 ((i) < rtd->dai_link->num_cpus) && ((dai) = asoc_rtd_to_cpu(rtd, i)); \ 1122 1118 (i)++) 1123 1119 #define for_each_rtd_codec_dais(rtd, i, dai) \ 1124 1120 for ((i) = 0; \ 1125 ((i) < rtd-> num_codecs) && ((dai) = asoc_rtd_to_codec(rtd, i)); \1121 ((i) < rtd->dai_link->num_codecs) && ((dai) = asoc_rtd_to_codec(rtd, i)); \ 1126 1122 (i)++) 1127 1123 #define for_each_rtd_dais(rtd, i, dai) \ 1128 1124 for ((i) = 0; \ 1129 ((i) < (rtd)-> num_cpus + (rtd)->num_codecs) &&\1125 ((i) < (rtd)->dai_link->num_cpus + (rtd)->dai_link->num_codecs) && \ 1130 1126 ((dai) = (rtd)->dais[i]); \ 1131 1127 (i)++) -
GPL/branches/uniaud32-exp/alsa-kernel/include/sound/sof.h
r750 r756 90 90 struct platform_device *pdev_mach; 91 91 const struct snd_soc_acpi_mach *machine; 92 const struct snd_sof_of_mach *of_machine; 92 93 93 94 void *hw_pdata; … … 103 104 /* list of machines using this configuration */ 104 105 struct snd_soc_acpi_mach *machines; 106 struct snd_sof_of_mach *of_machines; 105 107 106 108 /* alternate list of machines using this configuration */ -
GPL/branches/uniaud32-exp/alsa-kernel/include/sound/version.h
r755 r756 1 1 /* include/version.h */ 2 #define CONFIG_SND_VERSION "6. 0.7"2 #define CONFIG_SND_VERSION "6.1.0" 3 3 #define CONFIG_SND_DATE "" -
GPL/branches/uniaud32-exp/alsa-kernel/include/uapi/sound/asequencer.h
r615 r756 4 4 * Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl> 5 5 * (c) 1998-1999 by Jaroslav Kysela <perex@perex.cz> 6 *7 *8 * This program is free software; you can redistribute it and/or modify9 * it under the terms of the GNU General Public License as published by10 * the Free Software Foundation; either version 2 of the License, or11 * (at your option) any later version.12 *13 * This program is distributed in the hope that it will be useful,14 * but WITHOUT ANY WARRANTY; without even the implied warranty of15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16 * GNU General Public License for more details.17 *18 * You should have received a copy of the GNU General Public License19 * along with this program; if not, write to the Free Software20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA21 *22 6 */ 23 7 #ifndef _UAPI__SOUND_ASEQUENCER_H -
GPL/branches/uniaud32-exp/alsa-kernel/include/uapi/sound/asoc.h
r736 r756 5 5 * Copyright (C) 2012 Texas Instruments Inc. 6 6 * Copyright (C) 2015 Intel Corporation. 7 *8 * This program is free software; you can redistribute it and/or modify9 * it under the terms of the GNU General Public License version 2 as10 * published by the Free Software Foundation.11 7 * 12 8 * Simple file API to load FW that includes mixers, coefficients, DAPM graphs, -
GPL/branches/uniaud32-exp/alsa-kernel/include/uapi/sound/asound.h
r750 r756 4 4 * Copyright (c) 1994-2003 by Jaroslav Kysela <perex@perex.cz>, 5 5 * Abramo Bagnara <abramo@alsa-project.org> 6 *7 *8 * This program is free software; you can redistribute it and/or modify9 * it under the terms of the GNU General Public License as published by10 * the Free Software Foundation; either version 2 of the License, or11 * (at your option) any later version.12 *13 * This program is distributed in the hope that it will be useful,14 * but WITHOUT ANY WARRANTY; without even the implied warranty of15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16 * GNU General Public License for more details.17 *18 * You should have received a copy of the GNU General Public License19 * along with this program; if not, write to the Free Software20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA21 *22 6 */ 23 7 -
GPL/branches/uniaud32-exp/alsa-kernel/include/uapi/sound/asound_fm.h
r615 r756 11 11 * 12 12 * Direct FM control 13 *14 * This program is free software; you can redistribute it and/or modify15 * it under the terms of the GNU General Public License as published by16 * the Free Software Foundation; either version 2 of the License, or17 * (at your option) any later version.18 *19 * This program is distributed in the hope that it will be useful,20 * but WITHOUT ANY WARRANTY; without even the implied warranty of21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the22 * GNU General Public License for more details.23 *24 * You should have received a copy of the GNU General Public License25 * along with this program; if not, write to the Free Software26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA27 *28 13 */ 29 14 -
GPL/branches/uniaud32-exp/alsa-kernel/include/uapi/sound/compress_offload.h
r750 r756 6 6 * Authors: Vinod Koul <vinod.koul@linux.intel.com> 7 7 * Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> 8 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~9 *10 * This program is free software; you can redistribute it and/or modify11 * it under the terms of the GNU General Public License as published by12 * the Free Software Foundation; version 2 of the License.13 *14 * This program is distributed in the hope that it will be useful, but15 * WITHOUT ANY WARRANTY; without even the implied warranty of16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU17 * General Public License for more details.18 *19 * You should have received a copy of the GNU General Public License along20 * with this program; if not, write to the Free Software Foundation, Inc.,21 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.22 *23 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~24 *25 8 */ 26 9 #ifndef __COMPRESS_OFFLOAD_H -
GPL/branches/uniaud32-exp/alsa-kernel/include/uapi/sound/compress_params.h
r750 r756 8 8 * Vinod Koul <vinod.koul@linux.intel.com> 9 9 * 10 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11 *12 * This program is free software; you can redistribute it and/or modify13 * it under the terms of the GNU General Public License as published by14 * the Free Software Foundation; version 2 of the License.15 *16 * This program is distributed in the hope that it will be useful, but17 * WITHOUT ANY WARRANTY; without even the implied warranty of18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU19 * General Public License for more details.20 *21 * You should have received a copy of the GNU General Public License along22 * with this program; if not, write to the Free Software Foundation, Inc.,23 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.24 *25 10 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 26 11 * 27 12 * The definitions in this file are derived from the OpenMAX AL version 1.1 28 * and OpenMAX IL v 1.1.2 header files which contain the copyright notice below. 13 * and OpenMAX IL v 1.1.2 header files which contain the copyright notice below 14 * and are licensed under the MIT license. 29 15 * 30 16 * Copyright (c) 2007-2010 The Khronos Group Inc. 31 *32 * Permission is hereby granted, free of charge, to any person obtaining33 * a copy of this software and/or associated documentation files (the34 * "Materials "), to deal in the Materials without restriction, including35 * without limitation the rights to use, copy, modify, merge, publish,36 * distribute, sublicense, and/or sell copies of the Materials, and to37 * permit persons to whom the Materials are furnished to do so, subject to38 * the following conditions:39 *40 * The above copyright notice and this permission notice shall be included41 * in all copies or substantial portions of the Materials.42 *43 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS44 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF45 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.46 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY47 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,48 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE49 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.50 *51 17 */ 52 18 #ifndef __SND_COMPRESS_PARAMS_H -
GPL/branches/uniaud32-exp/alsa-kernel/include/uapi/sound/emu10k1.h
r629 r756 4 4 * Creative Labs, Inc. 5 5 * Definitions for EMU10K1 (SB Live!) chips 6 *7 *8 * This program is free software; you can redistribute it and/or modify9 * it under the terms of the GNU General Public License as published by10 * the Free Software Foundation; either version 2 of the License, or11 * (at your option) any later version.12 *13 * This program is distributed in the hope that it will be useful,14 * but WITHOUT ANY WARRANTY; without even the implied warranty of15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16 * GNU General Public License for more details.17 *18 * You should have received a copy of the GNU General Public License19 * along with this program; if not, write to the Free Software20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA21 *22 6 */ 23 7 #ifndef _UAPI__SOUND_EMU10K1_H -
GPL/branches/uniaud32-exp/alsa-kernel/include/uapi/sound/tlv.h
r615 r756 1 1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ 2 /*3 * This program is free software; you can redistribute it and/or modify4 * it under the terms of the GNU General Public License as published by5 * the Free Software Foundation; either version 2 of the License, or6 * (at your option) any later version.7 *8 * This program is distributed in the hope that it will be useful,9 * but WITHOUT ANY WARRANTY; without even the implied warranty of10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11 * GNU General Public License for more details.12 */13 2 14 3 #ifndef __UAPI_SOUND_TLV_H -
GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_codec.c
r755 r756 896 896 kfree(codec->modelname); 897 897 kfree(codec->wcaps); 898 899 /* 900 * In the case of ASoC HD-audio, hda_codec is device managed. 901 * It will be freed when the ASoC device is removed. 902 */ 903 if (codec->core.type == HDA_DEV_LEGACY) 904 kfree(codec); 898 kfree(codec); 905 899 } 906 900 … … 944 938 945 939 codec->bus = bus; 946 codec->core.type = HDA_DEV_LEGACY; 947 948 return codec; 949 } 950 EXPORT_SYMBOL_GPL(snd_hda_codec_device_init); 951 952 /** 953 * snd_hda_codec_new - create a HDA codec 954 * @bus: the bus to assign 955 * @card: card for this codec 956 * @codec_addr: the codec address 957 * @codecp: the pointer to store the generated codec 958 * 959 * Returns 0 if successful, or a negative error code. 960 */ 961 int snd_hda_codec_new(struct hda_bus *bus, struct snd_card *card, 962 unsigned int codec_addr, struct hda_codec **codecp) 963 { 964 struct hda_codec *codec; 965 int ret; 966 967 codec = snd_hda_codec_device_init(bus, codec_addr, "hdaudioC%dD%d", 968 card->number, codec_addr); 969 if (IS_ERR(codec)) 970 return PTR_ERR(codec); 971 *codecp = codec; 972 973 ret = snd_hda_codec_device_new(bus, card, codec_addr, *codecp, true); 974 if (ret) 975 put_device(hda_codec_dev(*codecp)); 976 977 return ret; 978 } 979 EXPORT_SYMBOL_GPL(snd_hda_codec_new); 980 981 int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card, 982 unsigned int codec_addr, struct hda_codec *codec, 983 bool snddev_managed) 984 { 985 char component[31]; 986 hda_nid_t fg; 987 int err; 988 static const struct snd_device_ops dev_ops = { 989 .dev_register = snd_hda_codec_dev_register, 990 .dev_free = snd_hda_codec_dev_free, 991 }; 992 993 dev_dbg(card->dev, "%s: entry\n", __func__); 994 995 if (snd_BUG_ON(!bus)) 996 return -EINVAL; 997 if (snd_BUG_ON(codec_addr > HDA_MAX_CODEC_ADDRESS)) 998 return -EINVAL; 999 940 codec->depop_delay = -1; 941 codec->fixup_id = HDA_FIXUP_ID_NOT_SET; 1000 942 codec->core.dev.release = snd_hda_codec_dev_release; 1001 943 codec->core.exec_verb = codec_exec_verb; 1002 1003 codec->card = card; 1004 codec->addr = codec_addr; 944 codec->core.type = HDA_DEV_LEGACY; 945 1005 946 mutex_init(&codec->spdif_mutex); 1006 947 mutex_init(&codec->control_mutex); … … 1015 956 INIT_LIST_HEAD(&codec->conn_list); 1016 957 INIT_LIST_HEAD(&codec->pcm_list_head); 958 INIT_DELAYED_WORK(&codec->jackpoll_work, hda_jackpoll_work); 1017 959 refcount_set(&codec->pcm_ref, 1); 1018 960 init_waitqueue_head(&codec->remove_sleep); 1019 961 1020 INIT_DELAYED_WORK(&codec->jackpoll_work, hda_jackpoll_work); 1021 codec->depop_delay = -1; 1022 codec->fixup_id = HDA_FIXUP_ID_NOT_SET; 962 return codec; 963 } 964 EXPORT_SYMBOL_GPL(snd_hda_codec_device_init); 965 966 /** 967 * snd_hda_codec_new - create a HDA codec 968 * @bus: the bus to assign 969 * @card: card for this codec 970 * @codec_addr: the codec address 971 * @codecp: the pointer to store the generated codec 972 * 973 * Returns 0 if successful, or a negative error code. 974 */ 975 int snd_hda_codec_new(struct hda_bus *bus, struct snd_card *card, 976 unsigned int codec_addr, struct hda_codec **codecp) 977 { 978 struct hda_codec *codec; 979 int ret; 980 981 codec = snd_hda_codec_device_init(bus, codec_addr, "hdaudioC%dD%d", 982 card->number, codec_addr); 983 if (IS_ERR(codec)) 984 return PTR_ERR(codec); 985 *codecp = codec; 986 987 ret = snd_hda_codec_device_new(bus, card, codec_addr, *codecp, true); 988 if (ret) 989 put_device(hda_codec_dev(*codecp)); 990 991 return ret; 992 } 993 EXPORT_SYMBOL_GPL(snd_hda_codec_new); 994 995 int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card, 996 unsigned int codec_addr, struct hda_codec *codec, 997 bool snddev_managed) 998 { 999 char component[31]; 1000 hda_nid_t fg; 1001 int err; 1002 static const struct snd_device_ops dev_ops = { 1003 .dev_register = snd_hda_codec_dev_register, 1004 .dev_free = snd_hda_codec_dev_free, 1005 }; 1006 1007 dev_dbg(card->dev, "%s: entry\n", __func__); 1008 1009 if (snd_BUG_ON(!bus)) 1010 return -EINVAL; 1011 if (snd_BUG_ON(codec_addr > HDA_MAX_CODEC_ADDRESS)) 1012 return -EINVAL; 1013 1014 codec->card = card; 1015 codec->addr = codec_addr; 1023 1016 1024 1017 #ifdef CONFIG_PM -
GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_controller.c
r711 r756 1058 1058 { 1059 1059 struct hdac_bus *bus = azx_bus(chip); 1060 struct hdac_stream *s; 1061 1062 list_for_each_entry(s, &bus->stream_list, list, struct hdac_stream) 1063 snd_hdac_stream_stop(s); 1060 1061 snd_hdac_stop_streams(bus); 1064 1062 } 1065 1063 EXPORT_SYMBOL_GPL(azx_stop_all_streams); -
GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_eld.c
r743 r756 451 451 452 452 void snd_hdmi_print_eld_info(struct hdmi_eld *eld, 453 struct snd_info_buffer *buffer) 453 struct snd_info_buffer *buffer, 454 hda_nid_t pin_nid, int dev_id, hda_nid_t cvt_nid) 454 455 { 455 456 struct parsed_hdmi_eld *e = &eld->info; … … 510 511 snd_iprintf(buffer, "monitor_present\t\t%d\n", eld->monitor_present); 511 512 snd_iprintf(buffer, "eld_valid\t\t%d\n", eld->eld_valid); 513 snd_iprintf(buffer, "codec_pin_nid\t\t0x%x\n", pin_nid); 514 snd_iprintf(buffer, "codec_dev_id\t\t0x%x\n", dev_id); 515 snd_iprintf(buffer, "codec_cvt_nid\t\t0x%x\n", cvt_nid); 512 516 if (!eld->eld_valid) 513 517 return; -
GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_intel.c
r751 r756 97 97 #define INTEL_SCH_HDA_DEVC_NOSNOOP (0x1<<11) 98 98 99 /* Define VIA HD Audio Device ID*/100 #define VIA_HDAC_DEVICE_ID 0x3288101 102 99 /* max number of SDs */ 103 100 /* ICH, ATI and VIA have 4 playback and 4 capture */ … … 112 109 #define ATIHDMI_NUM_CAPTURE 0 113 110 #define ATIHDMI_NUM_PLAYBACK 8 114 115 /* TERA has 4 playback and 3 capture */116 #define TERA_NUM_CAPTURE 3117 #define TERA_NUM_PLAYBACK 4118 111 119 112 … … 511 504 512 505 /* 513 * the codecs are sharing the first link setting by default514 * If other links are enabled for stream, they need similar fix506 * Changes to LCTL.SCF are only needed for the first multi-link dealing 507 * with external codecs 515 508 */ 516 509 val = readl(bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCTL); 517 val &= ~AZX_ML CTL_SPA;518 val |= state << AZX_ML CTL_SPA_SHIFT;510 val &= ~AZX_ML_LCTL_SPA; 511 val |= state << AZX_ML_LCTL_SPA_SHIFT; 519 512 writel(val, bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCTL); 520 513 /* wait for CPA */ … … 522 515 while (timeout) { 523 516 if (((readl(bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCTL)) & 524 AZX_ML CTL_CPA) == (state << AZX_MLCTL_CPA_SHIFT))517 AZX_ML_LCTL_CPA) == (state << AZX_ML_LCTL_CPA_SHIFT)) 525 518 return 0; 526 519 timeout--; … … 539 532 /* 0. check lctl register value is correct or not */ 540 533 val = readl(bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCTL); 541 /* if SCF is already set, let's use it*/542 if ((val & ML_LCTL_SCF_MASK) != 0)534 /* only perform additional configurations if the SCF is initially based on 6MHz */ 535 if ((val & AZX_ML_LCTL_SCF) != 0) 543 536 return; 544 537 … … 547 540 * Any deviation may result in undefined behavior. 548 541 */ 549 if (((val & AZX_ML CTL_SPA) >> AZX_MLCTL_SPA_SHIFT) !=550 ((val & AZX_ML CTL_CPA) >> AZX_MLCTL_CPA_SHIFT))542 if (((val & AZX_ML_LCTL_SPA) >> AZX_ML_LCTL_SPA_SHIFT) != 543 ((val & AZX_ML_LCTL_CPA) >> AZX_ML_LCTL_CPA_SHIFT)) 551 544 return; 552 545 … … 557 550 goto set_spa; 558 551 559 /* 2. update SCF to select a properly audio clock*/560 val &= ~ ML_LCTL_SCF_MASK;552 /* 2. update SCF to select an audio clock different from 6MHz */ 553 val &= ~AZX_ML_LCTL_SCF; 561 554 val |= intel_get_lctl_scf(chip); 562 555 writel(val, bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCTL); … … 2770 2763 .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS | 2771 2764 AZX_DCAPS_PM_RUNTIME }, 2765 { PCI_DEVICE(0x1002, 0xab30), 2766 .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS | 2767 AZX_DCAPS_PM_RUNTIME }, 2772 2768 { PCI_DEVICE(0x1002, 0xab38), 2773 2769 .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS | -
GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_local.h
r738 r756 727 727 #ifdef CONFIG_SND_PROC_FS 728 728 void snd_hdmi_print_eld_info(struct hdmi_eld *eld, 729 struct snd_info_buffer *buffer); 729 struct snd_info_buffer *buffer, 730 hda_nid_t pin_nid, int dev_id, hda_nid_t cvt_nid); 730 731 void snd_hdmi_write_eld_info(struct hdmi_eld *eld, 731 732 struct snd_info_buffer *buffer); -
GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_sysfs.c
r750 r756 375 375 return pin_configs_show(codec, &codec->user_pins, buf); 376 376 } 377 378 #define MAX_PIN_CONFIGS 32379 377 380 378 static int parse_user_pin_configs(struct hda_codec *codec, const char *buf) -
GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/patch_ca0132.c
r749 r756 1312 1312 SND_PCI_QUIRK(0x1458, 0xA036, "Gigabyte GA-Z170X-Gaming 7", QUIRK_R3DI), 1313 1313 SND_PCI_QUIRK(0x3842, 0x1038, "EVGA X99 Classified", QUIRK_R3DI), 1314 SND_PCI_QUIRK(0x3842, 0x1055, "EVGA Z390 DARK", QUIRK_R3DI), 1314 1315 SND_PCI_QUIRK(0x1102, 0x0013, "Recon3D", QUIRK_R3D), 1315 1316 SND_PCI_QUIRK(0x1102, 0x0018, "Recon3D", QUIRK_R3D), … … 2968 2969 unsigned int *port_map) 2969 2970 { 2970 int status;2971 2971 unsigned int num_chans; 2972 2972 … … 2982 2982 num_chans = get_hdafmt_chs(fmt) + 1; 2983 2983 2984 status = dsp_allocate_ports(codec, num_chans, rate_multi, port_map); 2985 2986 return status; 2984 return dsp_allocate_ports(codec, num_chans, rate_multi, port_map); 2987 2985 } 2988 2986 -
GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/patch_hdmi.c
r754 r756 164 164 int dev_num; 165 165 struct snd_array pins; /* struct hdmi_spec_per_pin */ 166 struct hdmi_pcm pcm_rec[ 16];166 struct hdmi_pcm pcm_rec[8]; 167 167 struct mutex pcm_lock; 168 168 struct mutex bind_lock; /* for audio component binding */ … … 180 180 181 181 bool dyn_pin_out; 182 bool dyn_pcm_assign;183 bool dyn_pcm_no_legacy;184 182 /* hdmi interrupt trigger control flag for Nvidia codec */ 185 183 bool hdmi_intr_trig_ctrl; … … 245 243 struct hdmi_audio_infoframe hdmi; 246 244 struct dp_audio_infoframe dp; 245 #ifndef TARGET_OS2 246 DECLARE_FLEX_ARRAY(u8, bytes); 247 #else 247 248 u8 bytes[1]; 249 #endif 248 250 }; 249 251 … … 509 511 510 512 mutex_lock(&per_pin->lock); 511 snd_hdmi_print_eld_info(&per_pin->sink_eld, buffer); 513 snd_hdmi_print_eld_info(&per_pin->sink_eld, buffer, per_pin->pin_nid, 514 per_pin->dev_id, per_pin->cvt_nid); 512 515 mutex_unlock(&per_pin->lock); 513 516 } … … 1200 1203 } 1201 1204 1202 /* called in hdmi_pcm_open when no pin is assigned to the PCM 1203 * in dyn_pcm_assign mode. 1204 */ 1205 /* called in hdmi_pcm_open when no pin is assigned to the PCM */ 1205 1206 static int hdmi_pcm_open_no_pin(struct hda_pcm_stream *hinfo, 1206 1207 struct hda_codec *codec, … … 1270 1271 mutex_lock(&spec->pcm_lock); 1271 1272 pin_idx = hinfo_to_pin_index(codec, hinfo); 1272 if (!spec->dyn_pcm_assign) { 1273 if (snd_BUG_ON(pin_idx < 0)) { 1274 err = -EINVAL; 1275 goto unlock; 1276 } 1277 } else { 1278 /* no pin is assigned to the PCM 1279 * PA need pcm open successfully when probe 1280 */ 1281 if (pin_idx < 0) { 1282 err = hdmi_pcm_open_no_pin(hinfo, codec, substream); 1283 goto unlock; 1284 } 1273 /* no pin is assigned to the PCM 1274 * PA need pcm open successfully when probe 1275 */ 1276 if (pin_idx < 0) { 1277 err = hdmi_pcm_open_no_pin(hinfo, codec, substream); 1278 goto unlock; 1285 1279 } 1286 1280 … … 1387 1381 int i; 1388 1382 1389 /* on the new machines, try to assign the pcm slot dynamically,1390 * not use the preferred fixed map (legacy way) anymore.1391 */1392 if (spec->dyn_pcm_no_legacy)1393 goto last_try;1394 1395 /*1396 * generic_hdmi_build_pcms() may allocate extra PCMs on some1397 * platforms (with maximum of 'num_nids + dev_num - 1')1398 *1399 * The per_pin of pin_nid_idx=n and dev_id=m prefers to get pcm-n1400 * if m==0. This guarantees that dynamic pcm assignments are compatible1401 * with the legacy static per_pin-pcm assignment that existed in the1402 * days before DP-MST.1403 *1404 * Intel DP-MST prefers this legacy behavior for compatibility, too.1405 *1406 * per_pin of m!=0 prefers to get pcm=(num_nids + (m - 1)).1407 */1408 1409 if (per_pin->dev_id == 0 || spec->intel_hsw_fixup) {1410 if (!test_bit(per_pin->pin_nid_idx, &spec->pcm_bitmap))1411 return per_pin->pin_nid_idx;1412 } else {1413 i = spec->num_nids + (per_pin->dev_id - 1);1414 if (i < spec->pcm_used && !(test_bit(i, &spec->pcm_bitmap)))1415 return i;1416 }1417 1418 /* have a second try; check the area over num_nids */1419 for (i = spec->num_nids; i < spec->pcm_used; i++) {1420 if (!test_bit(i, &spec->pcm_bitmap))1421 return i;1422 }1423 1424 last_try:1425 /* the last try; check the empty slots in pins */1426 1383 for (i = 0; i < spec->pcm_used; i++) { 1427 1384 if (!test_bit(i, &spec->pcm_bitmap)) … … 1485 1442 bool non_pcm; 1486 1443 1487 if (per_pin->pcm_idx >= 0 && per_pin->pcm_idx < spec->pcm_used) 1488 pcm = get_pcm_rec(spec, per_pin->pcm_idx); 1489 else 1444 if (per_pin->pcm_idx < 0 || per_pin->pcm_idx >= spec->pcm_used) 1490 1445 return; 1446 pcm = get_pcm_rec(spec, per_pin->pcm_idx); 1491 1447 if (!pcm->pcm) 1492 1448 return; … … 1586 1542 pcm_jack = pin_idx_to_pcm_jack(codec, per_pin); 1587 1543 1588 if (spec->dyn_pcm_assign) { 1589 if (eld->eld_valid) { 1590 hdmi_attach_hda_pcm(spec, per_pin); 1591 hdmi_pcm_setup_pin(spec, per_pin); 1592 } else { 1593 hdmi_pcm_reset_pin(spec, per_pin); 1594 hdmi_detach_hda_pcm(spec, per_pin); 1595 } 1544 if (eld->eld_valid) { 1545 hdmi_attach_hda_pcm(spec, per_pin); 1546 hdmi_pcm_setup_pin(spec, per_pin); 1547 } else { 1548 hdmi_pcm_reset_pin(spec, per_pin); 1549 hdmi_detach_hda_pcm(spec, per_pin); 1596 1550 } 1597 1551 /* if pcm_idx == -1, it means this is in monitor connection event … … 1955 1909 */ 1956 1910 dev_num = spec->dev_num; 1957 } else if ( spec->dyn_pcm_assign &&codec->dp_mst) {1911 } else if (codec->dp_mst) { 1958 1912 dev_num = snd_hda_get_num_devices(codec, pin_nid) + 1; 1959 1913 /* … … 1980 1934 return -ENOMEM; 1981 1935 1982 if (spec->dyn_pcm_assign) { 1983 per_pin->pcm = NULL; 1984 per_pin->pcm_idx = -1; 1985 } else { 1986 per_pin->pcm = get_hdmi_pcm(spec, pin_idx); 1987 per_pin->pcm_idx = pin_idx; 1988 } 1936 per_pin->pcm = NULL; 1937 per_pin->pcm_idx = -1; 1989 1938 per_pin->pin_nid = pin_nid; 1990 1939 per_pin->pin_nid_idx = spec->num_nids; … … 1995 1944 if (err < 0) 1996 1945 return err; 1946 if (!is_jack_detectable(codec, pin_nid)) 1947 codec_warn(codec, "HDMI: pin NID 0x%x - jack not detectable\n", pin_nid); 1997 1948 spec->num_pins++; 1998 1949 } … … 2142 2093 mutex_lock(&spec->pcm_lock); 2143 2094 pin_idx = hinfo_to_pin_index(codec, hinfo); 2144 if (spec->dyn_pcm_assign && pin_idx < 0) { 2145 /* when dyn_pcm_assign and pcm is not bound to a pin 2146 * skip pin setup and return 0 to make audio playback 2147 * be ongoing 2095 if (pin_idx < 0) { 2096 /* when pcm is not bound to a pin skip pin setup and return 0 2097 * to make audio playback be ongoing 2148 2098 */ 2149 2099 pin_cvt_fixup(codec, NULL, cvt_nid); … … 2248 2198 clear_bit(pcm_idx, &spec->pcm_in_use); 2249 2199 pin_idx = hinfo_to_pin_index(codec, hinfo); 2250 if ( spec->dyn_pcm_assign &&pin_idx < 0)2200 if (pin_idx < 0) 2251 2201 goto unlock; 2252 2202 … … 2346 2296 int idx, pcm_num; 2347 2297 2348 /* 2349 * for non-mst mode, pcm number is the same as before 2350 * for DP MST mode without extra PCM, pcm number is same 2351 * for DP MST mode with extra PCMs, pcm number is 2352 * (nid number + dev_num - 1) 2353 * dev_num is the device entry number in a pin 2354 */ 2355 2356 if (spec->dyn_pcm_no_legacy && codec->mst_no_extra_pcms) 2357 pcm_num = spec->num_cvts; 2358 else if (codec->mst_no_extra_pcms) 2359 pcm_num = spec->num_nids; 2360 else 2361 pcm_num = spec->num_nids + spec->dev_num - 1; 2362 2298 /* limit the PCM devices to the codec converters */ 2299 pcm_num = spec->num_cvts; 2363 2300 codec_dbg(codec, "hdmi: pcm_num set to %d\n", pcm_num); 2364 2301 … … 2379 2316 pstr->substreams = 1; 2380 2317 pstr->ops = generic_ops; 2381 /* pcm number is less than 16*/2382 if (spec->pcm_used >= 16)2318 /* pcm number is less than pcm_rec array size */ 2319 if (spec->pcm_used >= ARRAY_SIZE(spec->pcm_rec)) 2383 2320 break; 2384 2321 /* other pstr fields are set in open */ … … 2399 2336 char hdmi_str[32] = "HDMI/DP"; 2400 2337 struct hdmi_spec *spec = codec->spec; 2401 struct hdmi_spec_per_pin *per_pin = get_pin(spec, pcm_idx);2402 2338 struct snd_jack *jack; 2403 2339 int pcmdev = get_pcm_rec(spec, pcm_idx)->device; … … 2406 2342 if (pcmdev > 0) 2407 2343 sprintf(hdmi_str + strlen(hdmi_str), ",pcm=%d", pcmdev); 2408 if (!spec->dyn_pcm_assign &&2409 !is_jack_detectable(codec, per_pin->pin_nid))2410 strncat(hdmi_str, " Phantom",2411 sizeof(hdmi_str) - strlen(hdmi_str) - 1);2412 2344 2413 2345 err = snd_jack_new(codec->card, hdmi_str, SND_JACK_AVOUT, &jack, … … 2442 2374 * pin will be bound when monitor is connected 2443 2375 */ 2444 if (spec->dyn_pcm_assign) 2445 err = snd_hda_create_dig_out_ctls(codec, 2376 err = snd_hda_create_dig_out_ctls(codec, 2446 2377 0, spec->cvt_nids[0], 2447 2378 HDA_PCM_TYPE_HDMI); 2448 else {2449 struct hdmi_spec_per_pin *per_pin =2450 get_pin(spec, pcm_idx);2451 err = snd_hda_create_dig_out_ctls(codec,2452 per_pin->pin_nid,2453 per_pin->mux_nids[0],2454 HDA_PCM_TYPE_HDMI);2455 }2456 2379 if (err < 0) 2457 2380 return err; … … 2573 2496 if (spec->pcm_rec[pcm_idx].jack == NULL) 2574 2497 continue; 2575 if (spec->dyn_pcm_assign) 2576 snd_device_free(codec->card, 2577 spec->pcm_rec[pcm_idx].jack); 2578 else 2579 spec->pcm_rec[pcm_idx].jack = NULL; 2498 snd_device_free(codec->card, spec->pcm_rec[pcm_idx].jack); 2580 2499 } 2581 2500 … … 3055 2974 spec = codec->spec; 3056 2975 codec->dp_mst = true; 3057 spec->dyn_pcm_assign = true;3058 2976 spec->vendor_nid = vendor_nid; 3059 2977 spec->port_map = port_map; … … 3119 3037 */ 3120 3038 static const int map[] = {0x4, 0x6, 0x8, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf}; 3121 int ret; 3122 3123 ret = intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 4, 3124 enable_silent_stream); 3125 if (!ret) { 3126 struct hdmi_spec *spec = codec->spec; 3127 3128 spec->dyn_pcm_no_legacy = true; 3129 } 3130 3131 return ret; 3039 3040 return intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 4, 3041 enable_silent_stream); 3132 3042 } 3133 3043 … … 3769 3679 3770 3680 spec = codec->spec; 3771 spec->dyn_pcm_assign = true;3772 3681 3773 3682 err = hdmi_parse_codec(codec); … … 4049 3958 4050 3959 codec->dp_mst = true; 4051 codec->mst_no_extra_pcms = true;4052 3960 spec = codec->spec; 4053 3961 spec->dyn_pin_out = true; 4054 spec->dyn_pcm_assign = true;4055 3962 spec->hdmi_intr_trig_ctrl = true; 4056 3963 -
GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/patch_realtek.c
r755 r756 19 19 #include <linux/input.h> 20 20 #include <linux/leds.h> 21 #include <linux/ctype.h> 21 22 #include <sound/core.h> 22 23 #include <sound/jack.h> … … 3755 3756 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 3756 3757 3757 for (i = 0; i < HDA_MAX_COMPONENTS; i++)3758 if (spec->comps[i].resume_hook)3759 spec->comps[i].resume_hook(spec->comps[i].dev);3760 3761 3758 return 0; 3762 3759 … … 4680 4677 { 4681 4678 //NOT_USED struct alc_spec *spec = codec->spec; 4682 int i;4683 4679 4684 4680 #ifndef TARGET_OS2 … … 4686 4682 alc5505_dsp_suspend(codec); 4687 4683 4688 for (i = 0; i < HDA_MAX_COMPONENTS; i++)4689 if (spec->comps[i].suspend_hook)4690 spec->comps[i].suspend_hook(spec->comps[i].dev);4691 4684 #endif 4692 4685 return alc_suspend(codec); … … 4696 4689 { 4697 4690 struct alc_spec *spec = codec->spec; 4698 int i;4699 4691 4700 4692 if (spec->codec_variant == ALC269_TYPE_ALC269VB) … … 7364 7356 struct hda_codec *cdc = dev_to_hda_codec(dev); 7365 7357 struct alc_spec *spec = cdc->spec; 7366 int ret, i; 7367 7368 ret = component_bind_all(dev, spec->comps); 7369 if (ret) 7370 return ret; 7371 7372 if (snd_hdac_is_power_on(&cdc->core)) { 7373 codec_dbg(cdc, "Resuming after bind.\n"); 7374 for (i = 0; i < HDA_MAX_COMPONENTS; i++) 7375 if (spec->comps[i].resume_hook) 7376 spec->comps[i].resume_hook(spec->comps[i].dev); 7377 } 7378 7379 return 0; 7358 7359 return component_bind_all(dev, spec->comps); 7380 7360 } 7381 7361 … … 7405 7385 } 7406 7386 7387 struct cs35l41_dev_name { 7388 const char *bus; 7389 const char *hid; 7390 int index; 7391 }; 7392 7393 /* match the device name in a slightly relaxed manner */ 7394 static int comp_match_cs35l41_dev_name(struct device *dev, void *data) 7395 { 7396 struct cs35l41_dev_name *p = data; 7397 const char *d = dev_name(dev); 7398 int n = strlen(p->bus); 7399 char tmp[32]; 7400 7401 /* check the bus name */ 7402 if (strncmp(d, p->bus, n)) 7403 return 0; 7404 /* skip the bus number */ 7405 if (isdigit(d[n])) 7406 n++; 7407 /* the rest must be exact matching */ 7408 snprintf(tmp, sizeof(tmp), "-%s:00-cs35l41-hda.%d", p->hid, p->index); 7409 return !strcmp(d + n, tmp); 7410 } 7411 7407 7412 static void cs35l41_generic_fixup(struct hda_codec *cdc, int action, const char *bus, 7408 7413 const char *hid, int count) … … 7410 7415 struct device *dev = hda_codec_dev(cdc); 7411 7416 struct alc_spec *spec = cdc->spec; 7412 char *name;7417 struct cs35l41_dev_name *rec; 7413 7418 int ret, i; 7414 7419 … … 7416 7421 case HDA_FIXUP_ACT_PRE_PROBE: 7417 7422 for (i = 0; i < count; i++) { 7418 name = devm_kasprintf(dev, GFP_KERNEL, 7419 "%s-%s:00-cs35l41-hda.%d", bus, hid, i); 7420 if (!name) 7423 rec = devm_kmalloc(dev, sizeof(*rec), GFP_KERNEL); 7424 if (!rec) 7421 7425 return; 7426 rec->bus = bus; 7427 rec->hid = hid; 7428 rec->index = i; 7422 7429 spec->comps[i].codec = cdc; 7423 component_match_add(dev, &spec->match, component_compare_dev_name, name); 7430 component_match_add(dev, &spec->match, 7431 comp_match_cs35l41_dev_name, rec); 7424 7432 } 7425 7433 ret = component_master_add_with_match(dev, &comp_master_ops, spec->match); … … 7439 7447 static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action) 7440 7448 { 7441 cs35l41_generic_fixup(codec, action, "spi0", "CSC3551", 2); 7442 } 7443 7444 static void cs35l41_fixup_spi1_two(struct hda_codec *codec, const struct hda_fixup *fix, int action) 7445 { 7446 cs35l41_generic_fixup(codec, action, "spi1", "CSC3551", 2); 7449 cs35l41_generic_fixup(codec, action, "spi", "CSC3551", 2); 7447 7450 } 7448 7451 7449 7452 static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fixup *fix, int action) 7450 7453 { 7451 cs35l41_generic_fixup(codec, action, "spi 0", "CSC3551", 4);7454 cs35l41_generic_fixup(codec, action, "spi", "CSC3551", 4); 7452 7455 } 7453 7456 … … 7838 7841 ALC245_FIXUP_CS35L41_SPI_2, 7839 7842 ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED, 7840 ALC245_FIXUP_CS35L41_SPI1_2,7841 ALC245_FIXUP_CS35L41_SPI1_2_HP_GPIO_LED,7842 7843 ALC245_FIXUP_CS35L41_SPI_4, 7843 7844 ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED, … … 10007 10008 .type = HDA_FIXUP_FUNC, 10008 10009 .v.func = cs35l41_fixup_spi_two, 10009 .chained = true,10010 .chain_id = ALC285_FIXUP_HP_GPIO_LED,10011 },10012 [ALC245_FIXUP_CS35L41_SPI1_2] = {10013 .type = HDA_FIXUP_FUNC,10014 .v.func = cs35l41_fixup_spi1_two,10015 },10016 [ALC245_FIXUP_CS35L41_SPI1_2_HP_GPIO_LED] = {10017 .type = HDA_FIXUP_FUNC,10018 .v.func = cs35l41_fixup_spi1_two,10019 10010 .chained = true, 10020 10011 .chain_id = ALC285_FIXUP_HP_GPIO_LED, … … 10387 10378 SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED), 10388 10379 SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED), 10389 SND_PCI_QUIRK(0x103c, 0x8abb, "HP ZBook Firefly 14 G9", ALC245_FIXUP_CS35L41_SPI 1_2_HP_GPIO_LED),10380 SND_PCI_QUIRK(0x103c, 0x8abb, "HP ZBook Firefly 14 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10390 10381 SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10391 10382 SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), … … 10440 10431 SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401), 10441 10432 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401), 10433 SND_PCI_QUIRK(0x1043, 0x1f12, "ASUS UM5302", ALC287_FIXUP_CS35L41_I2C_2), 10442 10434 SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401), 10443 10435 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2), … … 10471 10463 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP), 10472 10464 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP), 10465 SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP), 10466 SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP), 10473 10467 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), 10474 10468 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP), … … 10644 10638 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), 10645 10639 SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK), 10640 SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC), 10646 10641 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS), 10647 10642 SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
Note:
See TracChangeset
for help on using the changeset viewer.
