[alsa-devel] [PATCH RFC 1/3] ASoC: uda1380: use callbacks instead of gpiolib

Mark Brown broonie at opensource.wolfsonmicro.com
Sat Jun 26 22:09:39 CEST 2010


On 26 Jun 2010, at 17:53, Vasily Khoruzhick wrote:

> В сообщении от 26 июня 2010 19:40:37 автор Mark Brown написал:

>> This is fine but it'd be really nice to preserve the use of GPIOs since
>> that will cover the majority of machines - for example, by providing a
>> default callback if none is provided and GPIOs are. This will also
>> avoid the need to update existing machine drivers (which needs to be
>> done otherwise).

> The only machine that uses uda1380 and supported by mainline kernel is 
> magician, rx1950 and h1940 sound support is not merged yet, so that's not a 
> problem to perform that change.

It's not just the hassle, it's also the fact that all these machine drivers will end
up duplicating the code. This feels like a step back for machines other than
yours.

>> However, I do wonder if the more complex set_power() callbacks might
>> not just end up as regulator API consumers?

> Is it really necessary? Plain callback perfectly fits here, and same approach 
> is used for s3cmci driver. For example, rx1950_uda1380_set_power is not 
> complex and looks like this:

The regulator API isn't massively complex either and it does provide a standard
abstraction for controlling power which seems like it might be useful here,
though given the (frankly rather odd) fiddling with clocks your callback does
perhaps it won't help.


More information about the Alsa-devel mailing list