From patchwork Wed Aug 13 12:39:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 4718921 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 04F729F375 for ; Wed, 13 Aug 2014 12:39:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2F9A02015A for ; Wed, 13 Aug 2014 12:39:23 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 0C65A2012B for ; Wed, 13 Aug 2014 12:39:22 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id A76B02655B3; Wed, 13 Aug 2014 14:39:20 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id AA105265561; Wed, 13 Aug 2014 14:39:09 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id C0D5F265561; Wed, 13 Aug 2014 14:39:08 +0200 (CEST) Received: from opensource.wolfsonmicro.com (opensource.wolfsonmicro.com [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id 9377F265531 for ; Wed, 13 Aug 2014 14:39:00 +0200 (CEST) Received: by opensource.wolfsonmicro.com (Postfix, from userid 1022) id 23B391110EA; Wed, 13 Aug 2014 13:39:00 +0100 (BST) Date: Wed, 13 Aug 2014 13:39:00 +0100 From: Charles Keepax To: Mark Brown Message-ID: <20140813123900.GL15833@opensource.wolfsonmicro.com> References: <1407926840-8576-1-git-send-email-nikesh@opensource.wolfsonmicro.com> <20140813110844.GF15833@opensource.wolfsonmicro.com> <20140813113841.GP17528@sirena.org.uk> <20140813121637.GH15833@opensource.wolfsonmicro.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140813121637.GH15833@opensource.wolfsonmicro.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) Cc: alsa-devel@alsa-project.org, tiwai@suse.de, patches@opensource.wolfsonmicro.com, lgirdwood@gmail.com, Nikesh Oswal , linux-kernel@vger.kernel.org Subject: Re: [alsa-devel] [PATCH] ASoC: wm_hubs: Fix DC Servo readback X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, Aug 13, 2014 at 01:16:37PM +0100, Charles Keepax wrote: > On Wed, Aug 13, 2014 at 12:38:41PM +0100, Mark Brown wrote: > > On Wed, Aug 13, 2014 at 12:08:44PM +0100, Charles Keepax wrote: > > > On Wed, Aug 13, 2014 at 11:47:20AM +0100, Nikesh Oswal wrote: > > > > > > case 2: > > > > dcs_reg = WM8994_DC_SERVO_4E; > > > > break; > > > > - case 1: > > > > - dcs_reg = WM8994_DC_SERVO_READBACK; > > > > - break; > > > > default: > > > > dcs_reg = WM8993_DC_SERVO_3; > > > > break; > > > > > This doesn't look right, firstly if it is the same register for > > > all versions then surely we should change the code that sets > > > dcs_readback_mode rather than setting that to different values > > > but treating them the same. Although obviously if nothing still > > > uses this case we could remove it as well. > > > > > Also I think the situation is more complex for example on version > > > 4.4 of the datasheet for wm8994 the WR_VAL fields appear to be in > > > register 59h. Which is not consistent with this. > > > > There was a change in the DC servo between revisions of the WM8994 (at > > revision E from the look of the code). This isn't documented in the > > datasheets as they only document current silicon. > > Indeed, but this patch sets all revs of wm8994 to use register 57h. > The lastest version of the datasheet has this register at 59h > although some of the older versions of the datasheet (which likely > match some older revs of the chip although no way to tell which one > just from the datasheet) have it at 57h. > > I think basically we need to get some clarity from hardware here > on which revs use which address and update this patch to match, > but either way it looks likely that this patch doesn't address > the whole picture. Sorry no ignore me I am talking non-sense here. It still treats the newer revs correctly, I suspect this might be a nice change though: Thanks, Charles --- a/sound/soc/codecs/wm_hubs.c +++ b/sound/soc/codecs/wm_hubs.c @@ -209,7 +209,7 @@ static int wm_hubs_read_dc_servo(struct snd_soc_codec *codec, dcs_reg = WM8994_DC_SERVO_4E; break; case 1: - dcs_reg = WM8994_DC_SERVO_READBACK; + dcs_reg = WM8994_DC_SERVO_4; break;