Subject: [PATCH 1/3] ASoC: tegra: add tegra sgtl5000 machine driver

From: [email-masked] (Stephen Warren)
Date: Wed, 10 Sep 2014 11:01:32 -0600

On 09/09/2014 12:00 PM, Fabio Estevam wrote:
> On Tue, Sep 9, 2014 at 12:28 PM, Marcel Ziswiler <[email-masked]> wrote:
>> This binding and driver describe/support playback to headphones, and
>> capture from line-in and microphone.
>>
>> This driver is useful for the Toradex Apalis T30 and Colibri T30 modules.
>>
>> Signed-off-by: Marcel Ziswiler <[email-masked]>
>> ---
>>   .../bindings/sound/nvidia,tegra-audio-sgtl5000.txt |  45 +++++
>>   sound/soc/tegra/Kconfig                            |  10 +
>>   sound/soc/tegra/Makefile                           |   2 +
>>   sound/soc/tegra/tegra_sgtl5000.c                   | 216 +++++++++++++++++++++
>
> What about using the simple-audio-card binding instead of adding the
> tegra_sgtl5000 machine driver?
>
> An example of simple-audio-card used with sgtl5000 can be found here:
>
> http://www.spinics.net/lists/devicetree/msg44466.html

I don't think that will work; the Tegra audio complex requires some 
clock management that doesn't immediately seem to fit into the 
simple-audio-card concept.

I had intended to refactor and collapse all the Tegra DT audio bindings 
(and driver code) into a single instance so we didn't need to keep 
adding more and more. However, I unfortunately never got around to that 
and probably won't in the future either. Basically, the binding and code 
would end up essentially identical to any of the current Tegra drivers 
(or the union of them), with a few tweaks such as only creating e.g. a 
headphone jack if a property in DT said to, and moving the sampling 
frequency -> CODEC MCLK table out of the driver into a table in DT. I 
think with those things parameterized in DT, we could get away with a 
single "nvidia,tegra-audio-simple" binding and driver. Such a new 
binding could be based on simple-audio-card with extensions though.