From patchwork Sun Jun 20 12:57:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ojaswin Mujoo X-Patchwork-Id: 12333401 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 9F950C48BDF for ; Sun, 20 Jun 2021 12:59:19 +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 6792F610CA for ; Sun, 20 Jun 2021 12:59:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6792F610CA 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=8DxUMCGTVBoJ6/k7UCMiSjJEvwNzS8ziYeqbZFApNgg=; b=fGb1n6gL/MvYjG xgfpJgHWK7v6ZHOTnP6GpuIX0hAE2k/3kIheDlbPw1sSdt96nOdJG3E4rO3ox5aTdV5p7cBDROwqT z/2xN44Ve+Se+Twn/YMUqtZaRhT8pv1aH4Zq9qw6lsIW5jA2Zy28eC2lMIFb55J2EHT3d1oHIE18p XSG+UhHuBhQWvWVdc3TwMLllnGhLS4QeYb0p5TcyCOW2yu3SZSn3j1/1urwo4a9DUAJzHGHKVveVH ECM4bwWwoG6dH4vG16p37LoUKkLQnHnXVkYFuYFixmmKfkHjMddZ/gAFb6zgszGzFpxzkM3JhUA1j zHY0ML+rfeh7TGMO9FdA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lux14-0011cn-Vn; Sun, 20 Jun 2021 12:57:35 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lux0i-0011TK-4x for linux-arm-kernel@lists.infradead.org; Sun, 20 Jun 2021 12:57:13 +0000 Received: by mail-pl1-x636.google.com with SMTP id o21so7066900pll.6 for ; Sun, 20 Jun 2021 05:57:11 -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=NEMvFyS18P5cftlbD6eQ1AwuZhrAFjZ8m++eEi7Zvp4=; b=NB3Tnxdo9kDLe2Bi09gNLIU9WWb7jtpM3y2BQQznCYCVA9ylsjvzN4N179Ogz0A7BH qDNnnE370C8YRZIOO0LWTSsiG/poEZ1VXlGO0pr+O5qiG1ZaUddPQ1D1klKRPY0UoxiT zWwBa/xvCwufx3zpfzW1OtoXEA4tEhk0JvZHmTmNR7ZVtcPuwgNz8A6rhjiwax6qunId 3wJpFtLj+g2lOFuk2AsxdsBk1ABg3KvW4H0IqK2zButA7EuVgmoRWQC/q3xbXrh5NlfU K6/5c0wHW090cAZqKdmZYeua13njLnzCqMCL+lSIMHmkVdea5WG190EyTrR+LlU+vsQ2 8Ovw== 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=NEMvFyS18P5cftlbD6eQ1AwuZhrAFjZ8m++eEi7Zvp4=; b=sTVOuSjVlU6Pk+vnAV0M3ysC7DEt7Kk9kP2S/GBvTQTAeCBagI7eapQ4vYIvUIytR9 uzHbimFIyiZR6E7SF0HqeVBK+BpK8WAICXgwbO6L2BLL18Z09abHpl3r39wKHA7hqaNw CXbsx3zlU16s76Gmfv9nhBph99WZIknTn7vt7r0yBbgjSsN2kprqGiFhM14XdZ+tAvLd M4iMe6E3dDNSnsWutn9TyYCb7scTLnnsqY7BFknwmaKvDF7c7XiHAMgHnoTVu20KwXON kMGRY1y5fhtS5vRQnhp8DpjT0/zUZix46rZPqA97BxBF5D4zMuvI5ilju0SVXvqVugkS bgjQ== X-Gm-Message-State: AOAM531MsNyDXJ6u7XgILlRWERznXplqtnPp8ogIVA6VFgSzH/vJ5cEJ 6GQd95GbJXtoPNa485xWSoIC0r/iaxg= X-Google-Smtp-Source: ABdhPJxq2skko6hT7WAdZ8XJ4MFeYCt4USuct+irJN/hebx2+vSZZO8601KL5ql3Pmo1gN7RSlQ/TQ== X-Received: by 2002:a17:902:ac81:b029:122:1809:40e with SMTP id h1-20020a170902ac81b02901221809040emr9498905plr.79.1624193831403; Sun, 20 Jun 2021 05:57:11 -0700 (PDT) Received: from ojas ([122.177.154.120]) by smtp.gmail.com with ESMTPSA id b1sm13215203pgb.91.2021.06.20.05.57.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 05:57:11 -0700 (PDT) Date: Sun, 20 Jun 2021 18:27:01 +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 v2 4/5] staging: vchiq: Make creation of vchiq cdev optional Message-ID: <80d4ad6cb3129d7c6e7e66f3d358c6dea82c509b.1624185152.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-20210620_055712_243519_F9A91354 X-CRM114-Status: GOOD ( 14.71 ) 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 the cdev needs to be created or not. Also modify the predefined config files to have this option set to "yes". Signed-off-by: Ojaswin Mujoo --- arch/arm/configs/bcm2709_defconfig | 1 + arch/arm/configs/bcm2711_defconfig | 1 + arch/arm/configs/bcmrpi_defconfig | 1 + drivers/staging/vc04_services/Kconfig | 10 ++++++++++ drivers/staging/vc04_services/Makefile | 5 ++++- .../vc04_services/interface/vchiq_arm/vchiq_arm.h | 9 +++++++++ 6 files changed, 26 insertions(+), 1 deletion(-) diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig index 7eb4418d7fea..444c80b97e2c 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig @@ -1314,6 +1314,7 @@ CONFIG_FB_TFT_UC1701=m CONFIG_FB_TFT_UPD161704=m CONFIG_FB_TFT_WATTEROTT=m CONFIG_BCM2835_VCHIQ=y +CONFIG_VCHIQ_CDEV=y CONFIG_SND_BCM2835=m CONFIG_VIDEO_BCM2835=m CONFIG_VIDEO_CODEC_BCM2835=m diff --git a/arch/arm/configs/bcm2711_defconfig b/arch/arm/configs/bcm2711_defconfig index 299e4d95e4ca..f323fb7f29e2 100644 --- a/arch/arm/configs/bcm2711_defconfig +++ b/arch/arm/configs/bcm2711_defconfig @@ -1352,6 +1352,7 @@ CONFIG_FB_TFT_UC1701=m CONFIG_FB_TFT_UPD161704=m CONFIG_FB_TFT_WATTEROTT=m CONFIG_BCM2835_VCHIQ=y +CONFIG_VCHIQ_CDEV=y CONFIG_SND_BCM2835=m CONFIG_VIDEO_BCM2835=m CONFIG_VIDEO_CODEC_BCM2835=m diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig index e270865d89cc..92216ce77d11 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig @@ -1325,6 +1325,7 @@ CONFIG_FB_TFT_UC1701=m CONFIG_FB_TFT_UPD161704=m CONFIG_FB_TFT_WATTEROTT=m CONFIG_BCM2835_VCHIQ=y +CONFIG_VCHIQ_CDEV=y CONFIG_SND_BCM2835=m CONFIG_VIDEO_BCM2835=m CONFIG_VIDEO_CODEC_BCM2835=m diff --git a/drivers/staging/vc04_services/Kconfig b/drivers/staging/vc04_services/Kconfig index 8b912617bfec..7c22554cdd20 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 700cd62fe346..cc6371386a62 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 bc9af1a0c764..a99cca0cb23b 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h @@ -172,12 +172,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);