From patchwork Tue Jun 27 20:16: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: 113591 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp8456039vqr; Tue, 27 Jun 2023 13:34:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7OJ74UqwvOpmN+I2Vj5L3dlHVJkQoZHfaosftIvFI0O9W7jLqopxXpkTL2C8Wx8cDRIiE/ X-Received: by 2002:a05:6a20:2590:b0:10b:acb4:620e with SMTP id k16-20020a056a20259000b0010bacb4620emr39071650pzd.41.1687898067141; Tue, 27 Jun 2023 13:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687898067; cv=none; d=google.com; s=arc-20160816; b=tIXobuDjmNbVR16uXFX4UUwnJNfTxp93zDQBDGy4klxxEnGLwVu2IMs2geD/B34NVT urUtleQ4jCjwofpdnXHCw7nsqNyMbfwOQAakr4rrXfc13FayWsE5oZpQhvuLoMHMpsnQ BNvY36G5JqhRxzrBtLDRh/trNF+1oSscd3pRZPM+LLYUdq0RnDFwPUqs5tjEFjlf63Dm hUACjDmwT21hm33TWkacRP1wLSQuMoOnxfdC/8zct2B7W8Iuhc2Hgo9Y86xGlIUCAJtt kNBHnlcKs2rMUICRjoNKHTWb89g0/bmdInZiQDjOhOaGrY/SKBer0Q5i5v13rmzpch/e fFVg== 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=/cIeWnMw/FlEKOorDmuZhZKu1Kp0zQWrXVs3sDosnzc=; fh=KJ7fz4phEMuOPL/5CIrq/GEqblJHB3UXSqcptreppbo=; b=MGtt3z9FpjBnaRktqrZ4fCF1DY9kUv0haXlzyfCbV6VS9i/7Si4zO6HIoBh7uDjlDd 3aYRaLhwWmL5u0YDGi7RZzLizHCnWOFvUIjv349s1YDkRL6HoRV/TYjekwt5dfxGriM1 l99WUxuZryBXD8WMd/Mr5oyh6Za4sfOdvWGFAnNTJxDa5sNuSkpUOYVz5tUrhVcWweTj u2WJ0cxuVoSJgvatElKujVSF+S/tgwDk56bUvUeu9U4BQ/AwbGKRjBa1zviuXQg8WylT oHCzGZeOLg44odSFh65OvKNO9PoU3Fg1hwzmJDlAQEh4yan5ElhLhiOPuqehilxOumLx CYBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=IWqJOP0A; 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 cq13-20020a056a00330d00b00674fe1b535asi5629617pfb.382.2023.06.27.13.34.13; Tue, 27 Jun 2023 13:34:27 -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=IWqJOP0A; 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 S230281AbjF0USH (ORCPT + 99 others); Tue, 27 Jun 2023 16:18:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231251AbjF0USC (ORCPT ); Tue, 27 Jun 2023 16:18:02 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58E8026B3; Tue, 27 Jun 2023 13:17:38 -0700 (PDT) Received: from umang.jainideasonboard.com (85-160-38-115.reb.o2.cz [85.160.38.115]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7CA241494; Tue, 27 Jun 2023 22:15:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1687896955; bh=5w38/4u4ju6HGE/B5QaYws0swVmnmA8BtFLDynYoebo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IWqJOP0ALlxXKsyRMObrr/VT13A2hvWnsj/vyr+V7HRL6c30xnTEXTq20bQn6bQn1 T26kIn2+KsEjOobDGphCWvNo8gut98QgTYq1nS6pqPxQGC5RVe/0O/bGkp4V5O1u32 pRrYhLd2WxMtYzKGCTdCgX+pIS1a37AWl2tqBX+U= 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 v8 1/5] staging: vc04_services: vchiq_arm: Add new bus type and device type Date: Tue, 27 Jun 2023 22:16:24 +0200 Message-Id: <20230627201628.207483-2-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230627201628.207483-1-umang.jain@ideasonboard.com> References: <20230627201628.207483-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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769889403613762031?= X-GMAIL-MSGID: =?utf-8?q?1769889403613762031?= 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 | 78 +++++++++++++++++++ .../interface/vchiq_arm/vchiq_device.h | 43 ++++++++++ 3 files changed, 122 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..dff312e9735c --- /dev/null +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_device.c @@ -0,0 +1,78 @@ +// 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); + +struct bus_type vchiq_bus_type = { + .name = "vchiq-bus", + .match = vchiq_bus_type_match, +}; + +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 void vchiq_device_release(struct device *dev) +{ + struct vchiq_device *device; + + device = container_of(dev, struct vchiq_device, dev); + kfree(device); +} + +int vchiq_device_register(struct device *parent, const char *name) +{ + struct vchiq_device *device = NULL; + int ret; + + device = kzalloc(sizeof(*device), GFP_KERNEL); + if (!device) + return -ENOMEM; + + 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) { + put_device(&device->dev); + return -EINVAL; + } + + return 0; +} + +int vchiq_device_unregister(struct device *dev, void *data) +{ + device_unregister(dev); + return 0; +} + +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..dcd8a3d9eebe --- /dev/null +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_device.h @@ -0,0 +1,43 @@ +/* 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; +}; + +extern struct bus_type vchiq_bus_type; + +int vchiq_device_register(struct device *parent, const char *name); +int vchiq_device_unregister(struct device *dev, void *data); + +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 Tue Jun 27 20:16: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: 113595 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp8462735vqr; Tue, 27 Jun 2023 13:50:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7wAVtZ2unsufcL3gZ97mQa9Zm80KwMzuOBRAn03ebQiCEKcoUneFcF5arL50OSc8mmg8LK X-Received: by 2002:a17:902:e851:b0:1b0:6c10:6836 with SMTP id t17-20020a170902e85100b001b06c106836mr7597866plg.33.1687899001292; Tue, 27 Jun 2023 13:50:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687899001; cv=none; d=google.com; s=arc-20160816; b=h2ZwVgt4qigfyGdzqxPrIRw6bVXAaU2RbUFBU6zW8cngwGx4edCv11p5d4cyy3l8Vk ULdzVk75NfOeDDlT4xxyMZpaIogGh81hXz7BjAV5fBi/qcLQ8KXaR9rXo9W0maMpgde1 oLzatyOSXha/bd3SGkNyE6ysiwcGEVvjejM55tmtGObzh1YwHhEy9BuFAigEnRRdwWoS 4+neH7OE+NOlUDYrPnOie+kWUpoXev3hxMuRV3i8A8H53oY4MiUWo8Pqm8S5znXbVypO ikg4/c+rCvawinvE4fgjnl8CWwPENnEsWFJ55LPeluGduP0Q72YD2AjP04UM9uaqMFip gVtg== 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=VrFQTRMZE+0/YXzL3Z+z01PqooZKqgzZ8lf+l2Bz094=; fh=KJ7fz4phEMuOPL/5CIrq/GEqblJHB3UXSqcptreppbo=; b=JYSBRFDeS0T0GDlYpd9Gndu7qBcpKfoareVwh4ekG3q56bolIY4qfIy9z/xstASCJ+ aaKaGTeHnMPVYig/fT7BR1pHK1X7AVYrYjTqXRN7vkoONSDE/HuVud/qrtoqJoJCP/0n s9/oKemXK65mXO4txFjCls87Mb+sG7cHLF0O67xCHbXz6en7W3zMtZ4/B1I6dMVgiQFw 5kCksdBgtIqpeXwATaBLdOkSDXroIpAe6Hk+5Je6M7Xj3WkiHNjqfE1+JTdLvQwPWVbE 2mmveIbXkSL4R+rGwCsNjhkyriyQJB8sd4KN1pLD8hFu1y4TO5PcpUurt9Dms4QcAZyh W5Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=i8iqgiRN; 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 li11-20020a170903294b00b001b561d3daf9si7267937plb.215.2023.06.27.13.49.48; Tue, 27 Jun 2023 13:50:01 -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=i8iqgiRN; 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 S231345AbjF0UT1 (ORCPT + 99 others); Tue, 27 Jun 2023 16:19:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231339AbjF0UTM (ORCPT ); Tue, 27 Jun 2023 16:19:12 -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 6716930DE; Tue, 27 Jun 2023 13:18:50 -0700 (PDT) Received: from umang.jainideasonboard.com (85-160-38-115.reb.o2.cz [85.160.38.115]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 765F22C1E; Tue, 27 Jun 2023 22:15:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1687896956; bh=h1HbFuL1coODwZNUdPdZyZjoMMWonPwJDJRxIgNIO9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i8iqgiRN4u9l00ZAeq0b5EYY+2KAN7bWs/hUbX2+6Pnqbsi1/u2/h9R7hVRvPPkx7 aPiSBoVxm7JPYIp7A/PQ1iNEiYPL8VlAHPVgqlEJxGU5ejWG8uuFKmPGxsbnawchv+ pEXsjH6ARfukV2TXKznx0k1phIIABvDXXIDuwGUM= 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 v8 2/5] staging: vc04_services: vchiq_arm: Register vchiq_bus_type Date: Tue, 27 Jun 2023 22:16:25 +0200 Message-Id: <20230627201628.207483-3-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230627201628.207483-1-umang.jain@ideasonboard.com> References: <20230627201628.207483-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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769890382922323984?= X-GMAIL-MSGID: =?utf-8?q?1769890382922323984?= Register the vchiq_bus_type bus with the vchiq interface. The bcm2835-camera nad 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 Tue Jun 27 20:16: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: 113609 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp8476771vqr; Tue, 27 Jun 2023 14:18:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6cqjt59ETdruP5kieglm/CUFZCviechM+MYuU84ymr3iDqtHFMD4Yg6Z07SJxDnHa3AS/u X-Received: by 2002:a17:906:4fc5:b0:982:82aa:86b1 with SMTP id i5-20020a1709064fc500b0098282aa86b1mr25779891ejw.43.1687900722722; Tue, 27 Jun 2023 14:18:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687900722; cv=none; d=google.com; s=arc-20160816; b=gDkbbNeF+5xl7MgY4jueBTRAwktK95LcBeljc2IYFosgXAMQBqR5FgYQTmKsiEbkSq EUL98to/ASCBbXYhzPL2OItkMu/9Xt0iHrqIPd8zcgCpzQffvxkp55xE/kdLrGQ71bbs jji3A+z7JgB5cbVVmebjpf9itGoofoSQL89k0BPvwRKN1UUBw8iJFnCqLFU+GDDUMrKg MEPgMhTV+Po5UHklTZB2ZM3GnZ0RR+PS5a9cjDDZpxcAl4mi55qHVffn5nxo3pxqw+QI JJ73tgW9JI4ObftEDO41C2r408yr6pQVfwKVzJ8wpY/9IQ01yBuXlzFHHnu2M/jm/9wq XLcQ== 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=ysT42IVyLNgKhnLZZ3tyJddXmGd5vF4+rr1MAQiQkY4=; fh=KJ7fz4phEMuOPL/5CIrq/GEqblJHB3UXSqcptreppbo=; b=G3T6M7sV+V382XVhBOXUK4JLpxjgbe8Sj/dt4hrisSyFEO7IOXNww0ovZyx0+oWSPh 0yTD2H0i2A5APWPOL0k9GKXRiFzkfsULUYeHbuhmZM2ED0kOJqUtAbkrhkkmjdr7rZ8I CHcX9+tmX5K9B8oRT9olpg8G2EZwIA2lHaJIJwLwicAxkDeUXlX0acIDCZo5eqqmC4iN A+42JUVYBYdLxwM24d2/XEzofPZIvYyB6MERh2qngId/ZUEjzy5FjQWulRfWAks9VJDk 936UAaADVxF4UobM6PKENhY7Tt9hLjtKORg2MFtMpkg/oxpnTb+R5nm0qYEsBmeLXrcZ km+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=LH38S3H1; 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 bi11-20020a170906a24b00b00982843ecb6dsi4802487ejb.134.2023.06.27.14.18.17; Tue, 27 Jun 2023 14:18:42 -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=LH38S3H1; 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 S231267AbjF0UXY (ORCPT + 99 others); Tue, 27 Jun 2023 16:23:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230420AbjF0UXT (ORCPT ); Tue, 27 Jun 2023 16:23:19 -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 E766E268C; Tue, 27 Jun 2023 13:23:17 -0700 (PDT) Received: from umang.jainideasonboard.com (85-160-38-115.reb.o2.cz [85.160.38.115]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7A80231B9; Tue, 27 Jun 2023 22:15:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1687896957; bh=FYswsBqlGTJd9Uyph3V+TQd6xP/1Bv4ExB0Kmxk7mY4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LH38S3H1Nk+x0OaEipDZuzWIsskQgS7sUasWv0Emmzbvpp3RWXSsCS8H6ilSbeEhX hkp/6tV9iShsHKHFZm+eBJJRIAWJjEiM3bjTy3A9HKu76FO8Gm1oHops0hdAh4JZsj r9GqDFxUGku8zZSFM4zY+zYjWN/Xi4uBbvpA6tkg= 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 v8 3/5] staging: bcm2835-camera: Register bcm2835-camera with vchiq_bus_type Date: Tue, 27 Jun 2023 22:16:26 +0200 Message-Id: <20230627201628.207483-4-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230627201628.207483-1-umang.jain@ideasonboard.com> References: <20230627201628.207483-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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769892188589992876?= X-GMAIL-MSGID: =?utf-8?q?1769892188589992876?= 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 | 16 +++++++------- .../interface/vchiq_arm/vchiq_arm.c | 21 ++++++++++++++++--- 2 files changed, 26 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..f37b2a881d92 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,16 @@ 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"); 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..79d4d0eeb5fb 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -67,7 +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_camera; static struct platform_device *bcm2835_audio; struct vchiq_drvdata { @@ -134,6 +133,15 @@ struct vchiq_pagelist_info { unsigned int scatterlist_mapped; }; +/* + * 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 const char *const vchiq_devices[] = { + "bcm2835-camera", +}; + static void __iomem *g_regs; /* This value is the size of the L2 cache lines as understood by the * VPU firmware, which determines the required alignment of the @@ -1798,6 +1806,7 @@ static int vchiq_probe(struct platform_device *pdev) struct device_node *fw_node; const struct of_device_id *of_id; struct vchiq_drvdata *drvdata; + unsigned int i; int err; of_id = of_match_node(vchiq_of_match, pdev->dev.of_node); @@ -1840,9 +1849,15 @@ 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"); + for (i = 0; i < ARRAY_SIZE(vchiq_devices); i++) { + err = vchiq_device_register(&pdev->dev, vchiq_devices[i]); + if (err) + dev_err(&pdev->dev, "Failed to register %s vchiq device\n", + vchiq_devices[i]); + } + return 0; failed_platform_init: @@ -1854,7 +1869,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); + bus_for_each_dev(&vchiq_bus_type, NULL, NULL, vchiq_device_unregister); vchiq_debugfs_deinit(); vchiq_deregister_chrdev(); } From patchwork Tue Jun 27 20:16: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: 113592 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp8456962vqr; Tue, 27 Jun 2023 13:36:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4hIi4CfVccq7h9m0dJiVcHcHlSxKdIIpHu6hk09VWUl026eJMp2p5O4HbPCaBM464aTqyS X-Received: by 2002:a17:90a:4607:b0:262:a37a:e940 with SMTP id w7-20020a17090a460700b00262a37ae940mr8104851pjg.4.1687898189634; Tue, 27 Jun 2023 13:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687898189; cv=none; d=google.com; s=arc-20160816; b=DyUKEEVgoWCCJ7zYhGnQYLQFcA5VK4mBp9UQEsMITvSduRUUyZxy0/0CJ6Witgg+Is KWlZDsh4nCGcaEUrvEqJ8tP42p53pS1RIbxpg02BHkbLwHpVLdFhnb+wgvq50GgOqIHX LESDV44Flh/sObqUIZitir3Jgmn+cxDnSJMlMa/NAD1jga9m9bU5KeZO8abCM8+BlYAV IiMeDD1wqUlJ902ATgGeXzgAI8pfTIMAIwOWucPvLqLWYBvhFvibdvMzcdak+7tG2gfP a4H9ioESCkRbqB/KN3KAL9M0xzSklKpsZPyOrOHhfCKOt/XdebtJ9JAqLlgtLy/C4TYh yYvw== 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=wXh19+jRdNyJwViZDsuT1e6i0xU3XUKCy/LpPEk0q8U=; fh=KJ7fz4phEMuOPL/5CIrq/GEqblJHB3UXSqcptreppbo=; b=JqCmrH38QyyHUPCgaWhydPUxm093Mcps9GS+JoBYb9gOj+To6ReIHDH5v6cYu5Tits A4ZGYc0XZYS5fBc063+to0DzM3MxhjA+Z4F7MV1jGcNzp3UG389qT0AclXIUkxluqnB6 IiPq8w9UM7rRC46KxaHa1KSdpoqdU+P07kvpuxVrej1BukfOOZJN5Lb50eKjVkWQITJj LXFfy5eab7xcgwh+60lmU7YVVeBs1zYLP9maI23V3lPvueWI7ZjzbPG2A6yr6SmWx0tQ gAaU16PR7wEZUEwHqIvWQwhGTSsWbQVXZDNlBiA6V8bkFDtSuadL/RBiOywJe6p+SUd0 7AgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="YgfQ/hYx"; 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 d8-20020a170903230800b001b82a4d3ea7si1060251plh.249.2023.06.27.13.36.15; Tue, 27 Jun 2023 13:36:29 -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="YgfQ/hYx"; 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 S229482AbjF0UUR (ORCPT + 99 others); Tue, 27 Jun 2023 16:20:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231370AbjF0UT4 (ORCPT ); Tue, 27 Jun 2023 16:19:56 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9304130D5; Tue, 27 Jun 2023 13:19:28 -0700 (PDT) Received: from umang.jainideasonboard.com (85-160-38-115.reb.o2.cz [85.160.38.115]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B9B5A31FA; Tue, 27 Jun 2023 22:15:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1687896958; bh=XFgDh+fTQMRiqKvrJjuyeVA6evMq+BgXAzNfMVVf5k4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YgfQ/hYxACcrzpQ6qGDoqppJzlq4vaKzImYQQfZ4ZvOlo0JDSP6lEPNAvjz1Tm8GR TOfti7N/dvhd7b1xH2GDF5AWl2hMkm608zhAg1Gr8a37UYgEW5aaPUGTG+3WE4u6fu lF+bpcrTKzw5Ltx4hG3r1KLE/rPBl2KjF8A7KDC8= 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 v8 4/5] staging: bcm2835-audio: Register bcm2835-audio with vchiq_bus_type Date: Tue, 27 Jun 2023 22:16:27 +0200 Message-Id: <20230627201628.207483-5-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230627201628.207483-1-umang.jain@ideasonboard.com> References: <20230627201628.207483-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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769889531949860630?= X-GMAIL-MSGID: =?utf-8?q?1769889531949860630?= Similar to how bcm2385-camera device is registered, register the bcm2835-audio with vchiq_bus_type as well. Signed-off-by: Umang Jain Reviewed-by: Kieran Bingham --- .../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"); 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(); From patchwork Tue Jun 27 20:16:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 113597 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp8463293vqr; Tue, 27 Jun 2023 13:51:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6IkVyLtV5csvcxBHhSrGyDze7HZu5aXemuvpkvI57LmZrQzbqxBMA92zTNWz74XTu00C2L X-Received: by 2002:a05:6a20:1051:b0:12b:e7de:6382 with SMTP id gt17-20020a056a20105100b0012be7de6382mr1214893pzc.34.1687899091424; Tue, 27 Jun 2023 13:51:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687899091; cv=none; d=google.com; s=arc-20160816; b=FI4GhE1OSsLF9HBzLpytynFUqfEaYx11l96GXr9ZRfZH+8lOoqYDrjVjqtYeBeyzS/ vFtYW+k5fS4b2fhqdCPom9S0GccRiH4m+nIReX8JoILntVL3fUKyeTOvlfcDvIvgcVF2 nPmtH7GJwq/I4hyGC8AkiokqiWutk19QZSApWy6knKORYYcbNAMbaHDr+VtK3ZBCJA7g gQigcVGobNOIF9taMPvZzPKp6ijEjFNtcRGTLHGiUdevmpBfc5czDY+uKyOsanDrrDvI 1zjruaBF5DiUKMrv89Fv7Ob0R4WP/c8KOR+ChAsHaIFQ++ACL67pieXvp1tN2dV4b7b6 a7Dg== 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=oJcf8lNeC2UG90Q1WPSJ8fbswFLgM7j6XxhsUMq/01I=; fh=KJ7fz4phEMuOPL/5CIrq/GEqblJHB3UXSqcptreppbo=; b=j8hzDS8c9OeA+Nxrl3M/v1c8VXg4XjKF6GUgva3I8JiSN3JnkHgtKkgqUSZClSpkWz Xjgpa/ViRKd5907uP45D2MD4yxWvxJJImdKaInDk6uhEyisY0N4hmQw2kDcwxbVtO+Nc 6qdyxMG9iYVF+0+aGxFHUryoa0AMbmwVuaUfAV6KGaPDJL5PsKx0ezSD9bn5kFis3SSM o2dC7kSgzVZQOuqqEUAHjxjPTJ8izh8ieKt+5MPOp5chk9fQ73WGCebfrY+xUSzgJv3j jGQNmUe6peNxhmFzRdCu3wPmuBYn36BqD+2LB80jC6FNAJqMFD/utIZ4cfXh50uUclH2 AmpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=jmxFLJPj; 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 14-20020a630f4e000000b005501b2005fasi7615500pgp.161.2023.06.27.13.51.19; Tue, 27 Jun 2023 13:51:31 -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=jmxFLJPj; 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 S231285AbjF0UUZ (ORCPT + 99 others); Tue, 27 Jun 2023 16:20:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229593AbjF0UUU (ORCPT ); Tue, 27 Jun 2023 16:20:20 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DE222D58; Tue, 27 Jun 2023 13:20:01 -0700 (PDT) Received: from umang.jainideasonboard.com (85-160-38-115.reb.o2.cz [85.160.38.115]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CC8953212; Tue, 27 Jun 2023 22:15:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1687896959; bh=aTEauMEul+vJmNEkdf5DceHvA7fGrWLQch/ls0rhujQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jmxFLJPjZ5HrCNXMwM6MWIbUGG4j30l7LhlebFosbJpl6BeB1IfvveRNFXSvZbn7K 63sVCA0ykeCRxFDN2tEIW2YD4ZIxE1in7uVNNzE1HvljgAv9xMKKhgltAn3MzRnxmp sjayfkeI9Ns5Ld3MIe28dBs1h+kIRUNa+Wh6JqQc= 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 v8 5/5] staging: vc04_services: vchiq_arm: Remove vchiq_register_child() Date: Tue, 27 Jun 2023 22:16:28 +0200 Message-Id: <20230627201628.207483-6-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230627201628.207483-1-umang.jain@ideasonboard.com> References: <20230627201628.207483-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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769890477499483906?= X-GMAIL-MSGID: =?utf-8?q?1769890477499483906?= 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 75da37fa6372..3c52b09c49ea 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -1778,28 +1778,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;