Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp755699pxp; Fri, 11 Mar 2022 14:16:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJxEMW764M5SbKo6K2WGfz7A4b+74xuUZGTmEyqnEuc1yTjQ82Jr0qy3vs035kd1G5XW1+kf X-Received: by 2002:a17:903:22c6:b0:151:da97:5a81 with SMTP id y6-20020a17090322c600b00151da975a81mr12236576plg.135.1647037011829; Fri, 11 Mar 2022 14:16:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647037011; cv=none; d=google.com; s=arc-20160816; b=nfEqo42JfxUGuBPiQcT2/FeWfpU/BfhKA8IiYK0YAliDwSPfapf9QwjhyLRubGpOSt cjRo/gbcNVSimxYopW1yg93MVCeP8Qw64YK7Vgykfy5aqOenBH3HTbP3zTjm1PeR+tUs 4VQ61U5E88mOe5i8MD5rxe0uvsSyCtwzcpqPjpuxIDK6fIGvPRJrnKaG02gsKzAY5CH6 IOIeVNNrCTz/uYucht0eEQlxLM1Y9a/RXABoLYOHuvGqxxKeYc2+pNp5GJQtU9IcT7/M ls7DfQ4cXwkJUUQGQ/fyficP8EXmIvkrpTj/t9Ug/aOsrQ5O6kyhDE4vYpFFMYYOJTJN 7p5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=3B8QjIlmdJC8Bd0Vem9hqomGTMW6ZUxC9fqa1LEpXd8=; b=JqwG+91kN3YRUeMd3l9loyme2izecDMywYwrObISgPC0vuMKpdvE/9MTtUh4wmdAqA Alljc/VmLrawBjLviUB2OViD/Jv+kd5frlaeaYDKr70lZMuxYXQEJdmVvhap9dldSWNr U0DvPU2TMKVq3QRpEiOR8HhF90sfYcHgQgihVjtY5t3hNrTUAob4EhBeFu05+1G3gsyn bLdWqOARPXCUQ0/CSVYSfh8db4l3vRAc2o+w7QW9h1em7Q8O2ZC5LHj7k3RvQyNRqAma V9el1svgtsJGOWzHGfjH/TFgeNyscDiFeePqrvBhrtWxToYeY5GH+N3jerLtXseydVQC FEgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QZGS63PS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id pg4-20020a17090b1e0400b001c44f70fc39si3057049pjb.164.2022.03.11.14.16.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 14:16:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QZGS63PS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E940C2CD639; Fri, 11 Mar 2022 13:26:35 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344633AbiCKFvd (ORCPT + 99 others); Fri, 11 Mar 2022 00:51:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235070AbiCKFvc (ORCPT ); Fri, 11 Mar 2022 00:51:32 -0500 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD9A6E98EA for ; Thu, 10 Mar 2022 21:50:29 -0800 (PST) Received: by mail-io1-xd41.google.com with SMTP id 195so9119786iou.0 for ; Thu, 10 Mar 2022 21:50:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=3B8QjIlmdJC8Bd0Vem9hqomGTMW6ZUxC9fqa1LEpXd8=; b=QZGS63PS9pfUSfyFr/oDhhJNtJFuik3KIdwKY3PpvuP3fY8aefSNurgtEJ75OAJyXL CbRQeVKeQor4yz60nSIWEdR5TZyN0QV5+FekbuenDvWrWpkFpxM/C4z3yTEHlb/CMZsz 3tk7l0R0YAf4zaLJ8CRpfdHIa8eu6xV20zKYwP2lEhHwTocUGa2bGeUbL+8BP4kzFmk/ qspHqatyaz920KEXdhgy+7n0G4bWFdblmhL49w9f0cn27W06zm6HVcD9ApjQMvrHUGEc nEV34M7C8hyfoRJKqjBc5ni9sld+2F3Ibx0OyfKLTKdJiIRDULBT4HlyFk2YUmbGdvLr 7VsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=3B8QjIlmdJC8Bd0Vem9hqomGTMW6ZUxC9fqa1LEpXd8=; b=SUlq/6VP+A0zjr03k55EJpU9m8/8fA73NcIgdXlKOTpuFb3Yrk76mpS0oqieumCxCl LuntwUjFI4FYBNI90UdJikrBtcYObIduhKFer9fObI2/P1KHb6OQmj+exzeawa5H2ias 9qT7lDaS+h99Dv4f2yjNbuxbEIceY+H+VEP2IvLaio9SCVaa4nmSkIlyYybOcQU3veN+ 9MQ96lfvtwz9h8WTfP+MosDWn3EgtFHqrfq+XDmaxzNBESoXPgt1AWicFhAiKx7Z24Gi Kms8+Ea5yiAw/0FC8IVeyUI60yy3pOHJiyzx+jZgsBrJdkVBVEh2KNxcLPU1AeOoQfA6 xhxQ== X-Gm-Message-State: AOAM533GHFuKz+xUap7M2U3mchDb/0sw33l5ONCWqaZcDFQCKFIceJIl a0t61w0eBQSGPKa3RKdTaA19oiYXM52gPCBmTBI= X-Received: by 2002:a05:6602:168f:b0:648:c800:3d61 with SMTP id s15-20020a056602168f00b00648c8003d61mr514167iow.197.1646977829264; Thu, 10 Mar 2022 21:50:29 -0800 (PST) MIME-Version: 1.0 References: <20220310081548.31846-1-steve.lee.analog@gmail.com> In-Reply-To: From: Lee Steve Date: Fri, 11 Mar 2022 14:50:18 +0900 Message-ID: Subject: Re: [PATCH] ASoC: max98390: Add reset gpio control To: "Sa, Nuno" Cc: "lgirdwood@gmail.com" , "broonie@kernel.org" , "perex@perex.cz" , "tiwai@suse.com" , "ckeepax@opensource.cirrus.com" , "geert@linux-m68k.org" , "rf@opensource.wolfsonmicro.com" , "shumingf@realtek.com" , "srinivas.kandagatla@linaro.org" , "krzk@kernel.org" , "dmurphy@ti.com" , "jack.yu@realtek.com" , "steves.lee@maximintegrated.com" , "linux-kernel@vger.kernel.org" , "alsa-devel@alsa-project.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 10, 2022 at 5:48 PM Sa, Nuno wrote: > > Hi Steve, > > > From: Steve Lee > > Sent: Thursday, March 10, 2022 9:16 AM > > To: lgirdwood@gmail.com; broonie@kernel.org; perex@perex.cz; > > tiwai@suse.com; ckeepax@opensource.cirrus.com; geert@linux- > > m68k.org; rf@opensource.wolfsonmicro.com; shumingf@realtek.com; > > srinivas.kandagatla@linaro.org; krzk@kernel.org; dmurphy@ti.com; > > jack.yu@realtek.com; Sa, Nuno ; > > steves.lee@maximintegrated.com; linux-kernel@vger.kernel.org; > > alsa-devel@alsa-project.org > > Cc: Steve Lee > > Subject: [PATCH] ASoC: max98390: Add reset gpio control > > > > [External] > > > > Add reset gpio control to support RESET PIN connected to gpio. > > > > Signed-off-by: Steve Lee > > --- > > sound/soc/codecs/max98390.c | 18 ++++++++++++++++++ > > sound/soc/codecs/max98390.h | 1 + > > 2 files changed, 19 insertions(+) > > > > diff --git a/sound/soc/codecs/max98390.c > > b/sound/soc/codecs/max98390.c > > index b392567c2b3e..574d8d5f1119 100644 > > --- a/sound/soc/codecs/max98390.c > > +++ b/sound/soc/codecs/max98390.c > > @@ -1073,6 +1073,24 @@ static int max98390_i2c_probe(struct > > i2c_client *i2c, > > return ret; > > } > > > > + max98390->reset_gpio =3D of_get_named_gpio(i2c- > > >dev.of_node, > > + "maxim,reset-gpios", 0); > > Why not using devm_gpiod_get_optional()? We could request the pin > already in the asserted state and make the code slightly better... > > /* I guess there's no need to save it in our struct as we only use it her= e? */ > struct gpio_desc *reset_gpio; > > reset_gpio =3D devm_gpiod_get_optional(&i2c->dev, "reset", GPIOD_OUT_HIGH= ); > if (reset_gpio) { > usleep_range(1000, 2000); > /* bring out of reset */ > gpio_direction_output(max98390->reset_gpio, 0); > usleep_range(1000, 2000); > } > > Also, do we have this on the bindings doc? If not, it should be done on a= second > patch on this series... > > - Nuno S=C3=A1 > Thanks for comment on this patch. I will check and update as commented.