ASoC: rt712-sdca: add the function for version B
The version B will support the multi-lane function and integrate the DMIC function in one SoundWire interface. Due to some registers having different default values between version A and B, this patch also removes the redundant default registers to avoid confusion.
@shumingfan is the function listed in the DSDT? IIRC all the functions should be a "Device" under the codec device, so in theory we might be able to add a quirk to go read the function and decide which system it is.
IOW, we would first start from the ACPI _ADR, but add a quirk to go check if there is a subdevice representing the DMIC function. And in that case we would know for sure what the codec is and select topology.
IOW, we would first start from the ACPI _ADR, but add a quirk to go check if there is a subdevice representing the DMIC function. And in that case we would know for sure what the codec is and select topology.
@plbossart Regarding RT712VA, we might check ACPI _ADR that the part id 171X exists or not.
Regarding RT712VB or VA, could we check the DisCo property "mipi-sdca-terminal-type"?
If mipi-sdca-terminal-type belongs to 0x201 or 0x205, that machine will use the DMIC function.
@plbossart Regarding RT712VA, we might check ACPI _ADR that the part id 171X exists or not.
Yes that's a possibility.
Regarding RT712VB or VA, could we check the DisCo property "mipi-sdca-terminal-type"? If mipi-sdca-terminal-type belongs to 0x201 or 0x205, that machine will use the DMIC function.
It's probably better to detect the function type, we should see a SmartMic function.
I'll start cooking something.
@shumingfan see https://github.com/thesofproject/linux/pull/4930 for an example on how we can parse the DSDT information and figure out if there are any SDCA functions in a device. we could use this to check if the device supports the SmartMic function.
Of course that assumes ACPI information is valid, which is already not true on the first device I tried...
Of course that assumes ACPI information is valid, which is already not true on the first device I tried...
@plbossart Thanks. The PR#4930 looks good to me. The function type of DMIC of RT713 might be a simple mic function.
The SimpleMic topology is not yet in the SDCA spec, it's still being added for 1.1. So I don't know how if it's really what it is, and how one would infer the topology mask.
That's my main fear with this ACPI-based solution, it's a mix of older devices with an older unpublished SDCA/DisCo spec, not sure how we can deal with all the variants. It might be just easier to only support 1.0+...
@shumingfan for my education, what's the difference between RT712 VB and RT722? They both seem to support UAJ, SmartAmp and SmartMic functions, along with multi-lane.
@shumingfan for my education, what's the difference between RT712 VB and RT722? They both seem to support UAJ, SmartAmp and SmartMic functions, along with multi-lane.
@plbossart As far as I know, RT712VB has a newer SDCA version than RT722. RT712VB has another function like TV mode, however, it isn't implemented in the codec driver yet. The basic functions like UAJ/Amp/Mic are similar to RT722.
The patches were upstreamed already.