From: Umang Jain <umang.jain@ideasonboard.com>
To: linux-staging@lists.linux.dev
Cc: Stefan Wahren <stefan.wahren@i2se.com>,
Dan Carpenter <error27@gmail.com>,
Kieran Bingham <kieran.bingham@ideasonboard.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Phil Elwell <phil@raspberrypi.com>,
Dave Stevenson <dave.stevenson@raspberrypi.com>,
Umang Jain <umang.jain@ideasonboard.com>
Subject: [PATCH 2/3] staging: v04_services: Add connection structure to driver data
Date: Tue, 12 Mar 2024 04:46:06 +0530 [thread overview]
Message-ID: <20240311231607.124491-3-umang.jain@ideasonboard.com> (raw)
In-Reply-To: <20240311231607.124491-1-umang.jain@ideasonboard.com>
Introduce a new struct vchiq_connected, responsible to track
the connections to the vchiq platform driver. The struct is added
as part of vchiq platform driver data.
Adding struct vchiq_connected will help us to move away from global
variables members being used to track the connections in
vchiq_connected.[ch]. This will be done in a subsequent patch.
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
.../vc04_services/interface/vchiq_arm/vchiq_arm.c | 10 ++++++++++
.../interface/vchiq_arm/vchiq_connected.h | 10 ++++++++++
.../vc04_services/interface/vchiq_arm/vchiq_core.h | 2 ++
3 files changed, 22 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 52569517ba4e..b8b51267bcde 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -72,10 +72,20 @@ static struct vchiq_device *bcm2835_camera;
static struct vchiq_drvdata bcm2835_drvdata = {
.cache_line_size = 32,
+ .drv_connected = {
+ .connected = 0,
+ .num_deferred_callbacks = 0,
+ .once_init = 0,
+ },
};
static struct vchiq_drvdata bcm2836_drvdata = {
.cache_line_size = 64,
+ .drv_connected = {
+ .connected = 0,
+ .num_deferred_callbacks = 0,
+ .once_init = 0,
+ },
};
struct vchiq_arm_state {
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.h
index e4ed56446f8a..cb5cba94dd54 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.h
@@ -6,6 +6,16 @@
#ifndef VCHIQ_CONNECTED_H
#define VCHIQ_CONNECTED_H
+#define VCHIQ_DRV_MAX_CALLBACKS 10
+
+struct vchiq_connected {
+ int connected;
+ int num_deferred_callbacks;
+ int once_init;
+
+ void (*deferred_callback[VCHIQ_DRV_MAX_CALLBACKS])(void);
+};
+
void vchiq_add_connected_callback(struct vchiq_device *device, void (*callback)(void));
void vchiq_call_connected_callbacks(void);
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
index 331959a91102..e36a8cd8533a 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
@@ -17,6 +17,7 @@
#include "../../include/linux/raspberrypi/vchiq.h"
#include "vchiq_cfg.h"
+#include "vchiq_connected.h"
/* Do this so that we can test-build the code on non-rpi systems */
#if IS_ENABLED(CONFIG_RASPBERRYPI_FIRMWARE)
@@ -429,6 +430,7 @@ struct vchiq_config {
struct vchiq_drvdata {
const unsigned int cache_line_size;
struct rpi_firmware *fw;
+ struct vchiq_connected drv_connected;
};
extern spinlock_t bulk_waiter_spinlock;
--
2.43.0
next prev parent reply other threads:[~2024-03-11 23:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-11 23:16 [PATCH 0/3] staging: vc04_services: Drop remaining global members Umang Jain
2024-03-11 23:16 ` [PATCH 1/3] staging: vc04_services: Move struct vchiq_drvdata to vchiq_core header Umang Jain
2024-03-11 23:16 ` Umang Jain [this message]
2024-03-13 5:28 ` [PATCH 2/3] staging: v04_services: Add connection structure to driver data Dan Carpenter
2024-03-11 23:16 ` [PATCH 3/3] staging: vc04_services: Drop global members for tracking connections Umang Jain
2024-03-13 5:31 ` Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240311231607.124491-3-umang.jain@ideasonboard.com \
--to=umang.jain@ideasonboard.com \
--cc=dave.stevenson@raspberrypi.com \
--cc=error27@gmail.com \
--cc=kieran.bingham@ideasonboard.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-staging@lists.linux.dev \
--cc=phil@raspberrypi.com \
--cc=stefan.wahren@i2se.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).