From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: leon@leon.nu
Cc: alsa-devel@alsa-project.org, Andrey Danin <danindrey@mail.ru>,
lrg@ti.com
Subject: Re: [PATCH v4] ASoC: Add new Realtek ALC5632 CODEC driver.
Date: Thu, 10 Nov 2011 12:11:09 +0000 [thread overview]
Message-ID: <20111110121108.GC3832@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <4eb51219.8238df0a.64ec.ffffdb00@mx.google.com>
On Sat, Nov 05, 2011 at 12:38:02PM +0200, leon@leon.nu wrote:
> From: Leon Romanovsky <leon@leon.nu>
>
> This driver implements basic functionality, using I²C for the control
> channel.
This is mostly looking good so I've applied it to save on review time
but there are a few fairly minor issues which you really should address
in follow on patches
> +static int alc5632_mute(struct snd_soc_dai *dai, int mute)
> +{
> + struct snd_soc_codec *codec = dai->codec;
> + u16 hp_mute = ALC5632_MISC_HP_DEPOP_MUTE_L \
> + |ALC5632_MISC_HP_DEPOP_MUTE_R;
No need for the \ here.
> +#define ALC5632_ADC_REC_GAIN_COMP(x) (int)((x - ALC5632_ADC_REC_GAIN_BASE) \
> + / ALC5632_ADC_REC_GAIN_STEP)
> +
> +#define ALC5632_MIC_BOOST_COMP(x) (int)(x / ALC5632_MIC_BOOST_STEP)
> +
> +#define ALC5632_SPK_OUT_VOL_COMP(x) (int)(x / ALC5632_SPK_OUT_VOL_STEP)
These aren't used and should probably be deleted.
> +static int alc5632_i2c_probe(struct i2c_client *client,
> + const struct i2c_device_id *id)
> +{
> + struct alc5632_priv *alc5632;
> + int ret, vid1, vid2;
> +
> + vid1 = i2c_smbus_read_word_data(client, ALC5632_VENDOR_ID1);
> + if (vid1 < 0) {
> + dev_err(&client->dev, "failed to read I2C\n");
> + return -EIO;
> + } else {
> + dev_info(&client->dev, "got vid1: %x\n", vid1);
> + }
> + vid1 = ((vid1 & 0xff) << 8) | (vid1 >> 8);
Ideally you should convert the driver over to work with the regmap API
and make use of the cache code it provides. This is going to be
required at some point in the future and would mean that you could use
the same register I/O functionality here where you're identifying the
device (which is definitely good practice).
I'd also do an initial device reset here to make sure that in the
interval between the driver registering and ASoC starting the hardware
is in a known good state.
next prev parent reply other threads:[~2011-11-10 12:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-05 10:38 [PATCH v4] ASoC: Add new Realtek ALC5632 CODEC driver leon
2011-11-10 12:11 ` Mark Brown [this message]
2011-11-10 12:35 ` Leon Romanovsky
2011-11-10 13:03 ` Mark Brown
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=20111110121108.GC3832@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=danindrey@mail.ru \
--cc=leon@leon.nu \
--cc=lrg@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.