Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp3202424pxx; Mon, 2 Nov 2020 02:50:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJwi7TymqGQzZOl9/aBr/Ws8fVm6otvR1Kvh3ASM1ZVJcToojXWJEq/Y+R5L49ZIorhFGReD X-Received: by 2002:a17:906:adcd:: with SMTP id lb13mr4851149ejb.362.1604314226110; Mon, 02 Nov 2020 02:50:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604314226; cv=none; d=google.com; s=arc-20160816; b=G+ujD65Qrr98RRKRTprZHURtuAVfvsza3u2fW9dn0LPoTLSvpPny0WqYzOqrTlb2ej F0t2ggj0pJeB+NR0wiPM7zL+aDh6VLYJwJaDaOs49gnPt3oyaKoQ/DncWfpwR5hgrjDU iabxq/KJeVHPHErhgIme1UR3xZx4f3azbgj31a6EMBkP90kd5pfE+4hNUqXi2wkXyW6b rWIXdnRyL4G+Px7sDPZ5FsLGFJBjUZUGOEB493yWjMJ3wiNrAOPwAXDFkSfN6vaAw5Zq BisQX6Potlr0g9EO7x1SbKE8YhMTVVU47eBkKH/Xwat6o9JVWhmYD7Z4mnBS6uBQ8jpx srFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=VRpjL02zuTcuiv/Rvb/qTyae7wJ0n/tsrDk8nGGEoq0=; b=Rt50UKchsDE43utt1XTVY+5OLHQwa5ezGgBPs98MdZvwApOj75FwtuKN/a7kVtctE2 yzrjvLL9B11aiqOnZ2fHXYH24OWm89Bt0O2yRFBnn/2DGnpxZK77PFaeqMivcA5MQ6KM ybhwbHbdM/rBoA1r8FOpqlzVgjyG17hgtGIH85j5yKfImdqxW6u7P4eLBpx7l3WHmcS0 kHqjv0EKJ3UfSeCb2V1+FTqsK0wpqWoAVWRCg8UffdLBLA07fhLgYLQTrh0w2pVVo45R KQSY7zHx4cTkOP8/wOGAqjHfmomSFCxa/G6M5PD4Azs4WTDCRoFzq2TtsVYgE8oZDIQ2 ww8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JbF7Xzcx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k3si12287170edl.33.2020.11.02.02.50.03; Mon, 02 Nov 2020 02:50:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JbF7Xzcx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728421AbgKBKqQ (ORCPT + 99 others); Mon, 2 Nov 2020 05:46:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728005AbgKBKqQ (ORCPT ); Mon, 2 Nov 2020 05:46:16 -0500 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5436C0617A6 for ; Mon, 2 Nov 2020 02:46:15 -0800 (PST) Received: by mail-io1-xd44.google.com with SMTP id s24so7648973ioj.13 for ; Mon, 02 Nov 2020 02:46:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VRpjL02zuTcuiv/Rvb/qTyae7wJ0n/tsrDk8nGGEoq0=; b=JbF7Xzcx6Wu8FIV7/iG4L8/z373ZoWlCO6auRph8RxolPKUCY1c9JzvvbI3Ea8+Uwf 623DoaDsaJKCpWEQpXNj98q9gCj1aDehvtpItUkRrmtnB8aAV6mbbK04ddWHMkKMYtl7 4oFJG1NT4N39UbIQ64IZIa0hXFMu0mTCuVoaXGy4E2hUE7fq1sNC37u1OnLRK+srC62G gfLCwVF7Pxw1UMQ/VlJ9hmuYmHSRgkVb/yWTy7xhVu91Rqz72oua6GOBx3TI2A2tO1oE MW6MhUJSrVNgZbnseXvs+TSZ8ZsJonOti3crmrOCtAmx7l1ybcV9Qx+yIWni9YtIGJ0B y6Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VRpjL02zuTcuiv/Rvb/qTyae7wJ0n/tsrDk8nGGEoq0=; b=L0Hv1gxkhBwmp5TsvhD1E95CWVqjhut6xVSqvKRPDdydqA8YmdELzPAsg/wSsYWHu5 DMy0zoIOY3xHEPPGN0wo9/o3YbYdTR7tn1n3oq2FvolEyBq1U9rG81lTpYe0jNy1xxx8 GU9DWdhOa6LBfiu21Qd99dGFdRFsP67eJVpc+0WnJ8FSEheyBSqWOsPSHskFRIh46mXF Z4dttYAGag+aK07kRukH+CDO2DSqVeDlt8EgPrnStc7zr6FsS5z2LVfrSqCkL8TFdKFL bvw/LQeQdRLV0+RUzUFVt0I6QeKjMtHtJnhP/lNRn4AlSrjQR2zf5lpBCoev9ZLNnKnL 8LbA== X-Gm-Message-State: AOAM532aM0BlRINUCMdP5N4u16OLQK/w2Gm6SBQCRmtbeZ6h6obuYdfB qSu0wC9O5aFLO2RqKbT0ccOzDgcDJJVhEPSH8YgwwQPyW5YkiQ== X-Received: by 2002:a6b:7a0b:: with SMTP id h11mr2777649iom.76.1604313974919; Mon, 02 Nov 2020 02:46:14 -0800 (PST) MIME-Version: 1.0 References: <20201102062408.331572-1-ajye_huang@compal.corp-partner.google.com> <20201102062408.331572-3-ajye_huang@compal.corp-partner.google.com> In-Reply-To: <20201102062408.331572-3-ajye_huang@compal.corp-partner.google.com> From: Tzung-Bi Shih Date: Mon, 2 Nov 2020 18:46:04 +0800 Message-ID: Subject: Re: [PATCH v3 2/2] ASoC: qcom: sc7180: Modify machine driver for 2mic To: Ajye Huang Cc: Linux Kernel Mailing List , Mark Brown , Rohit kumar , Banajit Goswami , Patrick Lai , Srinivasa Rao Mandadapu , Srini Kandagatla , Andy Gross , Bjorn Andersson , Liam Girdwood , Rob Herring , Jaroslav Kysela , Cheng-Yi Chiang , Tzung-Bi Shih , Douglas Anderson , "moderated list:ARM/Mediatek SoC support" , linux-arm-msm , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , ALSA development , Ajye Huang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 2, 2020 at 2:24 PM Ajye Huang wrote: > > In addition, having mixer control to switch between DMICs by > using "dmic-gpios" property. > > Refer to this one as an example, > commit b7a742cff3f6 ("ASoC: AMD: Use mixer control to switch between DMICs") > > Signed-off-by: Ajye Huang I am not sure if it would be better if you use another email (e.g. @gmail) for signoff. > +static int dmic_get(struct snd_kcontrol *kcontrol, > + struct snd_ctl_elem_value *ucontrol) > +{ > + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); > + struct sc7180_snd_data *data = snd_soc_card_get_drvdata(dapm->card); > + > + if (data) You don't need to check for NULL. If snd_soc_card_get_drvdata() returns NULL, it shouldn't run into here. See other snd_soc_card_get_drvdata() calls in the file. > +static int dmic_set(struct snd_kcontrol *kcontrol, > + struct snd_ctl_elem_value *ucontrol) > +{ > + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); > + struct sc7180_snd_data *data = snd_soc_card_get_drvdata(dapm->card); > + > + if (data) { Ditto. > + if (IS_ERR(data->dmic_sel)) { > + dev_err(&pdev->dev, "DMIC gpio failed err=%d\n", > + PTR_ERR(data->dmic_sel)); > + return PTR_ERR(data->dmic_sel); Remove 1 level indent.