From patchwork Tue Jul 19 22:36:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 9238387 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B001C602F0 for ; Tue, 19 Jul 2016 22:36:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A18072624C for ; Tue, 19 Jul 2016 22:36:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 96358277D9; Tue, 19 Jul 2016 22:36:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D687A2624C for ; Tue, 19 Jul 2016 22:36:16 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3A4152659FE; Wed, 20 Jul 2016 00:36:14 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id A4067265885; Wed, 20 Jul 2016 00:36:06 +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 11455265892; Wed, 20 Jul 2016 00:36:04 +0200 (CEST) Received: from mail-pa0-f67.google.com (mail-pa0-f67.google.com [209.85.220.67]) by alsa0.perex.cz (Postfix) with ESMTP id C803E2657B1 for ; Wed, 20 Jul 2016 00:35:57 +0200 (CEST) Received: by mail-pa0-f67.google.com with SMTP id ez1so2043330pab.3 for ; Tue, 19 Jul 2016 15:35:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=tBiosW81v9gMg49HvBx3PdDsZT8YkPOP8zQc8P6wa7Q=; b=qFcUQ5Vu9N8sGONGm7XNtXubgCKyYuDYPKnqEnHOdwTKHaiTDS8tdkGxHpJyGEINth hMKO/8tU8bpUZdANXGb8XJVBs4ikRnc84Ci5KkuwRUmSp/uwyQPCRmxVtrNT0Wm3RWl7 +3ygAcBWVaOAWc+Ug1Lp1snFDGs3xHAlx2vWmx4MyHungxx7HvEFa1gi6L9ovTstQjAg X1LfPHMi4lISgj2QdBjIt795egPRaC9GSAEAJqkuoPDbA4jmaCIX7Tm8o2jWZJD5goyy aWgOb17QEduITVw3Edm+YfZyAVhvE+ZC9xfyr80KMT25Lv9iW9nVdTWgmmKBIRoaU+yx yBSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=tBiosW81v9gMg49HvBx3PdDsZT8YkPOP8zQc8P6wa7Q=; b=h/R96CeYfq3YVTnPW4PN/lFf3XgyfP9a1rgXiEyPcbQh47RQtYnz/ayJ0+wWDVPQgR azntcVLSvWiIcQ/20+HafEViNeQmcixS/MVZMTawc4PnApFGrRP904d4RtjWXsGCuFA9 WFgdWNj1j3txC0lKIg/QjOzrY65fUIcrcmpLU+2xyMfFxqhtIvsKZUdBc84xkiOAdpXW 2Ad4mF0qUCrsW9Gjtf4Y4HoYbckxjM2R9FZ9KHEWDAvfNB6YqIDi/tlrEpWUmAXnv9RT XRhPr4HzOTzmrv8GHqNziNAcrnOzMm5oTnroNmcEDkBoGxL9bzFvKL9GA+BzSoy+fiRt YGDA== X-Gm-Message-State: ALyK8tK9gMZKutYKDpRcoOgSXTAkwXgoekHvewByX1sqInISl/7rTyBdEGcveZqI+xs/eA== X-Received: by 10.66.65.109 with SMTP id w13mr70618514pas.142.1468967756236; Tue, 19 Jul 2016 15:35:56 -0700 (PDT) Received: from Asurada-Nvidia.nvidia.com (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id j7sm7503094paa.30.2016.07.19.15.35.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jul 2016 15:35:55 -0700 (PDT) From: Nicolin Chen To: broonie@kernel.org Date: Tue, 19 Jul 2016 15:36:13 -0700 Message-Id: <1468967774-18621-1-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.1.4 Cc: brian.austin@cirrus.com, alsa-devel@alsa-project.org, lgirdwood@gmail.com, Paul.Handrigan@cirrus.com, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH 1/2] ASoC: cs53l30: Fix a bug for TDM slot location validation 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The maximum slot number of CS53L30 is 4 while it should support the situation that's less than 4 channels based on the rx_mask. So when the driver validates the last slot location, it should check the last active slot instead of always the 4th one. Signed-off-by: Nicolin Chen --- sound/soc/codecs/cs53l30.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/cs53l30.c b/sound/soc/codecs/cs53l30.c index 5988b5c..fd5502e 100644 --- a/sound/soc/codecs/cs53l30.c +++ b/sound/soc/codecs/cs53l30.c @@ -809,8 +809,8 @@ static int cs53l30_set_dai_tdm_slot(struct snd_soc_dai *dai, return -EINVAL; } - /* Validate the last CS53L30 slot */ - slot_next = loc[CS53L30_TDM_SLOT_MAX - 1] + slot_step - 1; + /* Validate the last active CS53L30 slot */ + slot_next = loc[i - 1] + slot_step - 1; if (slot_next > 47) { dev_err(dai->dev, "slot selection out of bounds: %u\n", slot_next);