From mboxrd@z Thu Jan 1 00:00:00 1970 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 5CE99EB64D7 for ; Wed, 28 Jun 2023 22:52:19 +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:Message-ID:Date:To:Cc:From:Subject: References:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=y7S2UbHp/dnN2orOD8MuB8Cdo//mDvpydCa1FV/SQ8M=; b=j5GxUKEqsGay2a RbdzbSorhRNTE52ilWfRc+0IMX6GAUEbDreL6bCzR0V1srfe8jo6j/WuvRh/vq3aP1XWM1bYNxlWJ JLfHUL3syTBwn5cNTVhJWtR2gGlgx0XDZ5RlX/Qnh0jtQNY84YVmGGNClqb3+4M9x0pDpAadm0UVN rx9j3OuV4D6aiZIvVo9uBlRA+xmxyBncsV3xaEQWqrO9+EFu+DslaS/L3pigwILz9p+yLIDZtvEuP 2/YihQhyd5GTYxSknWsZQj1i1/IYaLZE8YoYg4u/CBz/t3HPXOE4aKXFveaeEfNgRbyKEwY+VU2wf NgehZ531alGh0vnpPGwg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qEe0t-00GwX2-1f; Wed, 28 Jun 2023 22:51:51 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qEe0q-00GwW5-1G; Wed, 28 Jun 2023 22:51:49 +0000 Received: from pendragon.ideasonboard.com (aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net [82.37.23.78]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 890F3905; Thu, 29 Jun 2023 00:51:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1687992666; bh=FbpZiCKBRCQmKJWrA2DWJ1gw6fwfmj/bFIqXsro0RTQ=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=N7B+zAML9O8fAGsUpcNFyj9nAHNOQcS3s3QvrbBXE6Ph1mY052O3H6oXZ3MpKUWxX YCSnjHQ7qdLgpwq3efgl0bBeOgz5C9lqlfmsWYuMI3HAupJfGYeprG/RH/PVW3uiu2 9dNHFaJfndb033InaGitqTjURDYnWAVPmL1h+iKk= MIME-Version: 1.0 In-Reply-To: <20230627201628.207483-5-umang.jain@ideasonboard.com> References: <20230627201628.207483-1-umang.jain@ideasonboard.com> <20230627201628.207483-5-umang.jain@ideasonboard.com> Subject: Re: [PATCH v8 4/5] staging: bcm2835-audio: Register bcm2835-audio with vchiq_bus_type From: Kieran Bingham Cc: stefan.wahren@i2se.com, gregkh@linuxfoundation.org, f.fainelli@gmail.com, athierry@redhat.com, error27@gmail.com, dave.stevenson@raspberrypi.com, laurent.pinchart@ideasonboard.com, Umang Jain To: Umang Jain , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-staging@lists.linux.dev Date: Wed, 28 Jun 2023 23:51:43 +0100 Message-ID: <168799270390.3298351.3592364441774693940@Monstersaurus> User-Agent: alot/0.10 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230628_155148_577324_6624CBC8 X-CRM114-Status: GOOD ( 19.33 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Quoting Umang Jain (2023-06-27 21:16:27) > Similar to how bcm2385-camera device is registered, register the > bcm2835-audio with vchiq_bus_type as well. bcm2835-audio here and in the dir name, but registered as bcm2835_audio... Personally I prefer bcm2835-audio ... but this is already discussed earlier in the series. > > Signed-off-by: Umang Jain > --- > .../vc04_services/bcm2835-audio/bcm2835.c | 17 ++++++++--------- > .../interface/vchiq_arm/vchiq_arm.c | 6 +----- > 2 files changed, 9 insertions(+), 14 deletions(-) > > diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c > index 00bc898b0189..f81a9a4fbd5d 100644 > --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c > +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c > @@ -1,12 +1,12 @@ > // SPDX-License-Identifier: GPL-2.0 > /* Copyright 2011 Broadcom Corporation. All rights reserved. */ > > -#include > - > #include > #include > #include > > +#include "../interface/vchiq_arm/vchiq_arm.h" > +#include "../interface/vchiq_arm/vchiq_device.h" > #include "bcm2835.h" > > static bool enable_hdmi; > @@ -268,9 +268,9 @@ static int snd_add_child_devices(struct device *device, u32 numchans) > return 0; > } > > -static int snd_bcm2835_alsa_probe(struct platform_device *pdev) > +static int snd_bcm2835_alsa_probe(struct vchiq_device *device) > { > - struct device *dev = &pdev->dev; > + struct device *dev = &device->dev; > int err; > > if (num_channels <= 0 || num_channels > MAX_SUBSTREAMS) { > @@ -292,20 +292,20 @@ static int snd_bcm2835_alsa_probe(struct platform_device *pdev) > > #ifdef CONFIG_PM > > -static int snd_bcm2835_alsa_suspend(struct platform_device *pdev, > +static int snd_bcm2835_alsa_suspend(struct vchiq_device *device, > pm_message_t state) > { > return 0; > } > > -static int snd_bcm2835_alsa_resume(struct platform_device *pdev) > +static int snd_bcm2835_alsa_resume(struct vchiq_device *device) > { > return 0; > } > > #endif > > -static struct platform_driver bcm2835_alsa_driver = { > +static struct vchiq_driver bcm2835_alsa_driver = { > .probe = snd_bcm2835_alsa_probe, > #ifdef CONFIG_PM > .suspend = snd_bcm2835_alsa_suspend, > @@ -315,9 +315,8 @@ static struct platform_driver bcm2835_alsa_driver = { > .name = "bcm2835_audio", > }, > }; > -module_platform_driver(bcm2835_alsa_driver); > +module_vchiq_driver(bcm2835_alsa_driver); > > MODULE_AUTHOR("Dom Cobley"); > MODULE_DESCRIPTION("Alsa driver for BCM2835 chip"); > MODULE_LICENSE("GPL"); > -MODULE_ALIAS("platform:bcm2835_audio"); And same as with the bcm2385-camera ... I expect this might be required in some form to support module autoloading? But with that resolved: Reviewed-by: Kieran Bingham > diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > index 79d4d0eeb5fb..75da37fa6372 100644 > --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > @@ -67,8 +67,6 @@ int vchiq_susp_log_level = VCHIQ_LOG_ERROR; > DEFINE_SPINLOCK(msg_queue_spinlock); > struct vchiq_state g_state; > > -static struct platform_device *bcm2835_audio; > - > struct vchiq_drvdata { > const unsigned int cache_line_size; > struct rpi_firmware *fw; > @@ -139,6 +137,7 @@ struct vchiq_pagelist_info { > * the interface. > */ > static const char *const vchiq_devices[] = { > + "bcm2835_audio", > "bcm2835-camera", > }; > > @@ -1849,8 +1848,6 @@ static int vchiq_probe(struct platform_device *pdev) > goto error_exit; > } > > - bcm2835_audio = vchiq_register_child(pdev, "bcm2835_audio"); > - > for (i = 0; i < ARRAY_SIZE(vchiq_devices); i++) { > err = vchiq_device_register(&pdev->dev, vchiq_devices[i]); > if (err) > @@ -1868,7 +1865,6 @@ static int vchiq_probe(struct platform_device *pdev) > > static void vchiq_remove(struct platform_device *pdev) > { > - platform_device_unregister(bcm2835_audio); > bus_for_each_dev(&vchiq_bus_type, NULL, NULL, vchiq_device_unregister); > vchiq_debugfs_deinit(); > vchiq_deregister_chrdev(); > -- > 2.39.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel