From: Mark Brown <broonie@kernel.org>
To: "Mylène Josserand" <mylene.josserand@bootlin.com>
Cc: lgirdwood@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com,
perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
alexandre.belloni@bootlin.com, thomas.petazzoni@bootlin.com,
michael@amarulasolutions.com
Subject: Re: [PATCH v2 1/2] ASoC: codecs: Add support for PCM1789
Date: Mon, 5 Mar 2018 15:49:10 +0000 [thread overview]
Message-ID: <20180305154910.GJ8588@sirena.org.uk> (raw)
In-Reply-To: <20180305124817.7421-2-mylene.josserand@bootlin.com>
[-- Attachment #1: Type: text/plain, Size: 1566 bytes --]
On Mon, Mar 05, 2018 at 01:48:16PM +0100, Mylène Josserand wrote:
> --- /dev/null
> +++ b/sound/soc/codecs/pcm1789-i2c.c
> @@ -0,0 +1,76 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * PCM1789 ASoC I2C driver
> + *
> + * Copyright (c) Bootlin 2018
> + *
> + * Mylène Josserand <mylene.josserand@bootlin.com>
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
Please don't mix C and C++ style comments in a single comment like this
- it looks unintentional. Just use the same style for the whole thing.
You also don't need to include all the boilerplate with the SPDX header.
> +static bool pcm1789_accessible_reg(struct device *dev, unsigned int reg)
> +{
> + return reg >= PCM1789_MUTE_CONTROL && reg <= PCM1789_DAC_VOL_RIGHT;
> +}
> +
> +static bool pcm1789_writeable_reg(struct device *dev, unsigned int reg)
> +{
> + return pcm1789_accessible_reg(dev, reg);
> +}
> +static void pcm1789_work_queue(struct work_struct *work)
> +{
> + struct pcm1789_private *priv = container_of(work,
> + struct pcm1789_private,
> + work);
> +
> + /* Perform a software reset to remove codec from desynchronized state */
> + if (regmap_update_bits(priv->regmap, PCM1789_MUTE_CONTROL,
> + 0x3 << PCM1789_MUTE_SRET, 0) < 0)
> + dev_err(priv->dev, "Error while setting SRET");
> +}
A reset sounds like we'd also need to resync the register map,
presumably this is something else? The comment could be clearer.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2018-03-05 15:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-05 12:48 [PATCH v2 0/2] ASoC: Add support for DAC PCM1789 Mylène Josserand
2018-03-05 12:48 ` [PATCH v2 1/2] ASoC: codecs: Add support for PCM1789 Mylène Josserand
2018-03-05 15:49 ` Mark Brown [this message]
2018-03-05 15:57 ` Alexandre Belloni
2018-03-05 15:59 ` Mark Brown
2018-03-07 14:34 ` Mylène Josserand
2018-03-05 12:48 ` [PATCH v2 2/2] ASoC: Add bindings " Mylène Josserand
2018-03-07 22:30 ` Rob Herring
2018-03-08 8:54 ` Mylène Josserand
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=20180305154910.GJ8588@sirena.org.uk \
--to=broonie@kernel.org \
--cc=alexandre.belloni@bootlin.com \
--cc=alsa-devel@alsa-project.org \
--cc=devicetree@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=michael@amarulasolutions.com \
--cc=mylene.josserand@bootlin.com \
--cc=perex@perex.cz \
--cc=robh+dt@kernel.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=tiwai@suse.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®