From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Dmitry Artamonow <mad_soft@inbox.ru>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>,
alsa-devel@alsa-project.org, Eric Miao <eric.y.miao@gmail.com>,
linux-kernel@vger.kernel.org, Harald Welte <laforge@gnumonks.org>,
Philipp Zabel <philipp.zabel@gmail.com>,
Paul Parsons <lost.distance@yahoo.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [alsa-devel] [PATCH v2 1/3] ASoC: Asahi Kasei AK4641 codec driver
Date: Mon, 16 May 2011 22:25:34 +0100 [thread overview]
Message-ID: <20110516212533.GA2570@sirena.org.uk> (raw)
In-Reply-To: <1305579805-15617-2-git-send-email-mad_soft@inbox.ru>
On Tue, May 17, 2011 at 01:03:23AM +0400, Dmitry Artamonow wrote:
> A driver for the AK4641 codec used in iPAQ hx4700 and Glofiish M800
> among others.
This looks pretty good - a few small issues realting to the use of old
APIs and coding standards below but nothing serious.
> +static int ak4641_sync(struct snd_soc_codec *codec)
> +{
> + u8 *cache = codec->reg_cache;
> + int i, r = 0;
> +
> + for (i = 0; i < AK4641_CACHEREGNUM; i++)
> + r |= snd_soc_write(codec, i, cache[i]);
> +
> + return r;
> +};
You should be able to use snd_soc_cache_sync() instead of open coding
this. There's also a stray ; in there.
> +
> +static int ak4641_add_widgets(struct snd_soc_codec *codec)
> +{
> + struct snd_soc_dapm_context *dapm = &codec->dapm;
> + snd_soc_dapm_new_controls(dapm, ak4641_dapm_widgets,
> + ARRAY_SIZE(ak4641_dapm_widgets));
> +
> + snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
> +
> + snd_soc_dapm_new_widgets(dapm);
> + return 0;
You should be able to convert these to data based init using the
dapm_widgets and dapm_routes fields in the CODEC driver.
> + u8 mode2 = snd_soc_read(codec, AK4641_MODE2) & ~(0x3 << 5);
Use snd_soc_update_bits() to do a read/modify/write cycle rather than
open coding it - it's clearer and will save writing when there's no
change. A similar thing applies in several of the other DAI operations
and set_bias_level().
next prev parent reply other threads:[~2011-05-16 21:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-16 21:03 [PATCH v2 0/3] ASoC: add support for audio on iPaq hx4700 Dmitry Artamonow
2011-05-16 21:03 ` [PATCH v2 1/3] ASoC: Asahi Kasei AK4641 codec driver Dmitry Artamonow
2011-05-16 21:25 ` Mark Brown [this message]
2011-05-17 4:26 ` [alsa-devel] " Dmitry Artamonow
2011-05-16 21:03 ` [PATCH v2 2/3] ASoC: add iPAQ hx4700 machine driver Dmitry Artamonow
2011-05-16 21:35 ` [alsa-devel] " Mark Brown
2011-05-16 21:03 ` [PATCH v2 3/3] pxa/hx4700: add I2C board info for AK4641 codec Dmitry Artamonow
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=20110516212533.GA2570@sirena.org.uk \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=eric.y.miao@gmail.com \
--cc=laforge@gnumonks.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lost.distance@yahoo.com \
--cc=lrg@slimlogic.co.uk \
--cc=mad_soft@inbox.ru \
--cc=philipp.zabel@gmail.com \
/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
all inboxes | Powered by JetHome®