On Tue, 2022-11-29 at 17:22 +0000, Mark Brown wrote:
On Mon, Nov 28, 2022 at 03:07:22PM +0000, Jiaxin Yu (俞家鑫) wrote:
On Fri, 2022-11-25 at 12:18 +0000, Mark Brown wrote:
On Fri, Nov 25, 2022 at 05:44:11PM +0800, Jiaxin Yu wrote: I'm a little unclear why this is being implemented as a DAPM operation rather than having the driver forward the PCM trigger op if it's needed? Or alternatively if a DAPM callback is needed why not provide one directly rather than hooking into the trigger function - that's going to be called out of sequence with the rest of DAPM and be potentially confusing given the very different environments that trigger and DAPM operations run in. A quick glance at the it6505 driver suggests it'd be happier with a DAPM callback.
Let me describe the hardware connection about mt8186 with it6505(hdmi) and rt1015p(speakers). ==>it6505 = DL1(FE) ==>I2S3(BE) = = ==>rt1015p They shared the same one i2s port, but we'd like to control them separately. So if hdmi-codec use the PCM trigger op, whne we turn on the speaker, hdmi-codec's PCM trigger op is also executed, resulting in sound on both devices. Is there another way to control them separately? Thank you.
If you just need power control for one or both devices then the machine driver can add a _PIN_SWITCH() on the output of the device, that'll cause DAPM to keep the device powered down when not in use. That should work well with the suggestion to provide a DAPM callback instead of a a trigger operation.
Yes, we do use a _PIN_SWITCH() on the outout of the device:
static const struct snd_kcontrol_new mt8186_mt6366_rt1019_rt5682s_controls[] = { SOC_DAPM_PIN_SWITCH("Speakers"), SOC_DAPM_PIN_SWITCH("Headphone"), SOC_DAPM_PIN_SWITCH("Headset Mic"), SOC_DAPM_PIN_SWITCH("HDMI1"), };
Which operation should I use to inform bridge driver to control audio on or off? I'm curious why I don't see .trigger in the structure hdmi_codec_ops compared to the structure snd_soc_dai_ops?
************* MEDIATEK Confidentiality Notice ******************** The information contained in this e-mail message (including any attachments) may be confidential, proprietary, privileged, or otherwise exempt from disclosure under applicable laws. It is intended to be conveyed only to the designated recipient(s). Any use, dissemination, distribution, printing, retaining or copying of this e-mail (including its attachments) by unintended recipient(s) is strictly prohibited and may be unlawful. If you are not an intended recipient of this e-mail, or believe
that you have received this e-mail in error, please notify the sender immediately (by replying to this e-mail), delete any and all copies of this e-mail (including any attachments) from your system, and do not disclose the content of this e-mail to any other person. Thank you!