From patchwork Sun Jul 4 15:59:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ojaswin Mujoo X-Patchwork-Id: 12357551 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A57FC07E95 for ; Sun, 4 Jul 2021 16:01:08 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 67B8B613B1 for ; Sun, 4 Jul 2021 16:01:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 67B8B613B1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TBRAk1zq8YOTC9myYUMI7BvcZIdhlw83PLiXA9R5vBA=; b=cPEPs80rREL3Ae g/Kr+ZVLJ7kWb0D5fEfj6jrBLya9M7GPIJU1w134ShrK7N44FZ1lr1Qy49kl854Yuzqw6n8FwYGRf OMpGNg7TJk9l3TzjVhKIVDfSRsUTetUfb6gw1W97XR/fNExkAYQ0jVs7OO02jWseG2w+0c2j5pbBF aVaMQM+FN6gbvWJR6EUoaFmecDaALaSXJvDjAy5swttoiC1LCQrJ1Yx/nC+nddrlmkFAH0vQDgKcG oBswA5jGWDOcG0f7abqi637n+L/OF1TgXtQbXudJM4BrMn9s/tMdLjlHUtk5LM87DWlwL/SSGpj11 QsxFuSxi/cadCwpUoJVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m04Wo-006V8u-IB; Sun, 04 Jul 2021 15:59:30 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m04Wk-006V7p-W6 for linux-arm-kernel@lists.infradead.org; Sun, 04 Jul 2021 15:59:28 +0000 Received: by mail-pf1-x431.google.com with SMTP id b12so13042630pfv.6 for ; Sun, 04 Jul 2021 08:59:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=/YhBSpMPkjoprm5QHl3l72iyxSfWeqUMApb6I6Ek3Uc=; b=dyb9LU5AzNMpP1x/4ATULiORuPdljhKLCb5A9rtNjNThg1zwVWNcFQb2SKXXWCNgEr M3Z5bJGFa4u6Pnm9xuW1z0+DAjhDKGfDKCUVIruuUmUmtcjwB8/MskUjOHgoPGr0lhAB CJBf+Vgbn134bKa9ELiSjyVkTUiNzOXIVpZSu+YIXaGPaMyO4wK6rcozdB5wT/DJf9Bx 01AvD+zACHgdh406+0j2ee53i+/SzIimsFogqBJdeRDL5JtoGk3hl3frViuBUd8sp+9W NyenvEZ6yn6hQcVojSqrK9fAxLDfnnhSC9Grr+cbe7trpr22WgGHSNmzFFsCs6Bxijuq QI1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/YhBSpMPkjoprm5QHl3l72iyxSfWeqUMApb6I6Ek3Uc=; b=RBBnSWN78QGg5i+b3sebfz43hwH+3iT9SyOrgwpdQjyJ1DlsLvonbi9E+ds8TNq/Hq crePWd+1ISyXBJnq3HuYVn47VCp32ZsCY/L41MOg++cpIW6p9fTq1dgRM2t+BhV01Dsc 3XDaAcWRoK4jR2tJHO39ufas9OKuZFUhb8Snj4m7xBJEko0SUwP8HwYK/E47AU8Ia0Ke HqGgdlBCAaT+FRNqcfukWr0B6szCiFT+MPhu/WFUGEcyOMz7exQs/U1BsH2LxsGpR9J4 dsi5jYqmS9CIFUG6f+S2vFckw2Jv70gxsfqHvv2sc19xt9eTTgswPSp0F5l5mKKmCPDO QLPQ== X-Gm-Message-State: AOAM532XuQMiZBCCu43yZWdfaZ1NJ/WqXMVaUf/x/YFMmR+y5vgIUj8e iXMfWivDAB9uaxgmZfujArK9BiI8Y5Y= X-Google-Smtp-Source: ABdhPJwXbbidik9cEAFSs0JIKO3dBawtPiIWA3QhnPjzLKhfk5acNXm4a1lU3wtDLr/Nxl3QRE9j2Q== X-Received: by 2002:a05:6a00:c85:b029:311:bfe1:e407 with SMTP id a5-20020a056a000c85b0290311bfe1e407mr10217304pfv.77.1625414366261; Sun, 04 Jul 2021 08:59:26 -0700 (PDT) Received: from ojas ([182.69.223.21]) by smtp.gmail.com with ESMTPSA id l189sm5613360pgl.41.2021.07.04.08.59.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Jul 2021 08:59:26 -0700 (PDT) Date: Sun, 4 Jul 2021 21:29:16 +0530 From: Ojaswin Mujoo To: nsaenz@kernel.org Cc: gregkh@linuxfoundation.org, stefan.wahren@i2se.com, arnd@arndb.de, dan.carpenter@oracle.com, phil@raspberrypi.com, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v3 4/5] staging: vchiq: Make creation of vchiq cdev optional Message-ID: <03cbe3fc1d9d7dbf9b0a3844b700eb9bf5459088.1625401928.git.ojaswin98@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210704_085927_084642_643026A9 X-CRM114-Status: GOOD ( 13.81 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Before this commit, vchiq cdev (/dev/vchiq) was always created during platform initialization. Introduce a new Kconfig option CONFIG_VCHIQ_CDEV which determines if the cdev will be created or not. Signed-off-by: Ojaswin Mujoo Reviewed-by: Stefan Wahren --- drivers/staging/vc04_services/Kconfig | 10 ++++++++++ drivers/staging/vc04_services/Makefile | 5 ++++- .../vc04_services/interface/vchiq_arm/vchiq_arm.h | 9 +++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/staging/vc04_services/Kconfig b/drivers/staging/vc04_services/Kconfig index 4b886293f198..63caa6818d37 100644 --- a/drivers/staging/vc04_services/Kconfig +++ b/drivers/staging/vc04_services/Kconfig @@ -19,6 +19,16 @@ config BCM2835_VCHIQ Defaults to Y when the Broadcom Videocore services are included in the build, N otherwise. +if BCM2835_VCHIQ + +config VCHIQ_CDEV + bool "VCHIQ Character Driver" + help + Enable the creation of VCHIQ character driver to help + communicate with the Videocore platform. + +endif + source "drivers/staging/vc04_services/bcm2835-audio/Kconfig" source "drivers/staging/vc04_services/bcm2835-camera/Kconfig" diff --git a/drivers/staging/vc04_services/Makefile b/drivers/staging/vc04_services/Makefile index db28be341239..0a04338fc962 100644 --- a/drivers/staging/vc04_services/Makefile +++ b/drivers/staging/vc04_services/Makefile @@ -7,7 +7,10 @@ vchiq-objs := \ interface/vchiq_arm/vchiq_2835_arm.o \ interface/vchiq_arm/vchiq_debugfs.o \ interface/vchiq_arm/vchiq_connected.o \ - interface/vchiq_arm/vchiq_dev.o \ + +ifdef CONFIG_VCHIQ_CDEV +vchiq-objs += interface/vchiq_arm/vchiq_dev.o +endif obj-$(CONFIG_SND_BCM2835) += bcm2835-audio/ obj-$(CONFIG_VIDEO_BCM2835) += bcm2835-camera/ diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h index 2453971b6b78..e8e39a154c74 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h @@ -174,12 +174,21 @@ vchiq_instance_get_trace(struct vchiq_instance *instance); extern void vchiq_instance_set_trace(struct vchiq_instance *instance, int trace); +#if IS_ENABLED(CONFIG_VCHIQ_CDEV) + extern void vchiq_deregister_chrdev(void); extern int vchiq_register_chrdev(struct device *parent); +#else + +static inline void vchiq_deregister_chrdev(void) { } +static inline int vchiq_register_chrdev(struct device *parent) { return 0; } + +#endif /* IS_ENABLED(CONFIG_VCHIQ_CDEV) */ + extern enum vchiq_status service_callback(enum vchiq_reason reason, struct vchiq_header *header, unsigned int handle, void *bulk_userdata);