All of lore.kernel.org
 help / color / mirror / Atom feed
* The best practice to tie platform DAPM widget and codec pin
@ 2014-09-12  4:04 Anatol Pomozov
  2014-09-12 14:57 ` Mike Looijmans
  0 siblings, 1 reply; 3+ messages in thread
From: Anatol Pomozov @ 2014-09-12  4:04 UTC (permalink / raw)
  To: alsa-devel; +Cc: oder_chiou, bardliao

Hi

I bringing up a board that has Realtek 5677 codec. The codec has 6
gpios and two of them are used by the board. pin3 is used to enable
headphones amplifier. pin2 is used to gate DMIC clock for 3 of 4 DMICs
- it allows to leave only one DMIC working in low-power mode.

Now I need to configure the codec that when "Headphones" audio path is
enabled then pin3 should go high. The same true for DMIC/pin2. I was
looking for existing similar solutions but cannot find one.

I need something similar to SND_SOC_DAPM_REGULATOR_SUPPLY that allows
to turn on/off part of the system. But instead of manipulating a
voltage regulator I just need to set/unset codec's gpio. What would be
the best way to achieve it?

The problem here is that codec does not know which of the outputs
(LOUT1, LOUT2, LOUT3) corresponds to headphones. It is configured as
audio path in *.dts file.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: The best practice to tie platform DAPM widget and codec pin
  2014-09-12  4:04 The best practice to tie platform DAPM widget and codec pin Anatol Pomozov
@ 2014-09-12 14:57 ` Mike Looijmans
  2014-09-13  8:12   ` Anatol Pomozov
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Looijmans @ 2014-09-12 14:57 UTC (permalink / raw)
  To: alsa-devel

On 09/12/2014 06:04 AM, Anatol Pomozov wrote:
> Hi
>
> I bringing up a board that has Realtek 5677 codec. The codec has 6
> gpios and two of them are used by the board. pin3 is used to enable
> headphones amplifier. pin2 is used to gate DMIC clock for 3 of 4 DMICs
> - it allows to leave only one DMIC working in low-power mode.
>
> Now I need to configure the codec that when "Headphones" audio path is
> enabled then pin3 should go high. The same true for DMIC/pin2. I was
> looking for existing similar solutions but cannot find one.
>
> I need something similar to SND_SOC_DAPM_REGULATOR_SUPPLY that allows
> to turn on/off part of the system. But instead of manipulating a
> voltage regulator I just need to set/unset codec's gpio. What would be
> the best way to achieve it?

You can "convert" gpios to supply regulators using a "fixed" regulator 
driver (instantiated in the devicetree, or platform code on older kernels).

>
> The problem here is that codec does not know which of the outputs
> (LOUT1, LOUT2, LOUT3) corresponds to headphones. It is configured as
> audio path in *.dts file.
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>


-- 
Mike Looijmans

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: The best practice to tie platform DAPM widget and codec pin
  2014-09-12 14:57 ` Mike Looijmans
@ 2014-09-13  8:12   ` Anatol Pomozov
  0 siblings, 0 replies; 3+ messages in thread
From: Anatol Pomozov @ 2014-09-13  8:12 UTC (permalink / raw)
  To: Mike Looijmans; +Cc: alsa-devel

Hi

On Fri, Sep 12, 2014 at 7:57 AM, Mike Looijmans <mike.looijmans@topic.nl> wrote:
> On 09/12/2014 06:04 AM, Anatol Pomozov wrote:
>>
>> Hi
>>
>> I bringing up a board that has Realtek 5677 codec. The codec has 6
>> gpios and two of them are used by the board. pin3 is used to enable
>> headphones amplifier. pin2 is used to gate DMIC clock for 3 of 4 DMICs
>> - it allows to leave only one DMIC working in low-power mode.
>>
>> Now I need to configure the codec that when "Headphones" audio path is
>> enabled then pin3 should go high. The same true for DMIC/pin2. I was
>> looking for existing similar solutions but cannot find one.
>>
>> I need something similar to SND_SOC_DAPM_REGULATOR_SUPPLY that allows
>> to turn on/off part of the system. But instead of manipulating a
>> voltage regulator I just need to set/unset codec's gpio. What would be
>> the best way to achieve it?
>
>
> You can "convert" gpios to supply regulators using a "fixed" regulator
> driver (instantiated in the devicetree, or platform code on older kernels).

In my case it is not a system gpio, it is an audio codec pin. To
configure these pins I need to program codec (rt5677) registers. Pins
drive devices like headphones amp.

To convert the pins to gpio devicetree object I need to implement a
driver similar to gpio-tegra.c. The driver will expose rt5677 pins as
gpio. And then use fixed-regulator. Do I understand your proposal
correctly?

Is there an easier way?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-13  8:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-12  4:04 The best practice to tie platform DAPM widget and codec pin Anatol Pomozov
2014-09-12 14:57 ` Mike Looijmans
2014-09-13  8:12   ` Anatol Pomozov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.