[alsa-devel] [PATCH 2/3] sound: soc: fsl: Add support for Novena onboard audio

Sean Cross xobs at kosagi.com
Sat Feb 8 09:27:19 CET 2014


On 8/2/14 2:14 AM, Mark Brown wrote:
> On Fri, Feb 07, 2014 at 01:05:16PM +0800, Sean Cross wrote:
>> Novena uses an ES8328 audio codec connected via I2S.
> 
> The CODEC looked pretty simple, can this use simple-card?

I had never heard of simple-card.  It doesn't look like it supports
device tree.  Novena doesn't have a platform definition, and we run
entirely using DT.  If simple-card can work without a platform
definition, then we can use it.  Otherwise, it's nearly identical to
imx-sgtl5000.c, with the exception of the code you called out.

>> +	/* Headphone jack detection */ +	if
>> (gpio_is_valid(data->jack_gpio)) { +		ret =
>> snd_soc_jack_new(rtd->codec, "Headset", +
>> SND_JACK_HEADSET | SND_JACK_BTN_0, +				       &headset_jack); +
>> if (ret) +			return ret; + +		headset_jack_gpios[0].gpio =
>> data->jack_gpio; +		ret = snd_soc_jack_add_gpios(&headset_jack, +
>> ARRAY_SIZE(headset_jack_gpios), +					     headset_jack_gpios); +
>> }
> 
> We'd need to add support for this but that shouldn't be too hard.

It does seem simple.  I could imagine specifying the jack in a device
tree file, and mapping it to a GPIO.

Can you think of why this would oops on removal?  If I disable
headphone jack detection (by simply making data->jack_gpio an invalid
gpio), the module removes cleanly.

>> +static int imx_set_frequency(struct imx_novena_data *data, int
>> freq) { +	int ret; + +	ret = clk_set_parent(data->system_cko,
>> data->codec_clk); +	if (ret) { +		dev_err(data->dev, "unable to
>> set clk output"); +		return ret; +	} + +	ret =
>> clk_set_parent(data->codec_clk_sel, data->codec_clk_post_div); +
>> if (ret) { +		dev_err(data->dev, "unable to set clk parent"); +
>> return ret; +	}
> 
> There's supposed to be support for this sort of thing going into
> the clock API with some sort of generic binding.

Can you direct me to this patch?  Is it supposed to be defined in the
device tree file?  As of right now, the clock is hardcoded to 24 MHz
in clk-imx6q.c, which is why we need to change it here.



More information about the Alsa-devel mailing list