Skip to content

Commit 5f752da

Browse files
committed
Merge remote-tracking branch 'takashi/for-next' into sound/upstream-20260402
2 parents a75c8d1 + 872c743 commit 5f752da

47 files changed

Lines changed: 1022 additions & 298 deletions

Some content is hidden

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

Documentation/sound/alsa-configuration.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2376,6 +2376,13 @@ quirk_flags
23762376
Skip the probe-time interface setup (usb_set_interface,
23772377
init_pitch, init_sample_rate); redundant with
23782378
snd_usb_endpoint_prepare() at stream-open time
2379+
* bit 27: ``mixer_playback_linear_vol``
2380+
Set linear volume mapping for devices where the playback volume
2381+
control value is mapped to voltage (instead of dB) level linearly.
2382+
In short: ``x(raw) = (raw - raw_min) / (raw_max - raw_min)``;
2383+
``V(x) = k * x``; ``dB(x) = 20 * log10(x)``. Overrides bit 24
2384+
* bit 28: ``mixer_capture_linear_vol``
2385+
Similar to bit 27 but for capture streams. Overrides bit 25
23792386

23802387
This module supports multiple devices, autoprobe and hotplugging.
23812388

include/sound/core.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ struct snd_card {
133133
#ifdef CONFIG_SND_DEBUG
134134
struct dentry *debugfs_root; /* debugfs root for card */
135135
#endif
136+
#ifdef CONFIG_SND_CTL_DEBUG
137+
struct snd_ctl_elem_value *value_buf; /* buffer for kctl->put() verification */
138+
#endif
136139

137140
#ifdef CONFIG_PM
138141
unsigned int power_state; /* power state */

include/sound/hda_verbs.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ enum {
5656
#define AC_VERB_GET_DIGI_CONVERT_1 0x0f0d
5757
#define AC_VERB_GET_DIGI_CONVERT_2 0x0f0e /* unused */
5858
#define AC_VERB_GET_VOLUME_KNOB_CONTROL 0x0f0f
59-
/* f10-f1a: GPIO */
59+
/* f10-f1a: GPI/GPO/GPIO */
60+
#define AC_VERB_GET_GPI_DATA 0x0f10
61+
#define AC_VERB_GET_GPI_WAKE_MASK 0x0f11
62+
#define AC_VERB_GET_GPI_UNSOLICITED_RSP_MASK 0x0f12
63+
#define AC_VERB_GET_GPI_STICKY_MASK 0x0f13
64+
#define AC_VERB_GET_GPO_DATA 0x0f14
6065
#define AC_VERB_GET_GPIO_DATA 0x0f15
6166
#define AC_VERB_GET_GPIO_MASK 0x0f16
6267
#define AC_VERB_GET_GPIO_DIRECTION 0x0f17
@@ -99,6 +104,11 @@ enum {
99104
#define AC_VERB_SET_DIGI_CONVERT_2 0x70e
100105
#define AC_VERB_SET_DIGI_CONVERT_3 0x73e
101106
#define AC_VERB_SET_VOLUME_KNOB_CONTROL 0x70f
107+
#define AC_VERB_SET_GPI_DATA 0x710
108+
#define AC_VERB_SET_GPI_WAKE_MASK 0x711
109+
#define AC_VERB_SET_SPI_UNSOLICITED_RSP_MASK 0x712
110+
#define AC_VERB_SET_GPI_STICKY_MASK 0x713
111+
#define AC_VERB_SET_GPO_DATA 0x714
102112
#define AC_VERB_SET_GPIO_DATA 0x715
103113
#define AC_VERB_SET_GPIO_MASK 0x716
104114
#define AC_VERB_SET_GPIO_DIRECTION 0x717

include/sound/pcm.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,10 @@ static inline void __snd_pcm_set_state(struct snd_pcm_runtime *runtime,
729729
runtime->status->state = state; /* copy for mmap */
730730
}
731731

732+
void snd_pcm_set_state(struct snd_pcm_substream *substream,
733+
snd_pcm_state_t state);
734+
snd_pcm_state_t snd_pcm_get_state(struct snd_pcm_substream *substream);
735+
732736
/**
733737
* bytes_to_samples - Unit conversion of the size from bytes to samples
734738
* @runtime: PCM runtime instance

include/sound/timer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ struct snd_timer_instance {
102102
unsigned int slave_id;
103103
struct list_head open_list;
104104
struct list_head active_list;
105+
struct list_head master_list;
105106
struct list_head ack_list;
106107
struct list_head slave_list_head;
107108
struct list_head slave_active_head;

sound/aoa/aoa.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct aoa_codec {
4848
u32 connected;
4949

5050
/* data the fabric can associate with this structure */
51-
void *fabric_data;
51+
const void *fabric_data;
5252

5353
/* private! */
5454
struct list_head list;

sound/aoa/fabrics/layout.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ struct codec_connection {
5555

5656
struct codec_connect_info {
5757
char *name;
58-
struct codec_connection *connections;
58+
const struct codec_connection *connections;
5959
};
6060

6161
#define LAYOUT_FLAG_COMBO_LINEOUT_SPDIF (1<<0)
@@ -116,7 +116,7 @@ MODULE_ALIAS("aoa-device-id-35");
116116
MODULE_ALIAS("aoa-device-id-44");
117117

118118
/* onyx with all but microphone connected */
119-
static struct codec_connection onyx_connections_nomic[] = {
119+
static const struct codec_connection onyx_connections_nomic[] = {
120120
{
121121
.connected = CC_SPEAKERS | CC_HEADPHONE | CC_LINEOUT,
122122
.codec_bit = 0,
@@ -133,7 +133,7 @@ static struct codec_connection onyx_connections_nomic[] = {
133133
};
134134

135135
/* onyx on machines without headphone */
136-
static struct codec_connection onyx_connections_noheadphones[] = {
136+
static const struct codec_connection onyx_connections_noheadphones[] = {
137137
{
138138
.connected = CC_SPEAKERS | CC_LINEOUT |
139139
CC_LINEOUT_LABELLED_HEADPHONE,
@@ -157,7 +157,7 @@ static struct codec_connection onyx_connections_noheadphones[] = {
157157
};
158158

159159
/* onyx on machines with real line-out */
160-
static struct codec_connection onyx_connections_reallineout[] = {
160+
static const struct codec_connection onyx_connections_reallineout[] = {
161161
{
162162
.connected = CC_SPEAKERS | CC_LINEOUT | CC_HEADPHONE,
163163
.codec_bit = 0,
@@ -174,7 +174,7 @@ static struct codec_connection onyx_connections_reallineout[] = {
174174
};
175175

176176
/* tas on machines without line out */
177-
static struct codec_connection tas_connections_nolineout[] = {
177+
static const struct codec_connection tas_connections_nolineout[] = {
178178
{
179179
.connected = CC_SPEAKERS | CC_HEADPHONE,
180180
.codec_bit = 0,
@@ -191,7 +191,7 @@ static struct codec_connection tas_connections_nolineout[] = {
191191
};
192192

193193
/* tas on machines with neither line out nor line in */
194-
static struct codec_connection tas_connections_noline[] = {
194+
static const struct codec_connection tas_connections_noline[] = {
195195
{
196196
.connected = CC_SPEAKERS | CC_HEADPHONE,
197197
.codec_bit = 0,
@@ -204,7 +204,7 @@ static struct codec_connection tas_connections_noline[] = {
204204
};
205205

206206
/* tas on machines without microphone */
207-
static struct codec_connection tas_connections_nomic[] = {
207+
static const struct codec_connection tas_connections_nomic[] = {
208208
{
209209
.connected = CC_SPEAKERS | CC_HEADPHONE | CC_LINEOUT,
210210
.codec_bit = 0,
@@ -217,7 +217,7 @@ static struct codec_connection tas_connections_nomic[] = {
217217
};
218218

219219
/* tas on machines with everything connected */
220-
static struct codec_connection tas_connections_all[] = {
220+
static const struct codec_connection tas_connections_all[] = {
221221
{
222222
.connected = CC_SPEAKERS | CC_HEADPHONE | CC_LINEOUT,
223223
.codec_bit = 0,
@@ -233,31 +233,31 @@ static struct codec_connection tas_connections_all[] = {
233233
{} /* terminate array by .connected == 0 */
234234
};
235235

236-
static struct codec_connection toonie_connections[] = {
236+
static const struct codec_connection toonie_connections[] = {
237237
{
238238
.connected = CC_SPEAKERS | CC_HEADPHONE,
239239
.codec_bit = 0,
240240
},
241241
{} /* terminate array by .connected == 0 */
242242
};
243243

244-
static struct codec_connection topaz_input[] = {
244+
static const struct codec_connection topaz_input[] = {
245245
{
246246
.connected = CC_DIGITALIN,
247247
.codec_bit = 0,
248248
},
249249
{} /* terminate array by .connected == 0 */
250250
};
251251

252-
static struct codec_connection topaz_output[] = {
252+
static const struct codec_connection topaz_output[] = {
253253
{
254254
.connected = CC_DIGITALOUT,
255255
.codec_bit = 1,
256256
},
257257
{} /* terminate array by .connected == 0 */
258258
};
259259

260-
static struct codec_connection topaz_inout[] = {
260+
static const struct codec_connection topaz_inout[] = {
261261
{
262262
.connected = CC_DIGITALIN,
263263
.codec_bit = 0,
@@ -772,7 +772,7 @@ static int check_codec(struct aoa_codec *codec,
772772
{
773773
const u32 *ref;
774774
char propname[32];
775-
struct codec_connection *cc;
775+
const struct codec_connection *cc;
776776

777777
/* if the codec has a 'codec' node, we require a reference */
778778
if (of_node_name_eq(codec->node, "codec")) {
@@ -895,7 +895,7 @@ static void layout_notify(void *data)
895895

896896
static void layout_attached_codec(struct aoa_codec *codec)
897897
{
898-
struct codec_connection *cc;
898+
const struct codec_connection *cc;
899899
struct snd_kcontrol *ctl;
900900
int headphones, lineout;
901901
struct layout_dev *ldev = layout_device;

sound/aoa/soundbus/i2sbus/core.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ static void i2sbus_release_dev(struct device *dev)
8484
for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++)
8585
free_irq(i2sdev->interrupts[i], i2sdev);
8686
i2sbus_control_remove_dev(i2sdev->control, i2sdev);
87+
of_node_put(i2sdev->sound.ofdev.dev.of_node);
8788
mutex_destroy(&i2sdev->lock);
8889
kfree(i2sdev);
8990
}
@@ -147,7 +148,6 @@ static int i2sbus_get_and_fixup_rsrc(struct device_node *np, int index,
147148
}
148149

149150
/* Returns 1 if added, 0 for otherwise; don't return a negative value! */
150-
/* FIXME: look at device node refcounting */
151151
static int i2sbus_add_dev(struct macio_dev *macio,
152152
struct i2sbus_control *control,
153153
struct device_node *np)
@@ -178,8 +178,9 @@ static int i2sbus_add_dev(struct macio_dev *macio,
178178
i = 0;
179179
for_each_child_of_node(np, child) {
180180
if (of_node_name_eq(child, "sound")) {
181+
of_node_put(sound);
181182
i++;
182-
sound = child;
183+
sound = of_node_get(child);
183184
}
184185
}
185186
if (i == 1) {
@@ -205,6 +206,7 @@ static int i2sbus_add_dev(struct macio_dev *macio,
205206
}
206207
}
207208
}
209+
of_node_put(sound);
208210
/* for the time being, until we can handle non-layout-id
209211
* things in some fabric, refuse to attach if there is no
210212
* layout-id property or we haven't been forced to attach.
@@ -219,7 +221,7 @@ static int i2sbus_add_dev(struct macio_dev *macio,
219221
mutex_init(&dev->lock);
220222
spin_lock_init(&dev->low_lock);
221223
dev->sound.ofdev.archdata.dma_mask = macio->ofdev.archdata.dma_mask;
222-
dev->sound.ofdev.dev.of_node = np;
224+
dev->sound.ofdev.dev.of_node = of_node_get(np);
223225
dev->sound.ofdev.dev.dma_mask = &dev->sound.ofdev.archdata.dma_mask;
224226
dev->sound.ofdev.dev.parent = &macio->ofdev.dev;
225227
dev->sound.ofdev.dev.release = i2sbus_release_dev;
@@ -327,6 +329,7 @@ static int i2sbus_add_dev(struct macio_dev *macio,
327329
for (i=0;i<3;i++)
328330
release_and_free_resource(dev->allocated_resource[i]);
329331
mutex_destroy(&dev->lock);
332+
of_node_put(dev->sound.ofdev.dev.of_node);
330333
kfree(dev);
331334
return 0;
332335
}
@@ -405,6 +408,9 @@ static int i2sbus_resume(struct macio_dev* dev)
405408
int err, ret = 0;
406409

407410
list_for_each_entry(i2sdev, &control->list, item) {
411+
if (list_empty(&i2sdev->sound.codec_list))
412+
continue;
413+
408414
/* reset i2s bus format etc. */
409415
i2sbus_pcm_prepare_both(i2sdev);
410416

0 commit comments

Comments
 (0)