Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2253766pxb; Sat, 27 Feb 2021 16:52:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJyVpatXU7hUs0UDYLQav7zcvj2BWVQOmAQL/I9dygQZLNwm06dAFjKrKZXUMOvzkxyYTZP9 X-Received: by 2002:a17:906:cf90:: with SMTP id um16mr9933028ejb.389.1614473535084; Sat, 27 Feb 2021 16:52:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614473535; cv=none; d=google.com; s=arc-20160816; b=jEGpf6rBXS9JDq2Sc1yhPpdIe5U7eV1AFBFCj2UuIxvDATfSAk3WMAFFED+IZw1Ed1 3K7/rZAzyQt43XW1ivLb5Xq5I1qcfTO5lWCxKH2EQnLwYseQwlAOXxmYJdA/aaRJ5qV8 Ku7/NdrUsrHdSlAmVWHvpzmjvz4xhNNCrYrL5NWmWz84U/Btmu4GejYeRfArTLlC2/eQ TKt9wmk5B9Mnv+2L7HsCk4a2pQxYxsoRCl6ma1wZUskLX002ic2tkjJNYZPUifi7Zyxl F/eHPdfj4TmQ2/ihTMD6vYRHsj8oyaL+B8cfZQd98QJM5hlugYYQP1/8FAfG2yjWXD+N Rp5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=XWqnUl1mdnB3JAAYw5d6L5y9S7s05e4ZLh5O99+5nfM=; b=OkexIM3F/Dt4mj+gDHlyAGtLJOrcrG0ygbhUX8Gjjap0YGDOsGfk3MZz4xkVE5Kgah 8cD9UTWr2oI7RjC2WW2sl4CrHSwXRk5fCp0QMNgB/DAfENhw9ZCSA2d8Km0fAhmtXkhO l6MDlV3vPRIk25nSsZd9rNgN09QF+4gRNWmmRfCoYP9vUujHQott5k878EFEPtCU6CAk QIAe9vsKLV7BbjmGxUu/67qyxmp1wYHMLOo77UTqg8DLxdjwkpNtBHDzaDpAT6H4FcXj /yPrzRbqrRx+yt/6A5AaOsRPBkOlrXY20yrUkW6Ixcw+FB2PVwxMu6NfcFRAeattM3bb KpmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nigauri-org.20150623.gappssmtp.com header.s=20150623 header.b=qNy44be0; 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 p22si8598686ejj.57.2021.02.27.16.51.48; Sat, 27 Feb 2021 16:52:15 -0800 (PST) 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=@nigauri-org.20150623.gappssmtp.com header.s=20150623 header.b=qNy44be0; 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 S230178AbhB1Aun (ORCPT + 99 others); Sat, 27 Feb 2021 19:50:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230040AbhB1Aul (ORCPT ); Sat, 27 Feb 2021 19:50:41 -0500 Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A93A6C06178B for ; Sat, 27 Feb 2021 16:49:21 -0800 (PST) Received: by mail-ot1-x32b.google.com with SMTP id f33so12889453otf.11 for ; Sat, 27 Feb 2021 16:49:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nigauri-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=XWqnUl1mdnB3JAAYw5d6L5y9S7s05e4ZLh5O99+5nfM=; b=qNy44be0yKLCic21OcqvK9OW7l6hT9Ki+KTr5ZBg0y9aKe8VeN1cqTlDFrB1ELKFbG lBA/CvWWzuYMDDUDgHjOcA60wHwSjk0/NJVdL/QfxbGfp3P1okAuOAdYy3gULUMVayua dT20Qx5T8hVVyuXXfxwdayYp3/OcNqEFXYcMM9iHaqCuZDOdkpLdhRTWu/FxBUsY6c+8 vKr9HKIIQ7W9rU36hjZTNr05EZMrhLtLUhz+/j/727Lcdo7E+fl+KZyh5Cd8DB5+5V2r 1a8lBCVYJ6StHdG2WIUoQYJg9T4PZADff86lUWkF1QG7Fgdw8EuRXy2FjKgvi2CHF3EQ xcDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=XWqnUl1mdnB3JAAYw5d6L5y9S7s05e4ZLh5O99+5nfM=; b=EkQ/LWqyP6h7JP4l/eBeTbWWePfQfEWzhwMiwni+CFKUpFkTPMu7KpmPdi0ONH0Yan 2fMZ+5GAwj6h+KgPClpyDP0iqABklldwlzd2XU9CvCb41f/y4H8a7fUcWDgIHOLxQNzv E6lW7w6GNFtSjfsieFsuDsO0YzrgqlGYRVMf81u+Ro0ZguXSd3DV1j7tcMEDUsEuX9UW 9r7B8/oxVRwdmb6wmKmSQG5kf0pmRCEk34DA10p32dxzwqyhvEc/4tOHKg86hiHe9hil vCJOssp5rS4l/9aS0/Bo83PVVLtudGkrY02hcMukyive9UxfbHSWhQLvIzY7sTziFE5F Bx1Q== X-Gm-Message-State: AOAM532teWD0c5Aafxs599Z7Fg0dXHiMgSGKnocvoFL1gSoRY4tIfMs6 W6uchp8bzdpL8VkGMrLx0BvXdkuhbzrH7cCIntcJ X-Received: by 2002:a9d:63ce:: with SMTP id e14mr7682977otl.347.1614473360895; Sat, 27 Feb 2021 16:49:20 -0800 (PST) MIME-Version: 1.0 References: <1613131643-60062-1-git-send-email-lakshmi.sai.krishna.potthuri@xilinx.com> <1613131643-60062-4-git-send-email-lakshmi.sai.krishna.potthuri@xilinx.com> In-Reply-To: <1613131643-60062-4-git-send-email-lakshmi.sai.krishna.potthuri@xilinx.com> From: Nobuhiro Iwamatsu Date: Sun, 28 Feb 2021 09:48:54 +0900 Message-ID: Subject: Re: [PATCH v3 3/3] pinctrl: Add Xilinx ZynqMP pinctrl driver support To: Sai Krishna Potthuri Cc: Linus Walleij , Rob Herring , Michal Simek , Greg Kroah-Hartman , linux ARM , Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, git@xilinx.com, saikrishna12468@gmail.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, 2021=E5=B9=B42=E6=9C=8812=E6=97=A5(=E9=87=91) 21:10 Sai Krishna Potthuri : > > Adding pinctrl driver for Xilinx ZynqMP platform. > This driver queries pin information from firmware and registers > pin control accordingly. > > Signed-off-by: Sai Krishna Potthuri > --- > drivers/pinctrl/Kconfig | 13 + > drivers/pinctrl/Makefile | 1 + > drivers/pinctrl/pinctrl-zynqmp.c | 1031 ++++++++++++++++++++++++++++++ > 3 files changed, 1045 insertions(+) > create mode 100644 drivers/pinctrl/pinctrl-zynqmp.c > > diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig > index 815095326e2d..25d3c7208975 100644 > --- a/drivers/pinctrl/Kconfig > +++ b/drivers/pinctrl/Kconfig > @@ -341,6 +341,19 @@ config PINCTRL_ZYNQ > help > This selects the pinctrl driver for Xilinx Zynq. > > +config PINCTRL_ZYNQMP > + bool "Pinctrl driver for Xilinx ZynqMP" > + depends on ARCH_ZYNQMP > + select PINMUX > + select GENERIC_PINCONF > + help > + This selects the pinctrl driver for Xilinx ZynqMP platform. > + This driver will query the pin information from the firmware > + and allow configuring the pins. > + Configuration can include the mux function to select on those > + pin(s)/group(s), and various pin configuration parameters > + such as pull-up, slew rate, etc. > + > config PINCTRL_INGENIC > bool "Pinctrl driver for the Ingenic JZ47xx SoCs" > default MACH_INGENIC > diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile > index f53933b2ff02..7e058739f0d5 100644 > --- a/drivers/pinctrl/Makefile > +++ b/drivers/pinctrl/Makefile > @@ -43,6 +43,7 @@ obj-$(CONFIG_PINCTRL_TB10X) +=3D pinctrl-tb10x.o > obj-$(CONFIG_PINCTRL_ST) +=3D pinctrl-st.o > obj-$(CONFIG_PINCTRL_STMFX) +=3D pinctrl-stmfx.o > obj-$(CONFIG_PINCTRL_ZYNQ) +=3D pinctrl-zynq.o > +obj-$(CONFIG_PINCTRL_ZYNQMP) +=3D pinctrl-zynqmp.o > obj-$(CONFIG_PINCTRL_INGENIC) +=3D pinctrl-ingenic.o > obj-$(CONFIG_PINCTRL_RK805) +=3D pinctrl-rk805.o > obj-$(CONFIG_PINCTRL_OCELOT) +=3D pinctrl-ocelot.o > diff --git a/drivers/pinctrl/pinctrl-zynqmp.c b/drivers/pinctrl/pinctrl-z= ynqmp.c > new file mode 100644 > index 000000000000..ec0a5d0e22d5 > --- /dev/null > +++ b/drivers/pinctrl/pinctrl-zynqmp.c > @@ -0,0 +1,1031 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * ZynqMP pin controller > + * > + * Copyright (C) 2020 Xilinx, Inc. > + * > + * Sai Krishna Potthuri > + * Rajan Vaja > + */ > +/** > + * zynqmp_pinctrl_get_function_name() - get function name > + * @fid: Function ID. > + * @name: Function name > + * > + * Call firmware API to get name of given function. > + * > + * Return: 0 on success else error code. > + */ > +static int zynqmp_pinctrl_get_function_name(u32 fid, char *name) > +{ > + struct zynqmp_pm_query_data qdata =3D {0}; > + u32 ret_payload[PAYLOAD_ARG_CNT]; > + > + qdata.qid =3D PM_QID_PINCTRL_GET_FUNCTION_NAME; > + qdata.arg1 =3D fid; > + > + zynqmp_pm_query_data(qdata, ret_payload); Please check the return value here as well as other functions. I know that when we used zynqmp_pm_query_data with PM_QID_PINCTRL_GET_FUNCTION_NAME, it returns -22 error code. How about adding processing with zynqmp_pm_query_data like PM_QID_CLOCK_GET_NAME or writing a comment here? Best regards, Nobuhiro --=20 Nobuhiro Iwamatsu iwamatsu at {nigauri.org / debian.org} GPG ID: 40AD1FA6