Skip to content

Commit 02f2e78

Browse files
committed
Merge branch 'for-next' into for-linus
2 parents 84ab940 + 56e696c commit 02f2e78

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+1106
-1089
lines changed

Documentation/sound/kernel-api/writing-an-alsa-driver.rst

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3565,13 +3565,17 @@ given size.
35653565
The second argument (type) and the third argument (device pointer) are
35663566
dependent on the bus. For normal devices, pass the device pointer
35673567
(typically identical as ``card->dev``) to the third argument with
3568-
``SNDRV_DMA_TYPE_DEV`` type. For the continuous buffer unrelated to the
3568+
``SNDRV_DMA_TYPE_DEV`` type.
3569+
3570+
For the continuous buffer unrelated to the
35693571
bus can be pre-allocated with ``SNDRV_DMA_TYPE_CONTINUOUS`` type.
35703572
You can pass NULL to the device pointer in that case, which is the
35713573
default mode implying to allocate with ``GFP_KERNEL`` flag.
3572-
If you need a different GFP flag, you can pass it by encoding the flag
3573-
into the device pointer via a special macro
3574-
:c:func:`snd_dma_continuous_data()`.
3574+
If you need a restricted (lower) address, set up the coherent DMA mask
3575+
bits for the device, and pass the device pointer, like the normal
3576+
device memory allocations. For this type, it's still allowed to pass
3577+
NULL to the device pointer, too, if no address restriction is needed.
3578+
35753579
For the scatter-gather buffers, use ``SNDRV_DMA_TYPE_DEV_SG`` with the
35763580
device pointer (see the `Non-Contiguous Buffers`_ section).
35773581

@@ -3811,15 +3815,6 @@ arguments here. Since each vmalloc call should succeed at any time,
38113815
we don't need to pre-allocate the buffers like other continuous
38123816
pages.
38133817

3814-
If you need the 32bit DMA allocation, pass the device pointer encoded
3815-
by :c:func:`snd_dma_continuous_data()` with ``GFP_KERNEL|__GFP_DMA32``
3816-
argument.
3817-
3818-
::
3819-
3820-
snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_VMALLOC,
3821-
snd_dma_continuous_data(GFP_KERNEL | __GFP_DMA32), 0, 0);
3822-
38233818
Proc Interface
38243819
==============
38253820

drivers/usb/gadget/function/u_uac1_legacy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ size_t u_audio_playback(struct gaudio *card, void *buf, size_t count)
158158
snd_pcm_sframes_t frames;
159159

160160
try_again:
161-
if (runtime->status->state == SNDRV_PCM_STATE_XRUN ||
162-
runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) {
161+
if (runtime->state == SNDRV_PCM_STATE_XRUN ||
162+
runtime->state == SNDRV_PCM_STATE_SUSPENDED) {
163163
result = snd_pcm_kernel_ioctl(substream,
164164
SNDRV_PCM_IOCTL_PREPARE, NULL);
165165
if (result < 0) {

include/sound/hda_codec.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ struct hda_codec {
258258
unsigned int link_down_at_suspend:1; /* link down at runtime suspend */
259259
unsigned int relaxed_resume:1; /* don't resume forcibly for jack */
260260
unsigned int forced_resume:1; /* forced resume for jack */
261-
unsigned int mst_no_extra_pcms:1; /* no backup PCMs for DP-MST */
262261

263262
#ifdef CONFIG_PM
264263
unsigned long power_on_acct;
@@ -293,8 +292,6 @@ struct hda_codec {
293292
#define dev_to_hda_codec(_dev) container_of(_dev, struct hda_codec, core.dev)
294293
#define hda_codec_dev(_dev) (&(_dev)->core.dev)
295294

296-
#define hdac_to_hda_priv(_hdac) \
297-
container_of(_hdac, struct hdac_hda_priv, codec.core)
298295
#define hdac_to_hda_codec(_hdac) container_of(_hdac, struct hda_codec, core)
299296

300297
#define list_for_each_codec(c, bus) \

include/sound/hda_register.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -260,23 +260,25 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };
260260

261261
#define AZX_REG_ML_LCAP 0x00
262262
#define AZX_REG_ML_LCTL 0x04
263+
264+
#define AZX_ML_LCTL_CPA BIT(23)
265+
#define AZX_ML_LCTL_CPA_SHIFT 23
266+
#define AZX_ML_LCTL_SPA BIT(16)
267+
#define AZX_ML_LCTL_SPA_SHIFT 16
268+
#define AZX_ML_LCTL_SCF GENMASK(3, 0)
269+
263270
#define AZX_REG_ML_LOSIDV 0x08
271+
272+
/* bit0 is reserved, with BIT(1) mapping to stream1 */
273+
#define AZX_ML_LOSIDV_STREAM_MASK 0xFFFE
274+
264275
#define AZX_REG_ML_LSDIID 0x0C
265276
#define AZX_REG_ML_LPSOO 0x10
266277
#define AZX_REG_ML_LPSIO 0x12
267278
#define AZX_REG_ML_LWALFC 0x18
268279
#define AZX_REG_ML_LOUTPAY 0x20
269280
#define AZX_REG_ML_LINPAY 0x30
270281

271-
/* bit0 is reserved, with BIT(1) mapping to stream1 */
272-
#define ML_LOSIDV_STREAM_MASK 0xFFFE
273-
274-
#define ML_LCTL_SCF_MASK 0xF
275-
#define AZX_MLCTL_SPA (0x1 << 16)
276-
#define AZX_MLCTL_CPA (0x1 << 23)
277-
#define AZX_MLCTL_SPA_SHIFT 16
278-
#define AZX_MLCTL_CPA_SHIFT 23
279-
280282
/* registers for DMA Resume Capability Structure */
281283
#define AZX_DRSM_CAP_ID 0x5
282284
#define AZX_REG_DRSM_CTL 0x4

include/sound/hdaudio.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/interrupt.h>
1111
#include <linux/io.h>
1212
#include <linux/io-64-nonatomic-lo-hi.h>
13+
#include <linux/iopoll.h>
1314
#include <linux/pm_runtime.h>
1415
#include <linux/timecounter.h>
1516
#include <sound/core.h>
@@ -550,6 +551,7 @@ void snd_hdac_stream_init(struct hdac_bus *bus, struct hdac_stream *azx_dev,
550551
int idx, int direction, int tag);
551552
struct hdac_stream *snd_hdac_stream_assign(struct hdac_bus *bus,
552553
struct snd_pcm_substream *substream);
554+
void snd_hdac_stream_release_locked(struct hdac_stream *azx_dev);
553555
void snd_hdac_stream_release(struct hdac_stream *azx_dev);
554556
struct hdac_stream *snd_hdac_get_stream(struct hdac_bus *bus,
555557
int dir, int stream_tag);
@@ -560,8 +562,8 @@ int snd_hdac_stream_setup_periods(struct hdac_stream *azx_dev);
560562
int snd_hdac_stream_set_params(struct hdac_stream *azx_dev,
561563
unsigned int format_val);
562564
void snd_hdac_stream_start(struct hdac_stream *azx_dev, bool fresh_start);
563-
void snd_hdac_stream_clear(struct hdac_stream *azx_dev);
564565
void snd_hdac_stream_stop(struct hdac_stream *azx_dev);
566+
void snd_hdac_stop_streams(struct hdac_bus *bus);
565567
void snd_hdac_stop_streams_and_chip(struct hdac_bus *bus);
566568
void snd_hdac_stream_reset(struct hdac_stream *azx_dev);
567569
void snd_hdac_stream_sync_trigger(struct hdac_stream *azx_dev, bool set,
@@ -589,6 +591,12 @@ int snd_hdac_get_stream_stripe_ctl(struct hdac_bus *bus,
589591
snd_hdac_reg_readw((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
590592
#define snd_hdac_stream_readb(dev, reg) \
591593
snd_hdac_reg_readb((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
594+
#define snd_hdac_stream_readb_poll(dev, reg, val, cond, delay_us, timeout_us) \
595+
readb_poll_timeout((dev)->sd_addr + AZX_REG_ ## reg, val, cond, \
596+
delay_us, timeout_us)
597+
#define snd_hdac_stream_readl_poll(dev, reg, val, cond, delay_us, timeout_us) \
598+
readl_poll_timeout((dev)->sd_addr + AZX_REG_ ## reg, val, cond, \
599+
delay_us, timeout_us)
592600

593601
/* update a register, pass without AZX_REG_ prefix */
594602
#define snd_hdac_stream_updatel(dev, reg, mask, val) \

include/sound/hdaudio_ext.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ int snd_hdac_ext_bus_init(struct hdac_bus *bus, struct device *dev,
1111
const struct hdac_ext_bus_ops *ext_ops);
1212

1313
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);
1714
void snd_hdac_ext_bus_device_remove(struct hdac_bus *bus);
1815

1916
#define HDA_CODEC_REV_EXT_ENTRY(_vid, _rev, _name, drv_data) \
@@ -80,12 +77,9 @@ struct hdac_ext_stream {
8077
#define stream_to_hdac_ext_stream(s) \
8178
container_of(s, struct hdac_ext_stream, hstream)
8279

83-
void snd_hdac_ext_stream_init(struct hdac_bus *bus,
84-
struct hdac_ext_stream *hext_stream, int idx,
85-
int direction, int tag);
8680
int snd_hdac_ext_stream_init_all(struct hdac_bus *bus, int start_idx,
8781
int num_stream, int dir);
88-
void snd_hdac_stream_free_all(struct hdac_bus *bus);
82+
void snd_hdac_ext_stream_free_all(struct hdac_bus *bus);
8983
void snd_hdac_link_free_all(struct hdac_bus *bus);
9084
struct hdac_ext_stream *snd_hdac_ext_stream_assign(struct hdac_bus *bus,
9185
struct snd_pcm_substream *substream,
@@ -188,12 +182,6 @@ void snd_hdac_ext_bus_link_power(struct hdac_device *codec, bool enable);
188182
#define snd_hdac_adsp_readq_poll(chip, reg, val, cond, delay_us, timeout_us) \
189183
readq_poll_timeout((chip)->dsp_ba + (reg), val, cond, \
190184
delay_us, timeout_us)
191-
#define snd_hdac_stream_readb_poll(strm, reg, val, cond, delay_us, timeout_us) \
192-
readb_poll_timeout((strm)->sd_addr + AZX_REG_ ## reg, val, cond, \
193-
delay_us, timeout_us)
194-
#define snd_hdac_stream_readl_poll(strm, reg, val, cond, delay_us, timeout_us) \
195-
readl_poll_timeout((strm)->sd_addr + AZX_REG_ ## reg, val, cond, \
196-
delay_us, timeout_us)
197185

198186
struct hdac_ext_device;
199187

include/sound/memalloc.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ struct snd_dma_device {
2626
struct device *dev; /* generic device */
2727
};
2828

29-
#define snd_dma_continuous_data(x) ((struct device *)(__force unsigned long)(x))
30-
31-
3229
/*
3330
* buffer types
3431
*/

include/sound/pcm.h

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,8 @@ static inline void snd_pcm_pack_audio_tstamp_report(__u32 *data, __u32 *accuracy
346346

347347
struct snd_pcm_runtime {
348348
/* -- Status -- */
349+
snd_pcm_state_t state; /* stream state */
350+
snd_pcm_state_t suspended_state; /* suspended stream state */
349351
struct snd_pcm_substream *trigger_master;
350352
struct timespec64 trigger_tstamp; /* trigger timestamp */
351353
bool trigger_tstamp_latched; /* trigger timestamp latched in low-level driver/hardware */
@@ -678,11 +680,25 @@ void snd_pcm_stream_unlock_irqrestore(struct snd_pcm_substream *substream,
678680
*/
679681
static inline int snd_pcm_running(struct snd_pcm_substream *substream)
680682
{
681-
return (substream->runtime->status->state == SNDRV_PCM_STATE_RUNNING ||
682-
(substream->runtime->status->state == SNDRV_PCM_STATE_DRAINING &&
683+
return (substream->runtime->state == SNDRV_PCM_STATE_RUNNING ||
684+
(substream->runtime->state == SNDRV_PCM_STATE_DRAINING &&
683685
substream->stream == SNDRV_PCM_STREAM_PLAYBACK));
684686
}
685687

688+
/**
689+
* __snd_pcm_set_state - Change the current PCM state
690+
* @runtime: PCM runtime to set
691+
* @state: the current state to set
692+
*
693+
* Call within the stream lock
694+
*/
695+
static inline void __snd_pcm_set_state(struct snd_pcm_runtime *runtime,
696+
snd_pcm_state_t state)
697+
{
698+
runtime->state = state;
699+
runtime->status->state = state; /* copy for mmap */
700+
}
701+
686702
/**
687703
* bytes_to_samples - Unit conversion of the size from bytes to samples
688704
* @runtime: PCM runtime instance

include/uapi/sound/asequencer.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,6 @@
33
* Main header file for the ALSA sequencer
44
* Copyright (c) 1998-1999 by Frank van de Pol <[email protected]>
55
* (c) 1998-1999 by Jaroslav Kysela <[email protected]>
6-
*
7-
*
8-
* This program is free software; you can redistribute it and/or modify
9-
* it under the terms of the GNU General Public License as published by
10-
* the Free Software Foundation; either version 2 of the License, or
11-
* (at your option) any later version.
12-
*
13-
* This program is distributed in the hope that it will be useful,
14-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16-
* GNU General Public License for more details.
17-
*
18-
* You should have received a copy of the GNU General Public License
19-
* along with this program; if not, write to the Free Software
20-
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21-
*
226
*/
237
#ifndef _UAPI__SOUND_ASEQUENCER_H
248
#define _UAPI__SOUND_ASEQUENCER_H

include/uapi/sound/asoc.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
* Copyright (C) 2012 Texas Instruments Inc.
66
* Copyright (C) 2015 Intel Corporation.
77
*
8-
* This program is free software; you can redistribute it and/or modify
9-
* it under the terms of the GNU General Public License version 2 as
10-
* published by the Free Software Foundation.
11-
*
128
* Simple file API to load FW that includes mixers, coefficients, DAPM graphs,
139
* algorithms, equalisers, DAIs, widgets etc.
1410
*/

0 commit comments

Comments
 (0)