Message ID | 20250218-aux-device-create-helper-v4-0-c3d7dfdea2e6@baylibre.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org> 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 CF502C021AA for <linux-riscv@archiver.kernel.org>; Tue, 18 Feb 2025 20:11:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To: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=egYSf15FzINtRX9RX5Lu2wVPxt7+8t9FrPK/4dSKwl8=; b=SzpE+lL9OrlBw9 JwDc8f5E7/YqtVcj1Aj4XB/RJ6Zt53Ez35my34M+ot+yYUVmgp2T9qVO/YFxiX4i9KQVsfSonj0H4 NO+iwVJdqYwUHY9XlSzrI9tqIKCxG4xjXUQmC7VJWe+t9dY4t7EdMyYwtqQN6raZLg2dF/Rk2xlJy 6VK/nZjVN6znVfJ67l51Uiml0CYHMPhSq0daMHeZJkrA0kDAgh7trfro3zongLxLJ52SBoqQrZFSv SeFp+px4pgrDOIcRG1g9yc3PWtwtGeHDsukPTNGwUTSitOEy+StRgp2C/sfyBG0/PopxzAvhdo7bU XnTBoq6s4piGsUpVbF9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tkTvx-00000009hjM-28Wj; Tue, 18 Feb 2025 20:11:09 +0000 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tkTIh-00000009a06-00Ed for linux-riscv@lists.infradead.org; Tue, 18 Feb 2025 19:30:37 +0000 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5e05717755bso3947653a12.0 for <linux-riscv@lists.infradead.org>; 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=CvWEA+FlZ+nI2Zkt9DhXRtdnMXARJM0HOinoRjxW06YKn1LEga/PQ9YDijt3ElXu5N qMZNrRGFU37bs0Kb60gGUtZ4V6H1WTB1Xnp8/HgFtQofmCtVpMYq3a+vCxW9KZm0sf++ 6XwSuYoDDjXvokvv2SSoD671645coPraI+hxBzC8jWxbUpDputFCc8p372ZuGCuk2qCc ZqqbFVBWQQBCjkKlI+muEMdV5sS8RfBtktxzJBgRPtZv2v+/R4B9eJRLYqu+2piN1WY3 T/mbsyi6Teanp2M+Okca1ZrUHXvsa7Go4IodA+J2bajqDGwtVZLvFRDOqB8l/mMsYEGR 1w9Q== X-Forwarded-Encrypted: i=1; AJvYcCVrfy2lIFrX4oPK/c72A3TkYKASvm7SCx1OyvboGxDlry3xsDxO0WKOYBFPKJi4y+st2Q1xUZgZ+UquUQ==@lists.infradead.org X-Gm-Message-State: AOJu0YzXz2gKWSBElUqxWStLXkg5qfb0dXvIdC9agjKrhmjpCJL2TNRt 290l6sYGQsVA2vb9xAC6Z92655oGNpktmtwYNV6sYRMpoPYo7VU/IPWjMdcS+e0= X-Gm-Gg: ASbGnctPditVOFIyNxBMlT2DYrfqUOCtP0pzs5uVKcgjzUlnr8heZfhWR1MkAH109Zx MUp3d6I1az0Xt/eVBVfWYkmlrs+ZIM9Xy84iAgGGAnYxpmGSWeUNWO9yMD7Rp+qAzMyl/SRnu6S /7VQE4qrY4t+z7s+ps9aA6JuBlPhf6UHSkPO7gJRoABDBQnTDMmorJsfPGZm4ru4HsABVLZ7QJJ wh4K5yrLVzArhyRdDRIozat/0Mx+YIGF6tNyk7X+VzNnc5CX6wpLNBxQwsBXmeEpdHL9J6tjNc+ GLsY1Wjmtukkr1ApEWpZ0BqCivLC 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 <jbrunet@baylibre.com> 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 <gregkh@linuxfoundation.org>, Dave Ertman <david.m.ertman@intel.com>, Ira Weiny <ira.weiny@intel.com>, "Rafael J. Wysocki" <rafael@kernel.org>, Stephen Boyd <sboyd@kernel.org>, Arnd Bergmann <arnd@arndb.de>, Danilo Krummrich <dakr@kernel.org>, Conor Dooley <conor.dooley@microchip.com>, Daire McNamara <daire.mcnamara@microchip.com>, Philipp Zabel <p.zabel@pengutronix.de>, Douglas Anderson <dianders@chromium.org>, Andrzej Hajda <andrzej.hajda@intel.com>, Neil Armstrong <neil.armstrong@linaro.org>, Robert Foss <rfoss@kernel.org>, Laurent Pinchart <Laurent.pinchart@ideasonboard.com>, Jonas Karlman <jonas@kwiboo.se>, Jernej Skrabec <jernej.skrabec@gmail.com>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>, Hans de Goede <hdegoede@redhat.com>, =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com>, Bryan O'Donoghue <bryan.odonoghue@linaro.org>, Vladimir Kondratiev <vladimir.kondratiev@mobileye.com>, Gregory CLEMENT <gregory.clement@bootlin.com>, =?utf-8?q?Th=C3=A9o_Lebrun?= <theo.lebrun@bootlin.com>, Michael Turquette <mturquette@baylibre.com>, Abel Vesa <abelvesa@kernel.org>, Peng Fan <peng.fan@nxp.com>, Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix Kernel Team <kernel@pengutronix.de>, Fabio Estevam <festevam@gmail.com>, Kevin Hilman <khilman@baylibre.com>, Martin Blumenstingl <martin.blumenstingl@googlemail.com> 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 <jbrunet@baylibre.com> 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_122186_E1263A2A X-CRM114-Status: GOOD ( 15.67 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-riscv.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-riscv>, <mailto:linux-riscv-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-riscv/> List-Post: <mailto:linux-riscv@lists.infradead.org> List-Help: <mailto:linux-riscv-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-riscv>, <mailto:linux-riscv-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-riscv" <linux-riscv-bounces@lists.infradead.org> Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org |
Series |
driver core: auxiliary bus: add device creation helper
|
expand
|
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 <jbrunet@baylibre.com> --- 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,