Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'soundwire-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire

Pull soundwire updates from Vinod Koul:
"A couple of small core changes and driver updates:

- Core: handling of nesting irqs to outside the lock, stream
parameters handing on port prep failures.

- AMD driver support for ACP 7.2 platforms and improved handing of
slave alerts and resume sequences

- Qualcomm updating driver debug spew

- Intel BPT message length limitations, rt721 codec as wake capable
etc"

* tag 'soundwire-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire:
soundwire: amd: Add support for acp7.2 platform
soundwire: stream: restore params when prepare ports fail
soundwire: debugfs: move debug statement outside of error handling
soundwire: amd: add check for status update registers
soundwire: intel_auxdevice: add rt721 codec to wake_capable_list
soundwire: Correct some property names
soundwire: update Intel BPT message length limitation
soundwire: intel_ace2.x: Use str_read_write() helper
soundwire: amd: cancel pending slave status handling workqueue during remove sequence
soundwire: amd: serialize amd manager resume sequence during pm_prepare
soundwire: qcom: demote probe registration printk
ASoC: cs42l43: Remove unnecessary work functions
soundwire: Move handle_nested_irq outside of sdw_dev_lock
MAINTAINERS: Remove Sanyog Kale as reviewer on SoundWire

+55 -74
+1 -1
Documentation/driver-api/soundwire/bra.rst
··· 333 333 334 334 Alignment requirements are currently not enforced at the core level 335 335 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.
-1
MAINTAINERS
··· 23637 23637 M: Vinod Koul <vkoul@kernel.org> 23638 23638 M: Bard Liao <yung-chuan.liao@linux.intel.com> 23639 23639 R: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> 23640 - R: Sanyog Kale <sanyog.r.kale@intel.com> 23641 23640 L: linux-sound@vger.kernel.org 23642 23641 S: Supported 23643 23642 T: git git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire.git
+11 -3
drivers/soundwire/amd_manager.c
··· 499 499 break; 500 500 case ACP70_PCI_REV_ID: 501 501 case ACP71_PCI_REV_ID: 502 + case ACP72_PCI_REV_ID: 502 503 frame_fmt_reg = acp70_sdw_dp_reg[p_params->num].frame_fmt_reg; 503 504 break; 504 505 default: ··· 552 551 break; 553 552 case ACP70_PCI_REV_ID: 554 553 case ACP71_PCI_REV_ID: 554 + case ACP72_PCI_REV_ID: 555 555 frame_fmt_reg = acp70_sdw_dp_reg[params->port_num].frame_fmt_reg; 556 556 sample_int_reg = acp70_sdw_dp_reg[params->port_num].sample_int_reg; 557 557 hctrl_dp0_reg = acp70_sdw_dp_reg[params->port_num].hctrl_dp0_reg; ··· 616 614 break; 617 615 case ACP70_PCI_REV_ID: 618 616 case ACP71_PCI_REV_ID: 617 + case ACP72_PCI_REV_ID: 619 618 lane_ctrl_ch_en_reg = acp70_sdw_dp_reg[enable_ch->port_num].lane_ctrl_ch_en_reg; 620 619 break; 621 620 default: ··· 934 931 935 932 status_change_8to11 = readl(amd_manager->mmio + ACP_SW_STATE_CHANGE_STATUS_8TO11); 936 933 status_change_0to7 = readl(amd_manager->mmio + ACP_SW_STATE_CHANGE_STATUS_0TO7); 934 + if (!status_change_0to7 && !status_change_8to11) 935 + return; 936 + 937 937 dev_dbg(amd_manager->dev, "[SDW%d] SDW INT: 0to7=0x%x, 8to11=0x%x\n", 938 938 amd_manager->instance, status_change_0to7, status_change_8to11); 939 939 if (status_change_8to11 & AMD_SDW_WAKE_STAT_MASK) ··· 1041 1035 break; 1042 1036 case ACP70_PCI_REV_ID: 1043 1037 case ACP71_PCI_REV_ID: 1038 + case ACP72_PCI_REV_ID: 1044 1039 amd_manager->num_dout_ports = AMD_ACP70_SDW_MAX_TX_PORTS; 1045 1040 amd_manager->num_din_ports = AMD_ACP70_SDW_MAX_RX_PORTS; 1046 1041 break; ··· 1081 1074 int ret; 1082 1075 1083 1076 pm_runtime_disable(&pdev->dev); 1077 + cancel_work_sync(&amd_manager->amd_sdw_work); 1084 1078 amd_disable_sdw_interrupts(amd_manager); 1085 1079 sdw_bus_master_delete(&amd_manager->bus); 1086 1080 ret = amd_disable_sdw_manager(amd_manager); ··· 1186 1178 * device is not in runtime suspend state, observed that device alerts are missing 1187 1179 * without pm_prepare on AMD platforms in clockstop mode0. 1188 1180 */ 1189 - if (amd_manager->power_mode_mask & AMD_SDW_CLK_STOP_MODE) { 1190 - ret = pm_request_resume(dev); 1181 + if (amd_manager->power_mode_mask) { 1182 + ret = pm_runtime_resume(dev); 1191 1183 if (ret < 0) { 1192 - dev_err(bus->dev, "pm_request_resume failed: %d\n", ret); 1184 + dev_err(bus->dev, "pm_runtime_resume failed: %d\n", ret); 1193 1185 return 0; 1194 1186 } 1195 1187 }
+3 -3
drivers/soundwire/bus.c
··· 1753 1753 1754 1754 /* Update the Slave driver */ 1755 1755 if (slave_notify) { 1756 + if (slave->prop.use_domain_irq && slave->irq) 1757 + handle_nested_irq(slave->irq); 1758 + 1756 1759 mutex_lock(&slave->sdw_dev_lock); 1757 1760 1758 1761 if (slave->probed) { 1759 1762 struct device *dev = &slave->dev; 1760 1763 struct sdw_driver *drv = drv_to_sdw_driver(dev->driver); 1761 - 1762 - if (slave->prop.use_domain_irq && slave->irq) 1763 - handle_nested_irq(slave->irq); 1764 1764 1765 1765 if (drv->ops && drv->ops->interrupt_callback) { 1766 1766 slave_intr.sdca_cascade = sdca_cascade;
+3 -3
drivers/soundwire/debugfs.c
··· 291 291 292 292 finish_t = ktime_get(); 293 293 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 + 294 297 out: 295 298 if (fw) 296 299 release_firmware(fw); 297 300 298 301 pm_runtime_mark_last_busy(&slave->dev); 299 302 pm_runtime_put(&slave->dev); 300 - 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 303 304 304 return ret; 305 305 }
+6 -5
drivers/soundwire/intel_ace2x.c
··· 11 11 #include <linux/soundwire/sdw_registers.h> 12 12 #include <linux/soundwire/sdw.h> 13 13 #include <linux/soundwire/sdw_intel.h> 14 + #include <linux/string_choices.h> 14 15 #include <sound/hdaudio.h> 15 16 #include <sound/hda-mlink.h> 16 17 #include <sound/hda-sdw-bpt.h> ··· 184 183 return 0; 185 184 186 185 dev_err(cdns->dev, "%s: sdw_prepare_%s_dma_buffer failed %d\n", 187 - __func__, command ? "read" : "write", ret); 186 + __func__, str_read_write(command), ret); 188 187 189 188 ret1 = hda_sdw_bpt_close(cdns->dev->parent, /* PCI device */ 190 189 sdw->bpt_ctx.bpt_tx_stream, &sdw->bpt_ctx.dmab_tx_bdl, ··· 246 245 cdns->bus.bpt_stream = NULL; 247 246 } 248 247 249 - #define INTEL_BPT_MSG_BYTE_ALIGNMENT 32 248 + #define INTEL_BPT_MSG_BYTE_MIN 16 250 249 251 250 static int intel_ace2x_bpt_send_async(struct sdw_intel *sdw, struct sdw_slave *slave, 252 251 struct sdw_bpt_msg *msg) ··· 254 253 struct sdw_cdns *cdns = &sdw->cdns; 255 254 int ret; 256 255 257 - if (msg->len % INTEL_BPT_MSG_BYTE_ALIGNMENT) { 258 - dev_err(cdns->dev, "BPT message length %d is not a multiple of %d bytes\n", 259 - msg->len, INTEL_BPT_MSG_BYTE_ALIGNMENT); 256 + if (msg->len < INTEL_BPT_MSG_BYTE_MIN) { 257 + dev_err(cdns->dev, "BPT message length %d is less than the minimum bytes %d\n", 258 + msg->len, INTEL_BPT_MSG_BYTE_MIN); 260 259 return -EINVAL; 261 260 } 262 261
+1
drivers/soundwire/intel_auxdevice.c
··· 65 65 {0x025d, 0x715}, 66 66 {0x025d, 0x716}, 67 67 {0x025d, 0x717}, 68 + {0x025d, 0x721}, 68 69 {0x025d, 0x722}, 69 70 }; 70 71
+2 -2
drivers/soundwire/mipi_disco.c
··· 451 451 "mipi-sdw-highPHY-capable"); 452 452 453 453 prop->paging_support = mipi_device_property_read_bool(dev, 454 - "mipi-sdw-paging-support"); 454 + "mipi-sdw-paging-supported"); 455 455 456 456 prop->bank_delay_support = mipi_device_property_read_bool(dev, 457 - "mipi-sdw-bank-delay-support"); 457 + "mipi-sdw-bank-delay-supported"); 458 458 459 459 device_property_read_u32(dev, 460 460 "mipi-sdw-port15-read-behavior", &prop->p15_behave);
+3 -3
drivers/soundwire/qcom.c
··· 1622 1622 if (ret) 1623 1623 goto err_master_add; 1624 1624 1625 - dev_info(dev, "Qualcomm Soundwire controller v%x.%x.%x Registered\n", 1626 - (ctrl->version >> 24) & 0xff, (ctrl->version >> 16) & 0xff, 1627 - ctrl->version & 0xffff); 1625 + dev_dbg(dev, "Qualcomm Soundwire controller v%x.%x.%x registered\n", 1626 + (ctrl->version >> 24) & 0xff, (ctrl->version >> 16) & 0xff, 1627 + ctrl->version & 0xffff); 1628 1628 1629 1629 pm_runtime_set_autosuspend_delay(dev, 3000); 1630 1630 pm_runtime_use_autosuspend(dev);
+1 -1
drivers/soundwire/stream.c
··· 1510 1510 if (ret < 0) { 1511 1511 dev_err(bus->dev, "Prepare port(s) failed ret = %d\n", 1512 1512 ret); 1513 - return ret; 1513 + goto restore_params; 1514 1514 } 1515 1515 } 1516 1516
+1
include/linux/soundwire/sdw_amd.h
··· 30 30 #define ACP63_PCI_REV_ID 0x63 31 31 #define ACP70_PCI_REV_ID 0x70 32 32 #define ACP71_PCI_REV_ID 0x71 33 + #define ACP72_PCI_REV_ID 0x72 33 34 34 35 struct acp_sdw_pdata { 35 36 u16 instance;
+18 -28
sound/soc/codecs/cs42l43-jack.c
··· 361 361 priv->button_detect_running = false; 362 362 } 363 363 364 + #define CS42L43_BUTTON_COMB_US 11000 364 365 #define CS42L43_BUTTON_COMB_MAX 512 365 366 #define CS42L43_BUTTON_ROUT 2210 366 367 367 - void cs42l43_button_press_work(struct work_struct *work) 368 + irqreturn_t cs42l43_button_press(int irq, void *data) 368 369 { 369 - struct cs42l43_codec *priv = container_of(work, struct cs42l43_codec, 370 - button_press_work.work); 370 + struct cs42l43_codec *priv = data; 371 371 struct cs42l43 *cs42l43 = priv->core; 372 + irqreturn_t iret = IRQ_NONE; 372 373 unsigned int buttons = 0; 373 374 unsigned int val = 0; 374 375 int i, ret; ··· 377 376 ret = pm_runtime_resume_and_get(priv->dev); 378 377 if (ret) { 379 378 dev_err(priv->dev, "Failed to resume for button press: %d\n", ret); 380 - return; 379 + return iret; 381 380 } 382 381 383 382 mutex_lock(&priv->jack_lock); ··· 386 385 dev_dbg(priv->dev, "Spurious button press IRQ\n"); 387 386 goto error; 388 387 } 388 + 389 + // Wait for 2 full cycles of comb filter to ensure good reading 390 + usleep_range(2 * CS42L43_BUTTON_COMB_US, 2 * CS42L43_BUTTON_COMB_US + 50); 389 391 390 392 regmap_read(cs42l43->regmap, CS42L43_DETECT_STATUS_1, &val); 391 393 ··· 423 419 424 420 snd_soc_jack_report(priv->jack_hp, buttons, CS42L43_JACK_BUTTONS); 425 421 422 + iret = IRQ_HANDLED; 423 + 426 424 error: 427 425 mutex_unlock(&priv->jack_lock); 428 426 429 427 pm_runtime_put_autosuspend(priv->dev); 428 + 429 + return iret; 430 430 } 431 431 432 - irqreturn_t cs42l43_button_press(int irq, void *data) 432 + irqreturn_t cs42l43_button_release(int irq, void *data) 433 433 { 434 434 struct cs42l43_codec *priv = data; 435 - 436 - // Wait for 2 full cycles of comb filter to ensure good reading 437 - queue_delayed_work(system_wq, &priv->button_press_work, 438 - msecs_to_jiffies(20)); 439 - 440 - return IRQ_HANDLED; 441 - } 442 - 443 - void cs42l43_button_release_work(struct work_struct *work) 444 - { 445 - struct cs42l43_codec *priv = container_of(work, struct cs42l43_codec, 446 - button_release_work); 435 + irqreturn_t iret = IRQ_NONE; 447 436 int ret; 448 437 449 438 ret = pm_runtime_resume_and_get(priv->dev); 450 439 if (ret) { 451 440 dev_err(priv->dev, "Failed to resume for button release: %d\n", ret); 452 - return; 441 + return iret; 453 442 } 454 443 455 444 mutex_lock(&priv->jack_lock); ··· 451 454 dev_dbg(priv->dev, "Button release IRQ\n"); 452 455 453 456 snd_soc_jack_report(priv->jack_hp, 0, CS42L43_JACK_BUTTONS); 457 + 458 + iret = IRQ_HANDLED; 454 459 } else { 455 460 dev_dbg(priv->dev, "Spurious button release IRQ\n"); 456 461 } ··· 460 461 mutex_unlock(&priv->jack_lock); 461 462 462 463 pm_runtime_put_autosuspend(priv->dev); 463 - } 464 464 465 - irqreturn_t cs42l43_button_release(int irq, void *data) 466 - { 467 - struct cs42l43_codec *priv = data; 468 - 469 - queue_work(system_wq, &priv->button_release_work); 470 - 471 - return IRQ_HANDLED; 465 + return iret; 472 466 } 473 467 474 468 void cs42l43_bias_sense_timeout(struct work_struct *work) ··· 774 782 775 783 cancel_delayed_work(&priv->bias_sense_timeout); 776 784 cancel_delayed_work(&priv->tip_sense_work); 777 - cancel_delayed_work(&priv->button_press_work); 778 - cancel_work(&priv->button_release_work); 779 785 780 786 // Ensure delay after suspend is long enough to avoid false detection 781 787 if (priv->suspend_jack_debounce)
+5 -19
sound/soc/codecs/cs42l43.c
··· 167 167 snd_soc_dapm_mutex_unlock(dapm); 168 168 } 169 169 170 - static void cs42l43_hp_ilimit_work(struct work_struct *work) 170 + static irqreturn_t cs42l43_hp_ilimit(int irq, void *data) 171 171 { 172 - struct cs42l43_codec *priv = container_of(work, struct cs42l43_codec, 173 - hp_ilimit_work); 172 + struct cs42l43_codec *priv = data; 174 173 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(priv->component); 175 174 struct cs42l43 *cs42l43 = priv->core; 175 + 176 + dev_dbg(priv->dev, "headphone ilimit IRQ\n"); 176 177 177 178 snd_soc_dapm_mutex_lock(dapm); 178 179 ··· 184 183 185 184 priv->hp_ilimit_count++; 186 185 snd_soc_dapm_mutex_unlock(dapm); 187 - return; 186 + return IRQ_HANDLED; 188 187 } 189 188 190 189 dev_err(priv->dev, "Disabling headphone for %dmS, due to frequent current limit\n", ··· 219 218 priv->hp_ilimited = false; 220 219 221 220 snd_soc_dapm_mutex_unlock(dapm); 222 - } 223 - 224 - static irqreturn_t cs42l43_hp_ilimit(int irq, void *data) 225 - { 226 - struct cs42l43_codec *priv = data; 227 - 228 - dev_dbg(priv->dev, "headphone ilimit IRQ\n"); 229 - 230 - queue_work(system_long_wq, &priv->hp_ilimit_work); 231 221 232 222 return IRQ_HANDLED; 233 223 } ··· 2150 2158 2151 2159 cancel_delayed_work_sync(&priv->bias_sense_timeout); 2152 2160 cancel_delayed_work_sync(&priv->tip_sense_work); 2153 - cancel_delayed_work_sync(&priv->button_press_work); 2154 - cancel_work_sync(&priv->button_release_work); 2155 2161 2156 - cancel_work_sync(&priv->hp_ilimit_work); 2157 2162 cancel_delayed_work_sync(&priv->hp_ilimit_clear_work); 2158 2163 2159 2164 priv->component = NULL; ··· 2302 2313 2303 2314 INIT_DELAYED_WORK(&priv->tip_sense_work, cs42l43_tip_sense_work); 2304 2315 INIT_DELAYED_WORK(&priv->bias_sense_timeout, cs42l43_bias_sense_timeout); 2305 - INIT_DELAYED_WORK(&priv->button_press_work, cs42l43_button_press_work); 2306 2316 INIT_DELAYED_WORK(&priv->hp_ilimit_clear_work, cs42l43_hp_ilimit_clear_work); 2307 - INIT_WORK(&priv->button_release_work, cs42l43_button_release_work); 2308 - INIT_WORK(&priv->hp_ilimit_work, cs42l43_hp_ilimit_work); 2309 2317 2310 2318 pm_runtime_set_autosuspend_delay(priv->dev, 100); 2311 2319 pm_runtime_use_autosuspend(priv->dev);
-5
sound/soc/codecs/cs42l43.h
··· 88 88 89 89 struct delayed_work tip_sense_work; 90 90 struct delayed_work bias_sense_timeout; 91 - struct delayed_work button_press_work; 92 - struct work_struct button_release_work; 93 91 struct completion type_detect; 94 92 struct completion load_detect; 95 93 ··· 97 99 int jack_override; 98 100 bool suspend_jack_debounce; 99 101 100 - struct work_struct hp_ilimit_work; 101 102 struct delayed_work hp_ilimit_clear_work; 102 103 bool hp_ilimited; 103 104 int hp_ilimit_count; ··· 131 134 struct snd_soc_jack *jack, void *d); 132 135 void cs42l43_bias_sense_timeout(struct work_struct *work); 133 136 void cs42l43_tip_sense_work(struct work_struct *work); 134 - void cs42l43_button_press_work(struct work_struct *work); 135 - void cs42l43_button_release_work(struct work_struct *work); 136 137 irqreturn_t cs42l43_bias_detect_clamp(int irq, void *data); 137 138 irqreturn_t cs42l43_button_press(int irq, void *data); 138 139 irqreturn_t cs42l43_button_release(int irq, void *data);