Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp267686pxb; Mon, 8 Nov 2021 13:19:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJzmLZO+U1gGTObZRwqoh0zdXSBw3/1ZRMca+rNW1u1gUrFP2iTaeL0Xb6bfn2LA83PKZQhI X-Received: by 2002:a05:6402:3596:: with SMTP id y22mr2946075edc.255.1636406363674; Mon, 08 Nov 2021 13:19:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636406363; cv=none; d=google.com; s=arc-20160816; b=Af+40iRskAzqd3CdAKaS2gPDJ4IN7Quw+ZErvzTdOsKE8X5vg2y5d476z0NCsYLD9o ZB8W1sZY0M6wCPFipg5La2XiEC8zXLl6jpESIXqIN7RUs+sdYnGrPDUkImvW0FlCpGnc NjRPOHRl6vSRkP1212/HGtZdCnaXN1qILXuOuBnSBIgECaPrvDlct6ROc2xCHBJGbgAp lmbjx65l/nlK82DABV32sWvoPKBJL3AcySUVh1Ei78k0R8FYa1Fi2mnaHfXFZxpYaab7 GpkRbmDTSh8etIW6SeAIM49onxWS64jDOwp0mGXvKJ8G+5b6WSs3dB442kJVsEVLgiqP H+6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=k4LeFueSc7hLKiDpRlmPKtWWYGiljXl+wMBq6RJeU0c=; b=GHhbe09/IXj2CC1HBAhmVuPxYAwUTZ9Dvi5FSCI7jVkzY+6vXbZtCIjUFoohOzOlsW VxI2h3XH09thCtNnFR3fnHXcfhJ/FEKlq6aZpX4T2or1gnQ/KYCejZVn2sCHFjZQxqSY NyETTRtKRRL01bGAtjqXzSpKmMXX3B8kYMsKONa417D3TJgnA9PQDzR1iWspGCKSZsXg Y8L8rYKY6ZUtQS89m2X2ANtGJ9h4/hGXPwh/fOV9lW4Qta2x3EmVyDKKswR8zFakD1Ip ZTN1ewV5zRHfCsfv6u/EBEAeIivVRrwIuC14MLv+3SeGzvOKb43Sm7RXsoN4w+qVgiDJ ClOw== 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 qf7si33695872ejc.581.2021.11.08.13.18.45; Mon, 08 Nov 2021 13:19:23 -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; 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 S240980AbhKHPiz (ORCPT + 99 others); Mon, 8 Nov 2021 10:38:55 -0500 Received: from mail-ua1-f49.google.com ([209.85.222.49]:33692 "EHLO mail-ua1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236257AbhKHPiy (ORCPT ); Mon, 8 Nov 2021 10:38:54 -0500 Received: by mail-ua1-f49.google.com with SMTP id b17so32355607uas.0; Mon, 08 Nov 2021 07:36:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=k4LeFueSc7hLKiDpRlmPKtWWYGiljXl+wMBq6RJeU0c=; b=tmzvGeAwq+6gx0Eac/XWrOTd3yKwvI9T86qtVgAFiE1iuMKpcMKgfMqUTnZ85mb8qn YbuV3cIPN3N/63eInR80NkNVTa3aNpCk/pSVbml6TM9j5MX3nRzbIuUBRSJGtvjZVFfF 6E6j4xiBCFXQnrqhcHokEpkFrSYvtvedKzJLmRVtwmx86vCUyjUFGGsMZ5hahZ9W7NqC A2puvO4mv6YrKrG3wBZn+Y8NkhnYLnmuh+/d6P+5vt+AT0net4OfaWolBBFzN4TNyybE BhNHWBYE5w7ANTts1ERX46ilbHzxD9A7PGInNzWh4Es07f5FrGz0auoNa0OhrBu0PkEn lIzg== X-Gm-Message-State: AOAM533q+yzptSoSUCeKyQWT6Y9tFLWcOJXVxyrL1c76z1R8IQWCBM/1 a3fGbUkw6wfd2j07MJiladKpEdztk3f660ot X-Received: by 2002:a05:6102:ed3:: with SMTP id m19mr405335vst.5.1636385769345; Mon, 08 Nov 2021 07:36:09 -0800 (PST) Received: from mail-ua1-f46.google.com (mail-ua1-f46.google.com. [209.85.222.46]) by smtp.gmail.com with ESMTPSA id t12sm2618968vkk.52.2021.11.08.07.36.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Nov 2021 07:36:09 -0800 (PST) Received: by mail-ua1-f46.google.com with SMTP id b3so32334505uam.1; Mon, 08 Nov 2021 07:36:08 -0800 (PST) X-Received: by 2002:a05:6102:3a07:: with SMTP id b7mr75198533vsu.35.1636385768673; Mon, 08 Nov 2021 07:36:08 -0800 (PST) MIME-Version: 1.0 References: <20211029124437.20721-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20211029124437.20721-4-prabhakar.mahadev-lad.rj@bp.renesas.com> In-Reply-To: <20211029124437.20721-4-prabhakar.mahadev-lad.rj@bp.renesas.com> From: Geert Uytterhoeven Date: Mon, 8 Nov 2021 16:35:57 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 3/5] pinctrl: renesas: pinctrl-rzg2l: Add support to get/set pin config for GPIO port pins To: Lad Prabhakar Cc: Geert Uytterhoeven , Linus Walleij , Rob Herring , "open list:GPIO SUBSYSTEM" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List , Linux-Renesas , Prabhakar , Biju Das Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Prabhakar, On Fri, Oct 29, 2021 at 2:44 PM Lad Prabhakar wrote: > Add support to get/set pin config for GPIO port pins. > > Signed-off-by: Lad Prabhakar > Reviewed-by: Biju Das Thanks for your patch! > --- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c > +++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c > @@ -495,6 +512,14 @@ static int rzg2l_pinctrl_pinconf_get(struct pinctrl_dev *pctldev, > port = RZG2L_SINGLE_PIN_GET_PORT(*pin_data); > cfg = RZG2L_SINGLE_PIN_GET_CFGS(*pin_data); > bit = RZG2L_SINGLE_PIN_GET_BIT(*pin_data); > + } else { > + cfg = RZG2L_GPIO_PORT_GET_CFGS(*pin_data); > + port = RZG2L_PIN_ID_TO_PORT(_pin); > + bit = RZG2L_PIN_ID_TO_PIN(_pin); > + port_pin = true; Instead of setting this flag, perhaps port should be adjusted? Then rzg2l_r{ead,mw}_pin_config() don't have to care about that anymore. > + > + if (rzg2l_validate_gpio_pin(pctrl, *pin_data, port, bit)) > + return -EINVAL; > } > > switch (param) { > @@ -557,6 +582,14 @@ static int rzg2l_pinctrl_pinconf_set(struct pinctrl_dev *pctldev, > port = RZG2L_SINGLE_PIN_GET_PORT(*pin_data); > cfg = RZG2L_SINGLE_PIN_GET_CFGS(*pin_data); > bit = RZG2L_SINGLE_PIN_GET_BIT(*pin_data); > + } else { > + cfg = RZG2L_GPIO_PORT_GET_CFGS(*pin_data); > + port = RZG2L_PIN_ID_TO_PORT(_pin); > + bit = RZG2L_PIN_ID_TO_PIN(_pin); > + port_pin = true; Likewise. > + > + if (rzg2l_validate_gpio_pin(pctrl, *pin_data, port, bit)) > + return -EINVAL; > } > > for (i = 0; i < num_configs; i++) { Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds