Skip to content

Commit 455444c

Browse files
committed
Merge remote-tracking branch 'takashi/for-next' into sound/upstream-20260415
2 parents 6e5b0fa + e0da8a8 commit 455444c

90 files changed

Lines changed: 2352 additions & 703 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/gus.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ int snd_gf1_dma_transfer_block(struct snd_gus_card * gus,
536536
struct snd_gf1_dma_block * block,
537537
int atomic,
538538
int synth);
539+
void snd_gf1_dma_suspend(struct snd_gus_card *gus);
539540

540541
/* gus_volume.c */
541542

@@ -552,6 +553,8 @@ struct snd_gus_voice *snd_gf1_alloc_voice(struct snd_gus_card * gus, int type, i
552553
void snd_gf1_free_voice(struct snd_gus_card * gus, struct snd_gus_voice *voice);
553554
int snd_gf1_start(struct snd_gus_card * gus);
554555
int snd_gf1_stop(struct snd_gus_card * gus);
556+
int snd_gf1_suspend(struct snd_gus_card *gus);
557+
int snd_gf1_resume(struct snd_gus_card *gus);
555558

556559
/* gus_mixer.c */
557560

@@ -572,6 +575,8 @@ int snd_gus_create(struct snd_card *card,
572575
int effect,
573576
struct snd_gus_card ** rgus);
574577
int snd_gus_initialize(struct snd_gus_card * gus);
578+
int snd_gus_suspend(struct snd_gus_card *gus);
579+
int snd_gus_resume(struct snd_gus_card *gus);
575580

576581
/* gus_irq.c */
577582

@@ -583,6 +588,8 @@ void snd_gus_irq_profile_init(struct snd_gus_card *gus);
583588
/* gus_uart.c */
584589

585590
int snd_gf1_rawmidi_new(struct snd_gus_card *gus, int device);
591+
void snd_gf1_uart_suspend(struct snd_gus_card *gus);
592+
void snd_gf1_uart_resume(struct snd_gus_card *gus);
586593

587594
/* gus_dram.c */
588595
int snd_gus_dram_write(struct snd_gus_card *gus, char __user *ptr,
@@ -593,5 +600,6 @@ int snd_gus_dram_read(struct snd_gus_card *gus, char __user *ptr,
593600
/* gus_timer.c */
594601
void snd_gf1_timers_init(struct snd_gus_card *gus);
595602
void snd_gf1_timers_done(struct snd_gus_card *gus);
603+
void snd_gf1_timers_resume(struct snd_gus_card *gus);
596604

597605
#endif /* __SOUND_GUS_H */

include/sound/hda_codec.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,17 @@ snd_hda_codec_write(struct hda_codec *codec, hda_nid_t nid, int flags,
336336
return snd_hdac_codec_write(&codec->core, nid, flags, verb, parm);
337337
}
338338

339+
/* sync after write */
340+
static inline int
341+
snd_hda_codec_write_sync(struct hda_codec *codec, hda_nid_t nid, int flags,
342+
unsigned int verb, unsigned int parm)
343+
{
344+
/* use snd_hda_codec_read() for writing;
345+
* the returned value is usually discarded
346+
*/
347+
return snd_hdac_codec_read(&codec->core, nid, flags, verb, parm);
348+
}
349+
339350
#define snd_hda_param_read(codec, nid, param) \
340351
snd_hdac_read_parm(&(codec)->core, nid, param)
341352
#define snd_hda_get_sub_nodes(codec, nid, start_nid) \
@@ -470,6 +481,10 @@ void snd_hda_unlock_devices(struct hda_bus *bus);
470481
void snd_hda_bus_reset(struct hda_bus *bus);
471482
void snd_hda_bus_reset_codecs(struct hda_bus *bus);
472483

484+
void snd_hda_codec_set_gpio(struct hda_codec *codec, unsigned int mask,
485+
unsigned int dir, unsigned int data,
486+
unsigned int delay);
487+
473488
int snd_hda_codec_set_name(struct hda_codec *codec, const char *name);
474489

475490
/*

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/tea6330t.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
int snd_tea6330t_detect(struct snd_i2c_bus *bus, int equalizer);
1313
int snd_tea6330t_update_mixer(struct snd_card *card, struct snd_i2c_bus *bus,
1414
int equalizer, int fader);
15+
int snd_tea6330t_restore_mixer(struct snd_i2c_bus *bus);
1516

1617
#endif /* __SOUND_TEA6330T_H */

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/codecs/onyx.c

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <linux/module.h>
3333
#include <linux/of.h>
3434
#include <linux/slab.h>
35+
#include <sound/asoundef.h>
3536
MODULE_AUTHOR("Johannes Berg <johannes@sipsolutions.net>");
3637
MODULE_LICENSE("GPL");
3738
MODULE_DESCRIPTION("pcm3052 (onyx) codec driver for snd-aoa");
@@ -514,8 +515,36 @@ static int onyx_spdif_put(struct snd_kcontrol *kcontrol,
514515
return 1;
515516
}
516517

518+
static int onyx_set_spdif_pcm_rate(struct onyx *onyx, unsigned int rate)
519+
{
520+
u8 dig_info3, fs;
521+
522+
switch (rate) {
523+
case 32000:
524+
fs = IEC958_AES3_CON_FS_32000;
525+
break;
526+
case 44100:
527+
fs = IEC958_AES3_CON_FS_44100;
528+
break;
529+
case 48000:
530+
fs = IEC958_AES3_CON_FS_48000;
531+
break;
532+
default:
533+
return -EINVAL;
534+
}
535+
536+
if (onyx_read_register(onyx, ONYX_REG_DIG_INFO3, &dig_info3))
537+
return -EBUSY;
538+
dig_info3 = (dig_info3 & ~IEC958_AES3_CON_FS) | fs;
539+
if (onyx_write_register(onyx, ONYX_REG_DIG_INFO3, dig_info3))
540+
return -EBUSY;
541+
542+
return 0;
543+
}
544+
517545
static const struct snd_kcontrol_new onyx_spdif_ctrl = {
518-
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
546+
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
547+
SNDRV_CTL_ELEM_ACCESS_VOLATILE,
519548
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
520549
.name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
521550
.info = onyx_spdif_info,
@@ -695,9 +724,9 @@ static int onyx_prepare(struct codec_info_item *cii,
695724
case 32000:
696725
case 44100:
697726
case 48000:
698-
/* these rates are ok for all outputs */
699-
/* FIXME: program spdif channel control bits here so that
700-
* userspace doesn't have to if it only plays pcm! */
727+
if (onyx->codec.connected & 2)
728+
return onyx_set_spdif_pcm_rate(onyx,
729+
substream->runtime->rate);
701730
return 0;
702731
default:
703732
/* got some rate that the digital output can't do,
@@ -980,10 +1009,12 @@ static int onyx_i2c_probe(struct i2c_client *client)
9801009
onyx->codec.node = of_node_get(node);
9811010

9821011
if (aoa_codec_register(&onyx->codec)) {
983-
goto fail;
1012+
goto fail_put;
9841013
}
9851014
printk(KERN_DEBUG PFX "created and attached onyx instance\n");
9861015
return 0;
1016+
fail_put:
1017+
of_node_put(onyx->codec.node);
9871018
fail:
9881019
kfree(onyx);
9891020
return -ENODEV;

0 commit comments

Comments
 (0)