Received: by 2002:ab2:7853:0:b0:1fa:5c73:8e2d with SMTP id m19csp31823lqp; Thu, 30 May 2024 11:02:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVJ5bvq8ATwssWdsoK7qvv98XiCbkJkgiFh08VfIBBjkFOLC9yEtAxEB5RjtJHWPgQbyAQfbqIzOYET/wE7vt8aPy3aqUuLUcz65bMv+Q== X-Google-Smtp-Source: AGHT+IGiXknfyWI7f9cUmgo+v8HjgD022zQs1HU62lofc55H+3aDWmbQQX70ehSTtvz846bezPp2 X-Received: by 2002:a17:902:c40f:b0:1f4:8faa:cd68 with SMTP id d9443c01a7336-1f619622c24mr32012585ad.29.1717092171157; Thu, 30 May 2024 11:02:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717092171; cv=pass; d=google.com; s=arc-20160816; b=EWBsYbrp7OTvVVc/sASHxnbllpOkS2XHuQz3QXeGC5J/8BCPVHliRnOVbxEN7V+DMw fZCm8TRBhMyDrjASjNsEXJrjf9JkE9vRaOpTOCca8PPsoRRw2sf5ZE5u0OdGIghBzM8v yPS42tW/gE9iF2KJ4woJIp7FgYvXJx+yZ+xG7Go+QmU7dJ7iZeQ5A1E2TqNNUka/nHnw FwRHMcVIfo3Rm+oWmXI3nWb3vnO+szTIlhjm7HFIJgImkfRC6HoI0SZTukGbAKUBHHFe ICMsb30xU6ruGdVwrBAWTU6bufmukk976tPmjYOij0L1uQCRe1VsBchtPf24KVEP5kvf HpAg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=GuqYrTdiqIXrKd3pr++y5Sw5lUnemumcABKGe+QWJdU=; fh=dCSi2TL8s9yMKxL0kHAc6StylIcYJejPga0FX6Wo95Q=; b=gYeKAnAMHvU+k/HsJLcvqj8hf4inyKdQsKWu00HXGGKZZtKDAwixi478Su6M8h7OaN VoJs0vdV+8BakTbYRZyIyA22XU0o+shEJz+EKPzUrxYhSiTQSTWVXRaqgNSk6OV8bpgb HRrIJGYZVQlYXUph7nNYv9LcY8X5M/Z+cRtV8Sk5ygb3yHoJKEaaaiDcFuSkZrNRHAJD ozr/L0LeKKV54ZrVWH4l0GSpafXe2NMeuwbKmWEBxHN5JhLbtB/lU9CXeBgNZcxzM1jk HCG3TeJuhgVC0QvCLKmNzOqTEmq32YqKNvavbzRguq+cK87JW77TZ19HW7QW96V0A7+R Kr9g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HDwF9ntH; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-195751-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195751-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6324013eesi831485ad.472.2024.05.30.11.02.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 11:02:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195751-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HDwF9ntH; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-195751-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195751-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C079E287A1D for ; Thu, 30 May 2024 17:44:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DED464EB24; Thu, 30 May 2024 17:42:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HDwF9ntH" Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC60954747; Thu, 30 May 2024 17:42:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717090953; cv=none; b=tXCYTQOwor/cSlUXx2bmO3QVTwUy+JBiLygHDhgb3qN0Em4o0fCjstFHZ3X0VQaAiCBt5ikhYBKGG5D2zL9pbNdFX38V9TbJIr9Ot/ehO7i2kWf368LSYyZM+eo7ioJLEiMWzeYmbZSJ9c+Z/8GBSUMghw27D3tUZ7OLp6UD0XE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717090953; c=relaxed/simple; bh=p7r0INwKdRWb48rWdh8TKxHgYlfbC3bweA28z1yvs8k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KAKFfBxXQ4ze7V/RNoPZLHGxhsD83lrULNlh5Pgdn+lhJDBicD7x91Q1Arjrjazl4GoYWUZ6RgloEjBqMHQy5HiBliw3QrlNLG0Fn1+oI6R0bcwKFQcwfZj65MwP1hDMYxdOJrZ6qSU/kilyzDUUwSZZ1z1eGewazlgOF8eXcC8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HDwF9ntH; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1f62fae8c1aso2048195ad.3; Thu, 30 May 2024 10:42:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717090950; x=1717695750; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GuqYrTdiqIXrKd3pr++y5Sw5lUnemumcABKGe+QWJdU=; b=HDwF9ntHykrMhOhs5HkfRE8R6Uwg6TptC8PXFQUr2p8TFpUjPD+FCHxIv5DuuRNgoI 9wgH2sE2N9cErEnETrebFYgx4N8/JzHwOtow3xeKMAqeuo5mfDIIweR7Tc0dpYyJhPtS Qa/K3MclHIv42KMLY8TZnAEfzLUSjDggxEcbOhpon3c7iyh4PBPmnw3sai0/yqYmyQAi 3jcCcnFVGWpyD2a5ykWfdktJKFkyBltbE+ad1g09NRQvtixxtvdr6YJOckfpJL/HG9RU u0yYgvt3hhmyahVJOVE3WeaeQweSa+WbxW6mLEDewfw7pMHmg0vZXKPSmpY2VfWxyLoR z3PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717090950; x=1717695750; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GuqYrTdiqIXrKd3pr++y5Sw5lUnemumcABKGe+QWJdU=; b=lVX4EMbLY04zww4wbwP+DIviCmhhQfMXvXhHsK+4/PeBSLUuxwmn2sNFw+p4ogFESX HQTqR0WaLdIWV+hYBF1bdiwuJcUntNmmN/I+RsM8w+Z/RBkJwH86REBeJa+TObNGj6HR JxrK9m7ElcPw4zcitFphjvAFdJjd7lLcnlRH0yWH7vCbkUGvM733cs3QTJGnI/cJ+iR4 thMhcQkZsuTgJhauuxPCIHa3oFyUg4NtySeVLjYxuCAtI45FHbEfc9KYJcv0v06YL3Bw z5EX4NECo1UUhgmNf4PqKx/BSFJxr1A2pjcc0EwuZHRuM39jzmuVCZIe2diDd23oDTY6 /USw== X-Forwarded-Encrypted: i=1; AJvYcCWjj7mMNg2NYAw8ZApCqaPGIbwQtA+tVWJSEs2Y3MgaRmgVhgx5vdgMnCq9hUNL1IYvk8klYoenTndzxyiQD5M/XNWx+847x/xuHN9L6fQdjHVifElhIH+jz/xCkTWlUDHDkFB6IOWH1Hj0svPN9+31LTGT844UeDqFutyX/Tu4GU21Zd4= X-Gm-Message-State: AOJu0Yy2aAGR2fvwNg4wkq/y7gCBxykv/0KHtGq59ao2eDPaJaek61QO ki1Lyz2gTHEJlmXLJnBwq50uGZjLX7RjaB1C9Agqp6mmXFzoDZgDWwEodx+sNP4= X-Received: by 2002:a17:903:228a:b0:1f4:5ad1:b65e with SMTP id d9443c01a7336-1f6197271a5mr33858015ad.34.1717090949791; Thu, 30 May 2024 10:42:29 -0700 (PDT) Received: from prasmi.. ([2401:4900:1c07:3bcb:e05d:a577:9add:a9ce]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f63240c947sm450105ad.269.2024.05.30.10.42.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 10:42:29 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Geert Uytterhoeven , Linus Walleij , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Biju Das , Claudiu Beznea , Fabrizio Castro , Paul Barker , Lad Prabhakar Subject: [PATCH v3 10/15] pinctrl: renesas: pinctrl-rzg2l: Add support to configure the slew-rate Date: Thu, 30 May 2024 18:38:52 +0100 Message-Id: <20240530173857.164073-11-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240530173857.164073-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20240530173857.164073-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Lad Prabhakar Add support to configure slew-rate property of the pin. Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven --- v2->v3 - Included RB tag RFC->v2 - New patch --- drivers/pinctrl/renesas/pinctrl-rzg2l.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c index 807851c33e48..6b82e78afa7c 100644 --- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c +++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c @@ -127,6 +127,7 @@ #define PFC(off) (0x0400 + (off) * 4) #define PIN(off) (0x0800 + (off)) #define IOLH(off) (0x1000 + (off) * 8) +#define SR(off) (0x1400 + (off) * 8) #define IEN(off) (0x1800 + (off) * 8) #define ISEL(off) (0x2C00 + (off) * 8) #define SD_CH(off, ch) ((off) + (ch) * 4) @@ -145,6 +146,7 @@ #define PFC_MASK 0x07 #define IEN_MASK 0x01 #define IOLH_MASK 0x03 +#define SR_MASK 0x01 #define PM_INPUT 0x1 #define PM_OUTPUT 0x2 @@ -1049,6 +1051,13 @@ static int rzg2l_pinctrl_pinconf_get(struct pinctrl_dev *pctldev, arg = ret; break; + case PIN_CONFIG_SLEW_RATE: + if (!(cfg & PIN_CFG_SR)) + return -EINVAL; + + arg = rzg2l_read_pin_config(pctrl, SR(off), bit, SR_MASK); + break; + case PIN_CONFIG_DRIVE_STRENGTH: { unsigned int index; @@ -1155,6 +1164,15 @@ static int rzg2l_pinctrl_pinconf_set(struct pinctrl_dev *pctldev, settings.power_source = pinconf_to_config_argument(_configs[i]); break; + case PIN_CONFIG_SLEW_RATE: + arg = pinconf_to_config_argument(_configs[i]); + + if (!(cfg & PIN_CFG_SR) || arg > 1) + return -EINVAL; + + rzg2l_rmw_pin_config(pctrl, SR(off), bit, SR_MASK, arg); + break; + case PIN_CONFIG_DRIVE_STRENGTH: arg = pinconf_to_config_argument(_configs[i]); -- 2.34.1