linux icon indicating copy to clipboard operation
linux copied to clipboard

ASoC: rt712-sdca: add the function for version B

Open shumingfan opened this issue 1 year ago • 6 comments

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 avatar Apr 09 '24 09:04 shumingfan

@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.

plbossart avatar Apr 10 '24 13:04 plbossart

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. image

shumingfan avatar Apr 11 '24 03:04 shumingfan

@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.

plbossart avatar Apr 11 '24 13:04 plbossart

@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...

plbossart avatar Apr 16 '24 16:04 plbossart

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. image

shumingfan avatar Apr 17 '24 10:04 shumingfan

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+...

plbossart avatar Apr 17 '24 13:04 plbossart

@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 avatar May 14 '24 21:05 plbossart

@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.

shumingfan avatar May 15 '24 04:05 shumingfan

The patches were upstreamed already.

shumingfan avatar Jun 28 '24 05:06 shumingfan