On Tue, Jul 01, 2008 at 05:53:40PM -0600, Grant Likely wrote:

> +static ssize_t aic26_keyclick_show(struct device *dev,
> +                                struct device_attribute *attr, char *buf)
> +{
> +     struct aic26 *aic26 = dev_get_drvdata(dev);
> +     int val, amp, freq, len;
> +
> +     val = aic26_reg_read_cache(&aic26->codec, AIC26_REG_AUDIO_CTRL2);
> +     amp = (val >> 12) & 0x7;
> +     freq = (125 << ((val >> 8) & 0x7)) >> 1;
> +     len = 2 * (1 +((val >> 8) & 0xf));
> +
> +     return sprintf(buf, "amp=%x freq=%iHz len=%iclks\n", amp, freq, len);
> +}

It might be nice if these parameters were exposed as controls if they
can be configured, though obviously that's not essential.

> +     /* Tell the of_soc helper about this codec */
> +     of_snd_soc_register_codec(&aic26_soc_codec_dev, aic26, &aic26_dai,
> +                               spi->dev.archdata.of_node);

Does this need to be ifdefed out if of_snd_soc_register_codec() is not
in use or is the function stubbed out if it's not in use?  Stubbing it
out would be cleaner.
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to