Skip to content

Commit 638fd2a

Browse files
committed
Merge remote-tracking branch 'takashi/for-next' into sound/upstream-20250804
2 parents 282528d + 0808da3 commit 638fd2a

335 files changed

Lines changed: 22816 additions & 20906 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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,12 @@ CONFIG_SND_HDA_TEGRA=m
792792
CONFIG_SND_HDA_INPUT_BEEP=y
793793
CONFIG_SND_HDA_PATCH_LOADER=y
794794
CONFIG_SND_HDA_CODEC_REALTEK=m
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_GENERIC=m
799+
CONFIG_SND_HDA_CODEC_HDMI_NVIDIA=m
800+
CONFIG_SND_HDA_CODEC_HDMI_TEGRA=m
796801
CONFIG_SND_USB_AUDIO=m
797802
CONFIG_SND_SOC=m
798803
CONFIG_SND_ATMEL_SOC=m

arch/arm/configs/tegra_defconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,12 @@ CONFIG_SND_HDA_TEGRA=y
225225
CONFIG_SND_HDA_INPUT_BEEP=y
226226
CONFIG_SND_HDA_PATCH_LOADER=y
227227
CONFIG_SND_HDA_CODEC_REALTEK=y
228+
CONFIG_SND_HDA_CODEC_REALTEK_LIB=y
229+
CONFIG_SND_HDA_CODEC_ALC269=y
228230
CONFIG_SND_HDA_CODEC_HDMI=y
231+
CONFIG_SND_HDA_CODEC_HDMI_GENERIC=y
232+
CONFIG_SND_HDA_CODEC_HDMI_NVIDIA=y
233+
CONFIG_SND_HDA_CODEC_HDMI_TEGRA=y
229234
# CONFIG_SND_ARM is not set
230235
# CONFIG_SND_SPI is not set
231236
# CONFIG_SND_USB is not set

arch/loongarch/configs/loongson3_defconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,8 +784,23 @@ CONFIG_SND_HDA_HWDEP=y
784784
CONFIG_SND_HDA_INPUT_BEEP=y
785785
CONFIG_SND_HDA_PATCH_LOADER=y
786786
CONFIG_SND_HDA_CODEC_REALTEK=y
787+
CONFIG_SND_HDA_CODEC_REALTEK_LIB=y
788+
CONFIG_SND_HDA_CODEC_ALC260=y
789+
CONFIG_SND_HDA_CODEC_ALC262=y
790+
CONFIG_SND_HDA_CODEC_ALC268=y
791+
CONFIG_SND_HDA_CODEC_ALC269=y
792+
CONFIG_SND_HDA_CODEC_ALC662=y
793+
CONFIG_SND_HDA_CODEC_ALC680=y
794+
CONFIG_SND_HDA_CODEC_ALC861=y
795+
CONFIG_SND_HDA_CODEC_ALC861VD=y
796+
CONFIG_SND_HDA_CODEC_ALC880=y
797+
CONFIG_SND_HDA_CODEC_ALC882=y
787798
CONFIG_SND_HDA_CODEC_SIGMATEL=y
788799
CONFIG_SND_HDA_CODEC_HDMI=y
800+
CONFIG_SND_HDA_CODEC_HDMI_GENERIC=y
801+
CONFIG_SND_HDA_CODEC_HDMI_INTEL=y
802+
CONFIG_SND_HDA_CODEC_HDMI_ATI=y
803+
CONFIG_SND_HDA_CODEC_HDMI_NVIDIA=y
789804
CONFIG_SND_HDA_CODEC_CONEXANT=y
790805
CONFIG_SND_USB_AUDIO=m
791806
CONFIG_SND_SOC=m

arch/mips/configs/loongson2k_defconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,17 @@ CONFIG_SND_HDA_INTEL=y
257257
CONFIG_SND_HDA_HWDEP=y
258258
CONFIG_SND_HDA_PATCH_LOADER=y
259259
CONFIG_SND_HDA_CODEC_REALTEK=y
260+
CONFIG_SND_HDA_CODEC_REALTEK_LIB=y
261+
CONFIG_SND_HDA_CODEC_ALC260=y
262+
CONFIG_SND_HDA_CODEC_ALC262=y
263+
CONFIG_SND_HDA_CODEC_ALC268=y
264+
CONFIG_SND_HDA_CODEC_ALC269=y
265+
CONFIG_SND_HDA_CODEC_ALC662=y
266+
CONFIG_SND_HDA_CODEC_ALC680=y
267+
CONFIG_SND_HDA_CODEC_ALC861=y
268+
CONFIG_SND_HDA_CODEC_ALC861VD=y
269+
CONFIG_SND_HDA_CODEC_ALC880=y
270+
CONFIG_SND_HDA_CODEC_ALC882=y
260271
CONFIG_SND_HDA_CODEC_ANALOG=y
261272
CONFIG_SND_HDA_CODEC_SIGMATEL=y
262273
CONFIG_SND_HDA_CODEC_VIA=y

arch/mips/configs/loongson3_defconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,23 @@ CONFIG_SND_SEQ_DUMMY=m
293293
CONFIG_SND_HDA_INTEL=m
294294
CONFIG_SND_HDA_PATCH_LOADER=y
295295
CONFIG_SND_HDA_CODEC_REALTEK=m
296+
CONFIG_SND_HDA_CODEC_REALTEK_LIB=m
297+
CONFIG_SND_HDA_CODEC_ALC260=m
298+
CONFIG_SND_HDA_CODEC_ALC262=m
299+
CONFIG_SND_HDA_CODEC_ALC268=m
300+
CONFIG_SND_HDA_CODEC_ALC269=m
301+
CONFIG_SND_HDA_CODEC_ALC662=m
302+
CONFIG_SND_HDA_CODEC_ALC680=m
303+
CONFIG_SND_HDA_CODEC_ALC861=m
304+
CONFIG_SND_HDA_CODEC_ALC861VD=m
305+
CONFIG_SND_HDA_CODEC_ALC880=m
306+
CONFIG_SND_HDA_CODEC_ALC882=m
296307
CONFIG_SND_HDA_CODEC_SIGMATEL=m
297308
CONFIG_SND_HDA_CODEC_HDMI=m
309+
CONFIG_SND_HDA_CODEC_HDMI_GENERIC=m
310+
CONFIG_SND_HDA_CODEC_HDMI_INTEL=m
311+
CONFIG_SND_HDA_CODEC_HDMI_ATI=m
312+
CONFIG_SND_HDA_CODEC_HDMI_NVIDIA=m
298313
CONFIG_SND_HDA_CODEC_CONEXANT=m
299314
# CONFIG_SND_USB is not set
300315
CONFIG_HIDRAW=y

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

include/sound/tas2770-tlv.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
//
3+
// ALSA SoC Texas Instruments TAS2770 Audio Smart Amplifier
4+
//
5+
// Copyright (C) 2025 Texas Instruments Incorporated
6+
// https://www.ti.com
7+
//
8+
// The TAS2770 hda driver implements for one, two, or even multiple
9+
// TAS2770 chips.
10+
//
11+
// Author: Baojun Xu <baojun.xu@ti.com>
12+
//
13+
14+
#ifndef __TAS2770_TLV_H__
15+
#define __TAS2770_TLV_H__
16+
17+
#define TAS2770_DVC_LEVEL TASDEVICE_REG(0x0, 0x0, 0x05)
18+
#define TAS2770_AMP_LEVEL TASDEVICE_REG(0x0, 0x0, 0x03)
19+
20+
static const __maybe_unused DECLARE_TLV_DB_SCALE(tas2770_dvc_tlv, -10000, 50, 0);
21+
static const __maybe_unused DECLARE_TLV_DB_SCALE(tas2770_amp_tlv, 1100, 50, 0);
22+
23+
#endif

0 commit comments

Comments
 (0)