From patchwork Wed Jul 19 16:44:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 122757 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:410:b0:134:c3fc:3153 with SMTP id 16csp4235811rwd; Wed, 19 Jul 2023 10:54:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlE7XJ6shm1LD+eqi9P6XArJzTrg9+H2B/gbKgq4wTi/skvqd+xAlk3KAzGnInV6Rvv8sZVo X-Received: by 2002:a17:906:779a:b0:997:e9a3:9c4f with SMTP id s26-20020a170906779a00b00997e9a39c4fmr3544482ejm.30.1689789272932; Wed, 19 Jul 2023 10:54:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689789272; cv=none; d=google.com; s=arc-20160816; b=vKGMKDpOvwXzl2LQdwt2cnGPWZjMkaoPLk5EDki1za0B4ppLOkKUnMJsGawTKegVwp fG4lXW5GUn5GY4SSDvI4Ctybl08I++G4LOVfEa5QgVnHr69AtOcokaqnV/+4PeucxET7 2JsaQ4rM67ROHi6ZJwJOBJmRtRuP/P07nOiQFVYOylyJX5Q5LFaMBI0iCPG3/MUaffeg 5ChyK8NHZr2tXEw/WNhxS9/ENhnqlGxUkGLVAGdPBxBKdnzAJdt13w3kBHDqrE7FSTLZ Mqt+zEY0cgSNSzMdjYCfd7xLoVhf2Hu2L9oZ6Smg22YM4aVJVok+e0t8d4TQCV1BI50S mDwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Ib74BBMh0n/ZYAtKpFaN2x290By98r6/IlZ4o050SPk=; fh=HOFam38REw6BIxvQyXL0jcX3gf57D0OJSEWCuf65U0M=; b=g+x3WNaG5oVIBX5YH7G6Kb3xn64f30PI5r7zUPDyJOtIJgma6VfrxRquYgFM3gsyQl UwVH/FiXa1PMatmi5pVa7989yv38j3U/oLXWil6oE+0qr5dbm99eUpB1n/FvyEbiiGpv VHr4rXUJu/p80m3jT2gB3W5DZB8M1aYzav4wg0XJC3y2jnX58jrMSQNJU9HYRjv3AirG d3loYUSAiMDamPJqhHedLoXm2EHCJQ2kb+ds1juHQ34Stxt0KAsNmFXhSqqICBNq9qiR 7AmiQzbrbRGbnLy9V55gtJP+VtP2s/Pl7ysh2FB2vcMXO0MKBZfIaYeuJIFCzCaFLuUX O75A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=r38yf7bR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j15-20020a1709062a0f00b00992dce29d4csi3163730eje.874.2023.07.19.10.54.08; Wed, 19 Jul 2023 10:54:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=r38yf7bR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230163AbjGSQpD (ORCPT + 99 others); Wed, 19 Jul 2023 12:45:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229823AbjGSQo7 (ORCPT ); Wed, 19 Jul 2023 12:44:59 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5642E1FD6; Wed, 19 Jul 2023 09:44:46 -0700 (PDT) Received: from umang.jainideasonboard.com (unknown [103.86.18.219]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CD9C2AF2; Wed, 19 Jul 2023 18:43:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1689785030; bh=NTRl/8xjLjDciB8piQNg6qUidhzVBEXYXNdN0Rw6p6M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r38yf7bRxd9M6ev77mV0cGcpnjDoFKHKumR9FvFHWqOyqbaWus5j56+USIsmGYIpl PljEoKPtJH04myKfTvdUmr/meI4oc47DSRNGtLBhlWy178oupqEXI8ApNQ/sgknPaS GLT3i3O4/2N8cN2rtQa7LShnup2VcRpPJvBscuiw= From: Umang Jain To: linux-staging@lists.linux.dev, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: stefan.wahren@i2se.com, gregkh@linuxfoundation.org, f.fainelli@gmail.com, athierry@redhat.com, error27@gmail.com, dave.stevenson@raspberrypi.com, kieran.bingham@ideasonboard.com, laurent.pinchart@ideasonboard.com, Umang Jain Subject: [PATCH v9 1/5] staging: vc04_services: vchiq_arm: Add new bus type and device type Date: Wed, 19 Jul 2023 22:14:23 +0530 Message-Id: <20230719164427.1383646-2-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230719164427.1383646-1-umang.jain@ideasonboard.com> References: <20230719164427.1383646-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771872476407163778 X-GMAIL-MSGID: 1771872476407163778 The devices that the vchiq interface registers (bcm2835-audio, bcm2835-camera) are implemented and exposed by the VC04 firmware. The device tree describes the VC04 itself with the resources required to communicate with it through a mailbox interface. However, the vchiq interface registers these devices as platform devices. This also means the specific drivers for these devices are getting registered as platform drivers. This is not correct and a blatant abuse of platform device/driver. Add a new bus type, vchiq_bus_type and device type (struct vchiq_device) which will be used to migrate child devices that the vchiq interfaces creates/registers from the platform device/driver. Signed-off-by: Umang Jain --- drivers/staging/vc04_services/Makefile | 1 + .../interface/vchiq_arm/vchiq_device.c | 102 ++++++++++++++++++ .../interface/vchiq_arm/vchiq_device.h | 54 ++++++++++ 3 files changed, 157 insertions(+) create mode 100644 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_device.c create mode 100644 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_device.h diff --git a/drivers/staging/vc04_services/Makefile b/drivers/staging/vc04_services/Makefile index 44794bdf6173..2d071e55e175 100644 --- a/drivers/staging/vc04_services/Makefile +++ b/drivers/staging/vc04_services/Makefile @@ -5,6 +5,7 @@ vchiq-objs := \ interface/vchiq_arm/vchiq_core.o \ interface/vchiq_arm/vchiq_arm.o \ interface/vchiq_arm/vchiq_debugfs.o \ + interface/vchiq_arm/vchiq_device.o \ interface/vchiq_arm/vchiq_connected.o \ ifdef CONFIG_VCHIQ_CDEV diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_device.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_device.c new file mode 100644 index 000000000000..d7dfe4173579 --- /dev/null +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_device.c @@ -0,0 +1,102 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * vchiq_device.c - VCHIQ generic device and bus-type + * + * Copyright (c) 2023 Ideas On Board Oy + */ + +#include +#include +#include + +#include "vchiq_device.h" + +static int vchiq_bus_type_match(struct device *dev, struct device_driver *drv) +{ + if (dev->bus == &vchiq_bus_type && + strcmp(dev_name(dev), drv->name) == 0) + return 1; + + return 0; +} + +static int vchiq_bus_uevent(const struct device *dev, struct kobj_uevent_env *env) +{ + const struct vchiq_device *device = container_of_const(dev, struct vchiq_device, dev); + + return add_uevent_var(env, "MODALIAS=%s", dev_name(&device->dev)); +} + +static int vchiq_bus_probe(struct device *dev) +{ + struct vchiq_device *device = to_vchiq_device(dev); + struct vchiq_driver *driver = to_vchiq_driver(dev->driver); + int ret; + + ret = driver->probe(device); + if (ret == 0) + return 0; + + return ret; +} + +struct bus_type vchiq_bus_type = { + .name = "vchiq-bus", + .match = vchiq_bus_type_match, + .uevent = vchiq_bus_uevent, + .probe = vchiq_bus_probe, +}; + +static void vchiq_device_release(struct device *dev) +{ + struct vchiq_device *device = to_vchiq_device(dev); + + kfree(device); +} + +struct vchiq_device * +vchiq_device_register(struct device *parent, const char *name) +{ + struct vchiq_device *device; + int ret; + + device = kzalloc(sizeof(*device), GFP_KERNEL); + if (!device) { + dev_err(parent, "Cannot register %s: Insufficient memory\n", + name); + return NULL; + } + + device->dev.init_name = name; + device->dev.parent = parent; + device->dev.bus = &vchiq_bus_type; + device->dev.release = vchiq_device_release; + + ret = device_register(&device->dev); + if (ret) { + dev_err(parent, "Cannot register %s: %d\n", name, ret); + put_device(&device->dev); + return NULL; + } + + return device; +} + +void vchiq_device_unregister(struct vchiq_device *vchiq_dev) +{ + device_unregister(&vchiq_dev->dev); +} + +int vchiq_driver_register(struct vchiq_driver *vchiq_drv) +{ + vchiq_drv->driver.bus = &vchiq_bus_type; + + return driver_register(&vchiq_drv->driver); +} +EXPORT_SYMBOL_GPL(vchiq_driver_register); + +void vchiq_driver_unregister(struct vchiq_driver *vchiq_drv) +{ + driver_unregister(&vchiq_drv->driver); +} +EXPORT_SYMBOL_GPL(vchiq_driver_unregister); diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_device.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_device.h new file mode 100644 index 000000000000..7eaaf9a91cda --- /dev/null +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_device.h @@ -0,0 +1,54 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2023 Ideas On Board Oy + */ + +#ifndef _VCHIQ_DEVICE_H +#define _VCHIQ_DEVICE_H + +#include + +struct vchiq_device { + struct device dev; +}; + +struct vchiq_driver { + int (*probe)(struct vchiq_device *device); + void (*remove)(struct vchiq_device *device); + int (*resume)(struct vchiq_device *device); + int (*suspend)(struct vchiq_device *device, + pm_message_t state); + struct device_driver driver; +}; + +static inline struct vchiq_device *to_vchiq_device(struct device *d) +{ + return container_of(d, struct vchiq_device, dev); +} + +static inline struct vchiq_driver *to_vchiq_driver(struct device_driver *d) +{ + return container_of(d, struct vchiq_driver, driver); +} + +extern struct bus_type vchiq_bus_type; + +struct vchiq_device * +vchiq_device_register(struct device *parent, const char *name); +void vchiq_device_unregister(struct vchiq_device *dev); + +int vchiq_driver_register(struct vchiq_driver *vchiq_drv); +void vchiq_driver_unregister(struct vchiq_driver *vchiq_drv); + +/** + * module_vchiq_driver() - Helper macro for registering a vchiq driver + * @__vchiq_driver: vchiq driver struct + * + * Helper macro for vchiq drivers which do not do anything special in + * module init/exit. This eliminates a lot of boilerplate. Each module may only + * use this macro once, and calling it replaces module_init() and module_exit() + */ +#define module_vchiq_driver(__vchiq_driver) \ + module_driver(__vchiq_driver, vchiq_driver_register, vchiq_driver_unregister) + +#endif /* _VCHIQ_DEVICE_H */ From patchwork Wed Jul 19 16:44:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 122741 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2579540vqt; Wed, 19 Jul 2023 10:05:04 -0700 (PDT) X-Google-Smtp-Source: APBJJlE0ljiI3+PsSgNv1+J7wF02Z5zCqI8obycTP5+LEHdmVDcDyotN39EZ5xPTqCROJ8cR9upp X-Received: by 2002:a54:4808:0:b0:3a3:7228:8c98 with SMTP id j8-20020a544808000000b003a372288c98mr6558634oij.2.1689786304553; Wed, 19 Jul 2023 10:05:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689786304; cv=none; d=google.com; s=arc-20160816; b=muzQamwKLhQTWKNHCpvfjBGH+6Yjhlmppk5LtneDvPi+sSYmqkDwz67jBoEkKPOnks vIPBzDmAidHRG7IgW7CozmxUHkPWM42VSJ6yJqmXfVNqKs4xArHe4sQpecQrTldbof2Q R3fXBpa4n+5C4qRwmJXIM0ioZ+RC6vW4wa3Z/k3kD6DLHSLDKDsEWSLWmBc0L3Wx5x9f fO9DgLTGaS1prXSBbQulJqhgaEPA9dTX2fqSrThUog4CoZ1GY9yWWmBfZzTIq+1Heha5 zClBEsJWSXbIHyp4ikH11TNKJSRvPO1hcglVVQ/mZqp33rhrrWSV04nPdcRkdRr5EGTn uwcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2RYi+ajkHRDrsRT5kpWJ/D6NmMm5EFru7k3NdoNcjPI=; fh=HOFam38REw6BIxvQyXL0jcX3gf57D0OJSEWCuf65U0M=; b=hDf+JLdnohPDpluGMWlTFuidoV9uQpu8cJx+7keiddV2RzYLgdedg6Zh+0Z0/F/v8C gUb1NuaOWzHYknXNARESpPs/pHgvFco1Ad0eX0LmGq/SQNoSGLaNnsK69beFNpDqs54I 3pRWxe9w/MeN06tPWzSRbZ0sGNKEkez/2KOXGRQC6ppxkSqntawtsj1Pjagbrjvu9Iu5 M7SqXKyCp9ZOGE9BQuVxD8Uba1NlUBZxvRWccy1t+ScRNMS8jqk902SfDTUy665bQCz8 /0HxDzWgcIDlWkNuxn0heOecbdBgeZPXkLfDPBE1W/u/LmTMR4Mha4XNVE7uVmh/RA8z qhXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=CGuoBiIE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x11-20020a17090ab00b00b002635100d850si1618295pjq.178.2023.07.19.10.04.48; Wed, 19 Jul 2023 10:05:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=CGuoBiIE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230319AbjGSQpF (ORCPT + 99 others); Wed, 19 Jul 2023 12:45:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230282AbjGSQpB (ORCPT ); Wed, 19 Jul 2023 12:45:01 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38A721FD2; Wed, 19 Jul 2023 09:44:57 -0700 (PDT) Received: from umang.jainideasonboard.com (unknown [103.86.18.219]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9A7DA10FF; Wed, 19 Jul 2023 18:43:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1689785034; bh=LeLvy8dmB49ivCc3FmszLDCbTglhyeqRh8+wWDv2694=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CGuoBiIE4MMFCAuPr8E/hhUnomzAVazDINXKnNBOSlK8nef5ve0WYt9+RswVEklx+ jItQQLj17iHf1Dn2nSPCcjRsW8wwlgCZ6WdFC9yfBH1bCrvvERrp5Tb98ouarj9Sbb yAqXcbW8x1cc/Fq/mmg0WwvkVlVvguqUhBDvCRYA= From: Umang Jain To: linux-staging@lists.linux.dev, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: stefan.wahren@i2se.com, gregkh@linuxfoundation.org, f.fainelli@gmail.com, athierry@redhat.com, error27@gmail.com, dave.stevenson@raspberrypi.com, kieran.bingham@ideasonboard.com, laurent.pinchart@ideasonboard.com, Umang Jain Subject: [PATCH v9 2/5] staging: vc04_services: vchiq_arm: Register vchiq_bus_type Date: Wed, 19 Jul 2023 22:14:24 +0530 Message-Id: <20230719164427.1383646-3-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230719164427.1383646-1-umang.jain@ideasonboard.com> References: <20230719164427.1383646-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771869363934894847 X-GMAIL-MSGID: 1771869363934894847 Register the vchiq_bus_type bus with the vchiq interface. The bcm2835-camera and bcm2835_audio will be registered to this bus type going ahead. Signed-off-by: Umang Jain Reviewed-by: Kieran Bingham --- .../vc04_services/interface/vchiq_arm/vchiq_arm.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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 aa2313f3bcab..e8d40f891449 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -34,6 +35,7 @@ #include "vchiq_ioctl.h" #include "vchiq_arm.h" #include "vchiq_debugfs.h" +#include "vchiq_device.h" #include "vchiq_connected.h" #include "vchiq_pagelist.h" @@ -1870,6 +1872,12 @@ static int __init vchiq_driver_init(void) { int ret; + ret = bus_register(&vchiq_bus_type); + if (ret) { + pr_err("Failed to register %s\n", vchiq_bus_type.name); + return ret; + } + ret = platform_driver_register(&vchiq_driver); if (ret) pr_err("Failed to register vchiq driver\n"); @@ -1880,6 +1888,7 @@ module_init(vchiq_driver_init); static void __exit vchiq_driver_exit(void) { + bus_unregister(&vchiq_bus_type); platform_driver_unregister(&vchiq_driver); } module_exit(vchiq_driver_exit); From patchwork Wed Jul 19 16:44:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 122742 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2579854vqt; Wed, 19 Jul 2023 10:05:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlEd6osg+yMRq8DGLM/KLsojrKMk3M/jumbZEnMd0TudN9mxQCkOzEHF9SRshbjw8pg1xHdA X-Received: by 2002:a17:906:11a:b0:98d:4ae:8db9 with SMTP id 26-20020a170906011a00b0098d04ae8db9mr2930626eje.19.1689786328145; Wed, 19 Jul 2023 10:05:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689786328; cv=none; d=google.com; s=arc-20160816; b=qMKoeSEMKniwLWkHb4s2YDHS07BoM2Rad4ZqscD7h+oKu/YECYe2TDLeVsHjJ8XIif 7znUVbupwd/jRNg4DUQMY5LRsirvF1u6Mpab1vS4CgfnSUyJtoFkCnd+v3L0RO8zT/xj gmgoyxvIeZNLYKm2CrQDg46xV8Jn5ZfMfc5Nwn5RUhUvhcBvEhBuOJ63wAnFAg+wMgaI 0guGmN00XBJCX+afWvboDJRFjXALIF9YCaKFeIEneMsnL7VAqGiuDiyNHJYi0t14nrDB 7XA62wOMXVVQBzH042MQgIMk/nCjwos9hejmvsj4dzO+/5PR9/pmsmv8kFogv06AY60X qKXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=FtUk9uktQyEUB1jk/bUqaj4n76I+1QbmFzgcoOA8I6c=; fh=HOFam38REw6BIxvQyXL0jcX3gf57D0OJSEWCuf65U0M=; b=pZsSdkoTAHUg1I/EdqAw9VpjqJQErR7QOSGFMTNBHKf5p2ibSzbJO9EpDMBjxPpNnP c+chxixdUemdgJKwn153QCFO1GTHmG6LDmNWSpcOCu5IMjyAH634z1JAmNu5wF0hRcKQ zJBUIcAPij6YhiO5UNoTVjQSdEl1nf0TLES7Xvihdkd1+jlNjEux/Ok7mGDo1JBDXI2x vTZYeE5qxreGlp6vEljxuwq3rCHoSbpmCRsw/afFYa5CNqpO91h+hmdg/UlDj58H2OEC uK4rQ5SoXmcNf3dE1ZbigbMJZAoh3jRKpoUgw0k9yV7L+cn37LIijMPh14zKi6llTcFV DVow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=SsTiuEPa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jt18-20020a170906dfd200b0098da8d0ce54si3115119ejc.834.2023.07.19.10.05.03; Wed, 19 Jul 2023 10:05:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=SsTiuEPa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230290AbjGSQpO (ORCPT + 99 others); Wed, 19 Jul 2023 12:45:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230288AbjGSQpB (ORCPT ); Wed, 19 Jul 2023 12:45:01 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66A7B1FD7; Wed, 19 Jul 2023 09:45:00 -0700 (PDT) Received: from umang.jainideasonboard.com (unknown [103.86.18.219]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3950316B4; Wed, 19 Jul 2023 18:43:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1689785039; bh=DyQQJYltSHGTg2M7880nPkKYdn1yJe9QbLEK7kQN1+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SsTiuEPaK5Vctm7Q59nopltV4BYE00fJTe7hrKWsADbxXnjgcJi7rj0Csf+//XKpS 0x0zmqAMY4uaJcAqakkNMwjSvLYHL7g6J1EvuDijILug5L+/e28jTuPsCoVN63dKTA QHE4SS4lJ1vMsge1opLm4HI7VFSCG6hfGrDit3fY= From: Umang Jain To: linux-staging@lists.linux.dev, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: stefan.wahren@i2se.com, gregkh@linuxfoundation.org, f.fainelli@gmail.com, athierry@redhat.com, error27@gmail.com, dave.stevenson@raspberrypi.com, kieran.bingham@ideasonboard.com, laurent.pinchart@ideasonboard.com, Umang Jain Subject: [PATCH v9 3/5] staging: bcm2835-camera: Register bcm2835-camera with vchiq_bus_type Date: Wed, 19 Jul 2023 22:14:25 +0530 Message-Id: <20230719164427.1383646-4-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230719164427.1383646-1-umang.jain@ideasonboard.com> References: <20230719164427.1383646-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771869388809073146 X-GMAIL-MSGID: 1771869388809073146 Register the bcm2835-camera with the vchiq_bus_type instead of using platform driver/device. Also the VCHIQ firmware doesn't support device enumeration, hence one has to maintain a list of devices to be registered in the interface. Signed-off-by: Umang Jain --- .../bcm2835-camera/bcm2835-camera.c | 17 +++++++++-------- .../interface/vchiq_arm/vchiq_arm.c | 11 ++++++++--- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index 346d00df815a..58321856cf1a 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -24,8 +24,9 @@ #include #include #include -#include +#include "../interface/vchiq_arm/vchiq_arm.h" +#include "../interface/vchiq_arm/vchiq_device.h" #include "../vchiq-mmal/mmal-common.h" #include "../vchiq-mmal/mmal-encodings.h" #include "../vchiq-mmal/mmal-vchiq.h" @@ -1841,7 +1842,7 @@ static struct v4l2_format default_v4l2_format = { .fmt.pix.sizeimage = 1024 * 768, }; -static int bcm2835_mmal_probe(struct platform_device *pdev) +static int bcm2835_mmal_probe(struct vchiq_device *device) { int ret; struct bcm2835_mmal_dev *dev; @@ -1896,7 +1897,7 @@ static int bcm2835_mmal_probe(struct platform_device *pdev) &camera_instance); ret = v4l2_device_register(NULL, &dev->v4l2_dev); if (ret) { - dev_err(&pdev->dev, "%s: could not register V4L2 device: %d\n", + dev_err(&device->dev, "%s: could not register V4L2 device: %d\n", __func__, ret); goto free_dev; } @@ -1976,7 +1977,7 @@ static int bcm2835_mmal_probe(struct platform_device *pdev) return ret; } -static void bcm2835_mmal_remove(struct platform_device *pdev) +static void bcm2835_mmal_remove(struct vchiq_device *device) { int camera; struct vchiq_mmal_instance *instance = gdev[0]->instance; @@ -1988,17 +1989,17 @@ static void bcm2835_mmal_remove(struct platform_device *pdev) vchiq_mmal_finalise(instance); } -static struct platform_driver bcm2835_camera_driver = { +static struct vchiq_driver bcm2835_camera_driver = { .probe = bcm2835_mmal_probe, - .remove_new = bcm2835_mmal_remove, + .remove = bcm2835_mmal_remove, .driver = { .name = "bcm2835-camera", }, }; -module_platform_driver(bcm2835_camera_driver) +module_vchiq_driver(bcm2835_camera_driver) MODULE_DESCRIPTION("Broadcom 2835 MMAL video capture"); MODULE_AUTHOR("Vincent Sanders"); MODULE_LICENSE("GPL"); -MODULE_ALIAS("platform:bcm2835-camera"); +MODULE_ALIAS("bcm2835-camera"); 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 e8d40f891449..d941e9640415 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,13 @@ int vchiq_susp_log_level = VCHIQ_LOG_ERROR; DEFINE_SPINLOCK(msg_queue_spinlock); struct vchiq_state g_state; -static struct platform_device *bcm2835_camera; static struct platform_device *bcm2835_audio; +/* + * 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_camera; struct vchiq_drvdata { const unsigned int cache_line_size; @@ -1840,8 +1845,8 @@ static int vchiq_probe(struct platform_device *pdev) goto error_exit; } - bcm2835_camera = vchiq_register_child(pdev, "bcm2835-camera"); bcm2835_audio = vchiq_register_child(pdev, "bcm2835_audio"); + bcm2835_camera = vchiq_device_register(&pdev->dev, "bcm2835-camera"); return 0; @@ -1854,7 +1859,7 @@ static int vchiq_probe(struct platform_device *pdev) static void vchiq_remove(struct platform_device *pdev) { platform_device_unregister(bcm2835_audio); - platform_device_unregister(bcm2835_camera); + vchiq_device_unregister(bcm2835_camera); vchiq_debugfs_deinit(); vchiq_deregister_chrdev(); } From patchwork Wed Jul 19 16:44:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 122756 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2605311vqt; Wed, 19 Jul 2023 10:49:55 -0700 (PDT) X-Google-Smtp-Source: APBJJlFMD5UQtAEyF6ltgslMeF1q3Cru6CP+rrnD6/fX4QYEe36aXHO1QyhVFBRH7nAmZu0Kaw83 X-Received: by 2002:a17:907:2bcf:b0:98f:3485:9c44 with SMTP id gv15-20020a1709072bcf00b0098f34859c44mr2720521ejc.72.1689788994565; Wed, 19 Jul 2023 10:49:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689788994; cv=none; d=google.com; s=arc-20160816; b=QTLNgCOrUHVMpOrZMihrZXsMAeUfvbeBkMC8PhOeaaehTTWtXoLfFpsLiOmqftqchU o+70KWUjZtrrkYxTnUQ+sD7NPnCKEzdHhqEAJRWtf3EjeEZ5LlPxXfBoMyWDHnHEvfA+ 7pZ3JAeulB7grwPYK+CNszrogVGKsZY9YBGPEWwEPzYE/kn4C2HiHb+tGuSNyBkh8h9i BiH4uYGpN7AN7etMgEz0Rj/CokwZJ9JSNliRK+DPcQ18EHjoXaqLnB7EGQK9y6ovvAW8 3qV+4PZyQ3HJDi3t4y/6rRMl94S/keyL+PNZs4I12y57I3MAX6FL4tba6W3adLBWmTnS yMeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IGGZ0s3daf8BJ29vmW8GBu6Lrpyt7K7auExSMCQInUI=; fh=HOFam38REw6BIxvQyXL0jcX3gf57D0OJSEWCuf65U0M=; b=sTordRga13VNszNDFfO2AbWYJZWLe3FqBb8nK4yXZ4Gu3J5rYrtfygIqIkZtMrYx4z 3UpSrgNeNuv4P8WvB7ge7jdfYZP197VeU2coi4q+xq0BQqdTry1VUU4iELZNoW4AS5TC 4RqgBBs0JNjPZ1k63mV8HCjVZtJNvOFcB6L0jEE3ZSgGJlXb/jJLr/DfIZYNFlxyXGds Cs72Y0zMDrgZyu38AbMoOPjD/3ldmbmXVBwxHV9+67aENIovX+FNhAtY8+ZsLuaBKEtp tRh0BGwoiMAA6PBeNg37cdjKMo0MXu1cFmxzMXv43lWbtnpLVnPEG4c8x7lrM/T/IkEU UnTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=PwvhRZXK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z6-20020a1709064e0600b0098dd7716952si2755567eju.527.2023.07.19.10.49.30; Wed, 19 Jul 2023 10:49:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=PwvhRZXK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229555AbjGSQpL (ORCPT + 99 others); Wed, 19 Jul 2023 12:45:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230283AbjGSQpD (ORCPT ); Wed, 19 Jul 2023 12:45:03 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AE541FD5; Wed, 19 Jul 2023 09:45:02 -0700 (PDT) Received: from umang.jainideasonboard.com (unknown [103.86.18.219]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9D2E316C4; Wed, 19 Jul 2023 18:43:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1689785043; bh=L1JGgPAX9gIyD2sHlsEat9aOV8sorwircxkrr2ZqerU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PwvhRZXKZwl2v2+94JEIp5+oazmu9+U1XoCRu4Ajm4ZrueVVijOgQ0Gaa12Zj+oHj 6V56EwmJSbB7h6Ktni+IcDKU7G9Kv8fxb2WsvIGFNpLVr/YOYHyn131/3Citrixrkb ZIdTNXZO76sDC0wJfTQJRMl76ElBxytDV+uxcd1w= From: Umang Jain To: linux-staging@lists.linux.dev, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: stefan.wahren@i2se.com, gregkh@linuxfoundation.org, f.fainelli@gmail.com, athierry@redhat.com, error27@gmail.com, dave.stevenson@raspberrypi.com, kieran.bingham@ideasonboard.com, laurent.pinchart@ideasonboard.com, Umang Jain Subject: [PATCH v9 4/5] staging: bcm2835-audio: Register bcm2835-audio with vchiq_bus_type Date: Wed, 19 Jul 2023 22:14:26 +0530 Message-Id: <20230719164427.1383646-5-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230719164427.1383646-1-umang.jain@ideasonboard.com> References: <20230719164427.1383646-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771872184326582795 X-GMAIL-MSGID: 1771872184326582795 Similar to how bcm2385-camera device is registered, register the bcm2835-audio with vchiq_bus_type as well. Signed-off-by: Umang Jain --- .../vc04_services/bcm2835-audio/bcm2835.c | 20 +++++++++---------- .../interface/vchiq_arm/vchiq_arm.c | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c index 00bc898b0189..70e5e0942743 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,32 +292,32 @@ 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, .resume = snd_bcm2835_alsa_resume, #endif .driver = { - .name = "bcm2835_audio", + .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"); +MODULE_ALIAS("bcm2835-audio"); 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 d941e9640415..f7c2dce5ab09 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -67,12 +67,12 @@ int vchiq_susp_log_level = VCHIQ_LOG_ERROR; DEFINE_SPINLOCK(msg_queue_spinlock); struct vchiq_state g_state; -static struct platform_device *bcm2835_audio; /* * 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 struct vchiq_device *bcm2835_camera; struct vchiq_drvdata { @@ -1845,7 +1845,7 @@ static int vchiq_probe(struct platform_device *pdev) goto error_exit; } - bcm2835_audio = vchiq_register_child(pdev, "bcm2835_audio"); + bcm2835_audio = vchiq_device_register(&pdev->dev, "bcm2835-audio"); bcm2835_camera = vchiq_device_register(&pdev->dev, "bcm2835-camera"); return 0; @@ -1858,7 +1858,7 @@ static int vchiq_probe(struct platform_device *pdev) static void vchiq_remove(struct platform_device *pdev) { - platform_device_unregister(bcm2835_audio); + vchiq_device_unregister(bcm2835_audio); vchiq_device_unregister(bcm2835_camera); vchiq_debugfs_deinit(); vchiq_deregister_chrdev(); From patchwork Wed Jul 19 16:44:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 122749 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2598311vqt; Wed, 19 Jul 2023 10:36:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlF3MxE29gnFQMx/JM8aFBPdbdLhErSyyOm44r+W8DvapZGb8faA44iQ54RMC4Ck0S+w9bI5 X-Received: by 2002:aa7:c595:0:b0:521:8a13:644a with SMTP id g21-20020aa7c595000000b005218a13644amr3337913edq.23.1689788196849; Wed, 19 Jul 2023 10:36:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689788196; cv=none; d=google.com; s=arc-20160816; b=m7Sx9C+EH9AplnuCPdQmmg/gRPW5po30sXh21ghguh+AHnZKeXy4jIO7k4vzekZxi+ 0HIxG+O52/NKi15lG6uyB/Yu2WUFrVJDJgLwBD75D90i0E4hZM8urnaMv1W+/tintN0W kyiFVrA4IIQuwRjkCgcXyTcNT+5SzVVA9csR5DRbZJ00Vft/XbkoUcf/C7g/Eh7KNxVn PpFsD/GH4YRVPhK1dFMC0YqovX51FFIWl7WRqDug/IZtKUnABtZj5bTzsmfxA93/FbGG 5Lmcn6QfeVc4AK07axlpJzOrAV3A0uNQ+vLVnbssIlnR4GhvEyJyydDXydECQro0afmt 2kLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AtDCPmin1vnQCPATG2cI87sQROxH7W7LrP2wKdOqIzI=; fh=HOFam38REw6BIxvQyXL0jcX3gf57D0OJSEWCuf65U0M=; b=XhNS0lSulUvuzy/CNeOgUApGwl9aGEdA8vEoc06byvdSAV8YMPgi8SkBXJkYT4tWvB TkqN3VxE76z2BS1UbGvcDdAV+WSQQqsrR/PLtup83W33fMfxh6/jwlsPns3IAKLzNgLG EbEYJGCIMnKgXqJtxB7eNoxg76LqMRanb9Sfqb4g3zzZ+kUCxE7feuPJWhWTg6ZHJZUT vNGFZIHanobl+z9chiefV4b+PcnYfSfjyfECcByz+UQV30RxnDgyos91luYYMeNXGw09 1hLklsl9k3Y3qL3JYNJ8dHTaDy3pBo4P5gPSyxcYqZqqDhvqQrg2BO0ECwK71wsUpO1p btPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=SSThdzyS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d1-20020a05640208c100b0051df58751c4si3359090edz.134.2023.07.19.10.36.13; Wed, 19 Jul 2023 10:36:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=SSThdzyS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230323AbjGSQpV (ORCPT + 99 others); Wed, 19 Jul 2023 12:45:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230354AbjGSQpK (ORCPT ); Wed, 19 Jul 2023 12:45:10 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32865135; Wed, 19 Jul 2023 09:45:03 -0700 (PDT) Received: from umang.jainideasonboard.com (unknown [103.86.18.219]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B3F7A3382; Wed, 19 Jul 2023 18:44:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1689785047; bh=LOGzH69wKz4mW0XwcNxrfPFY1YNzGADoi/QhGY3s8Qc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SSThdzySp0pK6IXyo2UpqQuUuFLTcbbLCwnTLwtL9bgLVApWhFAroSsXuWDEZ7gF7 XpPCpGcs33T7HiguQuLpHfI/W+i7oDY/6WvEZAMhXJZp+SczNfHgs+ZpdKeGnNfjVa tnCzwpE/GQ3kWa1zlOt1H16bYZRX1zRLBBmiGRpg= From: Umang Jain To: linux-staging@lists.linux.dev, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: stefan.wahren@i2se.com, gregkh@linuxfoundation.org, f.fainelli@gmail.com, athierry@redhat.com, error27@gmail.com, dave.stevenson@raspberrypi.com, kieran.bingham@ideasonboard.com, laurent.pinchart@ideasonboard.com, Umang Jain Subject: [PATCH v9 5/5] staging: vc04_services: vchiq_arm: Remove vchiq_register_child() Date: Wed, 19 Jul 2023 22:14:27 +0530 Message-Id: <20230719164427.1383646-6-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230719164427.1383646-1-umang.jain@ideasonboard.com> References: <20230719164427.1383646-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771871348191043127 X-GMAIL-MSGID: 1771871348191043127 vchiq_register_child() is used to registered child devices as platform devices. Now that the child devices are migrated to use the vchiq_bus_type instead, they will be registered to that. Hence, drop vchiq_register_child() as it is no more required. Signed-off-by: Umang Jain Reviewed-by: Kieran Bingham --- .../interface/vchiq_arm/vchiq_arm.c | 22 ------------------- 1 file changed, 22 deletions(-) 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 f7c2dce5ab09..f18f0ebee60b 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -1776,28 +1776,6 @@ static const struct of_device_id vchiq_of_match[] = { }; MODULE_DEVICE_TABLE(of, vchiq_of_match); -static struct platform_device * -vchiq_register_child(struct platform_device *pdev, const char *name) -{ - struct platform_device_info pdevinfo; - struct platform_device *child; - - memset(&pdevinfo, 0, sizeof(pdevinfo)); - - pdevinfo.parent = &pdev->dev; - pdevinfo.name = name; - pdevinfo.id = PLATFORM_DEVID_NONE; - pdevinfo.dma_mask = DMA_BIT_MASK(32); - - child = platform_device_register_full(&pdevinfo); - if (IS_ERR(child)) { - dev_warn(&pdev->dev, "%s not registered\n", name); - child = NULL; - } - - return child; -} - static int vchiq_probe(struct platform_device *pdev) { struct device_node *fw_node;