Unverified Commit d1541caa authored by Mark Brown's avatar Mark Brown
Browse files

Add SDCA DisCo parsing support

Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>:

The MIPI SoundWire Device Class for Audio (SDCA) specification defines
most details of the hardware in ACPI using the MIPI Discovery and
Configuration (DisCo) specification. This patch chain adds support for
parsing most of this information into the kernel such that future work
can make use of it to construct CODEC devices and soundcards.

The most notable outstanding work here, is parsing the separate
properties for the Control Numbers (roughly equivalent to channels)
within an individual Control. The separate Control Numbers are
supported but currently only the scheme were a single default etc. is
supplied for all.  This should not be super hard to add in the future
but isn't currently required by any of the hardware I am working to
support.
parents 3c331bde 9da19588
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -17,29 +17,31 @@ struct sdw_slave;
#define SDCA_MAX_FUNCTION_COUNT 8

/**
 * sdca_device_desc - short descriptor for an SDCA Function
 * @adr: ACPI address (used for SDCA register access)
 * @type: Function topology type
 * @name: human-readable string
 * struct sdca_function_desc - short descriptor for an SDCA Function
 * @node: firmware node for the Function.
 * @name: Human-readable string.
 * @type: Function topology type.
 * @adr: ACPI address (used for SDCA register access).
 */
struct sdca_function_desc {
	struct fwnode_handle *node;
	const char *name;
	u32 type;
	u8 adr;
};

/**
 * sdca_device_data - structure containing all SDCA related information
 * @sdca_interface_revision: value read from _DSD property, mainly to check
 * for changes between silicon versions
 * @num_functions: total number of supported SDCA functions. Invalid/unsupported
 * struct sdca_device_data - structure containing all SDCA related information
 * @interface_revision: Value read from _DSD property, mainly to check
 * for changes between silicon versions.
 * @num_functions: Total number of supported SDCA functions. Invalid/unsupported
 * functions will be skipped.
 * @sdca_func: array of function descriptors
 * @function: Array of function descriptors.
 */
struct sdca_device_data {
	u32 interface_revision;
	int num_functions;
	struct sdca_function_desc sdca_func[SDCA_MAX_FUNCTION_COUNT];
	struct sdca_function_desc function[SDCA_MAX_FUNCTION_COUNT];
};

enum sdca_quirk {
+1067 −22

File changed.

Preview size limit exceeded, changes collapsed.

+1 −2
Original line number Diff line number Diff line
@@ -48,8 +48,7 @@ static bool sdca_device_quirk_rt712_vb(struct sdw_slave *slave)
		return false;

	for (i = 0; i < slave->sdca_data.num_functions; i++) {
		if (slave->sdca_data.sdca_func[i].type ==
		    SDCA_FUNCTION_TYPE_SMART_MIC)
		if (slave->sdca_data.function[i].type == SDCA_FUNCTION_TYPE_SMART_MIC)
			return true;
	}

+1400 −7

File changed.

Preview size limit exceeded, changes collapsed.