Skip to content

Commit bb9ffb4

Browse files
committed
Merge: ALSA - update drivers for 9.7 - fixes from upstream kernel 6.15.8
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7191 Apply ALSA fixes from upstream kernel 6.15.8 plus other fixes requested by Dell (SoundWire driver) JIRA: https://issues.redhat.com/browse/RHEL-101627 Only fix patches are applied to keep the changes at minimum and in sync with stable kernel. Signed-off-by: Jaroslav Kysela <jkysela@redhat.com> Approved-by: Tony Camuso <tcamuso@redhat.com> Approved-by: John W. Linville <linville@redhat.com> Approved-by: Eric Chanudet <echanude@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Jarod Wilson <jarod@redhat.com>
2 parents 98471fa + a97a819 commit bb9ffb4

Some content is hidden

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

64 files changed

+729
-242
lines changed

drivers/soundwire/amd_manager.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ static u64 amd_sdw_send_cmd_get_resp(struct amd_sdw_manager *amd_manager, u32 lo
238238

239239
if (sts & AMD_SDW_IMM_RES_VALID) {
240240
dev_err(amd_manager->dev, "SDW%x manager is in bad state\n", amd_manager->instance);
241-
writel(0x00, amd_manager->mmio + ACP_SW_IMM_CMD_STS);
241+
writel(AMD_SDW_IMM_RES_VALID, amd_manager->mmio + ACP_SW_IMM_CMD_STS);
242242
}
243243
writel(upper_data, amd_manager->mmio + ACP_SW_IMM_CMD_UPPER_WORD);
244244
writel(lower_data, amd_manager->mmio + ACP_SW_IMM_CMD_LOWER_QWORD);
@@ -931,6 +931,9 @@ static void amd_sdw_irq_thread(struct work_struct *work)
931931

932932
status_change_8to11 = readl(amd_manager->mmio + ACP_SW_STATE_CHANGE_STATUS_8TO11);
933933
status_change_0to7 = readl(amd_manager->mmio + ACP_SW_STATE_CHANGE_STATUS_0TO7);
934+
if (!status_change_0to7 && !status_change_8to11)
935+
return;
936+
934937
dev_dbg(amd_manager->dev, "[SDW%d] SDW INT: 0to7=0x%x, 8to11=0x%x\n",
935938
amd_manager->instance, status_change_0to7, status_change_8to11);
936939
if (status_change_8to11 & AMD_SDW_WAKE_STAT_MASK)
@@ -1074,6 +1077,7 @@ static void amd_sdw_manager_remove(struct platform_device *pdev)
10741077
int ret;
10751078

10761079
pm_runtime_disable(&pdev->dev);
1080+
cancel_work_sync(&amd_manager->amd_sdw_work);
10771081
amd_disable_sdw_interrupts(amd_manager);
10781082
sdw_bus_master_delete(&amd_manager->bus);
10791083
ret = amd_disable_sdw_manager(amd_manager);
@@ -1178,10 +1182,10 @@ static int __maybe_unused amd_pm_prepare(struct device *dev)
11781182
* device is not in runtime suspend state, observed that device alerts are missing
11791183
* without pm_prepare on AMD platforms in clockstop mode0.
11801184
*/
1181-
if (amd_manager->power_mode_mask & AMD_SDW_CLK_STOP_MODE) {
1182-
ret = pm_request_resume(dev);
1185+
if (amd_manager->power_mode_mask) {
1186+
ret = pm_runtime_resume(dev);
11831187
if (ret < 0) {
1184-
dev_err(bus->dev, "pm_request_resume failed: %d\n", ret);
1188+
dev_err(bus->dev, "pm_runtime_resume failed: %d\n", ret);
11851189
return 0;
11861190
}
11871191
}
@@ -1209,6 +1213,7 @@ static int __maybe_unused amd_suspend(struct device *dev)
12091213
}
12101214

12111215
if (amd_manager->power_mode_mask & AMD_SDW_CLK_STOP_MODE) {
1216+
cancel_work_sync(&amd_manager->amd_sdw_work);
12121217
amd_sdw_wake_enable(amd_manager, false);
12131218
if (amd_manager->acp_rev >= ACP70_PCI_REV_ID) {
12141219
ret = amd_sdw_host_wake_enable(amd_manager, false);
@@ -1219,6 +1224,7 @@ static int __maybe_unused amd_suspend(struct device *dev)
12191224
if (ret)
12201225
return ret;
12211226
} else if (amd_manager->power_mode_mask & AMD_SDW_POWER_OFF_MODE) {
1227+
cancel_work_sync(&amd_manager->amd_sdw_work);
12221228
amd_sdw_wake_enable(amd_manager, false);
12231229
if (amd_manager->acp_rev >= ACP70_PCI_REV_ID) {
12241230
ret = amd_sdw_host_wake_enable(amd_manager, false);

drivers/soundwire/generic_bandwidth_allocation.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,13 @@ static void _sdw_compute_port_params(struct sdw_bus *bus,
204204
port_bo = 1;
205205

206206
list_for_each_entry(m_rt, &bus->m_rt_list, bus_node) {
207+
/*
208+
* Only runtimes with CONFIGURED, PREPARED, ENABLED, and DISABLED
209+
* states should be included in the bandwidth calculation.
210+
*/
211+
if (m_rt->stream->state > SDW_STREAM_DISABLED ||
212+
m_rt->stream->state < SDW_STREAM_CONFIGURED)
213+
continue;
207214
sdw_compute_master_ports(m_rt, &params[i], &port_bo, hstop);
208215
}
209216

drivers/soundwire/qcom.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ struct qcom_swrm_port_config {
156156
u8 word_length;
157157
u8 blk_group_count;
158158
u8 lane_control;
159-
u8 ch_mask;
160159
};
161160

162161
/*
@@ -1049,13 +1048,9 @@ static int qcom_swrm_port_enable(struct sdw_bus *bus,
10491048
{
10501049
u32 reg = SWRM_DP_PORT_CTRL_BANK(enable_ch->port_num, bank);
10511050
struct qcom_swrm_ctrl *ctrl = to_qcom_sdw(bus);
1052-
struct qcom_swrm_port_config *pcfg;
10531051
u32 val;
10541052

1055-
pcfg = &ctrl->pconfig[enable_ch->port_num];
10561053
ctrl->reg_read(ctrl, reg, &val);
1057-
if (pcfg->ch_mask != SWR_INVALID_PARAM && pcfg->ch_mask != 0)
1058-
enable_ch->ch_mask = pcfg->ch_mask;
10591054

10601055
if (enable_ch->enable)
10611056
val |= (enable_ch->ch_mask << SWRM_DP_PORT_CTRL_EN_CHAN_SHFT);
@@ -1275,26 +1270,6 @@ static void *qcom_swrm_get_sdw_stream(struct snd_soc_dai *dai, int direction)
12751270
return ctrl->sruntime[dai->id];
12761271
}
12771272

1278-
static int qcom_swrm_set_channel_map(struct snd_soc_dai *dai,
1279-
unsigned int tx_num, const unsigned int *tx_slot,
1280-
unsigned int rx_num, const unsigned int *rx_slot)
1281-
{
1282-
struct qcom_swrm_ctrl *ctrl = dev_get_drvdata(dai->dev);
1283-
int i;
1284-
1285-
if (tx_slot) {
1286-
for (i = 0; i < tx_num; i++)
1287-
ctrl->pconfig[i].ch_mask = tx_slot[i];
1288-
}
1289-
1290-
if (rx_slot) {
1291-
for (i = 0; i < rx_num; i++)
1292-
ctrl->pconfig[i].ch_mask = rx_slot[i];
1293-
}
1294-
1295-
return 0;
1296-
}
1297-
12981273
static int qcom_swrm_startup(struct snd_pcm_substream *substream,
12991274
struct snd_soc_dai *dai)
13001275
{
@@ -1331,7 +1306,6 @@ static const struct snd_soc_dai_ops qcom_swrm_pdm_dai_ops = {
13311306
.shutdown = qcom_swrm_shutdown,
13321307
.set_stream = qcom_swrm_set_sdw_stream,
13331308
.get_stream = qcom_swrm_get_sdw_stream,
1334-
.set_channel_map = qcom_swrm_set_channel_map,
13351309
};
13361310

13371311
static const struct snd_soc_component_driver qcom_swrm_dai_component = {

include/sound/hdaudio.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ struct hdac_driver {
223223
struct device_driver driver;
224224
int type;
225225
const struct hda_device_id *id_table;
226-
int (*match)(struct hdac_device *dev, struct hdac_driver *drv);
226+
int (*match)(struct hdac_device *dev, const struct hdac_driver *drv);
227227
void (*unsol_event)(struct hdac_device *dev, unsigned int event);
228228

229229
/* fields used by ext bus APIs */
@@ -235,7 +235,7 @@ struct hdac_driver {
235235
#define drv_to_hdac_driver(_drv) container_of(_drv, struct hdac_driver, driver)
236236

237237
const struct hda_device_id *
238-
hdac_get_device_id(struct hdac_device *hdev, struct hdac_driver *drv);
238+
hdac_get_device_id(struct hdac_device *hdev, const struct hdac_driver *drv);
239239

240240
/*
241241
* Bus verb operators

include/sound/hdaudio_ext.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ void snd_hdac_ext_bus_ppcap_enable(struct hdac_bus *chip, bool enable);
2222
void snd_hdac_ext_bus_ppcap_int_enable(struct hdac_bus *chip, bool enable);
2323

2424
int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_bus *bus);
25+
struct hdac_ext_link *snd_hdac_ext_bus_get_hlink_by_id(struct hdac_bus *bus, u32 id);
2526
struct hdac_ext_link *snd_hdac_ext_bus_get_hlink_by_addr(struct hdac_bus *bus, int addr);
2627
struct hdac_ext_link *snd_hdac_ext_bus_get_hlink_by_name(struct hdac_bus *bus,
2728
const char *codec_name);
@@ -97,12 +98,17 @@ struct hdac_ext_link {
9798
void __iomem *ml_addr; /* link output stream reg pointer */
9899
u32 lcaps; /* link capablities */
99100
u16 lsdiid; /* link sdi identifier */
101+
u32 id;
102+
u8 slcount;
100103

101104
int ref_count;
102105

103106
struct list_head list;
104107
};
105108

109+
#define hdac_ext_link_alt(link) ((link)->lcaps & AZX_ML_HDA_LCAP_ALT)
110+
#define hdac_ext_link_ofls(link) ((link)->lcaps & AZX_ML_HDA_LCAP_OFLS)
111+
106112
int snd_hdac_ext_bus_link_power_up(struct hdac_ext_link *hlink);
107113
int snd_hdac_ext_bus_link_power_down(struct hdac_ext_link *hlink);
108114
int snd_hdac_ext_bus_link_power_up_all(struct hdac_bus *bus);

include/sound/soc-acpi.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/acpi.h>
1111
#include <linux/mod_devicetable.h>
1212
#include <linux/soundwire/sdw.h>
13+
#include <sound/soc.h>
1314

1415
struct snd_soc_acpi_package_context {
1516
char *name; /* package name */
@@ -195,6 +196,15 @@ struct snd_soc_acpi_link_adr {
195196
* is not constant since this field may be updated at run-time
196197
* @sof_tplg_filename: Sound Open Firmware topology file name, if enabled
197198
* @tplg_quirk_mask: quirks to select different topology files dynamically
199+
* @get_function_tplg_files: This is an optional callback, if specified then instead of
200+
* the single sof_tplg_filename the callback will return the list of function topology
201+
* files to be loaded.
202+
* Return value: The number of the files or negative ERRNO. 0 means that the single topology
203+
* file should be used, no function topology split can be used on the machine.
204+
* @card: the pointer of the card
205+
* @mach: the pointer of the machine driver
206+
* @prefix: the prefix of the topology file name. Typically, it is the path.
207+
* @tplg_files: the pointer of the array of the topology file names.
198208
*/
199209
/* Descriptor for SST ASoC machine driver */
200210
struct snd_soc_acpi_mach {
@@ -214,6 +224,9 @@ struct snd_soc_acpi_mach {
214224
struct snd_soc_acpi_mach_params mach_params;
215225
const char *sof_tplg_filename;
216226
const u32 tplg_quirk_mask;
227+
int (*get_function_tplg_files)(struct snd_soc_card *card,
228+
const struct snd_soc_acpi_mach *mach,
229+
const char *prefix, const char ***tplg_files);
217230
};
218231

219232
#define SND_SOC_ACPI_MAX_CODECS 3

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/seq_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ MODULE_LICENSE("GPL");
4343
static int snd_seq_bus_match(struct device *dev, struct device_driver *drv)
4444
{
4545
struct snd_seq_device *sdev = to_seq_dev(dev);
46-
struct snd_seq_driver *sdrv = to_seq_drv(drv);
46+
const struct snd_seq_driver *sdrv = to_seq_drv(drv);
4747

4848
return strcmp(sdrv->id, sdev->id) == 0 &&
4949
sdrv->argsize == sdev->argsize;

sound/hda/ext/hdac_ext_controller.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1010
*/
1111

12+
#include <linux/bitfield.h>
1213
#include <linux/delay.h>
1314
#include <linux/slab.h>
1415
#include <sound/hda_register.h>
@@ -81,6 +82,7 @@ int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_bus *bus)
8182
int idx;
8283
u32 link_count;
8384
struct hdac_ext_link *hlink;
85+
u32 leptr;
8486

8587
link_count = readl(bus->mlcap + AZX_REG_ML_MLCD) + 1;
8688

@@ -96,6 +98,12 @@ int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_bus *bus)
9698
(AZX_ML_INTERVAL * idx);
9799
hlink->lcaps = readl(hlink->ml_addr + AZX_REG_ML_LCAP);
98100
hlink->lsdiid = readw(hlink->ml_addr + AZX_REG_ML_LSDIID);
101+
hlink->slcount = FIELD_GET(AZX_ML_HDA_LCAP_SLCOUNT, hlink->lcaps) + 1;
102+
103+
if (hdac_ext_link_alt(hlink)) {
104+
leptr = readl(hlink->ml_addr + AZX_REG_ML_LEPTR);
105+
hlink->id = FIELD_GET(AZX_REG_ML_LEPTR_ID, leptr);
106+
}
99107

100108
/* since link in On, update the ref */
101109
hlink->ref_count = 1;
@@ -125,6 +133,17 @@ void snd_hdac_ext_link_free_all(struct hdac_bus *bus)
125133
}
126134
EXPORT_SYMBOL_GPL(snd_hdac_ext_link_free_all);
127135

136+
struct hdac_ext_link *snd_hdac_ext_bus_get_hlink_by_id(struct hdac_bus *bus, u32 id)
137+
{
138+
struct hdac_ext_link *hlink;
139+
140+
list_for_each_entry(hlink, &bus->hlink_list, list)
141+
if (hdac_ext_link_alt(hlink) && hlink->id == id)
142+
return hlink;
143+
return NULL;
144+
}
145+
EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_get_hlink_by_id);
146+
128147
/**
129148
* snd_hdac_ext_bus_get_hlink_by_addr - get hlink at specified address
130149
* @bus: hlink's parent bus device

sound/hda/hda_bus_type.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ MODULE_LICENSE("GPL");
2121
* driver id_table and returns the matching device id entry.
2222
*/
2323
const struct hda_device_id *
24-
hdac_get_device_id(struct hdac_device *hdev, struct hdac_driver *drv)
24+
hdac_get_device_id(struct hdac_device *hdev, const struct hdac_driver *drv)
2525
{
2626
if (drv->id_table) {
2727
const struct hda_device_id *id = drv->id_table;
@@ -38,7 +38,7 @@ hdac_get_device_id(struct hdac_device *hdev, struct hdac_driver *drv)
3838
}
3939
EXPORT_SYMBOL_GPL(hdac_get_device_id);
4040

41-
static int hdac_codec_match(struct hdac_device *dev, struct hdac_driver *drv)
41+
static int hdac_codec_match(struct hdac_device *dev, const struct hdac_driver *drv)
4242
{
4343
if (hdac_get_device_id(dev, drv))
4444
return 1;
@@ -49,7 +49,7 @@ static int hdac_codec_match(struct hdac_device *dev, struct hdac_driver *drv)
4949
static int hda_bus_match(struct device *dev, struct device_driver *drv)
5050
{
5151
struct hdac_device *hdev = dev_to_hdac_dev(dev);
52-
struct hdac_driver *hdrv = drv_to_hdac_driver(drv);
52+
const struct hdac_driver *hdrv = drv_to_hdac_driver(drv);
5353

5454
if (hdev->type != hdrv->type)
5555
return 0;

0 commit comments

Comments
 (0)