lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 5 Mar 2018 15:49:10 +0000
From:   Mark Brown <broonie@...nel.org>
To:     Mylène Josserand <mylene.josserand@...tlin.com>
Cc:     lgirdwood@...il.com, robh+dt@...nel.org, mark.rutland@....com,
        perex@...ex.cz, tiwai@...e.com, alsa-devel@...a-project.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        alexandre.belloni@...tlin.com, thomas.petazzoni@...tlin.com,
        michael@...rulasolutions.com
Subject: Re: [PATCH v2 1/2] ASoC: codecs: Add support for PCM1789

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@...tlin.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.

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ