From patchwork Wed Sep 13 19:53:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 139217 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp46679vqi; Wed, 13 Sep 2023 18:34:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHNuOahBZTQwzdE9M3k2DcHrt706hwJnUxwCwD4lWvd98NYhJECQ7kql5frg+6ueCkVFcKL X-Received: by 2002:a25:aaa1:0:b0:d4e:bbee:6e04 with SMTP id t30-20020a25aaa1000000b00d4ebbee6e04mr4322288ybi.51.1694655270329; Wed, 13 Sep 2023 18:34:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694655270; cv=none; d=google.com; s=arc-20160816; b=zTylzNGKhQOcID2nwEpDXydAmYb8/Y9e0TZ1gqIgpuwnMwY7+i4otrMXygpLQr69MK 6CIpR80Jksq5uS7SM4tRVcqiwZ3yN+HCZjmyO5RwJVkgPr9BnZosoNPfqlUJrYwHz9LR WYGDqrvHFQH1gOYVeIpIsdFlQ7AqwsSLXz0UfD1zSGG6/+t4iDio5iQjAiDvigryOb6z OvB3CZjyLubs0JBaK7NPlGt3zjQJe2+Z879KRhBO3pmfxak8QtvX1ymbgRVRkl6/+316 KhpTIgq9oKLLTQPAXjx7dwTd16x9CoiXKD/WiwfU79omyLfGZZ7vt+AscsV/Y7Q4FUg3 Uz2g== 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=kphXRU5g3JHLpDyqiKrmOedJ4rfUhX0QVxA5v0OuELk=; fh=x1hGPnZeYvyedQGDVaFY4F5NZX5OfdEJxyYqoMYIkPY=; b=sy1Lreqlrqj4tQYKpfgP1WSx/1lYygNUCCSABP4sS5baot/nlIjWGmE37oRukVXI6n o9x9nhwW9XvJ9sviwY6kvjeUakVRiL9xcBvwyGC2lWpNczl3bLzUxofvKwpbqZ6yYDay ZVVOyxUqJTBAecvPD2U02UbF5xg/BO0mg1FW1b4vlPpGquLaKdnkVGPFYkpl1MkQsjJw WAHN6fAZJ/sJtQMkrZ4FA0nkwaY96O47+wCUeTPT8Gwt0ogn7hQriu3qqjhBuxjUJfN3 KzWf/mq1Lh4oH3AEJ2nQovOdrFW+maanP55rVDocw/75/E2ZHmzFXPNdobyf1GzwEoAc ebyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=JVHIo3BT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id az1-20020a056a02004100b005653316de6fsi384420pgb.271.2023.09.13.18.34.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 18:34:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=JVHIo3BT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 91712822C62C; Wed, 13 Sep 2023 12:54:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232524AbjIMTyY (ORCPT + 34 others); Wed, 13 Sep 2023 15:54:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232516AbjIMTyW (ORCPT ); Wed, 13 Sep 2023 15:54:22 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 023B89E; Wed, 13 Sep 2023 12:54:18 -0700 (PDT) Received: from umang.jainideasonboard.com (unknown [103.86.18.170]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C2F8C16B7; Wed, 13 Sep 2023 21:52:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1694634764; bh=LPrKroR5yvaMCi5yUrTeV3TcH+SVi4IliBcGKe/xNZs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JVHIo3BT8JJYCSZiTQFHSrCxkmaeFW1ccL9l97hthLz8Vbo+ogKSUdqEockcOz+HG V/DnCy+EbW4VeIb/aE8TZ0U9b3F8dM1ktVWiXmxtxxv50UfEB56NmpNxZgU1hHtYHz ZPH2jWYrvIiTyY20pIvDANgNYl2TuGfPvPRMMiao= From: Umang Jain To: linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Stefan Wahren , Greg Kroah-Hartman , Florian Fainelli , Adrien Thierry , Dan Carpenter , Dave Stevenson , Kieran Bingham , Laurent Pinchart , Umang Jain Subject: [PATCH v11 2/5] staging: vc04_services: vchiq_arm: Register vchiq_bus_type Date: Thu, 14 Sep 2023 01:23:51 +0530 Message-Id: <20230913195354.835884-3-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230913195354.835884-1-umang.jain@ideasonboard.com> References: <20230913195354.835884-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 13 Sep 2023 12:54:35 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776973441494915971 X-GMAIL-MSGID: 1776974844537005425 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 | 13 ++++++++++++- .../interface/vchiq_arm/vchiq_device.c | 7 ------- 2 files changed, 12 insertions(+), 8 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 aa2313f3bcab..d993a91de237 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,9 +1872,17 @@ 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) + if (ret) { pr_err("Failed to register vchiq driver\n"); + bus_unregister(&vchiq_bus_type); + } return ret; } @@ -1880,6 +1890,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); diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_device.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_device.c index aad55c461905..b8c46f39e74a 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_device.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_device.c @@ -74,13 +74,6 @@ vchiq_device_register(struct device *parent, const char *name) device->dev.bus = &vchiq_bus_type; device->dev.release = vchiq_device_release; - of_dma_configure(&device->dev, parent->of_node, true); - ret = dma_set_mask_and_coherent(&device->dev, DMA_BIT_MASK(32)); - if (ret) { - dev_err(&device->dev, "32-bit DMA enable failed\n"); - return NULL; - } - ret = device_register(&device->dev); if (ret) { dev_err(parent, "Cannot register %s: %d\n", name, ret);