Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2227571/?format=api
{ "id": 2227571, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2227571/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260423230338.442497-2-bigunclemax@gmail.com/", "project": { "id": 42, "url": "http://patchwork.ozlabs.org/api/1.1/projects/42/?format=api", "name": "Linux GPIO development", "link_name": "linux-gpio", "list_id": "linux-gpio.vger.kernel.org", "list_email": "linux-gpio@vger.kernel.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20260423230338.442497-2-bigunclemax@gmail.com>", "date": "2026-04-23T23:03:35", "name": "[RFC,1/1] reset: add support the GPIO provider with #gpio-cells=3", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "162fe730ae1432c545bd2ae6f59922a111b0b3a5", "submitter": { "id": 78282, "url": "http://patchwork.ozlabs.org/api/1.1/people/78282/?format=api", "name": "Maxim Kiselev", "email": "bigunclemax@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260423230338.442497-2-bigunclemax@gmail.com/mbox/", "series": [ { "id": 501262, "url": "http://patchwork.ozlabs.org/api/1.1/series/501262/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/list/?series=501262", "date": "2026-04-23T23:03:34", "name": "reset: gpio: Add support for GPIO providers with #gpio-cells=3", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/501262/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2227571/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2227571/checks/", "tags": {}, "headers": { "Return-Path": "\n <linux-gpio+bounces-35443-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-gpio@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=j+esoVyL;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-gpio+bounces-35443-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"j+esoVyL\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.167.51", "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com" ], "Received": [ "from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g1sB60rPDz1yDD\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 24 Apr 2026 09:05:02 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id EF8FF3030135\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 23:04:30 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id C05993D811C;\n\tThu, 23 Apr 2026 23:04:30 +0000 (UTC)", "from mail-lf1-f51.google.com (mail-lf1-f51.google.com\n [209.85.167.51])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 1AA423D810B\n\tfor <linux-gpio@vger.kernel.org>; Thu, 23 Apr 2026 23:04:28 +0000 (UTC)", "by mail-lf1-f51.google.com with SMTP id\n 2adb3069b0e04-5a3af1b7549so9074890e87.1\n for <linux-gpio@vger.kernel.org>;\n Thu, 23 Apr 2026 16:04:28 -0700 (PDT)", "from wpc (host-95-152-45-178.dsl.sura.ru. [95.152.45.178])\n by smtp.gmail.com with ESMTPSA id\n 2adb3069b0e04-5a4185bc58fsm5567888e87.30.2026.04.23.16.04.25\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 23 Apr 2026 16:04:26 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776985470; cv=none;\n b=WDXezJBorG9M2WQf++6u5n+P2VCUU8kFFhpcMH/Bi+tShYw0YyQD+jK5yfODcwdGP774S3PPKaCzImfy0hL2b4ZZic9fs1nKGKbT5oNTI9Ut8ycqaQimRUBtHQPWzVOseO7g4s9IXE7wD3sHdQslM4Qpvp3mmREMb3/S/Wtiq8Q=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776985470; c=relaxed/simple;\n\tbh=erx80ktmfhC9oapl7jG73U4xyRNc6cD1xGEMZX4Wvy8=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=IX66bLdjTRhjp3o0kB7tCRpL2F1RIQsbmr9nacPXaUoXl4brA0L1KWWKkseWazRBPK1ztlDSIaciOVuqHYniHEnlyOVbqSatvdEcmHQ/QLjAMs9MJyLlQGE1c+rxh/EKYMu3zPJqWtx9F+q5oJeVpMjLnxIRjiE8VY3y7U/2+Pg=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=j+esoVyL; arc=none smtp.client-ip=209.85.167.51", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1776985467; x=1777590267;\n darn=vger.kernel.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=/tNmFsyAqLll9djiLitvDLt7Sq+VOfMkML8WGxUmnec=;\n b=j+esoVyLE+Qn/aXt7XK+WcnAmi5YIFlrMwJpdZ+H3gNmLFiC+IoPY+Ldtpr1c97oLZ\n rcmUGChqi3aexVElvpkD7ZUyTSH6+xQL0HtMHCqTp8WxGYvmuioQumDMgAnEtbVff41y\n wdGhxfu7WioqhrCGbYY5WkAw5+PXe3AUKfJccoWEDw9Ihti2ihG5tmCib0hUoEYM4KUE\n bmsATLDfyn1uMxi3iEPjATQ7fkMuuAB4sLmO4e8SVXt5fGsauI6Pe/C7KB5PAjVRzCOb\n I5NHO9oq9Y6xoZPVUNkhuUSUuTw8DhAb1EG4Guxnxg7RRLS4FE1OQJ4t8AYqJrDUQj1F\n kCSg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776985467; x=1777590267;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=/tNmFsyAqLll9djiLitvDLt7Sq+VOfMkML8WGxUmnec=;\n b=TynogEXGD3yDgRKiMxo+F2bLYbP6Bu/NkhyevKvYDnPtYevKTemyEzNRAKiPyx/7LB\n TClhJQn0uhxLN9r1ODcfV8opaM5e3nLkCqS5e4k7Q5zEGb0IeWkVBIDUaiQ/gydSG3QC\n VRdoZl80LXwCIqp3pugDN6gOIPAHXkMnDHwxrdVt1Pqz8va01Ju8LNmL8BEgY6Mz+VXh\n T2p7tepxLoiUP/JDah2YHDJYJ7kIL+FnjRT4CIGa/EEoxVhJHctEKcoUFFPliFneSgsA\n SPmU67WM7eqEdi3AOrfkMZ7/om3HjkvhFCU+bInwldDlvDULJsAwAcNsi5a8y18rqOcm\n qoaQ==", "X-Forwarded-Encrypted": "i=1;\n AFNElJ/aeo+tTZ0wQREv5WDikbkDGMt4ZvTzbS996PRc8dxrtJd+Ne4O+tc26yzqL3WzUJn0xiX27+ITkWNW@vger.kernel.org", "X-Gm-Message-State": "AOJu0YzwK/oyNrc0kA3qLBYLjvOA9iv0BulQUyptKaj2ZWnxFcAHe3xT\n\t8i+Nmmm9TW83lia4EYmZqx2QVeRDs+5z2pvTbq4K2SXB7MsGTtK3yPqK", "X-Gm-Gg": "AeBDieu6geOK11kvke3ZfyAOh1pX2TUYGzglGrB8x/VXafqVkymr6nEJATD0L8mCYqj\n\tqWxg7cMz1kDK2vSG9CkNi7wvpK76b7lpqyCdmPcU1NYkTY5sR4Rc6tqPU0/cNAGM+QfIwV0s2rL\n\tx5wixHZho0Uvt103ZYdrbw7/TyLKzDiERr8Fxr5ySRSqbNcee0tuieqm3GPOfbmhejSaRDAwzAu\n\tNFUR9ic7zpEs3mqJnL0IX0M0ROXDz1M6IuuXdfHgc0WCaFXFRPXHo2E+pv0Dl4yWKOl+DIqBb5H\n\tv2757LgOdYIRRlpAj2lexlMN/dh6qFvKyfDTuhnGUQYpEqIqB5XhGVLG5DIjgOY5dM/1aebsOgy\n\tTmL4nR4cH2ogqD6auGJu6kJna/IN4BLmEHruobpppL1RANXUAqyd6+L1ipHoxHtznJO+PlH1Jnm\n\tJMwvJrRTqwNFrUY/Q2FwVyeEbQqWTY7KL6uvRqvDEusyJfIqQpJv5/kF53uFuHV3bUL/Y=", "X-Received": "by 2002:a05:6512:118b:b0:5a2:8568:826a with SMTP id\n 2adb3069b0e04-5a4172eece0mr8485360e87.34.1776985467167;\n Thu, 23 Apr 2026 16:04:27 -0700 (PDT)", "From": "bigunclemax@gmail.com", "To": "linux-kernel@vger.kernel.org", "Cc": "Martin Botka <martin.botka@somainline.org>,\n\tAndre Przywara <andre.przywara@arm.com>,\n\tKrzysztof Kozlowski <krzk@kernel.org>,\n\tMaksim Kiselev <bigunclemax@gmail.com>,\n\tPhilipp Zabel <p.zabel@pengutronix.de>,\n\tYixun Lan <dlan@kernel.org>,\n\tLinus Walleij <linusw@kernel.org>,\n\tBartosz Golaszewski <brgl@kernel.org>,\n\tlinux-riscv@lists.infradead.org,\n\tspacemit@lists.linux.dev,\n\tlinux-gpio@vger.kernel.org", "Subject": "[RFC PATCH 1/1] reset: add support the GPIO provider with\n #gpio-cells=3", "Date": "Fri, 24 Apr 2026 02:03:35 +0300", "Message-ID": "<20260423230338.442497-2-bigunclemax@gmail.com>", "X-Mailer": "git-send-email 2.51.0", "In-Reply-To": "<20260423230338.442497-1-bigunclemax@gmail.com>", "References": "<20260423230338.442497-1-bigunclemax@gmail.com>", "Precedence": "bulk", "X-Mailing-List": "linux-gpio@vger.kernel.org", "List-Id": "<linux-gpio.vger.kernel.org>", "List-Subscribe": "<mailto:linux-gpio+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-gpio+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit" }, "content": "From: Maksim Kiselev <bigunclemax@gmail.com>\n\nThe __reset_add_reset_gpio_device() function currently expects a GPIO\nprovider with #gpio-cells=2, which prevents using the GPIO from\ncontrollers with #gpio-cells=3, such as the Allwinner pinctrl and others.\n\nExtend the parsing to support the GPIO phandle with three args,\nwhere:\n args[0]: GPIO bank\n args[1]: GPIO number\n args[2]: GPIO flags\n\nSigned-off-by: Maksim Kiselev <bigunclemax@gmail.com>\n---\n drivers/reset/core.c | 33 +++++++++++++++++++++++----------\n 1 file changed, 23 insertions(+), 10 deletions(-)", "diff": "diff --git a/drivers/reset/core.c b/drivers/reset/core.c\nindex 352c2360603b..18fb50ca645f 100644\n--- a/drivers/reset/core.c\n+++ b/drivers/reset/core.c\n@@ -868,7 +868,8 @@ static int reset_add_gpio_aux_device(struct device *parent,\n static int __reset_add_reset_gpio_device(const struct of_phandle_args *args)\n {\n \tstruct property_entry properties[3] = { };\n-\tunsigned int offset, of_flags, lflags;\n+\tunsigned int offset[2], of_flags, lflags;\n+\tstruct software_node_ref_args sw_ref[1];\n \tstruct reset_gpio_lookup *rgpio_dev;\n \tstruct device *parent;\n \tint id, ret, prop = 0;\n@@ -879,7 +880,7 @@ static int __reset_add_reset_gpio_device(const struct of_phandle_args *args)\n \t * args[1]: GPIO flags\n \t * TODO: Handle other cases.\n \t */\n-\tif (args->args_count != 2)\n+\tif (args->args_count != 2 && args->args_count != 3)\n \t\treturn -ENOENT;\n \n \t/*\n@@ -889,8 +890,13 @@ static int __reset_add_reset_gpio_device(const struct of_phandle_args *args)\n \t */\n \tlockdep_assert_not_held(&reset_list_mutex);\n \n-\toffset = args->args[0];\n-\tof_flags = args->args[1];\n+\toffset[0] = args->args[0];\n+\tif (args->args_count == 2) {\n+\t\tof_flags = args->args[1];\n+\t} else {\n+\t\toffset[1] = args->args[1];\n+\t\tof_flags = args->args[2];\n+\t}\n \n \t/*\n \t * Later we map GPIO flags between OF and Linux, however not all\n@@ -902,7 +908,7 @@ static int __reset_add_reset_gpio_device(const struct of_phandle_args *args)\n \t */\n \tif (of_flags > GPIO_ACTIVE_LOW) {\n \t\tpr_err(\"reset-gpio code does not support GPIO flags %u for GPIO %u\\n\",\n-\t\t of_flags, offset);\n+\t\t of_flags, offset[0]);\n \t\treturn -EINVAL;\n \t}\n \n@@ -923,7 +929,13 @@ static int __reset_add_reset_gpio_device(const struct of_phandle_args *args)\n \tlflags = GPIO_PERSISTENT | (of_flags & GPIO_ACTIVE_LOW);\n \tparent = gpio_device_to_device(gdev);\n \tproperties[prop++] = PROPERTY_ENTRY_STRING(\"compatible\", \"reset-gpio\");\n-\tproperties[prop++] = PROPERTY_ENTRY_GPIO(\"reset-gpios\", parent->fwnode, offset, lflags);\n+\n+\tif (args->args_count == 2)\n+\t\tsw_ref[0] = SOFTWARE_NODE_REFERENCE(parent->fwnode, offset[0], lflags);\n+\telse\n+\t\tsw_ref[0] = SOFTWARE_NODE_REFERENCE(parent->fwnode, offset[0], offset[1],\n+\t\t\t\t\t\t lflags);\n+\tproperties[prop++] = PROPERTY_ENTRY_REF_ARRAY(\"reset-gpios\", sw_ref);\n \n \tid = ida_alloc(&reset_gpio_ida, GFP_KERNEL);\n \tif (id < 0)\n@@ -1048,10 +1060,11 @@ __of_reset_control_get(struct device_node *node, const char *id, int index,\n \t\tgoto out_unlock;\n \t}\n \n-\tif (WARN_ON(args.args_count != rcdev->of_reset_n_cells)) {\n-\t\trstc = ERR_PTR(-EINVAL);\n-\t\tgoto out_unlock;\n-\t}\n+\tif (!(rcdev->dev && fwnode_device_is_compatible(dev_fwnode(rcdev->dev), \"reset-gpio\")))\n+\t\tif (WARN_ON(args.args_count != rcdev->of_reset_n_cells)) {\n+\t\t\trstc = ERR_PTR(-EINVAL);\n+\t\t\tgoto out_unlock;\n+\t\t}\n \n \trstc_id = rcdev->of_xlate(rcdev, &args);\n \tif (rstc_id < 0) {\n", "prefixes": [ "RFC", "1/1" ] }