Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753240AbbEDNPZ (ORCPT ); Mon, 4 May 2015 09:15:25 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:49299 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753166AbbEDNPM (ORCPT ); Mon, 4 May 2015 09:15:12 -0400 Date: Mon, 4 May 2015 12:39:43 +0100 From: Mark Brown To: Richard Fitzgerald Cc: lee.jones@linaro.org, linus.walleij@linaro.org, gnurou@gmail.com, cw00.choi@samsung.com, myungjoo.ham@samsung.com, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, ckeepax@opensource.wolfsonmicro.com Message-ID: <20150504113943.GB15510@sirena.org.uk> References: <1430493319-23808-1-git-send-email-rf@opensource.wolfsonmicro.com> <1430493319-23808-8-git-send-email-rf@opensource.wolfsonmicro.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="K8nIJk4ghYZn606h" Content-Disposition: inline In-Reply-To: <1430493319-23808-8-git-send-email-rf@opensource.wolfsonmicro.com> X-Cookie: Keep refrigerated. User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 86.189.253.62 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH v3 7/8] ASoC: wm8998: Initial WM8998 codec driver X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2184 Lines: 69 --K8nIJk4ghYZn606h Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, May 01, 2015 at 04:15:18PM +0100, Richard Fitzgerald wrote: > + switch (event) { > + case SND_SOC_DAPM_PRE_PMU: > + val = snd_soc_read(codec, ARIZONA_ASRC_RATE1); > + val &= ARIZONA_ASRC_RATE1_MASK; > + val >>= ARIZONA_ASRC_RATE1_SHIFT; > + > + val = snd_soc_read(codec, ARIZONA_SAMPLE_RATE_1 + val); > + if (val >= 0x11) > + dev_warn(codec->dev, "Unsupported ASRC rate1\n"); Shouldn't we be returning an error if the rate is unsupported? It'd also be helpful to log what the invalid value that's been set is. > + val = snd_soc_read(codec, ARIZONA_ASRC_RATE2); > + val &= ARIZONA_ASRC_RATE2_MASK; > + val >>= ARIZONA_ASRC_RATE2_SHIFT; > + val -= 0x8; What if the value we read back is set (invalidly I guess) to less than 8? We'll just read... > + > + val = snd_soc_read(codec, ARIZONA_ASYNC_SAMPLE_RATE_1 + val); > + if (val >= 0x11) > + dev_warn(codec->dev, "Unsupported ASRC rate2\n"); ...some random other register. > +static const char * const wm8998_inmux_texts[] = { > + "A", > + "B", > +}; > + > +static const SOC_ENUM_SINGLE_DECL(wm8998_in1muxl_enum, > + ARIZONA_ADC_DIGITAL_VOLUME_1L, > + ARIZONA_IN1L_SRC_SHIFT, > + wm8998_inmux_texts); Those are some fun input names... --K8nIJk4ghYZn606h Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJVR1p/AAoJECTWi3JdVIfQ/+YH/Ajj2a+CpJDiOruFT/pHURp1 v97sJgk5S68xVyOxr01iBCoZlviEgBMfcgl8TREnS4THeIgvRhRauIsLaBotqZoF 0Z+qPi5KnLzEZZdFzDcZ2K3BDv2mF4s3VH8e9iRV7HI1Rp+plHx5dwO0tyQFmFq5 v/DGF63n4BKfrZ2MmoRdXyBlbQdODzxIh2WO3EgMnAnNe0Jq0nzGy8Ss+ucTpkS8 H1oZyB0A5LMYVxHTXm7Xvi8SMeoFZGh8XHxUcYmgoXr2dOcPcjtdLJatm/44hGA0 L/4HnTvCoV+Pvmxi6Cucxo6o6QqRLE2s/GczmPO8HSnvA+WSQoH1uJpxQsiRAUk= =QNEv -----END PGP SIGNATURE----- --K8nIJk4ghYZn606h-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/