Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp3139698pxb; Sun, 29 Aug 2021 15:15:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyReQKtw/aDv0nIYuLSVirpLjEJWNCMnE1BZ2LwU+o5FfoXV1HmEGmICSF/WK5GoBXceSGg X-Received: by 2002:a05:6e02:128b:: with SMTP id y11mr13884284ilq.104.1630275339527; Sun, 29 Aug 2021 15:15:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630275339; cv=none; d=google.com; s=arc-20160816; b=Fa78hBw3yUplCNFq+t5anjnDle1mP5naGrkNxOU/hhzGWqo/qDfdiYfNa97z5XbpP2 PQ/MFNeTX1Zz+svuHg8zcWkcCQQdoUKVLReZ0/0+aiZuRJ3G69A+G1Sam1f64e4VhwMg mA9OaZHAGxHKv0a+6sbpI/yvwJgeCnDMYPh4BrKEiv9p1+wWJj9sUBxo5cXqss+G1/0r ICcjdzO7az9bCFl3MH4AX47FQwfQDoR1qt0fKbYhH86hOWW6ibEbYZlY9aHPT+qkZbzT 9AQIGrI1Il/2QeJTdz19HMncHo6dTXs8lqJBHbdhNW3QJPJcX66ILcgfdO27h0gphcSu ie/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=p8EdhdiW+D8UryNJEC94BuZQt/tBGKNDXsTLiT/IcoQ=; b=AskpIp9DBaswEVEbScwjHM+31lm/YGtm7veP+9VfSa/p4DeYLx/jufqXSnpA5+hw63 vi8Ev/MyUr82QYVeRJe5Gzb3/1ksrT3yovUJkISQ42djg+giwZKqcrw3Pk/GbIyspLoK +3XrhrfLiaPDQ17gVZc7wqdg8sCE+KUPBjjfGrsAV7Cuqe6u4U8/7pnTmLpXvwglOeSy 4LbyUpbSKkf5vqThiexBzJmL5XvZrCYCLIbQKs8oSNCMJIw6idh2KndZbu88fucBmSzs 5SNZhMwprnbGsClqhy/Tj7jarPZtC8iouAilzmANt5UtCJQy+hAu4/PhLG6CL4AECioc DX1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dnyon.com header.s=mail header.b=0Rm6SJJk; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z4si12483623jap.100.2021.08.29.15.15.28; Sun, 29 Aug 2021 15:15:39 -0700 (PDT) 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=@dnyon.com header.s=mail header.b=0Rm6SJJk; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236073AbhH2WOh (ORCPT + 99 others); Sun, 29 Aug 2021 18:14:37 -0400 Received: from dnyon.com ([82.223.165.189]:56182 "EHLO dnyon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235370AbhH2WOg (ORCPT ); Sun, 29 Aug 2021 18:14:36 -0400 X-Greylist: delayed 23025 seconds by postgrey-1.27 at vger.kernel.org; Sun, 29 Aug 2021 18:14:36 EDT Received: from dnyon.com (45.74.222.87.dynamic.jazztel.es [87.222.74.45]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dnyon.com (Postfix) with ESMTPSA id B9FFC40442; Sun, 29 Aug 2021 22:13:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=dnyon.com; s=mail; t=1630275223; bh=aw1SvFqyWFMuJYWbD3SZOO+rClzP6Lw/Acya+RIY0Z4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=0Rm6SJJkrMKPuF+qpFkge2kUEP2OnceG6Oj82j5mVk5rpJ5ifwekPM3xIcBdpVKax guOds/fzBIIN3+sEkB4s1Fp9HtUlr1/h4Uv08V2rinlaUaTJc8lL29/5Ha4F+dYDgx B4E7w15wun17uk/RXfxooBui4QdPCc60SOfzBdHIo1KCXqPLLFMbpQ+2y7hAMTWFLB iOTzEORaqZO9+ueEg+7vyGzdApzmR6Bk6ybW2A3J1ZTkk3eGxfslMVDbb0kY3y4g9w yOlJCrN23bjtoj0b8zE40rkjOmMtmAq5HPN7d7TbuLOyS3D+aQvDURkklfNeMu5IZu +xhjR9EBwcRbA== Date: Mon, 30 Aug 2021 00:13:41 +0200 From: Alejandro Tafalla To: Andy Shevchenko Cc: Liam Girdwood , Mark Brown , "alsa-devel@alsa-project.org" , Rob Herring , Jaroslav Kysela , Takashi Iwai , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH RESEND 1/2] ASoC: max98927: Handle reset gpio when probing i2c Message-ID: References: <20210829170019.384632-1-atafalla@dnyon.com> <20210829170019.384632-2-atafalla@dnyon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=mensaje In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Andy, On Sun, Aug 29, 2021 at 11:22:35PM +0300, Andy Shevchenko wrote: > > + max98927->reset_gpio > > + = devm_gpiod_get_optional(&i2c->dev, "reset", > > GPIOD_OUT_HIGH); > > + if (IS_ERR(max98927->reset_gpio)) { > > + ret = PTR_ERR(max98927->reset_gpio); > > + dev_err(&i2c->dev, > > + "Failed to request GPIO reset pin, error %d\n", > > ret); > > + return ret; > > > > Spamming logs is not good. Use > > return dev_err_probe(...); Okay. > > + } > > + > > + if (max98927->reset_gpio) { > > + gpiod_set_value_cansleep(max98927->reset_gpio, 0); > > > > You may request the pin in a proper state, also with current code you seems > mishandle the conception of the logical pin level vs. physical one. Right, i made the mistake of basing off an old driver that use legacy functions. > > diff --git a/sound/soc/codecs/max98927.h b/sound/soc/codecs/max98927.h > > index 05f495db914d..5c04bf38e24a 100644 > > --- a/sound/soc/codecs/max98927.h > > +++ b/sound/soc/codecs/max98927.h > > @@ -255,6 +255,7 @@ struct max98927_priv { > > struct regmap *regmap; > > struct snd_soc_component *component; > > struct max98927_pdata *pdata; > > > > > + struct gpio_desc *reset_gpio; > > > Why? Are you using it outside of ->probe()? No, I'll delete it and use a local variable. > With Best Regards, > Andy Shevchenko Thank you for the feedback, I'll address all the issues in a V2. Alejandro Tafalla