![](https://secure.gravatar.com/avatar/d28dfe03ea754ea1153719f4ced12649.jpg?s=120&d=mm&r=g)
14 Sep
2009
14 Sep
'09
7:25 p.m.
On Mon, Sep 14, 2009 at 12:00:34PM -0500, Lopez Cruz, Misael wrote:
+static int twl6030_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
unsigned int freq_in, unsigned int freq_out)
+{
- struct snd_soc_codec *codec = codec_dai->codec;
- struct twl6030_priv_data *twl6030_priv = codec->private_data;
- int div;
- if (!freq_in || !freq_out)
return -EINVAL;
This is normally supported in order to allow the PLL to be stopped for power saving - an output of zero means turn the PLL off.
- twl6030_priv = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL);
- if (twl6030_priv == NULL) {
ret = -ENOMEM;
goto priv_err;
- }
The sizeof() looks wrong here, especially given that you're not actually embedding the snd_soc_codec in the private data (though that's a good idea to save doing two allocations).
/* LPPLLCTL (0x08) fields */
#define TWL6030_LPLLENA 0x01 #define TWL6030_LPLLRST 0x02 #define TWL6030_LPLLSEL 0x04 -#define TWL6030_FIN 0x08 +#define TWL6030_LPLLFIN 0x08 #define TWL6030_HPLLSEL 0x10
I guess that should be squashed into the first patch?