[alsa-devel] [PATCH 1/2] ASoC WM8753 codec support.

Takashi Iwai tiwai at suse.de
Mon Apr 16 17:03:39 CEST 2007


At Mon, 16 Apr 2007 15:46:05 +0100,
Liam Girdwood wrote:
> 
> This patch series adds support for the WM8753 codec as found on the
> OpenMoko Neo 1973 (other Neo 1973 and Samsung S3C24xx patches to follow
> today) as well other new devices.
> 
> Features:-
> 
>  o HiFi and Voice DAI supported (inc runtime switching of DAI mode)
>  o DAPM
>  o All mixers
>  o PLL calculator
>  o 16,20 and 24bit samples.
>  o WM8753 I2C ID added to include/linux/i2c-id.h
> 
> Signed-off-by: Harald Welte <laforge at openmoko.org>
> Signed-off-by: Graeme Gregory <gg at opensource.wolfsonmicro.com>
> Signed-off-by: Seth Forshee <seth.forshee at gmail.com>
> Signed-off-by: Liam Girdwood <lg at opensource.wolfsonmicro.com>

Am I correct to understand that Harald is the patch author?


> +static int caps_charge = 2000;
> +module_param(caps_charge, int, 0);

Don't want to export to sysfs?

> +static const struct soc_enum wm8753_enum[] = {
> +SOC_ENUM_SINGLE(WM8753_BASS, 7, 2, wm8753_base),		// 0

Avoid C++ style comments.


> +static void pll_factors(struct _pll_div *pll_div, unsigned int target,
> +	unsigned int source)
> +{
> +	unsigned long long Kpart;

u64 is better here.

> +static int wm8753_set_dai_pll(struct snd_soc_codec_dai *codec_dai,
> +		int pll_id, unsigned int freq_in, unsigned int freq_out)
> +{
(snip)
> +	} else {
> +
> +        u16 value = 0;
> +        struct _pll_div pll_div;
> +
> +		pll_factors(&pll_div, freq_out * 8, freq_in);
> +
> +        /* set up N and K PLL divisor ratios */
> +        /* bits 8:5 = PLL_N, bits 3:0 = PLL_K[21:18] */
> +        value = (pll_div.n << 5) + ((pll_div.k & 0x3c0000) >> 18);
> +        wm8753_write(codec, WM8753_PLL1CTL2 + offset, value);
> +
> +        /* bits 8:0 = PLL_K[17:9] */
> +        value = (pll_div.k & 0x03fe00) >> 9;
> +        wm8753_write(codec, WM8753_PLL1CTL3 + offset, value);
> +
> +        /* bits 8:0 = PLL_K[8:0] */
> +        value = pll_div.k & 0x0001ff;
> +        wm8753_write(codec, WM8753_PLL1CTL4 + offset, value);
> +
> +        /* set PLL as input and enable */
> +        wm8753_write(codec, WM8753_PLL1CTL1 + offset, 0x0027 |
> +        	(pll_div.div2 << 3));
> +		wm8753_write(codec, WM8753_CLOCK, reg | enable);

Broken indentations...


Takashi


More information about the Alsa-devel mailing list