From nobody Tue Dec 2 02:28:33 2025 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 521F433F391 for ; Thu, 20 Nov 2025 13:24:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763645070; cv=none; b=b1jUOiJ1GchLXH7ZoNYm8GNGnFxfq/awvSNao1NcWLCXsQoEM3fUNSZmILJtbVDWYcRYOOQVIHxG2Juo9OFPept20Nim/tBh7vahgbbmkUb2lp1h8YPXwHIcNB9G71LKYUWONbHhUFs694J6sUzwvpWUJiFo/pWuKxakO4HAMDI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763645070; c=relaxed/simple; bh=TmnPwRPKxNqDK4kqJf7gkqi9ML3vw5hcnCB0TrZwF+c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SuSdItj1vaz7jL2/WikFafAmlzB7QuAWanG2Yys8yB5QwVGButOH68/IJQ1LtR/3GEZchrIn6G9CAcWmrznNeGGjgdrVqnp6MX/L4Bet4DI/KRqShftuAiUc2UypRJgZHee+7rvEFyyaVXMHHquT03+IIsGv2WSUe7GVnl/MTNM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=2UaiMPMD; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="2UaiMPMD" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-477632b0621so6218435e9.2 for ; Thu, 20 Nov 2025 05:24:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1763645061; x=1764249861; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=4XjD0ueSQIVGxSnWq5N3fbydIO3JRz9g8LzIgvZUmG8=; b=2UaiMPMD8sG8UssyS9sKwozsoxbZT8fNWYYFijsRQiLud51+TaXDixljGfwhTBoa0B 2YBSDAKvAvu1SLUCiJT0RXEO8x1mr9TxGSZcAxcrezztXGDejcuLEe3J1R/v3ZLfewdH Q9AKIaFlNvY6+x4PCwF/BWkKr9mxR0TAv1viTY/0kc7dE4Le3FJ+YI2L4yCNGbRnomLt JeovOk8QV8nAWMqPYjDpuKtQr8TojLC028raL9gMgnB2TbVKpdRT04+Hr+DyOgY8ybMn IgXMB8c9Xl2L29SVcYx9/dUiI4ozgwJNGkaeBrJlnU71Z2kYLaa7ut/5GaaHZKa67Vj8 vvrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763645061; x=1764249861; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=4XjD0ueSQIVGxSnWq5N3fbydIO3JRz9g8LzIgvZUmG8=; b=hXB3n3mT58jTOnbIMw3PU6jP961W/CsyQkzKT0zld19NO53Hofi9T2wq5Xx2B5J+sS v64oV2G9OOAWSE/8pXPR5v3uXXdh7rL5ov1lLROM+6+8m8TOmcU36H3Hii6pZFB9MaTp 2TVgaw6XDNFmIbKs80zMbkuhlgwqtm8gl7nLlOM5qMtbm1TYQUj2keO/+emvpZw4jjAI COyoZiuNFHb3aNYgCBdpFWjnzMGOJVCr+3P9P5UfQhtnqao75bX/IMsRyhqEGeLZg7Hz KkLNXVpm4X985ciyHMQH4TVSefpmkXozatChXT4MunV6l9RKGRRrmRLtDNsn61WTQgrY YPQA== X-Forwarded-Encrypted: i=1; AJvYcCXeBvZxa+USzaD4xaft1z1UnpbEgG6q55r/Onu4VDPwqzY1HORaUZIzHczBscwogXMpE6KcHOfr8EUylTE=@vger.kernel.org X-Gm-Message-State: AOJu0YxNUndN52JUoaShLqL81S4uTYnD5bd24Kat3g13OoPgo3sS94OT GbLhOUwZYNCDN7lnRhcKlckur3rtb346F5q65aL5+edd1xzQ6bKD9OuJKgklxKSGT5s= X-Gm-Gg: ASbGncuvcShOXmrNhovPpuhZUl/U+Z9DmLgzm3w8bwmRQj4Bhw4HqSSg44DkYXbvHN/ 9FpVEH7BQl1+zRiduiXzaugDtd7ii/P/pQUrjVqeZAnK+fIWAl+dfot42mgFV+PtGT9I5zSEhLq WCQF1gokQeilWali8ycZXVm4YqOkwO7n2j7lwzOIMkwl68X1mD6ZyBA45hDnuDwa9D1GsaOWdxD g5rjR9wFMUwMF/ju+FjyZvfSf/YRD+6mbgcx7NGGVlvSvikDtKRm6nJ+NYTr75suAERkvI8E70w M9lf8vIWT4WVHX9jS4yATMGl5G6/enLjucFqtNojJ2M8mhr1D0Rg0hqV5TNK3ljFP4uTAjTBArc 9ZedpfZSazqbHKX7awTY8YjmC5bD4vHDLVzS6wUww8Y6R0lT44SijZpf9vEFJAuud/kcrB5dI91 FQ2uk= X-Google-Smtp-Source: AGHT+IH6vuUXtQR0V74bFxueAkhlb1rxpZ2IJm5JuJVY/HCjNaVgdMXz0xpHyMcS1GsLh4Ijmud52A== X-Received: by 2002:a05:600c:154d:b0:475:d8b3:a9d5 with SMTP id 5b1f17b1804b1-477b8953efdmr36167295e9.10.1763645060976; Thu, 20 Nov 2025 05:24:20 -0800 (PST) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:37af:6c1f:28a:47d2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477b82cc72dsm46762935e9.1.2025.11.20.05.24.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Nov 2025 05:24:20 -0800 (PST) From: Bartosz Golaszewski Date: Thu, 20 Nov 2025 14:24:03 +0100 Subject: [PATCH v7 8/9] reset: gpio: convert the driver to using the auxiliary bus Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251120-reset-gpios-swnodes-v7-8-a100493a0f4b@linaro.org> References: <20251120-reset-gpios-swnodes-v7-0-a100493a0f4b@linaro.org> In-Reply-To: <20251120-reset-gpios-swnodes-v7-0-a100493a0f4b@linaro.org> To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Philipp Zabel , Krzysztof Kozlowski , David Rhodes , Richard Fitzgerald , Mark Brown , Maciej Strozek , Charles Keepax , Andy Shevchenko , Bartosz Golaszewski Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-sound@vger.kernel.org, patches@opensource.cirrus.com, linux-spi@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=5143; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=KmSwa9RPZ6TcHq3hcL4F56YB9LD5MmMIEe1ovhHQ/ek=; b=owEBbQKS/ZANAwAKAQWdLsv/NoTDAcsmYgBpHxZ0kT6+RHdf8teKNwn/OCNtuIggjuyI0WJtv RrJ4k8WfqaJAjMEAAEKAB0WIQSR5RMt5bVGHXuiZfwFnS7L/zaEwwUCaR8WdAAKCRAFnS7L/zaE w9oRD/4w+yTXcGQDgBD2AkFNCjVW169CvEZDNpxIWwn8p4/8WKdVbKIRy9ldTYs3xMQsC6SBYmO BbuZtGJJkxQsEHA33nRWUBlUTPNbseHPESTeNt8X9QOQX01uwF4t0mcN7v8fZ/h3Bf1XVX3VoeQ LtthcPFxv0I16Bxv2roIJvfnwVwYOmYbrnxW91DAiwKTmQ1Y2T/Ajw4rp9EAwqcHmdy2N10vcQR IvtulANBhSy3cLRG+afIeKDM2rWV86aFFktjV02p+ffUtfYcCibQeuXc9IegwtjftptH6RxCDUC jhg20ItvFg8t25huMvBlzIGB+g90L6gfs8YsBtNuCVnXJ/yXXtGUBf+f+mavGUrbbWgEg1p9bTH 77wU9lOyKMfw0TLgPCrTXbTchX+0jddQEov2yCVwCpqMmM2MwiIR3xD3ZB9whRouzLXL1xffUG8 0nL45YdejFVdx/gWaWI2WiW1ptKKgaCdBWkL7d4shrS7m6gkY/YPRt+NkpkQSjH4tyIeUOEfltN Wjz/KxArwX3u8m270Sso7GRWpFHi47r4zZ00MI9FgsKQica3Bg/aa2zt1aGypPieOmDKkYpsSeT 5Igo4lrt+mm2mpDokz3YIuT4Nl8xVSfTIQf1TPFCowUWlW3SEkainSqgbPmT9MItYRj7aRBPv6Z +SBs2oQU7YGb/RA== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski As the reset-gpio devices are purely virtual and never instantiated from real firmware nodes, let's convert the driver to using the - more fitting - auxiliary bus. Reviewed-by: Philipp Zabel Acked-by: Linus Walleij Acked-by: Greg Kroah-Hartman Signed-off-by: Bartosz Golaszewski --- drivers/reset/Kconfig | 1 + drivers/reset/core.c | 14 ++++++-------- drivers/reset/reset-gpio.c | 19 ++++++++++--------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig index 9951dbd50130946952f3bbfc4b97525978f494ae..e158a818fb0897a51af370a8e5c= e058e1de3b4ee 100644 --- a/drivers/reset/Kconfig +++ b/drivers/reset/Kconfig @@ -99,6 +99,7 @@ config RESET_EYEQ config RESET_GPIO tristate "GPIO reset controller" depends on GPIOLIB + select AUXILIARY_BUS help This enables a generic reset controller for resets attached via GPIOs. Typically for OF platforms this driver expects "reset-gpios" diff --git a/drivers/reset/core.c b/drivers/reset/core.c index 50ff078dea7fd84d59e505fc1f607f593ec6381f..1f5f8d85dc16142da3e3a9988f2= 737c83550cb2f 100644 --- a/drivers/reset/core.c +++ b/drivers/reset/core.c @@ -7,6 +7,7 @@ =20 #include #include +#include #include #include #include @@ -18,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -852,7 +852,7 @@ static int __reset_add_reset_gpio_lookup(struct gpio_de= vice *gdev, int id, if (!lookup) return -ENOMEM; =20 - lookup->dev_id =3D kasprintf(GFP_KERNEL, "reset-gpio.%d", id); + lookup->dev_id =3D kasprintf(GFP_KERNEL, "reset.gpio.%d", id); if (!lookup->dev_id) return -ENOMEM; =20 @@ -873,7 +873,7 @@ static int __reset_add_reset_gpio_lookup(struct gpio_de= vice *gdev, int id, static int __reset_add_reset_gpio_device(const struct of_phandle_args *arg= s) { struct reset_gpio_lookup *rgpio_dev; - struct platform_device *pdev; + struct auxiliary_device *adev; int id, ret; =20 /* @@ -929,11 +929,9 @@ static int __reset_add_reset_gpio_device(const struct = of_phandle_args *args) * Hold reference as long as rgpio_dev memory is valid. */ of_node_get(rgpio_dev->of_args.np); - pdev =3D platform_device_register_data(gpio_device_to_device(gdev), - "reset-gpio", id, - &rgpio_dev->of_args, - sizeof(rgpio_dev->of_args)); - ret =3D PTR_ERR_OR_ZERO(pdev); + adev =3D auxiliary_device_create(gpio_device_to_device(gdev), "reset", + "gpio", &rgpio_dev->of_args, id); + ret =3D PTR_ERR_OR_ZERO(adev); if (ret) goto err_put; =20 diff --git a/drivers/reset/reset-gpio.c b/drivers/reset/reset-gpio.c index 2290b25b6703536f2245f15cab870bd7092d3453..e5512b3b596b5290af20e5fdd99= a38f81e670d2b 100644 --- a/drivers/reset/reset-gpio.c +++ b/drivers/reset/reset-gpio.c @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0 =20 +#include #include #include #include #include -#include #include =20 struct reset_gpio_priv { @@ -61,9 +61,10 @@ static void reset_gpio_of_node_put(void *data) of_node_put(data); } =20 -static int reset_gpio_probe(struct platform_device *pdev) +static int reset_gpio_probe(struct auxiliary_device *adev, + const struct auxiliary_device_id *id) { - struct device *dev =3D &pdev->dev; + struct device *dev =3D &adev->dev; struct of_phandle_args *platdata =3D dev_get_platdata(dev); struct reset_gpio_priv *priv; int ret; @@ -75,7 +76,7 @@ static int reset_gpio_probe(struct platform_device *pdev) if (!priv) return -ENOMEM; =20 - platform_set_drvdata(pdev, &priv->rc); + auxiliary_set_drvdata(adev, &priv->rc); =20 priv->reset =3D devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); if (IS_ERR(priv->reset)) @@ -99,20 +100,20 @@ static int reset_gpio_probe(struct platform_device *pd= ev) return devm_reset_controller_register(dev, &priv->rc); } =20 -static const struct platform_device_id reset_gpio_ids[] =3D { - { .name =3D "reset-gpio", }, +static const struct auxiliary_device_id reset_gpio_ids[] =3D { + { .name =3D "reset.gpio" }, {} }; -MODULE_DEVICE_TABLE(platform, reset_gpio_ids); +MODULE_DEVICE_TABLE(auxiliary, reset_gpio_ids); =20 -static struct platform_driver reset_gpio_driver =3D { +static struct auxiliary_driver reset_gpio_driver =3D { .probe =3D reset_gpio_probe, .id_table =3D reset_gpio_ids, .driver =3D { .name =3D "reset-gpio", }, }; -module_platform_driver(reset_gpio_driver); +module_auxiliary_driver(reset_gpio_driver); =20 MODULE_AUTHOR("Krzysztof Kozlowski "); MODULE_DESCRIPTION("Generic GPIO reset driver"); --=20 2.51.0