Skip to content

Commit 61050d3

Browse files
committed
Merge remote-tracking branch 'takashi/for-next' into sound/upstream-20250716
2 parents 6bd62e3 + f261196 commit 61050d3

327 files changed

Lines changed: 22584 additions & 20844 deletions

File tree

Some content is hidden

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

MAINTAINERS

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5743,9 +5743,9 @@ F: drivers/spi/spi-cs42l43*
57435743
F: include/dt-bindings/sound/cs*
57445744
F: include/linux/mfd/cs42l43*
57455745
F: include/sound/cs*
5746-
F: sound/pci/hda/cirrus*
5747-
F: sound/pci/hda/cs*
5748-
F: sound/pci/hda/hda_component*
5746+
F: sound/hda/codecs/cirrus*
5747+
F: sound/hda/codecs/side-codecs/cs*
5748+
F: sound/hda/codecs/side-codecs/hda_component*
57495749
F: sound/soc/codecs/cs*
57505750

57515751
CIRRUS LOGIC HAPTIC DRIVERS
@@ -24549,7 +24549,7 @@ F: Documentation/devicetree/bindings/sound/ti,tlv320*.yaml
2454924549
F: Documentation/devicetree/bindings/sound/ti,tlv320adcx140.yaml
2455024550
F: include/sound/tas2*.h
2455124551
F: include/sound/tlv320*.h
24552-
F: sound/pci/hda/tas2781_hda_i2c.c
24552+
F: sound/hda/codecs/side-codecs/tas2781_hda_i2c.c
2455324553
F: sound/soc/codecs/pcm1681.c
2455424554
F: sound/soc/codecs/pcm1789*.*
2455524555
F: sound/soc/codecs/pcm179x*.*
@@ -27482,7 +27482,7 @@ SENARYTECH AUDIO CODEC DRIVER
2748227482
M: bo liu <bo.liu@senarytech.com>
2748327483
S: Maintained
2748427484
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
27485-
F: sound/pci/hda/patch_senarytech.c
27485+
F: sound/hda/codecs/senarytech.c
2748627486

2748727487
THE REST
2748827488
M: Linus Torvalds <torvalds@linux-foundation.org>

arch/arm/configs/multi_v7_defconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,8 +791,11 @@ CONFIG_SND=m
791791
CONFIG_SND_HDA_TEGRA=m
792792
CONFIG_SND_HDA_INPUT_BEEP=y
793793
CONFIG_SND_HDA_PATCH_LOADER=y
794-
CONFIG_SND_HDA_CODEC_REALTEK=m
794+
CONFIG_SND_HDA_CODEC_REALTEK=y
795+
CONFIG_SND_HDA_CODEC_REALTEK_LIB=m
796+
CONFIG_SND_HDA_CODEC_ALC269=m
795797
CONFIG_SND_HDA_CODEC_HDMI=m
798+
CONFIG_SND_HDA_CODEC_HDMI_TEGRA=m
796799
CONFIG_SND_USB_AUDIO=m
797800
CONFIG_SND_SOC=m
798801
CONFIG_SND_ATMEL_SOC=m

arch/mips/configs/loongson3_defconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,9 @@ CONFIG_SND_SEQ_DUMMY=m
292292
# CONFIG_SND_ISA is not set
293293
CONFIG_SND_HDA_INTEL=m
294294
CONFIG_SND_HDA_PATCH_LOADER=y
295-
CONFIG_SND_HDA_CODEC_REALTEK=m
295+
CONFIG_SND_HDA_CODEC_REALTEK=y
296+
CONFIG_SND_HDA_CODEC_REALTEK_LIB=m
297+
CONFIG_SND_HDA_CODEC_ALC269=m
296298
CONFIG_SND_HDA_CODEC_SIGMATEL=m
297299
CONFIG_SND_HDA_CODEC_HDMI=m
298300
CONFIG_SND_HDA_CODEC_CONEXANT=m

include/sound/cs35l41.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,18 @@
609609
#define CS35L41_DSP_NG_DELAY_MASK 0x0F00
610610
#define CS35L41_DSP_NG_DELAY_SHIFT 8
611611

612+
#define CS35L41_ASP_RX1_EN_MASK 0x00010000
613+
#define CS35L41_ASP_RX1_EN_SHIFT 16
614+
#define CS35L41_ASP_RX2_EN_MASK 0x00020000
615+
#define CS35L41_ASP_RX2_EN_SHIFT 17
616+
#define CS35L41_ASP_TX1_EN_MASK 0x00000001
617+
#define CS35L41_ASP_TX1_EN_SHIFT 0
618+
#define CS35L41_ASP_TX2_EN_MASK 0x00000002
619+
#define CS35L41_ASP_TX2_EN_SHIFT 1
620+
#define CS35L41_ASP_TX3_EN_MASK 0x00000004
621+
#define CS35L41_ASP_TX3_EN_SHIFT 2
622+
#define CS35L41_ASP_TX4_EN_MASK 0x00000008
623+
#define CS35L41_ASP_TX4_EN_SHIFT 3
612624
#define CS35L41_ASP_FMT_MASK 0x0700
613625
#define CS35L41_ASP_FMT_SHIFT 8
614626
#define CS35L41_ASP_DOUT_HIZ_MASK 0x03

include/sound/hda_codec.h

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ struct hda_beep;
2727
struct hda_codec;
2828
struct hda_pcm;
2929
struct hda_pcm_stream;
30+
struct hda_codec_ops;
3031

3132
/*
3233
* codec bus
@@ -69,28 +70,31 @@ struct hda_bus {
6970

7071
/*
7172
* codec preset
72-
*
73-
* Known codecs have the patch to build and set up the controls/PCMs
74-
* better than the generic parser.
7573
*/
76-
typedef int (*hda_codec_patch_t)(struct hda_codec *);
77-
74+
7875
#define HDA_CODEC_ID_SKIP_PROBE 0x00000001
7976
#define HDA_CODEC_ID_GENERIC_HDMI 0x00000101
8077
#define HDA_CODEC_ID_GENERIC 0x00000201
8178

82-
#define HDA_CODEC_REV_ENTRY(_vid, _rev, _name, _patch) \
79+
#define HDA_CODEC_ID_REV_MODEL(_vid, _rev, _name, _model) \
8380
{ .vendor_id = (_vid), .rev_id = (_rev), .name = (_name), \
84-
.api_version = HDA_DEV_LEGACY, \
85-
.driver_data = (unsigned long)(_patch) }
86-
#define HDA_CODEC_ENTRY(_vid, _name, _patch) \
87-
HDA_CODEC_REV_ENTRY(_vid, 0, _name, _patch)
81+
.api_version = HDA_DEV_LEGACY, .driver_data = (_model) }
82+
#define HDA_CODEC_ID_MODEL(_vid, _name, _model) \
83+
HDA_CODEC_ID_REV_MODEL(_vid, 0, _name, _model)
84+
#define HDA_CODEC_ID_REV(_vid, _rev, _name) \
85+
HDA_CODEC_ID_REV_MODEL(_vid, _rev, _name, 0)
86+
#define HDA_CODEC_ID(_vid, _name) \
87+
HDA_CODEC_ID_REV(_vid, 0, _name)
8888

8989
struct hda_codec_driver {
9090
struct hdac_driver core;
9191
const struct hda_device_id *id;
92+
const struct hda_codec_ops *ops;
9293
};
9394

95+
#define hda_codec_to_driver(codec) \
96+
container_of((codec)->core.dev.driver, struct hda_codec_driver, core.driver)
97+
9498
int __hda_codec_driver_register(struct hda_codec_driver *drv, const char *name,
9599
struct module *owner);
96100
#define hda_codec_driver_register(drv) \
@@ -100,12 +104,13 @@ void hda_codec_driver_unregister(struct hda_codec_driver *drv);
100104
module_driver(drv, hda_codec_driver_register, \
101105
hda_codec_driver_unregister)
102106

103-
/* ops set by the preset patch */
107+
/* ops for hda codec driver */
104108
struct hda_codec_ops {
109+
int (*probe)(struct hda_codec *codec, const struct hda_device_id *id);
110+
void (*remove)(struct hda_codec *codec);
105111
int (*build_controls)(struct hda_codec *codec);
106112
int (*build_pcms)(struct hda_codec *codec);
107113
int (*init)(struct hda_codec *codec);
108-
void (*free)(struct hda_codec *codec);
109114
void (*unsol_event)(struct hda_codec *codec, unsigned int res);
110115
void (*set_power_state)(struct hda_codec *codec, hda_nid_t fg,
111116
unsigned int power_state);
@@ -181,10 +186,7 @@ struct hda_codec {
181186
const struct hda_device_id *preset;
182187
const char *modelname; /* model name for preset */
183188

184-
/* set by patch */
185-
struct hda_codec_ops patch_ops;
186-
187-
/* PCM to create, set by patch_ops.build_pcms callback */
189+
/* PCM to create, set by hda_codec_ops.build_pcms callback */
188190
struct list_head pcm_list_head;
189191
refcount_t pcm_ref;
190192
wait_queue_head_t remove_sleep;
@@ -478,8 +480,10 @@ extern const struct dev_pm_ops hda_codec_driver_pm;
478480
static inline
479481
int hda_call_check_power_status(struct hda_codec *codec, hda_nid_t nid)
480482
{
481-
if (codec->patch_ops.check_power_status)
482-
return codec->patch_ops.check_power_status(codec, nid);
483+
struct hda_codec_driver *driver = hda_codec_to_driver(codec);
484+
485+
if (driver->ops && driver->ops->check_power_status)
486+
return driver->ops->check_power_status(codec, nid);
483487
return 0;
484488
}
485489

include/sound/hdaudio.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,30 @@ static inline void snd_hdac_dsp_cleanup(struct hdac_stream *azx_dev,
680680
}
681681
#endif /* CONFIG_SND_HDA_DSP_LOADER */
682682

683+
/*
684+
* Easy macros for widget capabilities
685+
*/
686+
#define snd_hdac_get_wcaps(codec, nid) \
687+
snd_hdac_read_parm(codec, nid, AC_PAR_AUDIO_WIDGET_CAP)
688+
689+
/* get the widget type from widget capability bits */
690+
static inline int snd_hdac_get_wcaps_type(unsigned int wcaps)
691+
{
692+
if (!wcaps)
693+
return -1; /* invalid type */
694+
return (wcaps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;
695+
}
696+
697+
/* get the number of supported channels */
698+
static inline unsigned int snd_hdac_get_wcaps_channels(u32 wcaps)
699+
{
700+
unsigned int chans;
701+
702+
chans = (wcaps & AC_WCAP_CHAN_CNT_EXT) >> 13;
703+
chans = (chans + 1) * 2;
704+
705+
return chans;
706+
}
683707

684708
/*
685709
* generic array helpers

sound/core/compress_offload.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,62 +1269,62 @@ static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
12691269
stream = &data->stream;
12701270

12711271
guard(mutex)(&stream->device->lock);
1272-
switch (_IOC_NR(cmd)) {
1273-
case _IOC_NR(SNDRV_COMPRESS_IOCTL_VERSION):
1272+
switch (cmd) {
1273+
case SNDRV_COMPRESS_IOCTL_VERSION:
12741274
return put_user(SNDRV_COMPRESS_VERSION,
12751275
(int __user *)arg) ? -EFAULT : 0;
1276-
case _IOC_NR(SNDRV_COMPRESS_GET_CAPS):
1276+
case SNDRV_COMPRESS_GET_CAPS:
12771277
return snd_compr_get_caps(stream, arg);
12781278
#ifndef COMPR_CODEC_CAPS_OVERFLOW
1279-
case _IOC_NR(SNDRV_COMPRESS_GET_CODEC_CAPS):
1279+
case SNDRV_COMPRESS_GET_CODEC_CAPS:
12801280
return snd_compr_get_codec_caps(stream, arg);
12811281
#endif
1282-
case _IOC_NR(SNDRV_COMPRESS_SET_PARAMS):
1282+
case SNDRV_COMPRESS_SET_PARAMS:
12831283
return snd_compr_set_params(stream, arg);
1284-
case _IOC_NR(SNDRV_COMPRESS_GET_PARAMS):
1284+
case SNDRV_COMPRESS_GET_PARAMS:
12851285
return snd_compr_get_params(stream, arg);
1286-
case _IOC_NR(SNDRV_COMPRESS_SET_METADATA):
1286+
case SNDRV_COMPRESS_SET_METADATA:
12871287
return snd_compr_set_metadata(stream, arg);
1288-
case _IOC_NR(SNDRV_COMPRESS_GET_METADATA):
1288+
case SNDRV_COMPRESS_GET_METADATA:
12891289
return snd_compr_get_metadata(stream, arg);
12901290
}
12911291

12921292
if (stream->direction == SND_COMPRESS_ACCEL) {
12931293
#if IS_ENABLED(CONFIG_SND_COMPRESS_ACCEL)
1294-
switch (_IOC_NR(cmd)) {
1295-
case _IOC_NR(SNDRV_COMPRESS_TASK_CREATE):
1294+
switch (cmd) {
1295+
case SNDRV_COMPRESS_TASK_CREATE:
12961296
return snd_compr_task_create(stream, arg);
1297-
case _IOC_NR(SNDRV_COMPRESS_TASK_FREE):
1297+
case SNDRV_COMPRESS_TASK_FREE:
12981298
return snd_compr_task_seq(stream, arg, snd_compr_task_free_one);
1299-
case _IOC_NR(SNDRV_COMPRESS_TASK_START):
1299+
case SNDRV_COMPRESS_TASK_START:
13001300
return snd_compr_task_start_ioctl(stream, arg);
1301-
case _IOC_NR(SNDRV_COMPRESS_TASK_STOP):
1301+
case SNDRV_COMPRESS_TASK_STOP:
13021302
return snd_compr_task_seq(stream, arg, snd_compr_task_stop_one);
1303-
case _IOC_NR(SNDRV_COMPRESS_TASK_STATUS):
1303+
case SNDRV_COMPRESS_TASK_STATUS:
13041304
return snd_compr_task_status_ioctl(stream, arg);
13051305
}
13061306
#endif
13071307
return -ENOTTY;
13081308
}
13091309

1310-
switch (_IOC_NR(cmd)) {
1311-
case _IOC_NR(SNDRV_COMPRESS_TSTAMP):
1310+
switch (cmd) {
1311+
case SNDRV_COMPRESS_TSTAMP:
13121312
return snd_compr_tstamp(stream, arg);
1313-
case _IOC_NR(SNDRV_COMPRESS_AVAIL):
1313+
case SNDRV_COMPRESS_AVAIL:
13141314
return snd_compr_ioctl_avail(stream, arg);
1315-
case _IOC_NR(SNDRV_COMPRESS_PAUSE):
1315+
case SNDRV_COMPRESS_PAUSE:
13161316
return snd_compr_pause(stream);
1317-
case _IOC_NR(SNDRV_COMPRESS_RESUME):
1317+
case SNDRV_COMPRESS_RESUME:
13181318
return snd_compr_resume(stream);
1319-
case _IOC_NR(SNDRV_COMPRESS_START):
1319+
case SNDRV_COMPRESS_START:
13201320
return snd_compr_start(stream);
1321-
case _IOC_NR(SNDRV_COMPRESS_STOP):
1321+
case SNDRV_COMPRESS_STOP:
13221322
return snd_compr_stop(stream);
1323-
case _IOC_NR(SNDRV_COMPRESS_DRAIN):
1323+
case SNDRV_COMPRESS_DRAIN:
13241324
return snd_compr_drain(stream);
1325-
case _IOC_NR(SNDRV_COMPRESS_PARTIAL_DRAIN):
1325+
case SNDRV_COMPRESS_PARTIAL_DRAIN:
13261326
return snd_compr_partial_drain(stream);
1327-
case _IOC_NR(SNDRV_COMPRESS_NEXT_TRACK):
1327+
case SNDRV_COMPRESS_NEXT_TRACK:
13281328
return snd_compr_next_track(stream);
13291329
}
13301330

sound/core/control.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,7 @@ static int snd_ctl_elem_user_enum_info(struct snd_kcontrol *kcontrol,
14351435
names = ue->priv_data;
14361436
for (; item > 0; --item)
14371437
names += strlen(names) + 1;
1438-
strcpy(uinfo->value.enumerated.name, names);
1438+
strscpy(uinfo->value.enumerated.name, names);
14391439

14401440
return 0;
14411441
}

sound/core/hrtimer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include <linux/init.h>
88
#include <linux/slab.h>
9+
#include <linux/string.h>
910
#include <linux/module.h>
1011
#include <linux/moduleparam.h>
1112
#include <linux/hrtimer.h>
@@ -138,7 +139,7 @@ static int __init snd_hrtimer_init(void)
138139
return err;
139140

140141
timer->module = THIS_MODULE;
141-
strcpy(timer->name, "HR timer");
142+
strscpy(timer->name, "HR timer");
142143
timer->hw = hrtimer_hw;
143144
timer->hw.resolution = resolution;
144145
timer->hw.ticks = NANO_SEC / resolution;

sound/core/init.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -723,27 +723,25 @@ static void snd_card_set_id_no_lock(struct snd_card *card, const char *src,
723723
* ("card" conflicts with proc directories)
724724
*/
725725
if (!*id || !strncmp(id, "card", 4)) {
726-
strcpy(id, "Default");
726+
strscpy(card->id, "Default");
727727
is_default = true;
728728
}
729729

730730
len = strlen(id);
731731
for (loops = 0; loops < SNDRV_CARDS; loops++) {
732-
char *spos;
733732
char sfxstr[5]; /* "_012" */
734-
int sfxlen;
733+
int sfxlen, slen;
735734

736735
if (card_id_ok(card, id))
737736
return; /* OK */
738737

739738
/* Add _XYZ suffix */
740-
sprintf(sfxstr, "_%X", loops + 1);
741-
sfxlen = strlen(sfxstr);
739+
sfxlen = scnprintf(sfxstr, sizeof(sfxstr), "_%X", loops + 1);
742740
if (len + sfxlen >= sizeof(card->id))
743-
spos = id + sizeof(card->id) - sfxlen - 1;
741+
slen = sizeof(card->id) - sfxlen - 1;
744742
else
745-
spos = id + len;
746-
strcpy(spos, sfxstr);
743+
slen = len;
744+
strscpy(id + slen, sfxstr, sizeof(card->id) - slen);
747745
}
748746
/* fallback to the default id */
749747
if (!is_default) {
@@ -801,7 +799,7 @@ static ssize_t id_store(struct device *dev, struct device_attribute *attr,
801799
guard(mutex)(&snd_card_mutex);
802800
if (!card_id_ok(NULL, buf1))
803801
return -EEXIST;
804-
strcpy(card->id, buf1);
802+
strscpy(card->id, buf1);
805803
snd_info_card_id_change(card);
806804

807805
return count;

0 commit comments

Comments
 (0)