Skip to content

Commit 456f387

Browse files
committed
Merge remote-tracking branch 'soundwire/next' into sound/upstream-20250708
2 parents 7a75d47 + 06f77ff commit 456f387

12 files changed

Lines changed: 49 additions & 73 deletions

File tree

Documentation/driver-api/soundwire/bra.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,4 +333,4 @@ FIFO sizes to avoid xruns.
333333

334334
Alignment requirements are currently not enforced at the core level
335335
but at the platform-level, e.g. for Intel the data sizes must be
336-
multiples of 32 bytes.
336+
equal to or larger than 16 bytes.

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23324,7 +23324,6 @@ SOUNDWIRE SUBSYSTEM
2332423324
M: Vinod Koul <vkoul@kernel.org>
2332523325
M: Bard Liao <yung-chuan.liao@linux.intel.com>
2332623326
R: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
23327-
R: Sanyog Kale <sanyog.r.kale@intel.com>
2332823327
L: linux-sound@vger.kernel.org
2332923328
S: Supported
2333023329
T: git git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire.git

drivers/soundwire/amd_manager.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

drivers/soundwire/bus.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1753,15 +1753,15 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave)
17531753

17541754
/* Update the Slave driver */
17551755
if (slave_notify) {
1756+
if (slave->prop.use_domain_irq && slave->irq)
1757+
handle_nested_irq(slave->irq);
1758+
17561759
mutex_lock(&slave->sdw_dev_lock);
17571760

17581761
if (slave->probed) {
17591762
struct device *dev = &slave->dev;
17601763
struct sdw_driver *drv = drv_to_sdw_driver(dev->driver);
17611764

1762-
if (slave->prop.use_domain_irq && slave->irq)
1763-
handle_nested_irq(slave->irq);
1764-
17651765
if (drv->ops && drv->ops->interrupt_callback) {
17661766
slave_intr.sdca_cascade = sdca_cascade;
17671767
slave_intr.control_port = clear;

drivers/soundwire/debugfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,16 +291,16 @@ static int cmd_go(void *data, u64 value)
291291

292292
finish_t = ktime_get();
293293

294+
dev_dbg(&slave->dev, "command completed, num_byte %zu status %d, time %lld ms\n",
295+
num_bytes, ret, div_u64(finish_t - start_t, NSEC_PER_MSEC));
296+
294297
out:
295298
if (fw)
296299
release_firmware(fw);
297300

298301
pm_runtime_mark_last_busy(&slave->dev);
299302
pm_runtime_put(&slave->dev);
300303

301-
dev_dbg(&slave->dev, "command completed, num_byte %zu status %d, time %lld ms\n",
302-
num_bytes, ret, div_u64(finish_t - start_t, NSEC_PER_MSEC));
303-
304304
return ret;
305305
}
306306
DEFINE_DEBUGFS_ATTRIBUTE(cmd_go_fops, NULL,

drivers/soundwire/intel_ace2x.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/soundwire/sdw_registers.h>
1212
#include <linux/soundwire/sdw.h>
1313
#include <linux/soundwire/sdw_intel.h>
14+
#include <linux/string_choices.h>
1415
#include <sound/hdaudio.h>
1516
#include <sound/hda-mlink.h>
1617
#include <sound/hda-sdw-bpt.h>
@@ -183,7 +184,7 @@ static int intel_ace2x_bpt_open_stream(struct sdw_intel *sdw, struct sdw_slave *
183184
return 0;
184185

185186
dev_err(cdns->dev, "%s: sdw_prepare_%s_dma_buffer failed %d\n",
186-
__func__, command ? "read" : "write", ret);
187+
__func__, str_read_write(command), ret);
187188

188189
ret1 = hda_sdw_bpt_close(cdns->dev->parent, /* PCI device */
189190
sdw->bpt_ctx.bpt_tx_stream, &sdw->bpt_ctx.dmab_tx_bdl,
@@ -245,17 +246,17 @@ static void intel_ace2x_bpt_close_stream(struct sdw_intel *sdw, struct sdw_slave
245246
cdns->bus.bpt_stream = NULL;
246247
}
247248

248-
#define INTEL_BPT_MSG_BYTE_ALIGNMENT 32
249+
#define INTEL_BPT_MSG_BYTE_MIN 16
249250

250251
static int intel_ace2x_bpt_send_async(struct sdw_intel *sdw, struct sdw_slave *slave,
251252
struct sdw_bpt_msg *msg)
252253
{
253254
struct sdw_cdns *cdns = &sdw->cdns;
254255
int ret;
255256

256-
if (msg->len % INTEL_BPT_MSG_BYTE_ALIGNMENT) {
257-
dev_err(cdns->dev, "BPT message length %d is not a multiple of %d bytes\n",
258-
msg->len, INTEL_BPT_MSG_BYTE_ALIGNMENT);
257+
if (msg->len < INTEL_BPT_MSG_BYTE_MIN) {
258+
dev_err(cdns->dev, "BPT message length %d is less than the minimum bytes %d\n",
259+
msg->len, INTEL_BPT_MSG_BYTE_MIN);
259260
return -EINVAL;
260261
}
261262

drivers/soundwire/intel_auxdevice.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ static struct wake_capable_part wake_capable_list[] = {
6565
{0x025d, 0x715},
6666
{0x025d, 0x716},
6767
{0x025d, 0x717},
68+
{0x025d, 0x721},
6869
{0x025d, 0x722},
6970
};
7071

drivers/soundwire/mipi_disco.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,10 +451,10 @@ int sdw_slave_read_prop(struct sdw_slave *slave)
451451
"mipi-sdw-highPHY-capable");
452452

453453
prop->paging_support = mipi_device_property_read_bool(dev,
454-
"mipi-sdw-paging-support");
454+
"mipi-sdw-paging-supported");
455455

456456
prop->bank_delay_support = mipi_device_property_read_bool(dev,
457-
"mipi-sdw-bank-delay-support");
457+
"mipi-sdw-bank-delay-supported");
458458

459459
device_property_read_u32(dev,
460460
"mipi-sdw-port15-read-behavior", &prop->p15_behave);

drivers/soundwire/qcom.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,9 +1648,9 @@ static int qcom_swrm_probe(struct platform_device *pdev)
16481648
if (ret)
16491649
goto err_master_add;
16501650

1651-
dev_info(dev, "Qualcomm Soundwire controller v%x.%x.%x Registered\n",
1652-
(ctrl->version >> 24) & 0xff, (ctrl->version >> 16) & 0xff,
1653-
ctrl->version & 0xffff);
1651+
dev_dbg(dev, "Qualcomm Soundwire controller v%x.%x.%x registered\n",
1652+
(ctrl->version >> 24) & 0xff, (ctrl->version >> 16) & 0xff,
1653+
ctrl->version & 0xffff);
16541654

16551655
pm_runtime_set_autosuspend_delay(dev, 3000);
16561656
pm_runtime_use_autosuspend(dev);

sound/soc/codecs/cs42l43-jack.c

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -361,22 +361,23 @@ static void cs42l43_stop_button_detect(struct cs42l43_codec *priv)
361361
priv->button_detect_running = false;
362362
}
363363

364+
#define CS42L43_BUTTON_COMB_US 11000
364365
#define CS42L43_BUTTON_COMB_MAX 512
365366
#define CS42L43_BUTTON_ROUT 2210
366367

367-
void cs42l43_button_press_work(struct work_struct *work)
368+
irqreturn_t cs42l43_button_press(int irq, void *data)
368369
{
369-
struct cs42l43_codec *priv = container_of(work, struct cs42l43_codec,
370-
button_press_work.work);
370+
struct cs42l43_codec *priv = data;
371371
struct cs42l43 *cs42l43 = priv->core;
372+
irqreturn_t iret = IRQ_NONE;
372373
unsigned int buttons = 0;
373374
unsigned int val = 0;
374375
int i, ret;
375376

376377
ret = pm_runtime_resume_and_get(priv->dev);
377378
if (ret) {
378379
dev_err(priv->dev, "Failed to resume for button press: %d\n", ret);
379-
return;
380+
return iret;
380381
}
381382

382383
mutex_lock(&priv->jack_lock);
@@ -386,6 +387,9 @@ void cs42l43_button_press_work(struct work_struct *work)
386387
goto error;
387388
}
388389

390+
// Wait for 2 full cycles of comb filter to ensure good reading
391+
usleep_range(2 * CS42L43_BUTTON_COMB_US, 2 * CS42L43_BUTTON_COMB_US + 50);
392+
389393
regmap_read(cs42l43->regmap, CS42L43_DETECT_STATUS_1, &val);
390394

391395
/* Bail if jack removed, the button is irrelevant and likely invalid */
@@ -419,33 +423,26 @@ void cs42l43_button_press_work(struct work_struct *work)
419423

420424
snd_soc_jack_report(priv->jack_hp, buttons, CS42L43_JACK_BUTTONS);
421425

426+
iret = IRQ_HANDLED;
427+
422428
error:
423429
mutex_unlock(&priv->jack_lock);
424430

425431
pm_runtime_put_autosuspend(priv->dev);
426-
}
427-
428-
irqreturn_t cs42l43_button_press(int irq, void *data)
429-
{
430-
struct cs42l43_codec *priv = data;
431-
432-
// Wait for 2 full cycles of comb filter to ensure good reading
433-
queue_delayed_work(system_wq, &priv->button_press_work,
434-
msecs_to_jiffies(20));
435432

436-
return IRQ_HANDLED;
433+
return iret;
437434
}
438435

439-
void cs42l43_button_release_work(struct work_struct *work)
436+
irqreturn_t cs42l43_button_release(int irq, void *data)
440437
{
441-
struct cs42l43_codec *priv = container_of(work, struct cs42l43_codec,
442-
button_release_work);
438+
struct cs42l43_codec *priv = data;
439+
irqreturn_t iret = IRQ_NONE;
443440
int ret;
444441

445442
ret = pm_runtime_resume_and_get(priv->dev);
446443
if (ret) {
447444
dev_err(priv->dev, "Failed to resume for button release: %d\n", ret);
448-
return;
445+
return iret;
449446
}
450447

451448
mutex_lock(&priv->jack_lock);
@@ -454,22 +451,17 @@ void cs42l43_button_release_work(struct work_struct *work)
454451
dev_dbg(priv->dev, "Button release IRQ\n");
455452

456453
snd_soc_jack_report(priv->jack_hp, 0, CS42L43_JACK_BUTTONS);
454+
455+
iret = IRQ_HANDLED;
457456
} else {
458457
dev_dbg(priv->dev, "Spurious button release IRQ\n");
459458
}
460459

461460
mutex_unlock(&priv->jack_lock);
462461

463462
pm_runtime_put_autosuspend(priv->dev);
464-
}
465463

466-
irqreturn_t cs42l43_button_release(int irq, void *data)
467-
{
468-
struct cs42l43_codec *priv = data;
469-
470-
queue_work(system_wq, &priv->button_release_work);
471-
472-
return IRQ_HANDLED;
464+
return iret;
473465
}
474466

475467
void cs42l43_bias_sense_timeout(struct work_struct *work)
@@ -782,8 +774,6 @@ irqreturn_t cs42l43_tip_sense(int irq, void *data)
782774

783775
cancel_delayed_work(&priv->bias_sense_timeout);
784776
cancel_delayed_work(&priv->tip_sense_work);
785-
cancel_delayed_work(&priv->button_press_work);
786-
cancel_work(&priv->button_release_work);
787777

788778
// Ensure delay after suspend is long enough to avoid false detection
789779
if (priv->suspend_jack_debounce)

0 commit comments

Comments
 (0)