From patchwork Thu Jul 31 11:58:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 34608 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f69.google.com (mail-qg0-f69.google.com [209.85.192.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1344220792 for ; Thu, 31 Jul 2014 12:18:13 +0000 (UTC) Received: by mail-qg0-f69.google.com with SMTP id a108sf5137326qge.8 for ; Thu, 31 Jul 2014 05:18:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=387hKOQu7Esl0imKClh49vn1PqqlhfCXORVseDjGF5Y=; b=l0mY6zc7O77K/LYxZRuq6URpsCqRlvv4GzoRKQh1ykstYIEfIx2vz+qXU8zZYq8a7J nN4rugzrJWFoc4+clvdiKgGWYRxn8wPa0bnHNbceuViEuys8S6+CfzcWdlZtbpECEalH /w7tLjk2v1V1PBuVeP+1/kFOa51i8raREHcLirTHOIhuhqEbpkq5NTlYBxppnzeCSj80 XPl/F+5vW+q/JrC559Xw1m6dD+X/etF7gTA2BM6gDvs28lJ9rndLVA42KE5ztLKilFEx w4CBlB4wggSn86bdJJJLPOL+fVpHk2TTV/d8nUP8529PhfGhAzDw8KXs6iB27S4wdOlS 7K3w== X-Gm-Message-State: ALoCoQnPqzhkEGvfqweeyNe9ZWoEooiU3Ysa9OKqZdv9oNCI0C3giawk8WF2wuOyHC6eZfrkXqFa X-Received: by 10.236.206.51 with SMTP id k39mr1198492yho.23.1406809092877; Thu, 31 Jul 2014 05:18:12 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.80.36 with SMTP id b33ls963407qgd.68.gmail; Thu, 31 Jul 2014 05:18:12 -0700 (PDT) X-Received: by 10.221.64.80 with SMTP id xh16mr11983870vcb.35.1406809092764; Thu, 31 Jul 2014 05:18:12 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id v10si4177127vdo.17.2014.07.31.05.18.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 31 Jul 2014 05:18:12 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.169 as permitted sender) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id le20so4026556vcb.28 for ; Thu, 31 Jul 2014 05:18:12 -0700 (PDT) X-Received: by 10.52.120.38 with SMTP id kz6mr1305145vdb.86.1406809092685; Thu, 31 Jul 2014 05:18:12 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp13523vcb; Thu, 31 Jul 2014 05:18:12 -0700 (PDT) X-Received: by 10.152.44.129 with SMTP id e1mr11839924lam.91.1406809091625; Thu, 31 Jul 2014 05:18:11 -0700 (PDT) Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id wy1si10982548wjc.74.2014.07.31.05.18.05 for ; Thu, 31 Jul 2014 05:18:06 -0700 (PDT) Received-SPF: none (google.com: alsa-devel-bounces@alsa-project.org does not designate permitted sender hosts) client-ip=77.48.224.243; Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3342F265829; Thu, 31 Jul 2014 14:18:00 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.2.4 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 359DB26563A; Thu, 31 Jul 2014 14:04:51 +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 AAF7B2655F0; Thu, 31 Jul 2014 14:04:49 +0200 (CEST) Received: from mezzanine.sirena.org.uk (mezzanine.sirena.org.uk [106.187.55.193]) by alsa0.perex.cz (Postfix) with ESMTP id A0E83265489 for ; Thu, 31 Jul 2014 13:59:43 +0200 (CEST) Received: from cpc11-sgyl31-2-0-cust672.sgyl.cable.virginm.net ([94.175.94.161] helo=debutante) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XCp0y-0004EY-FK; Thu, 31 Jul 2014 11:59:42 +0000 Received: from broonie by debutante with local (Exim 4.83) (envelope-from ) id 1XCp0v-0001aW-Lu; Thu, 31 Jul 2014 12:59:17 +0100 From: Mark Brown To: Liam Girdwood Date: Thu, 31 Jul 2014 12:58:03 +0100 Message-Id: <1406807898-5927-20-git-send-email-broonie@kernel.org> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1406807898-5927-1-git-send-email-broonie@kernel.org> References: <1406807898-5927-1-git-send-email-broonie@kernel.org> X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk 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) Cc: alsa-devel@alsa-project.org, linaro-kernel@lists.linaro.org, patches@opensource.wolfsonmicro.com, Mark Brown Subject: [alsa-devel] [PATCH 20/35] ASoC: wm8960: Convert to params_width() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: broonie@kernel.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Mark Brown The CODEC doesn't care how data is laid out in memory. Signed-off-by: Mark Brown --- sound/soc/codecs/wm8960.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c index e96349b04ba6..4dc4e85116cd 100644 --- a/sound/soc/codecs/wm8960.c +++ b/sound/soc/codecs/wm8960.c @@ -567,24 +567,21 @@ static int wm8960_hw_params(struct snd_pcm_substream *substream, struct snd_soc_codec *codec = dai->codec; struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); u16 iface = snd_soc_read(codec, WM8960_IFACE1) & 0xfff3; - snd_pcm_format_t format = params_format(params); int i; /* bit size */ - switch (format) { - case SNDRV_PCM_FORMAT_S16_LE: - case SNDRV_PCM_FORMAT_S16_BE: + switch (params_width(params)) { + case 16: break; - case SNDRV_PCM_FORMAT_S20_3LE: - case SNDRV_PCM_FORMAT_S20_3BE: + case 20: iface |= 0x0004; break; - case SNDRV_PCM_FORMAT_S24_LE: - case SNDRV_PCM_FORMAT_S24_BE: + case 24: iface |= 0x0008; break; default: - dev_err(codec->dev, "unsupported format %i\n", format); + dev_err(codec->dev, "unsupported width %d\n", + params_width(params)); return -EINVAL; }