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 569BFC4332F for ; Wed, 16 Nov 2022 01:43:06 +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=gadFacylmPL8/9TJD+2N5SPaiLond4ESqNTj+OxcC8I=; b=OwR4Bs2dbsjZir fKbJ7X90XK8QKcxHmRTwALi0DSqliLz2yDxTCFutO0XL0vSkpwEBcM6sHaBqT0SlP6tVEWhm5TX// LDXnX4+W95vljA2U3hghenfDaesUeNF4pRVVkchfa3tMvvvU5nO4/sWy/8IiYn9Kovl37GcPAs/B4 K2OO34rBsK9R4xcF98V1OH4SVF3y9bJsZSp3yFF6/FqNn6eDJD0Ig002KkIp2/6E32UKI8SHW3LwY mSMPSUGYPa8mj9YM9G4Mn2ZS4WY+J8KRxgOp6xpxnINpCFyaRcl10XzUoOuS9ZbAZaJjLX66ZYDhG 4Nbz1Ff3jWWcNxA6NlEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ov7Px-00GCJ2-9l; Wed, 16 Nov 2022 01:40:45 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ov7Pu-00GCI0-8P for linux-arm-kernel@lists.infradead.org; Wed, 16 Nov 2022 01:40:43 +0000 Received: by mail-pl1-x636.google.com with SMTP id g24so15078844plq.3 for ; Tue, 15 Nov 2022 17:40:39 -0800 (PST) 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:message-id:reply-to; bh=tC39c52VXlH1nLHOE32Z4yAFwh97BBwoEeu9XFxg7fM=; b=LFN77UazmWNU86etGthla4NIY+DMIOtHWFTsYHkQw1ZP+tJWXCdRp90H5t1p8jWSCk SrwYiySwZffeTN44dS+DClYvo5sM2qDaOSuElWyVgJU+6b0K4ZdVHEmYyRlP2sMaArzx VmP5+9Iaf7z0tmaBvSCiRpfGuxEMvyGqrVom4ZjM24OlGbI1z3GJSFZe1K/QFYwn3klf WEsDqM3n0rNhOSfxQ/za7xF0SgT+4X1NW0vqH54DbHocnRLFJqNDX/hGIr7gexroyxiI iKltQF6CwoLeVYM7bWxT9+qSlDoUUS1/a3ptNhDUV8qCz/6lqtOJxlXMpkHDp964Ox8s 0qgA== 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 :message-id:reply-to; bh=tC39c52VXlH1nLHOE32Z4yAFwh97BBwoEeu9XFxg7fM=; b=hoZYTRwMcWssR9Qont5tJ6KTMkjejAkpFK2eh7f2X1iXdsXFMAcNy2czQlLGjPuhZd naoQARxoyjYzsstr4/Hb4KtLTB83uV0VXo2c/hZzrGp1V0eF9eu/K7PTuNwEEHsl0wio IB1dvH7jcjL+DyY0Df5fdwzsNQJdb+E2gQsFOvBHCs0IqCnfA3Jq5qKHi2jReYbjBj/D hmnlRI9Zs0MDoBAh+5vT8lrwGfDk8O3VTplnLAoHhXrgMf0IFW/DYVvM/yfcEHX+jDiu UKjkHeQa17a8VAd6fIJUsVy7rnrmj8WTdv/KSvwd80KLyxwoIC8gWTyUy41NNrlVCF/h x0cA== X-Gm-Message-State: ANoB5pkxt7VyjR5cAzY1w4W79Z+OB0iBFQwgH6CEzYUtvwVlQx0pmaZi kNndvQKfwB/GxS9QBLCXJbE= X-Google-Smtp-Source: AA0mqf4FH1AyoCGGPQjYiNXznNXk6gMUe9N38XL1WWSBRft/ou8X2i72yV7p9JGRQIHXlpcaBZeVqQ== X-Received: by 2002:a17:90a:a006:b0:213:e907:5c0d with SMTP id q6-20020a17090aa00600b00213e9075c0dmr1181126pjp.83.1668562838631; Tue, 15 Nov 2022 17:40:38 -0800 (PST) Received: from google.com ([2620:15c:9d:2:2d36:e9a0:170b:669f]) by smtp.gmail.com with ESMTPSA id h2-20020a170902f7c200b00176ab6a0d5fsm10578774plw.54.2022.11.15.17.40.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 17:40:38 -0800 (PST) Date: Tue, 15 Nov 2022 17:40:35 -0800 From: Dmitry Torokhov To: Andrew Lunn Cc: Gregory Clement , Sebastian Hesselbarth , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ARM: mvebu: switch to using gpiod API in pm-board code Message-ID: References: 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-20221115_174042_317370_4F17C1C0 X-CRM114-Status: GOOD ( 13.10 ) 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 Wed, Nov 16, 2022 at 02:10:29AM +0100, Andrew Lunn wrote: > > - ret = gpio_direction_output(pic_gpios[i], 0); > > - if (ret < 0) { > > - gpio_free(pic_gpios[i]); > > + pic_gpios[i] = fwnode_gpiod_get_index(of_fwnode_handle(np), > > + "ctrl", i, GPIOD_OUT_HIGH, > > + name); > > The old code passes value=0 to gpio_direction_output(). For > fwnode_gpiod_get_index() you pass GPIOD_OUT_HIGH. Is this correct? Yes, gpiod API works on logical states, whereas old gpio API used signal levels. In arch/arm/boot/dts/armada-xp-gp.dts ctrl-gpios are described as "active low": cpus { pm_pic { ctrl-gpios = <&gpio0 16 GPIO_ACTIVE_LOW>, <&gpio0 17 GPIO_ACTIVE_LOW>, <&gpio0 18 GPIO_ACTIVE_LOW>; }; }; so gpiolib will translate GPIOD_OUT_HIGH to 0 when setting final state of the pin. There are discussions to rename GPIOD_OUT_HIGH and friends to something like active/inactive for better clarity, but that has not happened yet. Thanks. -- Dmitry _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel