Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932847AbbD0Mkd (ORCPT ); Mon, 27 Apr 2015 08:40:33 -0400 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:44920 "EHLO opensource.wolfsonmicro.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932776AbbD0Mk0 (ORCPT ); Mon, 27 Apr 2015 08:40:26 -0400 Date: Mon, 27 Apr 2015 13:40:19 +0100 From: Richard Fitzgerald To: Mark Brown Cc: lee.jones@linaro.org, linus.walleij@linaro.org, gnurou@gmail.com, myungjoo.ham@samsung.com, cw00.choi@samsung.com, ckeepax@opensource.wolfsonmicro.com, patches@opensource.wolfsonmicro.com, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org Subject: Re: [PATCH 3/8] mfd: arizona: Add support for WM8998 and WM1814 Message-ID: <20150427124019.GA3622@opensource.wolfsonmicro.com> References: <1429619636-25478-1-git-send-email-rf@opensource.wolfsonmicro.com> <1429619636-25478-4-git-send-email-rf@opensource.wolfsonmicro.com> <20150422110808.GU22845@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150422110808.GU22845@sirena.org.uk> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 948 Lines: 24 On Wed, Apr 22, 2015 at 12:08:08PM +0100, Mark Brown wrote: > On Tue, Apr 21, 2015 at 01:33:51PM +0100, Richard Fitzgerald wrote: > > > + switch (arizona->type) { > > + case WM8998: > > + case WM1814: > > + /* Some bits are shifted on WM8998, > > + * rearrange to match the standard bit layout > > + */ > > + val[0] = ((val[0] & 0x60e0) >> 1) | > > + ((val[0] & 0x1e00) >> 2) | > > + (val[0] & 0x000f); > > + break; > > Are you sure this approach is going to scale (and avoid confusion)? It's a total one-off for the WM8998/WM1814, no other codecs have this shifted-bit-position problem. This shouldn't happen for any future codecs, so I don't feel like it's worth over-complicating it. -- 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/