Received: by 2002:a05:6a10:5594:0:0:0:0 with SMTP id ee20csp59874pxb; Mon, 25 Apr 2022 05:51:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmqE74nmhfE5LJTxo3sFzdiVRMBcHLZ2Bd1tM0vCpWQ5Tm6CIb4siXkKl1gihfVTP6Xave X-Received: by 2002:a50:d79a:0:b0:425:e577:c71a with SMTP id w26-20020a50d79a000000b00425e577c71amr5588953edi.188.1650891060761; Mon, 25 Apr 2022 05:51:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650891060; cv=none; d=google.com; s=arc-20160816; b=TJDsfcTQbpGO0yEBeAhk4qiFPCy2Qwe+ZCa/4Lu177UZAq39jVxTpAgS7Nv6m0qQXh UaaoCfuAcDrprzIuqLAyb77zHpkLkELZudew/L5HF41zpbQ31GVbJkcoUuiqMaeDIMvm XgiWGC1TwqBW5yddHQZYr43zkkfy77QqxAWPYSJwPW+SkhNyZLB05Xnie7AgKaqAr6pX xaIpB6irQk1qMyB9UtxZGPMHed17/vy/OhFSp+HGX3LCfjwvsO5wxy5GjQV3FArn8/oh knXqYQ07+bqigF5o95SyeWB78LsVJIba6hQZKW/BItM7K3YqHXXAv59yaN8aV3T7R/67 SJ8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=I8EY4lglboRN1c93e8I2TXpVeMHcklvaGoHB6utRNQ0=; b=J+S/GMBQlDtqCs5yFB1P4/byqzdp1UJu8A8jyMDipuw9095IhgQLCaMDG8AjhvbX0O b99cr+euf4HFHMba17OEZapGjKmXzfuf6rkuU9tR/x+cVzVNfpAH99leO4hmupQhHLzH ttMWBJ/TFVns0ahDskZuwzSAXY5x0Jap1PaNQhO9BoKq5LBVPYQOB9UEHRLYDprEKcsK vGfwqBr18IeLdtpTkbY8MBbeEc3xRg+nJe5036xDonfwhzKH19tbk8LAm8jCn5xW2a0P WccukVi49QSgHZ0cQNgR4m1RSQB8Ps9+dnxBToNHRLoJ0/m55R1ELe7OnLITs6+dxU32 ORbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cd1-20020a170906b34100b006e8be18a965si13236535ejb.306.2022.04.25.05.50.32; Mon, 25 Apr 2022 05:51:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238545AbiDYMLg (ORCPT + 99 others); Mon, 25 Apr 2022 08:11:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240563AbiDYMLY (ORCPT ); Mon, 25 Apr 2022 08:11:24 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 377855BD0B for ; Mon, 25 Apr 2022 05:08:12 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nixVU-0000PM-KI; Mon, 25 Apr 2022 14:07:56 +0200 Message-ID: <56052bc6e3b6cab6bfdfc5f706ec9984bea16bba.camel@pengutronix.de> Subject: Re: [PATCH v3] PCI: imx6: Replace legacy gpio interface for gpiod interface From: Lucas Stach To: Linus Walleij , =?ISO-8859-1?Q?Ma=EDra?= Canal Cc: hongxing.zhu@nxp.com, lorenzo.pieralisi@arm.com, robh@kernel.org, bhelgaas@google.com, helgaas@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, linux-imx@nxp.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Date: Mon, 25 Apr 2022 14:07:53 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.4 (3.40.4-1.fc34) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 Hi Linus, Am Donnerstag, dem 21.04.2022 um 01:24 +0200 schrieb Linus Walleij: > Hi Maira and sorry for being slow on reviews. > > On Tue, Nov 2, 2021 at 2:04 AM MaĆ­ra Canal wrote: > > > - gpio_set_value_cansleep(imx6_pcie->reset_gpio, > > + gpiod_set_raw_value_cansleep(imx6_pcie->reset_gpio, > > !imx6_pcie->gpio_active_high); > > Hm I see you got advised to use the raw api. I'm not so sure about > that I like v1 better. > > > + imx6_pcie->reset_gpio = devm_gpiod_get_optional(dev, "reset", > > + imx6_pcie->gpio_active_high ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW); > > + if (IS_ERR(imx6_pcie->reset_gpio)) > > + return dev_err_probe(dev, PTR_ERR(imx6_pcie->reset_gpio), > > + "unable to get reset gpio\n"); > > Where is this descriptor coming from? Device trees? Can't we just fix the > DTS file(s) in that case given how wrong they are if they don't set > GPIO_ACTIVE_LOW flag on this IRQ. The binding explicitly describes the GPIO as not polarity aware and has a separate property "reset-gpio-active-high" to avoid breaking old DTBs. I don't think it's helpful to dismiss this explicit backward compat just because the driver code looks nicer that way. Regards, Lucas