Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp272254pxb; Wed, 18 Aug 2021 01:53:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfrFKSWOO5h31+M9P4BUpyau+RixNDVkSYQTqiAZBs5yN69W1ApbutjYJMrBTvXQItNjx3 X-Received: by 2002:a05:6638:3789:: with SMTP id w9mr6994279jal.131.1629276815070; Wed, 18 Aug 2021 01:53:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629276815; cv=none; d=google.com; s=arc-20160816; b=xE6ss2vkhSAgNRwhhdU8SlhPntr/J0+9OU9inZmJkw4xKUk8222AFh4P2jZY5Ru2Np KoSMyv+nIT+SaLBD2WJBJjSc07sxNC5QsG3zJVBacBskEKa/tbtQ299HSHYnLRJwIyiB ZEIoUbRlmu4hVLJ21gLwUF9hiRJ4Br5ibsIuxgRIniPqUsUtDTIZiOgdqNd4gLv2zJh3 n+T6FJ1LC+VE0Xmr9IXrWdA7rhLV6N99+9E4rsQZJCyMEzApGtRKMagP8O4QWBJCg4i6 mO8nMxIu76lCx1GuE8jEYMgkt+OnuFMr9ifplV8+aYXFSKHfHUMgsP70BVZvJBEPy9ae Oxpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=kAs4FcsKjsY9uyu5cLCHNtFRpsWY8caITfEKFA0U4PA=; b=k/dKyTvMf2x3DX+YYZYyxRb9dla6j0p+MHsFlAHiN1VCAjnP/gOzDoJvYCHj3mGhfs X7XWQxszoqO95Ncdv1IaQvMbkFURsVo8Y4qKsyTqR0Z8sDj3lrzPctkNFSLLW5Ai00LY yOPoDJZ4ZG/QyWQ9t3hddfYNC7CTQeyERT9EtPR+NCCe7LPFarb074flqmUWqeel1rul sLKhLT0OauyDzhWbRMLp9rbnM01z65vDPgDIIDU8IpBAGNeXvAd5l+k/IhATp2ViyiXA yL2dYHUbPFz8+aOxZRieMMqaCaCGgN7fNUwzy2WUGsEEJyDaPt/qn/lAekBhV/Vn3Zrq L0ug== ARC-Authentication-Results: i=1; mx.google.com; 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 k17si4928276jao.14.2021.08.18.01.53.22; Wed, 18 Aug 2021 01:53:35 -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; 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 S229845AbhHRIwm (ORCPT + 99 others); Wed, 18 Aug 2021 04:52:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229726AbhHRIwm (ORCPT ); Wed, 18 Aug 2021 04:52:42 -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 11F19C061764 for ; Wed, 18 Aug 2021 01:52:08 -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 esmtp (Exim 4.92) (envelope-from ) id 1mGHIs-0001JE-9s; Wed, 18 Aug 2021 10:52:06 +0200 Subject: Re: [PATCH V3 3/3] gpio: modepin: Add driver support for modepin GPIO controller To: Piyush Mehta , arnd@arndb.de, zou_wei@huawei.com, gregkh@linuxfoundation.org, linus.walleij@linaro.org, michal.simek@xilinx.com, wendy.liang@xilinx.com, iwamatsu@nigauri.org, bgolaszewski@baylibre.com, robh+dt@kernel.org, rajan.vaja@xilinx.com Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, git@xilinx.com, sgoud@xilinx.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Pengutronix Kernel Team References: <20210818081018.2620544-1-piyush.mehta@xilinx.com> <20210818081018.2620544-4-piyush.mehta@xilinx.com> From: Ahmad Fatoum Message-ID: Date: Wed, 18 Aug 2021 10:52:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210818081018.2620544-4-piyush.mehta@xilinx.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: a.fatoum@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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18.08.21 10:10, Piyush Mehta wrote: > This patch adds driver support for the zynqmp modepin GPIO controller. > GPIO modepin driver set and get the value and status of the PS_MODE pin, > based on device-tree pin configuration. These four mode pins are > configurable as input/output. The mode pin has a control register, which > have lower four-bits [0:3] are configurable as input/output, next four-bits > can be used for reading the data as input[4:7], and next setting the > output pin state output[8:11]. > > Signed-off-by: Piyush Mehta > Acked-by: Michal Simek > Reviewed-by: Linus Walleij > --- > +/** > + * modepin_gpio_dir_in - Set the direction of the specified GPIO pin as input > + * @chip: gpio_chip instance to be worked on > + * @pin: gpio pin number within the device > + * > + * Return: 0 always > + */ > +static int modepin_gpio_dir_in(struct gpio_chip *chip, unsigned int pin) > +{ > + return 0; > +} You say the gpio controller can configure pins as inputs or outputs. Yet, .direction_input is doing nothing. So it's not clear to me, how this sequence could work: - set gpio output high (writes bootmode) - set gpio to input (no-op, pin will remain high, not high impedance) I didn't check the previous discussions, but if this indeed works as intended, the how should be written here into the driver. That is a more useful comment than kernel doc for a stub function. -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |