From patchwork Wed Jul 21 16:20:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ojaswin Mujoo X-Patchwork-Id: 12391589 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=-13.8 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,USER_AGENT_GIT 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 11DB7C12002 for ; Wed, 21 Jul 2021 16:24:01 +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 D6F4460FE9 for ; Wed, 21 Jul 2021 16:24:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D6F4460FE9 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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TBRAk1zq8YOTC9myYUMI7BvcZIdhlw83PLiXA9R5vBA=; b=TaWIW3yqNpTu1T dX/6vvevzl/cEfVkNo1P106rSnioEzCxW6EfXC4ympGXDSlkGMJLHGFcBs5Mf1/ZU9hBnvEF9qn2j w1VKwr7gfa/0/ucobATa8CEE8KAEaWUhbm5cgD33QXozLf69mqFV3DNxrMxzRbL8hW0i0Y9F7645i oZuFigq5S4dU/KrLYM4gZZiTi91hYpAnAedUpk/zb9yyQo6p1g3T67Nghie7yuqbGwxyXtCFJOIFt H/6hMMjt90PErsJbhcTjVM7/69A6kRpEp4bFNXq/+mc9Q1mtQfs3jpdUIaK21rJpXnVARQ4BeTuwr ct7E9Rj4F86UluXBQjZg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m6EzE-00GXGQ-0I; Wed, 21 Jul 2021 16:22:20 +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 1m6Eyl-00GX3g-QJ for linux-arm-kernel@lists.infradead.org; Wed, 21 Jul 2021 16:21:56 +0000 Received: by mail-pf1-x431.google.com with SMTP id d9so2603134pfv.4 for ; Wed, 21 Jul 2021 09:21:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/YhBSpMPkjoprm5QHl3l72iyxSfWeqUMApb6I6Ek3Uc=; b=linJ0O7VC0Exf6xqQ2Vlv4OisfLD/u3BjblB2pG25Gpo3N7vLIgR6fO4BT1hifkUdy e3NlPsaBmJo+XyDvLtKP43w+T4oJaPcu3KLvzja+GQeuyhml0XbYnM/aW5sK8auDWRoo JkZ2ExKFxrz+RNH5rS06Tib/37gR3+rWIwx+dxsIB+huPJqQVo5bMaE03TIMa1pvhC0c 93sTMdyTXiUGtjooTzNJBEYM1gs2KOIU3NVFd70FBgVG9/ivk7bvM0NtbnpYaVYjkDvs goSNOtzaJiVajPewn6aWMnWy6SpG2v0qzYFJwHoshmy8JfUISe4kS2yN0k6OvqS9FbUv iHjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/YhBSpMPkjoprm5QHl3l72iyxSfWeqUMApb6I6Ek3Uc=; b=Pi07DFNh0jROXyhrk8ibEMHX1OLX6qpJXN58EwGfZrWdTvSSym7dq3pHv8fnbV8zy5 c+lKSfPbZvx2HvYwq3VxcIVJnRWqqrqSXRM1NCHlv4UqY0fR2XHBmegrpJGzSU3JlAAR xyfYvkBBh5B8N+E1fX1ASxLYUFErWh6SRqrZOCcuZUfWtQd/wC/rcuUHTWwuL2P1JRXp M3BjHANC3ei7clEqBcfjUwseG2bDmdf7yBkixJSIfIoz1VPphi71KumnGu33j1gFetsj RwNW+85HiPSbr2PnAsYydn+7v3o8Bufav6h+EUATv1Je0LrEhRbK01Rs4hKDu1wIW56N zEaw== X-Gm-Message-State: AOAM532npnG70gv51ozQxJH8Rq8r7Vn6WhemV7/ZMkv8dCBUVAQeuLwd qM+R2LuMqPgxW28zmb0nRuQ= X-Google-Smtp-Source: ABdhPJysHGkEZZfjArGvmcX1gUACwVayjsOpzEzNTpX7BYeTLdrzHtoPHysXUfwyaVYsJQpyXEvB6A== X-Received: by 2002:a05:6a00:1692:b029:300:7193:f67 with SMTP id k18-20020a056a001692b029030071930f67mr37257534pfc.19.1626884510752; Wed, 21 Jul 2021 09:21:50 -0700 (PDT) Received: from localhost.localdomain ([122.161.48.33]) by smtp.googlemail.com with ESMTPSA id s21sm3013459pfw.69.2021.07.21.09.21.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 09:21:50 -0700 (PDT) From: Ojaswin Mujoo To: nsaenz@kernel.org Cc: Ojaswin Mujoo , gregkh@linuxfoundation.org, stefan.wahren@i2se.com, dan.carpenter@oracle.com, phil@raspberrypi.com, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v4 4/5] staging: vchiq: Make creation of vchiq cdev optional Date: Wed, 21 Jul 2021 21:50:52 +0530 Message-Id: <846c424dd4aae14d1cc28c8f30877a06e2b7dd10.1626882325.git.ojaswin98@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210721_092151_912934_9F7F6C2B X-CRM114-Status: GOOD ( 14.42 ) 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 --- 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);