From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E3800ECAAA1 for ; Tue, 6 Sep 2022 18:18:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6HWzDNvznSkq9scgSGbPrKE63rCjnoW8j8iVwhEL118=; b=VTHAO0/l1knXX1 YRRPV/4a9MkV38KK5OAKD4b/KpmuZceIyh2OXz7mPuAImHYJs0G63YgyOLpnrISjhlm3ccdeHmkUD ov1iJZvvBkksnexdy7HaX/K8cfkMWmYdJ6s4vFLfcXkI0OGFUiHiFVx6ipuU6afrG94eP2A6fWJVo rRr6FClTafkRTDUql/HBO/XXHXZGRHPZ+ScL29SWF2X3JXRoJYwDQ30e4hu7FQAEZCoKAlyxaczSg ElUdJleMK1TMfCS20vYOS84Zm2xB73m7mdKG+g296nQ/zJnFX1cCT0i+vsr4NDp85De37rNC5SUGy CemN9cnUaHioUgHHgX8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVd8e-00GIUs-W2; Tue, 06 Sep 2022 18:17:33 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVd8b-00GIRm-G2 for linux-arm-kernel@lists.infradead.org; Tue, 06 Sep 2022 18:17:30 +0000 Received: by mail-pl1-x633.google.com with SMTP id f24so12121574plr.1 for ; Tue, 06 Sep 2022 11:17:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=1cU7UfDXk2R+WQwWmDiW60/Uw8jRycsdTAhnfgj4iBM=; b=ixQ6tn8uWRvYnx7R/00EJbVf17V7A8zHBagl3NjXneaG4KrqRX+QP4XuZCPQIokbI6 4SFV4pCeqed8FK0brlV9HnabrtQ0narTICzy3oO8zdg3BAcUH7e4P9KJKqqTPvgod4lg UIYAFGcUASoL0SU7bddXcyCeIyWwH34yWtPYMenOiAOeZGM48qpFTzUiWAAj+ukMxpD/ Kf++SJ9mn1m5vmQS6Egk5hJJGs1+ddhJD/NKn/0ZssfVHSXtEhVTsNIcNLu5skLqu5ry r5t0QfYVzlHi6OYkKrvYeDJ/yo1DOveIwRi5vSO5oK6/2JKnU142og0QNRZ0gvHcvBXc 8ouw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=1cU7UfDXk2R+WQwWmDiW60/Uw8jRycsdTAhnfgj4iBM=; b=uKxI/Q36+y0fOYOFb5CLI4yuG93AdDADF0mA0Oj5pjQM/tF42dVaQZAf3pq4UfkUM1 h78fHDd0cXGBHdMmJcYRI9mLW2PxMGusTnrHRqKwol29kAOCoL+MNpG20YzlOTAMXPKM kv8dTVU9xGWebjfDIghKpebr5xVmBZeLAKTSfRAxddlcRILYTaamh44AMBK2dv1je7mT iXDlpFxqni6WrxvYXEUk7+KixJU7TC1dCqq1XkRPg7Q1SWzEiDsydkgWnCHiu/g2qBPW sobm+wsL2Q2tjBlud0vGEkVeNmcWTGjil8QDuHZ1Lq2HKnlh2V0XA4/zmxVGhZjlQmsj 4dlg== X-Gm-Message-State: ACgBeo3ZAdk3lcSUfS62Gk91gIo6Vpqt2e5lAInApq74ZUm1pkzStm9Y 1Qf9UoMXzTRW5zT5ZKCxVtE= X-Google-Smtp-Source: AA6agR4Qg3AgovtIOc9UvNEgar/zUFmdCfiWlQls8oneM0rj00dyQfIrYOnBsZUFLJFUB6q5aKOZ3A== X-Received: by 2002:a17:903:1211:b0:174:9ee2:4444 with SMTP id l17-20020a170903121100b001749ee24444mr45725071plh.77.1662488245406; Tue, 06 Sep 2022 11:17:25 -0700 (PDT) Received: from google.com ([2620:15c:202:201:1190:fbfa:ae95:111c]) by smtp.gmail.com with ESMTPSA id b2-20020a170903228200b00173cfb184c0sm10320825plh.32.2022.09.06.11.17.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 11:17:24 -0700 (PDT) Date: Tue, 6 Sep 2022 11:17:22 -0700 From: Dmitry Torokhov To: Linus Walleij Cc: Francesco Dolcini , Lee Jones , Maxime Coquelin , Alexandre Torgue , Marcel Ziswiler , Bartosz Golaszewski , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mfd: stmpe: switch to using gpiod API Message-ID: References: <20220906101126.GA8061@francesco-nb.int.toradex.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220906_111729_555841_5E53B5C6 X-CRM114-Status: GOOD ( 26.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Sep 06, 2022 at 01:29:21PM +0200, Linus Walleij wrote: > On Tue, Sep 6, 2022 at 12:11 PM Francesco Dolcini > wrote: > > On Mon, Sep 05, 2022 at 10:01:47PM -0700, Dmitry Torokhov wrote: > > > This patch switches the driver away from legacy gpio/of_gpio API to > > > gpiod API, and removes use of of_get_named_gpio_flags() which I want to > > > make private to gpiolib. > > > > > > Signed-off-by: Dmitry Torokhov > > > --- > > > drivers/mfd/stmpe.c | 36 +++++++++++++----------------------- > > > 1 file changed, 13 insertions(+), 23 deletions(-) > > > > > > diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c > > > index 987e251d90ae..0c4f74197d3e 100644 > > > --- a/drivers/mfd/stmpe.c > > > +++ b/drivers/mfd/stmpe.c > > > @@ -8,14 +8,13 @@ > > > */ > > > > > > > > > > > > - pdata->irq_gpio = of_get_named_gpio_flags(np, "irq-gpio", 0, > > > > > + irq_gpio = devm_gpiod_get_optional(ci->dev, "irq", GPIOD_ASIS); > > isn't this changing from irq-gpio to irq-gpios property name? > > The gpiolib core will automatically append and test the strings > *-gpios and *-gpio (in that order) > > > in the DTS files we do have something like that: > > > > irq-gpio = <&gpio TEGRA_GPIO(V, 0) IRQ_TYPE_LEVEL_LOW>; > > This seems to be an orthogonal bug. > > That flag in the last cell is invalid for a GPIO, the DT schema should > scream at you if you have one. GPIO flags are > GPIO_ACTIVE_LOW, GPIO_OPEN_DRAIN etc. That looks more > like an IRQ, and then the property should be irqs = <...>. Francesco is right though in the sense that we need to update DTS together with the patch, or we will break the driver... The original code relied on the fact that flags returned by of_get_named_gpio_flags() could contain anything, not necessarily valid GPIO flags. Thanks. -- Dmitry _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel