From nobody Tue Feb 10 07:41:10 2026 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32130313290 for ; Mon, 5 Jan 2026 08:58:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767603513; cv=none; b=Z06tGKMlCTujCZS/iMx/IdC/XR9RGjAbX0enJhtLh2fIrNBOx2s3ZjelM/7431rcysw7+0pL8XUqwvLTCWP0B8kb9V5/SbgpKACySfKDX+VNoy93BiYWJa15UyW0bSbOFsrbGwgEL5TywwrZAK6RN/fSZ/GbPaJ5MiXyB6e5iGg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767603513; c=relaxed/simple; bh=yaP3HyKstBhKWf2536vAbnaHRYAmQhF5Pn7rz8yvAm4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WWPUVAhtWMMrgZvfkL/m0msDEYNVX4hjoJbCF8CHYeGI/gyjn4O0S1SidEsyH2Ul0E9IsfeKc9MfZkDxD3E2h1Mgscip0d9NYOwdM80z5jYZXFHhEQASFn+j99qR1mvIjJYVEcUcd+hX7yFT1cjypp0oXIAX+CpzhfmJw0HE+Mk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=aP4I+0Ry; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="aP4I+0Ry" Received: from mail.ideasonboard.com (unknown [223.190.87.50]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0967622A; Mon, 5 Jan 2026 09:58:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1767603489; bh=yaP3HyKstBhKWf2536vAbnaHRYAmQhF5Pn7rz8yvAm4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=aP4I+0RyVbaPlmv0gI1lCr7ICSFm+QBe2dzmy3/0qoViabq2wYHQ1L85X4nGgkztV ECY9220BPnXc9jMBl9jHvqPITmNPGWCogkmGVRcq9u/9u40wUnPRdVviCFs/yp6krv oyO7Szurqwq1sAL4Bpxiiqq704pdoLHUh2M3EmpE= From: Jai Luthra Date: Mon, 05 Jan 2026 14:26:48 +0530 Subject: [PATCH v2 2/6] platform/raspberrypi: vchiq: Store audio device in driver management struct 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: <20260105-b4-vc-sm-cma-v2-2-4daea749ced9@ideasonboard.com> References: <20260105-b4-vc-sm-cma-v2-0-4daea749ced9@ideasonboard.com> In-Reply-To: <20260105-b4-vc-sm-cma-v2-0-4daea749ced9@ideasonboard.com> To: Florian Fainelli , Raspberry Pi Kernel Maintenance , bcm-kernel-feedback-list@broadcom.com, Greg Kroah-Hartman , Dave Stevenson Cc: Phil Elwell , Stefan Wahren , Laurent Pinchart , Kieran Bingham , Sumit Semwal , =?utf-8?q?Christian_K=C3=B6nig?= , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, Jai Luthra X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2939; i=jai.luthra@ideasonboard.com; h=from:subject:message-id; bh=yaP3HyKstBhKWf2536vAbnaHRYAmQhF5Pn7rz8yvAm4=; b=owEBbQKS/ZANAwAKAUPekfkkmnFFAcsmYgBpW3z6Mn9Yr/vXGIvYrWYdNbtQ0+Bt8XuJQuqPg iFAbXHGs72JAjMEAAEKAB0WIQRN4NgY5dV16NRar8VD3pH5JJpxRQUCaVt8+gAKCRBD3pH5JJpx RT5JD/wPBWLOrysUl0tM7jiCnNlmX4YpLyhefMmi2ioK3A9RhwN8JNcUZyPRtMCyw6ZthaOVuq2 xNf55FAjxpa4AIejODCDBRKfN9Nos8c/lSXBB0xctkBmh/l19I+5vYc6rtknnSMoK6RSQQOo8M0 Fg9aZdCmw03c8WFERF17HGDaJrlOOuIS2fLPuCRsaThOJ2wv6sz1g6qnfmFOswP4ZKe4rt5jS43 faTYSCgfFTshB74d8liXNKWIgf7FaqMp6jucNhYK95GVkgSRjfe/c/RABIG9BdXtEy9YTjI6fbz cQXa9C1aqZuDIPe6Tros9xU+ML6VuujgvGDM2XyUXTeq319vLN83AkOZcBJdcV26an7QFhMWuDc S/9D5MWqjjIoLaBPa+an8G/XfL++2guyggYa8FByqUBK7Fvd+AsdGNkP7qtiKw8nxn/zXWL1uYl 5WEYO2c/V05v97PBaOhipAK5RxIR8CS1WAg8Vj9PAeQ/N4YctPV1oQ/La5HCFxcwa67PetMBI+q IertMtjgqLtgkRvdkTbTwVvcdgybLT5Ef+HiKQ+3Ihye6v0Q+pLFrpZdUVlQE/A9i8SajBaoMQV LzTG/1pOlzsqYxu+qTrxe9lyq0qGkbcPuiGzlzYnFWVRn2f/K0Klq3ZkyrSCGvnHGq1AT04AFq2 gif3b/P6sUoLrkg== X-Developer-Key: i=jai.luthra@ideasonboard.com; a=openpgp; fpr=4DE0D818E5D575E8D45AAFC543DE91F9249A7145 The VCHIQ firmware devices are not discoverable, so they must be tracked manually by the driver. Previously, the bcm2835 audio device was stored in a static global pointer. Move the audio device pointer into struct vchiq_drv_mgmt instead, so it is properly associated with the driver instance and lifecycle. This avoids global state and makes device registration and removal follow the platform device more cleanly. No functional change intended. Signed-off-by: Jai Luthra --- drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c | 11 ++--------- include/linux/raspberrypi/vchiq_arm.h | 8 ++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c b/dri= vers/platform/raspberrypi/vchiq-interface/vchiq_arm.c index 6a7b96d3dae6275a483ef15dc619c5510454765e..2cc7574a6132d9a26278439eb5f= 89c7bad94d764 100644 --- a/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c +++ b/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c @@ -57,13 +57,6 @@ #define KEEPALIVE_VER 1 #define KEEPALIVE_VER_MIN KEEPALIVE_VER =20 -/* - * The devices implemented in the VCHIQ firmware are not discoverable, - * so we need to maintain a list of them in order to register them with - * the interface. - */ -static struct vchiq_device *bcm2835_audio; - static const struct vchiq_platform_info bcm2835_info =3D { .cache_line_size =3D 32, }; @@ -1421,7 +1414,7 @@ static int vchiq_probe(struct platform_device *pdev) =20 vchiq_debugfs_init(&mgmt->state); =20 - bcm2835_audio =3D vchiq_device_register(&pdev->dev, "bcm2835-audio"); + mgmt->audio_dev =3D vchiq_device_register(&pdev->dev, "bcm2835-audio"); =20 return 0; } @@ -1430,7 +1423,7 @@ static void vchiq_remove(struct platform_device *pdev) { struct vchiq_drv_mgmt *mgmt =3D dev_get_drvdata(&pdev->dev); =20 - vchiq_device_unregister(bcm2835_audio); + vchiq_device_unregister(mgmt->audio_dev); vchiq_debugfs_deinit(); vchiq_deregister_chrdev(); vchiq_platform_uninit(mgmt); diff --git a/include/linux/raspberrypi/vchiq_arm.h b/include/linux/raspberr= ypi/vchiq_arm.h index e32b02f990244b46ab97c463dab6a973fdd97033..541b4efd64d9a8229c7e4b5bc21= 137a9899af9c6 100644 --- a/include/linux/raspberrypi/vchiq_arm.h +++ b/include/linux/raspberrypi/vchiq_arm.h @@ -11,6 +11,7 @@ #include #include #include +#include "vchiq_bus.h" #include "vchiq_core.h" #include "vchiq_debugfs.h" =20 @@ -54,6 +55,13 @@ struct vchiq_drv_mgmt { void __iomem *regs; =20 struct vchiq_state state; + + /* + * The devices implemented in the VCHIQ firmware are not discoverable, + * so we need to maintain a list of them in order to register them with + * the interface. + */ + struct vchiq_device *audio_dev; }; =20 struct user_service { --=20 2.52.0