Received: by 10.223.185.116 with SMTP id b49csp2730540wrg; Mon, 5 Mar 2018 07:51:49 -0800 (PST) X-Google-Smtp-Source: AG47ELvcIKePpyjqSls2KYaiMuRHuwhxSKCaem+zg0ySbXKs5MYAHMtL3OS/88T4ctCEZLNiakP3 X-Received: by 10.98.237.12 with SMTP id u12mr15682320pfh.72.1520265109742; Mon, 05 Mar 2018 07:51:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520265109; cv=none; d=google.com; s=arc-20160816; b=UJLJO77+1iPsEKvnSAlNZI5UaL82USr13YccRRlTVJGyjN9uvnoHjqbohxEwWW4cvZ LCYxfHeDuxx4f/LJNAdfVJKMBwZWQHNvv0QnHgX/mR0kCnlbjyzRgQd9+5gXC2NL+GtT w9GWy/9vAOtt/j/7THZaIlBp0Utf0EBW4Igs1cYt8bgjFW3bxBYOrwRf4HoM6shFjeJB BDiLsstqkfhg6tR+mlnaDSBQI+IVPtsLGk8vytH9Wos9IXhEeGr5jVI1RSWK4Gyrz6Eu 8/N7cmhYroZeYT5pVT+GZGZBIqlc0LbCC4V6tO1Hy1q8VyBerKuHS8HS75Y+GGb2SwkR sHMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=hmzSTiItHO+rUT79mhOknuObvmmrOLEDKfkOcuK9kqw=; b=zSaKXOg1xFeGqrnUomvXK4IDaZ9b/3YjEO1pw7QekEeZ+jDNz6tH8f0eRZkCvYwUDP xRzEBm5c/aAv6fWBqpYy/Be+ZWdMZveEK0qPonnEfpnSf0Xf7enP9dxmWcSUShIBKCZf 79v4MAwsC490rrwSxNsI1RIwxoNpiqxMFBpRKs0DUI1M3KaRB04YWm/VbYeRavPYzRKB +5FbtDACqo5xK1rqPCtfww8X8pdDj7tFh5VDLAKfUfEMnbLjS9sH/ueMcTrET5SEO8QZ RgO/uKzfSebGl+Ahlley+6dx6/XTmafU7QAiL12f7tDh2mI/lLKbBJEMefrMyqkJOxko xV8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=dvY1cVt+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j63si8429823pgd.731.2018.03.05.07.51.35; Mon, 05 Mar 2018 07:51:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=dvY1cVt+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752307AbeCEPt0 (ORCPT + 99 others); Mon, 5 Mar 2018 10:49:26 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:32804 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751311AbeCEPtY (ORCPT ); Mon, 5 Mar 2018 10:49:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hmzSTiItHO+rUT79mhOknuObvmmrOLEDKfkOcuK9kqw=; b=dvY1cVt+493KD/GKrkBdq+igq h2HZYKtx34ikvqVaNpqguWabMz5ooPcvAQ0k5PJePTJ5/y/Q/JuuLKWZDQOd+ZAkKZoMPdsgw0xit iIgzRm/R48L+xwZ7kQkw2Lin9gxxkBUc7r/8BM7QFejGsKMoWuWaU95AeTVAWK2wvMS+U=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1essMR-0005jS-5k; Mon, 05 Mar 2018 15:49:11 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1essMQ-0004eE-Ji; Mon, 05 Mar 2018 15:49:10 +0000 Date: Mon, 5 Mar 2018 15:49:10 +0000 From: Mark Brown To: =?iso-8859-1?Q?Myl=E8ne?= Josserand 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 Message-ID: <20180305154910.GJ8588@sirena.org.uk> References: <20180305124817.7421-1-mylene.josserand@bootlin.com> <20180305124817.7421-2-mylene.josserand@bootlin.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="n8884J15jRwcBTvu" Content-Disposition: inline In-Reply-To: <20180305124817.7421-2-mylene.josserand@bootlin.com> X-Cookie: Do not write below this line. User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --n8884J15jRwcBTvu Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 05, 2018 at 01:48:16PM +0100, Myl=E8ne 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=E8ne Josserand > + * > + * 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 >=3D PCM1789_MUTE_CONTROL && reg <=3D 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 =3D 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. --n8884J15jRwcBTvu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlqdZvUACgkQJNaLcl1U h9ArPgf/doY6KKkVX5LZMkHvKd+IQYpFQit1dIzFg1IQEU63IJnFwKu29BMIVMk0 8czRzrLQQkM/S9+vEHqRYLJYUjAVZFA0I1QeVsc504gnIHl9eDLZE0heXbOTWkpu rN6lTw8+7t8rm9b1wPnp8SXsqWM+3NaF+Kc02T0bvb2xW+gM/gYvYDqfM2oV2Kfm 267+/ekaYiYGolHbFlK6zmyH/2EyawKnDXQw5dTJ9dA9AlyYXMKFFoiigBVzcYFM GK6R7PRZqCPj44nUBsGirId6WeE7CJU+DI9ZAZRIBugJrcsuS0+oxuafBkhkaUZH BmjWvGV7wGXis0ecQ3munLn5Bsw/Bg== =+ja3 -----END PGP SIGNATURE----- --n8884J15jRwcBTvu--