Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Rajeev Kumar <rajeev-dlh.kumar@st.com>
Cc: tiwai@suse.de, alsa-devel@alsa-project.org, lrg@slimlogic.co.uk
Subject: Re: [PATCH V3 1/5] sound: asoc: Adding support for STA529 Audio Codec
Date: Mon, 11 Apr 2011 07:56:22 -0700	[thread overview]
Message-ID: <20110411145621.GA26769@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1302499804-24386-2-git-send-email-rajeev-dlh.kumar@st.com>

On Mon, Apr 11, 2011 at 11:00:00AM +0530, Rajeev Kumar wrote:

> +static const char *op_mode_text[] = { "slave", "master"};

What is op_mode?  This sounds like it should be configured by
set_dai_fmt()...

> +static const struct snd_kcontrol_new sta529_new_snd_controls[] = {
> +	SOC_ENUM("pwm select", pwm_src_enum),
> +	SOC_ENUM("mode select", mode_src_enum),
> +};

ALSA control names are idiomatically things like "PWM Select" with
capitalisation.

> +	/*store the label for powers down audio subsystem for suspend.This is
> +	 ** used by soc core layer*/
> +	codec->bias_level = level;

The formatting of this comment isn't terribly idiomatic.

> +static int sta529_probe(struct snd_soc_codec *codec)
> +{
> +	struct sta529 *sta529 = snd_soc_codec_get_drvdata(codec);
> +	int ret;
> +
> +	codec->hw_write = (hw_write_t)i2c_master_send;
> +	codec->hw_read = NULL;
> +	ret = snd_soc_codec_set_cache_io(codec, 8, 8, sta529->control_type);
> +	if (ret < 0) {
> +		dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
> +		return ret;
> +	}

You shouldn't need to be assigning the I/O functions if you set the
control type.  If the device only supports I2C that can just be hard
coded.

> +static int sta529_resume(struct snd_soc_codec *codec)
> +{
> +	int i;
> +	u8 data[2];
> +	u8 *cache = codec->reg_cache;
> +
> +	for (i = 0; i < ARRAY_SIZE(sta529_reg); i++) {
> +		data[0] = i;
> +		data[1] = cache[i];
> +		codec->hw_write(codec->control_data, data, 2);
> +	}

It looks like you can use the standard cache sync implementation here?
snd_soc_cache_sync().

  parent reply	other threads:[~2011-04-11 17:46 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-11  5:29 [PATCH V3 0/5] Adding ASoC drivers for SPEAr13XX platform Rajeev Kumar
2011-04-11  5:30 ` [PATCH V3 1/5] sound: asoc: Adding support for STA529 Audio Codec Rajeev Kumar
2011-04-11  5:30   ` [PATCH V3 2/5] sound: asoc: Adding support for SPEAr13XX ASoC platform driver Rajeev Kumar
2011-04-11  5:30     ` [PATCH V3 3/5] sound: asoc: Adding support for SPEAr13XX ASoC machine driver Rajeev Kumar
2011-04-11  5:30       ` [PATCH V3 4/5] sound: asoc: Adding Kconfig and Makefile to support SPEAr13XX ASoC driver Rajeev Kumar
2011-04-11  5:30         ` [PATCH V3 5/5] sound: asoc: Adding support for SPEAr13XX in soc Rajeev Kumar
2011-04-11 13:00     ` [PATCH V3 2/5] sound: asoc: Adding support for SPEAr13XX ASoC platform driver Lu Guanqun
2011-04-18  5:00       ` rajeev
2011-04-11 12:53   ` [PATCH V3 1/5] sound: asoc: Adding support for STA529 Audio Codec Lu Guanqun
2011-04-11 13:35     ` Mark Brown
2011-04-11 15:09       ` Lu Guanqun
2011-04-11 23:54         ` Mark Brown
2011-04-12  0:06           ` Lu Guanqun
2011-04-11 14:56   ` Mark Brown [this message]
2011-04-14  9:54     ` Takashi Iwai
2011-04-14 12:18       ` Mark Brown
2011-04-14 12:25         ` Takashi Iwai
2011-04-14 14:19       ` Lu Guanqun
2011-04-14 14:28         ` Lu Guanqun
2011-04-15  9:27           ` Takashi Iwai
2011-04-15 14:10             ` Lu Guanqun
2011-04-15  9:23         ` Takashi Iwai
2011-04-20  4:24     ` rajeev
2011-04-20 10:56       ` Mark Brown
2011-04-20 11:41         ` rajeev
2011-04-20 11:42         ` rajeev
2011-04-11 15:45   ` Lu Guanqun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110411145621.GA26769@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=rajeev-dlh.kumar@st.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox