From patchwork Thu Dec 24 10:06:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 11989405 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47DC7C433E0 for ; Thu, 24 Dec 2020 10:08:20 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 30C552168B for ; Thu, 24 Dec 2020 10:08:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 30C552168B Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (unknown [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A103117F9; Thu, 24 Dec 2020 11:07:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A103117F9 Authentication-Results: alsa0.perex.cz; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="t+z39E2b" Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3758EF80234; Thu, 24 Dec 2020 11:06:27 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D940BF80264; Thu, 24 Dec 2020 11:06:25 +0100 (CET) Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 213F4F80232 for ; Thu, 24 Dec 2020 11:06:19 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 213F4F80232 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="t+z39E2b" Received: by mail-yb1-xb49.google.com with SMTP id b131so2722617ybc.3 for ; Thu, 24 Dec 2020 02:06:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=ZYYrAWwbkxeayAzkRubBQLJLquwO6POPrmwFlXil8ko=; b=t+z39E2b76LHvZE37y4WSBn4SH8RT9Tq7+7TEQFmcafgvV0eKKMyxl/Qw2Geu9ytB5 EcDAj8MvCVDe0c9l4BvyUV4QjfVrM+v1eUOsX4LzlfckQKEDyyOT9+xl32Fz28unJj0F 5gNJTDnVxamE5fxQST2M8Z4xYTRL6Bi/qQ2ou3I6tqfn+YS4YrkTMZLb/jimjz0riruw Kif5qaA9U1QDlwEO5PxKqDaYZ28QeUu6g1NJEWxVE3KpcBSOBNM/i6x5mo4AspSoNfjv yVBjVcZIv+fcTZ858OrosW+mxAK/W3ZOaLlkdN/74QlpEZzrJeQFQ/Cd6YxS9yWB4q8E Axpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=ZYYrAWwbkxeayAzkRubBQLJLquwO6POPrmwFlXil8ko=; b=LVJVt1n0tBRqiaJfH2QvhdrsGZ4AqhQVYYjT/M7swJwDwuZsd6EwJJeNMos5zqLMWk AVUHZRObbKVrExI8bOOGjAwkOaVDHj0NZiVIIA2IYKi10J6YLQWknuo4uNKDI3No8vvx ZIWxrlW2dZdOCR9LmypWi80e4VvfmwSebDfB7MUMkweTaYQuoqtF8YPQvmWLGa9BDDIY WxCOgFH0LGx2CCya77AkW1BiZs7uhuUYjwnmJyV8lmCxXuKOtMVZFKwGCq3dF0dAUcT6 Yo57T6I1Fvp1SA/oMz4lk6gop4Nnhi1Lerr9xo4dRAsBAgNSmH34sieSDpRYyQRUbAh1 VQaQ== X-Gm-Message-State: AOAM532hioUBfAi9zabQRuYpW18wRBFBriqQ2uvqjTek2/wqD/SaAgK2 vxhMLevdFTu0UTibJMjzdG/oY5VfsBgQ X-Google-Smtp-Source: ABdhPJzNixU+e7flFbrBEQcjPzaC8HJ/IeljfCk1TpQJq1X5EHw+l3eRDkbnV40xaFqSwcBSlnw+nNfdr3ra X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:725a:fff:fe41:c6a5]) (user=tzungbi job=sendgmr) by 2002:a25:df8b:: with SMTP id w133mr44028414ybg.491.1608804376913; Thu, 24 Dec 2020 02:06:16 -0800 (PST) Date: Thu, 24 Dec 2020 18:06:03 +0800 In-Reply-To: <20201224100607.3006171-1-tzungbi@google.com> Message-Id: <20201224100607.3006171-2-tzungbi@google.com> Mime-Version: 1.0 References: <20201224100607.3006171-1-tzungbi@google.com> X-Mailer: git-send-email 2.29.2.729.g45daf8777d-goog Subject: [PATCH 1/5] ASoC: rt1015: sort header inclusions From: Tzung-Bi Shih To: broonie@kernel.org Cc: tzungbi@google.com, alsa-devel@alsa-project.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" Sorts header inclusions. ASCII value of 'r' is less than 's'. Signed-off-by: Tzung-Bi Shih --- sound/soc/codecs/rt1015.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/rt1015.c b/sound/soc/codecs/rt1015.c index 32e6bcf763d1..1a29d3d5263e 100644 --- a/sound/soc/codecs/rt1015.c +++ b/sound/soc/codecs/rt1015.c @@ -24,10 +24,10 @@ #include #include #include +#include #include #include #include -#include #include "rl6231.h" #include "rt1015.h" From patchwork Thu Dec 24 10:06:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 11989407 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F69EC433E6 for ; Thu, 24 Dec 2020 10:08:21 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 964CF221EB for ; Thu, 24 Dec 2020 10:08:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 964CF221EB Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B8C4617EB; Thu, 24 Dec 2020 11:07:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B8C4617EB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1608804496; bh=toafuJ03EiDZ6CbDny/fE78PxW4mnQQMn2CF5j95t4M=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Nuk7FyqN0y3s16Hx9J2TXo0GgHwr1yt6FwC0t+HqSAljwMQi8+LTCty24d6nf1qNr YycsMFnGxYHQKytHN3h6C9g/pk633qc9FNB5oJsRZmS6MtYAm09sAj2YafHGcewQlN 83jMNqPsY0agiOX7akyKpjyQ49OlCs5T8YCzvI98= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 21865F804BB; Thu, 24 Dec 2020 11:06:29 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 476AEF8023E; Thu, 24 Dec 2020 11:06:26 +0100 (CET) Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 25BDDF800CE for ; Thu, 24 Dec 2020 11:06:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 25BDDF800CE Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="dSBjK7Bj" Received: by mail-yb1-xb49.google.com with SMTP id j1so2717568ybj.11 for ; Thu, 24 Dec 2020 02:06:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=yrNMV8ZIBx+GbIeepiPn7ci0CTXODCE+VcJLXlRVrCo=; b=dSBjK7Bj6usn3j+JLJ39oIOp8+wI8ut4IAtEflfTfrVsIdUa/0Xvdz/lS47FVT81BU 9/O7nRD2WQVw7camoeR3q+mvxXVwX7eI6saXG24AVIRQCKSzHUFj7+d3HQU+jAJ32D3b 8M3Q2xoinjYfFUCGSczeSIJjiaKa9g2zl/BkKmodhmi/SPpZPq9L6TisnW+0HYigS0kG 0qK94zAt8nTYGOicAG9iN7IH0rfCIitP+VOlo8EtXfhwfnUEDxeFCwi7MMn1fzdg9Z0o BxN7pi8dUkeRKcW7xOy8hVpGzvWQNxEn6i9TmlaMIyxwc/1HrQfoBz+eylerv8KodkdC BMuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=yrNMV8ZIBx+GbIeepiPn7ci0CTXODCE+VcJLXlRVrCo=; b=s7/3w50ZDAq7EZ4n/PZfx4ONLG6IuOk/O1DKw5xA0+7lFg4h/CEHeAHGvm4YU9tZnb 2k7NCnKhSIgmhn1TPcvCs0TYfPrvkTyi5z47JY2UtTYwWhKFNhpeTZ8E/WVVlCWwc4RL L2ebJy881w2yDo/0uq1g1oDfJGcnfhOvzSV1AP7FAevKxhHgiSTPuG5b7ekW5bcWq++0 c1Z+KHL1hS1en6UtARIUo9SpexBJxe7COX5g/YRotLjNKliEhv5O4a9ryGnt+Dc21vl/ 8kuBs9IXJmYryyW/gsmMYIJsCQrtxpkWjwewJ8hrxyHIX+o/GdHF4Fgypmv399XWN+mf 2qIg== X-Gm-Message-State: AOAM533bF8A3ZbtxLChXAn0aaAakTgwqDaDkHrUCwNw/E67e8qe6OxLr PvUOwGepAzB8lpGtUjfLOqbqG8tOIQdT X-Google-Smtp-Source: ABdhPJw/INHqt/AJcIwc9GpCaVWo/LOT2Joexym9YJxs+wq+S1qafTFwfkn05GNbBXt/x8dn9A/RHIkPR1WD X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:725a:fff:fe41:c6a5]) (user=tzungbi job=sendgmr) by 2002:a25:5c2:: with SMTP id 185mr40617523ybf.161.1608804380703; Thu, 24 Dec 2020 02:06:20 -0800 (PST) Date: Thu, 24 Dec 2020 18:06:04 +0800 In-Reply-To: <20201224100607.3006171-1-tzungbi@google.com> Message-Id: <20201224100607.3006171-3-tzungbi@google.com> Mime-Version: 1.0 References: <20201224100607.3006171-1-tzungbi@google.com> X-Mailer: git-send-email 2.29.2.729.g45daf8777d-goog Subject: [PATCH 2/5] ASoC: rt1015: save boost_mode only if valid From: Tzung-Bi Shih To: broonie@kernel.org Cc: tzungbi@google.com, alsa-devel@alsa-project.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" Saves boost_mode only if valid. Also returns -EINVAL if it is invalid. Signed-off-by: Tzung-Bi Shih --- sound/soc/codecs/rt1015.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/rt1015.c b/sound/soc/codecs/rt1015.c index 1a29d3d5263e..696e00478991 100644 --- a/sound/soc/codecs/rt1015.c +++ b/sound/soc/codecs/rt1015.c @@ -444,10 +444,9 @@ static int rt1015_boost_mode_put(struct snd_kcontrol *kcontrol, snd_soc_kcontrol_component(kcontrol); struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component); + int boost_mode = ucontrol->value.integer.value[0]; - rt1015->boost_mode = ucontrol->value.integer.value[0]; - - switch (rt1015->boost_mode) { + switch (boost_mode) { case BYPASS: snd_soc_component_update_bits(component, RT1015_SMART_BST_CTRL1, RT1015_ABST_AUTO_EN_MASK | @@ -471,8 +470,11 @@ static int rt1015_boost_mode_put(struct snd_kcontrol *kcontrol, break; default: dev_err(component->dev, "Unknown boost control.\n"); + return -EINVAL; } + rt1015->boost_mode = boost_mode; + return 0; } From patchwork Thu Dec 24 10:06:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 11989409 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D346AC433E0 for ; Thu, 24 Dec 2020 10:08:56 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 317AE221EB for ; Thu, 24 Dec 2020 10:08:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 317AE221EB Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 93E011812; Thu, 24 Dec 2020 11:08:04 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 93E011812 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1608804534; bh=ZIyBW/OdCjm9OgNgwmgcJadImSmbzl+RKE3MWvR5MHU=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=tKp8bphzRFw899jJZYGQ0Yxgo+462AEdncIbn6BkV+YvpUsb0kmZ7TuEg1D8u5PTG BxXyHj0AB1MWSmk4hreg7mS+1rNnTxqecSluIeR280NU1LJ1Ahmtpf73vFjmfeKJz+ 1O9Z/IvtloV+orP+3L5CN+ZJ+GCx3mBac4ZNlJFE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9591BF804C1; Thu, 24 Dec 2020 11:06:46 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 16C1FF804CA; Thu, 24 Dec 2020 11:06:31 +0100 (CET) Received: from mail-qv1-xf4a.google.com (mail-qv1-xf4a.google.com [IPv6:2607:f8b0:4864:20::f4a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 52A87F804C1 for ; Thu, 24 Dec 2020 11:06:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 52A87F804C1 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="knmXjOC+" Received: by mail-qv1-xf4a.google.com with SMTP id i13so1288797qvx.11 for ; Thu, 24 Dec 2020 02:06:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=91fsL1pp4XLPsEvvcENGJE8PRwu4ZAo87pxxJcnuKws=; b=knmXjOC+U0U1WB4qx0X9WZJXMcnkL/pzaGHJ6kT5ap+mWIlPKInBio/2+gordkTHnK +oFOvZnYjV5J3qiSiYvmdl9Y4laRL5u7QwTl0fmt0rXSNuq4uQUHW85HvZwLP5TmkHhp NsK+gfmMZbGul6JfwI453baGUpvPo20VJ8kiyUgiZ7WVjw7KAm4xdaoCIXluHqNMf3WR UjX7kB1x9Gp5Oav4MZI3N1XDjcZ8e4Cfe3XaE5+OWuh9pruA9zUEPeoIa7VkkYJsRAud TEPgHOswaHNzPrpGa9QSI1ewEVyuDSXc+5efRZ1JxjP8syl5UvTVywZcUvGP0cBRxaQF sJiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=91fsL1pp4XLPsEvvcENGJE8PRwu4ZAo87pxxJcnuKws=; b=VK1hn0a4g5KGMPb6C1oR7k2CzaFRPaLTt95Eq0vEc6IV6PyR50zWrx0CSQWOzQATMd uNLRSUrZj12k32XgX/lRt3NllF5rispKla4u50nDMcWTcuQVWzMRtFbb5EWgwJrWN8pQ 6CG82uYTkR+3Zmv5Wyf9WP1ex+WRuSL1TiYODpjprwf9njRF+PgBuApJag1Mxu21P+05 47qPlB2buS5SJu0ei7X01bRyjtYoT2feL3xPWA6FVI9Xdd3qqiaJbfBQ7CSEDr3iv98U Sw7q2t7FqqRyiHL6TrUncojmeeuKFEUDGtEv35B1v6h7qKIVHY/uA7hTU/Qj9hcSAA23 Zhbg== X-Gm-Message-State: AOAM532yIYnD5Vjd25LcrlKJ/qdFSMdA6vML4hHCYawihWAPSPrUxWrL gFWOhqlizpiKcXncwsQ5pwdFsByhbuA8 X-Google-Smtp-Source: ABdhPJzg7/USQygC4uwY8eQcVkRFZFmavk2XgbxeG00pBVgrZJuVjaf4bSC4wwcUNzQfaGtuBzZHX13pnDG1 X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:725a:fff:fe41:c6a5]) (user=tzungbi job=sendgmr) by 2002:a0c:e651:: with SMTP id c17mr23148264qvn.34.1608804384288; Thu, 24 Dec 2020 02:06:24 -0800 (PST) Date: Thu, 24 Dec 2020 18:06:05 +0800 In-Reply-To: <20201224100607.3006171-1-tzungbi@google.com> Message-Id: <20201224100607.3006171-4-tzungbi@google.com> Mime-Version: 1.0 References: <20201224100607.3006171-1-tzungbi@google.com> X-Mailer: git-send-email 2.29.2.729.g45daf8777d-goog Subject: [PATCH 3/5] ASoC: rt1015: return error if any when setting bypass_boost From: Tzung-Bi Shih To: broonie@kernel.org Cc: tzungbi@google.com, alsa-devel@alsa-project.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" Returns -EBUSY if DAC is using when setting bypass_boost. Signed-off-by: Tzung-Bi Shih --- sound/soc/codecs/rt1015.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sound/soc/codecs/rt1015.c b/sound/soc/codecs/rt1015.c index 696e00478991..93e4763ece11 100644 --- a/sound/soc/codecs/rt1015.c +++ b/sound/soc/codecs/rt1015.c @@ -548,17 +548,19 @@ static int rt1015_bypass_boost_put(struct snd_kcontrol *kcontrol, struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component); - if (!rt1015->dac_is_used) { - rt1015->bypass_boost = ucontrol->value.integer.value[0]; - if (rt1015->bypass_boost == RT1015_Bypass_Boost && + if (rt1015->dac_is_used) { + dev_err(component->dev, "DAC is being used!\n"); + return -EBUSY; + } + + rt1015->bypass_boost = ucontrol->value.integer.value[0]; + if (rt1015->bypass_boost == RT1015_Bypass_Boost && !rt1015->cali_done) { - rt1015_calibrate(rt1015); - rt1015->cali_done = 1; + rt1015_calibrate(rt1015); + rt1015->cali_done = 1; - regmap_write(rt1015->regmap, RT1015_MONO_DYNA_CTRL, 0x0010); - } - } else - dev_err(component->dev, "DAC is being used!\n"); + regmap_write(rt1015->regmap, RT1015_MONO_DYNA_CTRL, 0x0010); + } return 0; } From patchwork Thu Dec 24 10:06:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 11989411 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59BFAC433DB for ; Thu, 24 Dec 2020 10:09:09 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AD2A92168B for ; Thu, 24 Dec 2020 10:09:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD2A92168B Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 435C7181E; Thu, 24 Dec 2020 11:08:17 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 435C7181E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1608804547; bh=lxIgOnn7nn4gp0NnJ8H8XVWkj1lGeGIeRa/iJ9KF0Dc=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=tUEYlU1WNzRcQN0O0PO2yixHiSnd/ooQv7Z0YLSGBTLHEyKLKrVe0nxzNxKJI96u2 mSxhY65UjaFNq9TkXUd/ZJsA7QRf7BqeJ8M1ZuUrulYBaQoMR2XoZyNAMCS9U/ua5N cBuoQJMMWJdEXnkVGTMtFAW04uJs+xqIzeij0XWY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4822BF804D2; Thu, 24 Dec 2020 11:06:47 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B3719F804CA; Thu, 24 Dec 2020 11:06:33 +0100 (CET) Received: from mail-pl1-x649.google.com (mail-pl1-x649.google.com [IPv6:2607:f8b0:4864:20::649]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0B3C4F804C2 for ; Thu, 24 Dec 2020 11:06:30 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0B3C4F804C2 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="LM8U8c+W" Received: by mail-pl1-x649.google.com with SMTP id y5so984700plr.19 for ; Thu, 24 Dec 2020 02:06:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=cesefJeA9SG97IrQXCu6DnjriyZpRNEevem65s6SRwg=; b=LM8U8c+WIobkOFLgAb3KQHLWG4QJDkkcdDPQ5VSH29EpeRAL2xXpIxxPUZQ0C80zY5 tjfD/5kkHKoL1W+lFkDxatK78otky02zZVnY2EnqK5r4C2HGKZ5I3Bg1V0pSWphoiSP8 WzdxkjzaRVIeZ8zcZzuSrKMNTMJNtHNWZYjwq4TtbwKUXiAIZxt1WDF2NvlpzwnUJblX qnOYBuZnUQSXCuDuVjfCzv9bohSw8q8bdZynga4DEt+hl7FXJlDHfJ4QEQd9dyAcE47+ K7z6EjGMizdZI576LkLyGIjPyB7G5vNFrJMdwU15mX0T8MWpkuG+/79SEdErQxc9oSrL eo5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=cesefJeA9SG97IrQXCu6DnjriyZpRNEevem65s6SRwg=; b=mHLuttuhOQsKGLwQyMCRiXOb76e4RPTwzWHLYc+dnu6reCt4ESn/jYMsqwHVjcuBdo YodGQNwaZ8i1/eULrvBxadrdjSyj3zhWtC2PSkbaXYDkft9aiLJXtYCTfR4qKddhxDWo 810caGEtDXIb4756PY3ZeqdBVDK5D5fMeuLqSmjp38FI0KpCkiSG9mEky9QtfmCKDkBP DH0+bTX8kRtpnenN3sPsN2kuniBVR1yclg7rGRNY3KgyxzEAp95IiGD5KeWqS6NT8PZ0 8OiLjyf4UZfiw2faIZm4YN4vgF5J924I4lnui0w1VoklC/svlB9exbaN1nNqyXsmhjS8 VVYg== X-Gm-Message-State: AOAM532U1CKkWHMQLLVadjaiy9yf8Xn59OQ6MgK6eKXXV0qU6M1nNah6 T3grjgEd+bANIgICC/zIqC37/0f10Gu/ X-Google-Smtp-Source: ABdhPJyX5iFk4UiHk7i/gjhzX40fEO68EHg1ZYqtyKvAkyRCN9jNscVshEFCp7i1C0gs0tLI/kMNTqTz8bav X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:725a:fff:fe41:c6a5]) (user=tzungbi job=sendgmr) by 2002:a17:902:ff0e:b029:da:d4ee:eca3 with SMTP id f14-20020a170902ff0eb02900dad4eeeca3mr29244211plj.41.1608804388362; Thu, 24 Dec 2020 02:06:28 -0800 (PST) Date: Thu, 24 Dec 2020 18:06:06 +0800 In-Reply-To: <20201224100607.3006171-1-tzungbi@google.com> Message-Id: <20201224100607.3006171-5-tzungbi@google.com> Mime-Version: 1.0 References: <20201224100607.3006171-1-tzungbi@google.com> X-Mailer: git-send-email 2.29.2.729.g45daf8777d-goog Subject: [PATCH 4/5] ASoC: rt1015: refactor retry loop and rt1015_priv allocation From: Tzung-Bi Shih To: broonie@kernel.org Cc: tzungbi@google.com, alsa-devel@alsa-project.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" Refactors retry loop in flush DAC work. It is more clear to use a for-loop here. Uses !rt1015 to check if NULL. Signed-off-by: Tzung-Bi Shih --- sound/soc/codecs/rt1015.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/rt1015.c b/sound/soc/codecs/rt1015.c index 93e4763ece11..a7b9dfcb4b0f 100644 --- a/sound/soc/codecs/rt1015.c +++ b/sound/soc/codecs/rt1015.c @@ -570,15 +570,14 @@ static void rt1015_flush_work(struct work_struct *work) struct rt1015_priv *rt1015 = container_of(work, struct rt1015_priv, flush_work.work); struct snd_soc_component *component = rt1015->component; - unsigned int val, i = 0, count = 200; + unsigned int val, i; - while (i < count) { + for (i = 0; i < 200; ++i) { usleep_range(1000, 1500); dev_dbg(component->dev, "Flush DAC (retry:%u)\n", i); regmap_read(rt1015->regmap, RT1015_CLK_DET, &val); if (val & 0x800) break; - i++; } regmap_write(rt1015->regmap, RT1015_SYS_RST1, 0x0597); @@ -1187,9 +1186,8 @@ static int rt1015_i2c_probe(struct i2c_client *i2c, int ret; unsigned int val; - rt1015 = devm_kzalloc(&i2c->dev, sizeof(struct rt1015_priv), - GFP_KERNEL); - if (rt1015 == NULL) + rt1015 = devm_kzalloc(&i2c->dev, sizeof(*rt1015), GFP_KERNEL); + if (!rt1015) return -ENOMEM; i2c_set_clientdata(i2c, rt1015); From patchwork Thu Dec 24 10:06:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 11989413 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91BCDC433DB for ; Thu, 24 Dec 2020 10:09:45 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A7F9C2168B for ; Thu, 24 Dec 2020 10:09:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A7F9C2168B Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DAD651824; Thu, 24 Dec 2020 11:08:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DAD651824 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1608804582; bh=VB9K6BHi72Dl994HnAiqiSAlBT2w0EfwCzPsAVOhw48=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=npWmPYcwN1UsG0H3/tfC3vWT3dWdAaviLo9bcSttp6aK9qx8RT4D8aNA5gF46FxhQ cwIeBkWD28wCZSdPqeH7qDSYo5ShrgJsbrjuy1KPc3RHI6nEaSs6k1Je8j8Ojeurjn L8Wz3rZRE95Q2HZKiju9DvSGw/cnQ/tPcG8dpZDE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E680CF804E0; Thu, 24 Dec 2020 11:06:47 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D88EAF804CA; Thu, 24 Dec 2020 11:06:35 +0100 (CET) Received: from mail-qv1-xf4a.google.com (mail-qv1-xf4a.google.com [IPv6:2607:f8b0:4864:20::f4a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5748EF804C1 for ; Thu, 24 Dec 2020 11:06:33 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5748EF804C1 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="scmhNdwB" Received: by mail-qv1-xf4a.google.com with SMTP id i13so1288956qvx.11 for ; Thu, 24 Dec 2020 02:06:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=7EXZ4XxksOgK1qOr5dIqjUfXKl/wZLCjJI5TkXqsxYE=; b=scmhNdwBGILEiIvs17e++6ZheHCGYOYaczn8BwxwCW6jyd82njkfUtBmwJcLMRoFoG J1LusIvVja9gAr7m9juqcWFGp8czo3wrHcJweLdVfHjCqfni2eSXgO67BCUczZOLiqlq EIQaNjzcMY87m7zWJljE6Y6Ph3kggq1MArh6/dVhfguez9xeetryjWk7atmrx1fT/MjX pWdj/k+VChPnFxpUW9UOKr8b/9lZ66Oro/WhXaumETp7uKW89SjecRgDxmJzOFeU5IyR MImZQsdeUly8dbF8SBptVL3e5jwdd1Tv4VPIA3bXhBenQJTMkJq8rV4L2ypLLJIwJCwv KU8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=7EXZ4XxksOgK1qOr5dIqjUfXKl/wZLCjJI5TkXqsxYE=; b=KzNk3PDlGAPAKChUoxMottiDMCsSzH5BmOb1mAsBhZUi6IT/4llONdtMegsqCtpTPO BXS+XMtuInV/A0NialZlRcSH2Npg9KI6dGxPAiPjvv+aaKfOdMJYAqexFkPew2WHQ9Qo KzZKpP6rib1kY0MtUxS/ibXKwXemWufudeuVFC2qGGJCFZJC+V6/DI/F0IQHChPZskxf XHWKt/PoXRgj6iwpdlxRUA7pT8laCFjB0WxeHxmhBups9MqVUIOrV+OnW1nHdaNzJYz6 1b7f5S1ZH/uEwJ58scV3D5nu0BHh5akPjk95ieHjO9y0T4D1RcwVLDfCDkvQIj+kXqLP 7Pkw== X-Gm-Message-State: AOAM530xZ3MAWnlPRePiiRwisztBY7sg8MOBt501Rb+9N0m6YrlGeEaP WQFfZsAaKAkUIBVKGadhLyx+5I06csfx X-Google-Smtp-Source: ABdhPJzC9Ct1jM4W5daL22jAHwDM3GsTi1OvvUBJPE3fF9k9rr8/6Bqgn4vUtwnec+x1QFFvzZm9KX82wew+ X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:725a:fff:fe41:c6a5]) (user=tzungbi job=sendgmr) by 2002:a05:6214:28f:: with SMTP id l15mr30570526qvv.38.1608804392238; Thu, 24 Dec 2020 02:06:32 -0800 (PST) Date: Thu, 24 Dec 2020 18:06:07 +0800 In-Reply-To: <20201224100607.3006171-1-tzungbi@google.com> Message-Id: <20201224100607.3006171-6-tzungbi@google.com> Mime-Version: 1.0 References: <20201224100607.3006171-1-tzungbi@google.com> X-Mailer: git-send-email 2.29.2.729.g45daf8777d-goog Subject: [PATCH 5/5] ASoC: rt1015: remove unneeded variables in rt1015_priv From: Tzung-Bi Shih To: broonie@kernel.org Cc: tzungbi@google.com, alsa-devel@alsa-project.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" - `lrck' is only used in .hw_params callback so that it can be local. - `bclk' is unused. - `id' is unused. - `amp_ver' is unused. Signed-off-by: Tzung-Bi Shih --- sound/soc/codecs/rt1015.c | 9 ++++----- sound/soc/codecs/rt1015.h | 4 ---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/sound/soc/codecs/rt1015.c b/sound/soc/codecs/rt1015.c index a7b9dfcb4b0f..4a9e2eaebe30 100644 --- a/sound/soc/codecs/rt1015.c +++ b/sound/soc/codecs/rt1015.c @@ -724,11 +724,11 @@ static int rt1015_hw_params(struct snd_pcm_substream *substream, { struct snd_soc_component *component = dai->component; struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component); - int pre_div, bclk_ms, frame_size; + int pre_div, bclk_ms, frame_size, lrck; unsigned int val_len = 0; - rt1015->lrck = params_rate(params); - pre_div = rl6231_get_clk_info(rt1015->sysclk, rt1015->lrck); + lrck = params_rate(params); + pre_div = rl6231_get_clk_info(rt1015->sysclk, lrck); if (pre_div < 0) { dev_err(component->dev, "Unsupported clock rate\n"); return -EINVAL; @@ -742,13 +742,12 @@ static int rt1015_hw_params(struct snd_pcm_substream *substream, } bclk_ms = frame_size > 32; - rt1015->bclk = rt1015->lrck * (32 << bclk_ms); dev_dbg(component->dev, "bclk_ms is %d and pre_div is %d for iis %d\n", bclk_ms, pre_div, dai->id); dev_dbg(component->dev, "lrck is %dHz and pre_div is %d for iis %d\n", - rt1015->lrck, pre_div, dai->id); + lrck, pre_div, dai->id); switch (params_width(params)) { case 16: diff --git a/sound/soc/codecs/rt1015.h b/sound/soc/codecs/rt1015.h index b6ea753014e1..e9b498a754e0 100644 --- a/sound/soc/codecs/rt1015.h +++ b/sound/soc/codecs/rt1015.h @@ -427,16 +427,12 @@ struct rt1015_priv { struct regmap *regmap; int sysclk; int sysclk_src; - int lrck; - int bclk; int bclk_ratio; - int id; int pll_src; int pll_in; int pll_out; int boost_mode; int bypass_boost; - int amp_ver; int dac_is_used; int cali_done; int hw_config;