From patchwork Tue Feb 18 19:29:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 13980952 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 50106C021AA for ; Tue, 18 Feb 2025 21:41:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To: Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=mIW3Tj0XdfJSfKxjiYcsy2cS5srx8ZXffTdS0QjWZns=; b=DHUK+17jCnx0M0 zw4i01uYa6vFurtynWzctEuVYRaf4SAib/EuYgY2lfidHyEw52uu7fGHSuPjJ3PfX7BWzadhw1ZE1 swNjF/EPCORZDOM/qCtTZdAJw7dZ41+OfiUMYIcUFIOd6MYE3TrBYLCXm6VstqF/L6RxFF7cEWLDQ V0qYQRepnSgkSE+3YjWu0JKdKOougQwH0/dBoih8A9IQMkJW4gMWsSMJ+Kvb6GBwqJNPEeImbJrXA mFb9an4e6mdaEVgrzbEjnIPqw1XsP/YcobVsED/XSk+4ZXPRnVGyuoT3IG0Kzke8zy5ennyjbk6ZZ xk9Nbr+JWE4Cp3k6I7Gg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tkVL1-0000000A2Vy-05wz; Tue, 18 Feb 2025 21:41:07 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tkTIg-00000009a08-44Zm for linux-arm-kernel@lists.infradead.org; Tue, 18 Feb 2025 19:30:38 +0000 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5dedd4782c6so8514051a12.3 for ; Tue, 18 Feb 2025 11:30:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1739907033; x=1740511833; darn=lists.infradead.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=mIW3Tj0XdfJSfKxjiYcsy2cS5srx8ZXffTdS0QjWZns=; b=gMBk2uU98Mhyk4MYJXQvDTlgO431bhH99LvAoXG4tnDKLou7jw7GA2sRLmdkL16KF9 kz1y691wjtm1lRbFzsXqeii5h4onOxhv65shSoG9dfO+PvAvqrpJqWOF+uwk92cFPkiy t80Byj/A8/USxUot5+QHba3H/jmPIegQ9DqP/QM2GMkP7hcKSy3KNn/HSbIzIrPKvllj 1EnK/1kWIaqVMi4K3zqUfqO6/KJE64NxPCnxC4SQYIuPaRh26+0EIM9G0eJx0dbCebe4 uD7mGasylRTJsOsk+R2SqnpRRzs4EGcC+80KcxA8BjR0lZ8JLHz5NVtS9cfpwO7PlsMG cXpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739907033; x=1740511833; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mIW3Tj0XdfJSfKxjiYcsy2cS5srx8ZXffTdS0QjWZns=; b=LFjR1qMfZwMrA+MoLrr3A75Bj3P6yNIQLhC72sKqkKdNHS/u54BXfHxx64zaEy5VeV dj6vGz0fK+umos+lbACSr6F8QB8ONpRtCnMx3+2f6rdYiZuHxjDOhTx3xZNzDr9fulse nFAsnTaLiDtVIpx7r3jfmpKBvwoA7LqxXx5PnKzHsT35VjmUr6G0/8SZ/5ROxI8vY0HU TElOVqQFSOa/0yQ+7eMW7Oer9s20yAXQc0rJHuYsndkxdRag994XAlT8t6/z/fNCUThk 1cpke7MBE+NHEiaXv1D1lG4ZnikgUxujvIVyE8QSOSBGgAJcH3dLN3h6xMQo5sa1E0m6 Wiqg== X-Forwarded-Encrypted: i=1; AJvYcCWffRBM2GJy9ImMx8OU3oM0/cWISbLXOpNp0AQXy+IIqvJqdwmbxvYeVKwoOgOf2lbMztIvQhd9nXAlhE1uUO7D@lists.infradead.org X-Gm-Message-State: AOJu0YxFUlBppA/LboYG0FmAZC/y4llJxV1wHI/6kkKJhy0jk0UDQtH3 kX8I/Vpc2dpRqRXLa+f6TLGICwT73w1fSDEupij3XW/Nk9HlVCjy38szE3AaxNI= X-Gm-Gg: ASbGnct4nc8a8+o2R65UCOjczbtxNh4c7/ue+oR5KOzGHW+K83kfNjK2gAHimcB7ME/ kJjI9fn88i+m7HIkkL4EsoiZjJNjNktcmQRfYbKzF5d2TqyTPy3Xg7eR90pIPmjQWz34DWtVbgL PkaINDzhlIDvms1Ro86J7SG7SxhevX/hzdUXhlfzlt0xCFx5iPzFjbgkIWFssJKh0kjkxhBhxGu IQ8DfUtIXa06rs5bwyc9D5FVnjok1uHKUuR+XKVZ5ZUyiTNNfx7r0YU3YwyUSoVXPMHwoeUxjHa idMPDmugAn6yLK8/9zlhUbmwY9gD X-Google-Smtp-Source: AGHT+IEsUkQkmLnMxncHVAOTmPsKmvVPSTaQR78ji9vJrVN7d833EMl3VWJfxC45bU7tBdks7OZrJg== X-Received: by 2002:a05:6402:51d4:b0:5e0:51a9:d410 with SMTP id 4fb4d7f45d1cf-5e051a9d59cmr11065896a12.25.1739907032830; Tue, 18 Feb 2025 11:30:32 -0800 (PST) Received: from toaster.baylibre.com ([2a01:e0a:3c5:5fb1:cbaf:af0:839d:fb4a]) by smtp.googlemail.com with ESMTPSA id 4fb4d7f45d1cf-5dece1c3ce5sm9338985a12.17.2025.02.18.11.30.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2025 11:30:32 -0800 (PST) From: Jerome Brunet Subject: [PATCH v4 0/8] driver core: auxiliary bus: add device creation helper Date: Tue, 18 Feb 2025 20:29:45 +0100 Message-Id: <20250218-aux-device-create-helper-v4-0-c3d7dfdea2e6@baylibre.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAKnftGcC/42NQQ6CMBBFr0Jm7RimLbG48h6GRSmDNEEgUyQQw t2tnMDl+/n//R0iS+AI92wH4SXEMA4JzCUD37nhxRiaxKByZUhRju6zYpOKntELu5mx435iwVK ToUIZLpSGNJ+E27Ce6meVuAtxHmU7nxb6pX9IF0LCwtpbaxpb6tw+arf1oRa++vEN1XEcXzgI+ /LDAAAA X-Change-ID: 20241210-aux-device-create-helper-93141524e523 To: Greg Kroah-Hartman , Dave Ertman , Ira Weiny , "Rafael J. Wysocki" , Stephen Boyd , Arnd Bergmann , Danilo Krummrich , Conor Dooley , Daire McNamara , Philipp Zabel , Douglas Anderson , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Bryan O'Donoghue , Vladimir Kondratiev , Gregory CLEMENT , =?utf-8?q?Th=C3=A9o_Lebrun?= , Michael Turquette , Abel Vesa , Peng Fan , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Kevin Hilman , Martin Blumenstingl Cc: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, dri-devel@lists.freedesktop.org, platform-driver-x86@vger.kernel.org, linux-mips@vger.kernel.org, linux-clk@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, Jerome Brunet X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3639; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=5jr0njrsEqh+gx0/hryuSdGRgOG6j3FS8QheXHGTwG0=; b=owEBbQKS/ZANAwAKAeb8Dxw38tqFAcsmYgBntN/OWNreQDN/vUjV7hrjtf9acN+LfunziKrQQ 0+55m0edLGJAjMEAAEKAB0WIQT04VmuGPP1bV8btxvm/A8cN/LahQUCZ7TfzgAKCRDm/A8cN/La hRMsD/9ziamapLyta7b2bnUpuc3WwKbKpFZ9GL/J7nw2y3cw/h5jQBYbDSF9JrRSKgzBbfv6Sey QRNn8YHjpUuiMQoo8wdF8JQAlfzz2s0Us6Or+rdpDD/QESOXyHDqj4MUG6FTXYd6FP3XToJ42vi o298p/RQJt7nZk755yQCNu+oz2gqK2ZaQnsfxtwRPjODRR7EFCDtt6GzOIQ6gMys62o6Mk/PRs+ l1rKan/fK30ltLDStso25MaxLWBWV+npLFI35BMTlhMEwG+JTun3VMmjlWz9kiBjMqGBx2qiste CCASomjcV/H2nDkNLAKwD/UefscVOHz9VIb3RNV4bBZIaCNqPYvjtZw8poWesaxupOoNpkApV1I iuOjXT0pkOdE3AtkaBQ/6cVd15in+oW9zqTzplE86661VuagqxrOQ+l8pbmbmk0R89TtIXS6KLO hLZG6xJCG94i6UMTAU0hCmZlQU/CW22okUfGUHjgTYK6ptzPX+PDffsa4fBWg7IHfxtdZ2bKtln RgJlvATKPKlyz7ds7JlS5NJM9MAPT8rPBlDL08q9TxYGO1jW1mxv3I14XfLQ7XXv+yTGVoSNwA0 XUgHQc8fDO8z2hMMyQDJqxbCfvG5BaZ42qT2FGwEEHgMmmQe7i0RN0x7Le1Ppt/hMQ35Cpsysif vfaUCrYJTwsPKFQ== X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250218_113035_122193_E4AFF723 X-CRM114-Status: GOOD ( 17.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The suggestion for this change was initially discussed here: [1] This patchset adds and use a helper to create a simple auxiliary device. The goal is to remove boilerplate code that tends to get repeated for simple cases. Only the last change was tested on actual HW. The other usage of the helper have only been compile tested with x64_64 allmodconfig. There are many other simple cases of auxiliary device creation but those tend to use the 'container_of' trick to allocate the auxiliary device. It is possible to convert these drivers to use the provided helper but the conversion is slightly more complex. NOTE: This series is based on -rc1. Only the first change is meant to applied. The reset will likely wait for the helper to land in mainline. Rebase on the corresponding subsystem will be done when/if necessary. [1]: https://lore.kernel.org/linux-clk/df0a53ee859e450d84e81547099f5f36.sboyd@kernel.org Changes in v4: - Added eyeq reset patch from Theo (Thanks) - Changed returned value to 'valid or NULL'. Consumers should return -ENODEV if translation to int is necessary. - Export the non-managed function helpers - Default id to 0 for the simpler devm_auxiliary_device_create() as suggested by Conor - Fix clk-imx8mp-audiomix config problem reported by Ira - Rebased on drm-next for ti-sn65dsi86 - Link to v3: https://lore.kernel.org/r/20250211-aux-device-create-helper-v3-0-7edb50524909@baylibre.com Changes in v3: - Implement Ira's suggestion to use KBUILD_MODNAME by default, same as auxiliary_driver_register() - Link to v2: https://lore.kernel.org/r/20250206-aux-device-create-helper-v2-0-fa6a0f326527@baylibre.com Changes in v2: - Add usage examples, as requested. - Add 'id' as function parameter: Adding the example usage showed that handling IDA allocation was not appropriate and making the usage more complex for simple use case. - Also add 'modname' as parameter: Most driver have been using KBUILD_MODNAME and this actually rarely align with the driver name. - Link to v1: https://lore.kernel.org/r/20241210-aux-device-create-helper-v1-1-5887f4d89308@baylibre.com Signed-off-by: Jerome Brunet --- Jerome Brunet (7): driver core: auxiliary bus: add device creation helpers reset: mpfs: use the auxiliary device creation drm/bridge: ti-sn65dsi86: use the auxiliary device platform: arm64: lenovo-yoga-c630: use the auxiliary device creation helper clk: eyeq: use the auxiliary device creation helper clk: clk-imx8mp-audiomix: use the auxiliary device creation helper clk: amlogic: axg-audio: use the auxiliary reset driver - take 2 Théo Lebrun (1): reset: eyeq: drop device_set_of_node_from_dev() done by parent drivers/base/auxiliary.c | 108 ++++++++++++++++++++++++++++ drivers/clk/clk-eyeq.c | 57 ++++----------- drivers/clk/imx/clk-imx8mp-audiomix.c | 49 +++---------- drivers/clk/meson/Kconfig | 2 +- drivers/clk/meson/axg-audio.c | 114 ++++-------------------------- drivers/gpu/drm/bridge/ti-sn65dsi86.c | 49 ++----------- drivers/platform/arm64/lenovo-yoga-c630.c | 40 +---------- drivers/reset/reset-eyeq.c | 13 +--- drivers/reset/reset-mpfs.c | 56 ++------------- include/linux/auxiliary_bus.h | 17 +++++ 10 files changed, 176 insertions(+), 329 deletions(-) --- base-commit: 0ed1356af8f629ae807963b7db4e501e3b580bc2 change-id: 20241210-aux-device-create-helper-93141524e523 Best regards,