Commit fe1de551 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull soundwire updates from Vinod Koul:

 - Stream handling and slave alert handling

 - Qualcomm Soundwire v2.0.0 controller support

 - Intel ACE2.x initial support and code reorganization

* tag 'soundwire-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: (55 commits)
  soundwire: stream: Make master_list ordered to prevent deadlocks
  soundwire: bus: Prevent lockdep asserts when stream has multiple buses
  soundwire: qcom: fix storing port config out-of-bounds
  soundwire: intel_ace2x: fix SND_SOC_SOF_HDA_MLINK dependency
  soundwire: debugfs: Add missing SCP registers
  soundwire: stream: Remove unnecessary gotos
  soundwire: stream: Invert logic on runtime alloc flags
  soundwire: stream: Remove unneeded checks for NULL bus
  soundwire: bandwidth allocation: Remove pointless variable
  soundwire: cadence: revisit parity injection
  soundwire: intel/cadence: update hardware reset sequence
  soundwire: intel_bus_common: enable interrupts last
  soundwire: intel_bus_common: update error log
  soundwire: amd: Improve error message in remove callback
  soundwire: debugfs: fix unbalanced pm_runtime_put()
  soundwire: qcom: fix unbalanced pm_runtime_put()
  soundwire: qcom: set clk stop need reset flag at runtime
  soundwire: qcom: add software workaround for bus clash interrupt assertion
  soundwire: qcom: wait for fifo to be empty before suspend
  soundwire: qcom: drop unused struct qcom_swrm_ctrl members
  ...
parents 15ac4686 a4857d1a
Loading
Loading
Loading
Loading
+28 −11
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ properties:
      - qcom,soundwire-v1.5.1
      - qcom,soundwire-v1.6.0
      - qcom,soundwire-v1.7.0
      - qcom,soundwire-v2.0.0

  reg:
    maxItems: 1
@@ -80,18 +81,29 @@ properties:
      or applicable for the respective data port.
      More info in MIPI Alliance SoundWire 1.0 Specifications.
    minItems: 3
    maxItems: 8
    maxItems: 16

  qcom,ports-sinterval-low:
    $ref: /schemas/types.yaml#/definitions/uint8-array
    description:
      Sample interval low of each data port.
      Sample interval (only lowest byte) of each data port.
      Out ports followed by In ports. Used for Sample Interval calculation.
      Value of 0xff indicates that this option is not implemented
      or applicable for the respective data port.
      More info in MIPI Alliance SoundWire 1.0 Specifications.
    minItems: 3
    maxItems: 8
    maxItems: 16

  qcom,ports-sinterval:
    $ref: /schemas/types.yaml#/definitions/uint16-array
    description:
      Sample interval of each data port.
      Out ports followed by In ports. Used for Sample Interval calculation.
      Value of 0xffff indicates that this option is not implemented
      or applicable for the respective data port.
      More info in MIPI Alliance SoundWire 1.0 Specifications.
    minItems: 3
    maxItems: 16

  qcom,ports-offset1:
    $ref: /schemas/types.yaml#/definitions/uint8-array
@@ -102,7 +114,7 @@ properties:
      or applicable for the respective data port.
      More info in MIPI Alliance SoundWire 1.0 Specifications.
    minItems: 3
    maxItems: 8
    maxItems: 16

  qcom,ports-offset2:
    $ref: /schemas/types.yaml#/definitions/uint8-array
@@ -113,7 +125,7 @@ properties:
      or applicable for the respective data port.
      More info in MIPI Alliance SoundWire 1.0 Specifications.
    minItems: 3
    maxItems: 8
    maxItems: 16

  qcom,ports-lane-control:
    $ref: /schemas/types.yaml#/definitions/uint8-array
@@ -124,7 +136,7 @@ properties:
      or applicable for the respective data port.
      More info in MIPI Alliance SoundWire 1.0 Specifications.
    minItems: 3
    maxItems: 8
    maxItems: 16

  qcom,ports-block-pack-mode:
    $ref: /schemas/types.yaml#/definitions/uint8-array
@@ -137,7 +149,7 @@ properties:
      or applicable for the respective data port.
      More info in MIPI Alliance SoundWire 1.0 Specifications.
    minItems: 3
    maxItems: 8
    maxItems: 16
    items:
      oneOf:
        - minimum: 0
@@ -154,7 +166,7 @@ properties:
      or applicable for the respective data port.
      More info in MIPI Alliance SoundWire 1.0 Specifications.
    minItems: 3
    maxItems: 8
    maxItems: 16
    items:
      oneOf:
        - minimum: 0
@@ -171,7 +183,7 @@ properties:
      or applicable for the respective data port.
      More info in MIPI Alliance SoundWire 1.0 Specifications.
    minItems: 3
    maxItems: 8
    maxItems: 16
    items:
      oneOf:
        - minimum: 0
@@ -187,7 +199,7 @@ properties:
      or applicable for the respective data port.
      More info in MIPI Alliance SoundWire 1.0 Specifications.
    minItems: 3
    maxItems: 8
    maxItems: 16
    items:
      oneOf:
        - minimum: 0
@@ -219,10 +231,15 @@ required:
  - '#size-cells'
  - qcom,dout-ports
  - qcom,din-ports
  - qcom,ports-sinterval-low
  - qcom,ports-offset1
  - qcom,ports-offset2

oneOf:
  - required:
      - qcom,ports-sinterval-low
  - required:
      - qcom,ports-sinterval

additionalProperties: false

examples:
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ config SOUNDWIRE_INTEL
	select SOUNDWIRE_GENERIC_ALLOCATION
	select AUXILIARY_BUS
	depends on ACPI && SND_SOC
	depends on SND_SOC_SOF_HDA_MLINK || !SND_SOC_SOF_HDA_MLINK
	help
	  SoundWire Intel Master driver.
	  If you have an Intel platform which has a SoundWire Master then
+2 −1
Original line number Diff line number Diff line
@@ -24,7 +24,8 @@ soundwire-cadence-y := cadence_master.o
obj-$(CONFIG_SOUNDWIRE_CADENCE) += soundwire-cadence.o

#Intel driver
soundwire-intel-y :=	intel.o intel_auxdevice.o intel_init.o dmi-quirks.o \
soundwire-intel-y :=	intel.o intel_ace2x.o intel_ace2x_debugfs.o \
			intel_auxdevice.o intel_init.o dmi-quirks.o \
			intel_bus_common.o
obj-$(CONFIG_SOUNDWIRE_INTEL) += soundwire-intel.o

+6 −3
Original line number Diff line number Diff line
@@ -972,15 +972,18 @@ static int amd_sdw_manager_probe(struct platform_device *pdev)
	return 0;
}

static int amd_sdw_manager_remove(struct platform_device *pdev)
static void amd_sdw_manager_remove(struct platform_device *pdev)
{
	struct amd_sdw_manager *amd_manager = dev_get_drvdata(&pdev->dev);
	int ret;

	pm_runtime_disable(&pdev->dev);
	cancel_work_sync(&amd_manager->probe_work);
	amd_disable_sdw_interrupts(amd_manager);
	sdw_bus_master_delete(&amd_manager->bus);
	return amd_disable_sdw_manager(amd_manager);
	ret = amd_disable_sdw_manager(amd_manager);
	if (ret)
		dev_err(&pdev->dev, "Failed to disable device (%pe)\n", ERR_PTR(ret));
}

static int amd_sdw_clock_stop(struct amd_sdw_manager *amd_manager)
@@ -1194,7 +1197,7 @@ static const struct dev_pm_ops amd_pm = {

static struct platform_driver amd_sdw_driver = {
	.probe	= &amd_sdw_manager_probe,
	.remove = &amd_sdw_manager_remove,
	.remove_new = &amd_sdw_manager_remove,
	.driver = {
		.name	= "amd_sdw_manager",
		.pm = &amd_pm,
+20 −10
Original line number Diff line number Diff line
@@ -69,8 +69,17 @@ int sdw_bus_master_add(struct sdw_bus *bus, struct device *parent,
		return -EINVAL;
	}

	mutex_init(&bus->msg_lock);
	mutex_init(&bus->bus_lock);
	/*
	 * Give each bus_lock and msg_lock a unique key so that lockdep won't
	 * trigger a deadlock warning when the locks of several buses are
	 * grabbed during configuration of a multi-bus stream.
	 */
	lockdep_register_key(&bus->msg_lock_key);
	__mutex_init(&bus->msg_lock, "msg_lock", &bus->msg_lock_key);

	lockdep_register_key(&bus->bus_lock_key);
	__mutex_init(&bus->bus_lock, "bus_lock", &bus->bus_lock_key);

	INIT_LIST_HEAD(&bus->slaves);
	INIT_LIST_HEAD(&bus->m_rt_list);

@@ -181,6 +190,8 @@ void sdw_bus_master_delete(struct sdw_bus *bus)
	sdw_master_device_del(bus);

	sdw_bus_debugfs_exit(bus);
	lockdep_unregister_key(&bus->bus_lock_key);
	lockdep_unregister_key(&bus->msg_lock_key);
	ida_free(&sdw_bus_ida, bus->id);
}
EXPORT_SYMBOL(sdw_bus_master_delete);
@@ -769,6 +780,9 @@ static int sdw_assign_device_num(struct sdw_slave *slave)
	/* After xfer of msg, restore dev_num */
	slave->dev_num = slave->dev_num_sticky;

	if (bus->ops && bus->ops->new_peripheral_assigned)
		bus->ops->new_peripheral_assigned(bus, dev_num);

	return 0;
}

@@ -1588,7 +1602,7 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave)
	unsigned long port;
	bool slave_notify;
	u8 sdca_cascade = 0;
	u8 buf, buf2[2], _buf, _buf2[2];
	u8 buf, buf2[2];
	bool parity_check;
	bool parity_quirk;

@@ -1745,9 +1759,9 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave)
				"SDW_SCP_INT1 recheck read failed:%d\n", ret);
			goto io_err;
		}
		_buf = ret;
		buf = ret;

		ret = sdw_nread_no_pm(slave, SDW_SCP_INTSTAT2, 2, _buf2);
		ret = sdw_nread_no_pm(slave, SDW_SCP_INTSTAT2, 2, buf2);
		if (ret < 0) {
			dev_err(&slave->dev,
				"SDW_SCP_INT2/3 recheck read failed:%d\n", ret);
@@ -1765,12 +1779,8 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave)
		}

		/*
		 * Make sure no interrupts are pending, but filter to limit loop
		 * to interrupts identified in the first status read
		 * Make sure no interrupts are pending
		 */
		buf &= _buf;
		buf2[0] &= _buf2[0];
		buf2[1] &= _buf2[1];
		stat = buf || buf2[0] || buf2[1] || sdca_cascade;

		/*
Loading