Hi
Here is reiteration from my previous question [1]
I have following task. I have realtek rt5677 codec. Codec has 6 pins. Some of the pins are configured as output and used to manipulate part of audio routing subsystem. In my case one pin enables headphones amp, another pin gates DMIC clock.
I can easily do it by hard-coding this logic to rt5677 driver. Now I an trying to pull this board-specific logic out of the codec driver code and move it to device tree.
I was told (without much explanation) to do it either 2 ways:
1) export codec pins as gpio and then create fixed regulator and tie it to codec via SND_SOC_DAPM_REGULATOR_SUPPLY. I sent a question [1] to clarify if it is the right way.
2) create ALSA controls for pins. I believe it means I need to create controls with names "GPIO1", "GPIO2"..."GPIO6" and then use as part of audio_routing list.
What is the right way to achieve my goal. Are there examples of configuration similar to mine? I am sure it is an easy task that was already implemented by someone, but I can't google any useful result.