Commit 9d523111 authored by Nicolas Saenz Julienne's avatar Nicolas Saenz Julienne Committed by Greg Kroah-Hartman
Browse files

staging: vchiq: Get rid of vchi



All the functions that vchi currently provides are a 1:1 mapping to its
vchiq counterparts. Get rid of vchi altogether and use vchiq's on all
services.

In the process also get rid of the vchi directory, as the only remaining
file was a TODO file, which now lives in the parent directory.

Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-44-nsaenzjulienne@suse.de


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5c01fc5c
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@ vchiq-objs := \
   interface/vchiq_arm/vchiq_arm.o \
   interface/vchiq_arm/vchiq_2835_arm.o \
   interface/vchiq_arm/vchiq_debugfs.o \
   interface/vchiq_arm/vchiq_shim.o \
   interface/vchiq_arm/vchiq_connected.o \

obj-$(CONFIG_SND_BCM2835)		+= bcm2835-audio/
+12 −12
Original line number Diff line number Diff line
@@ -25,12 +25,12 @@ MODULE_PARM_DESC(force_bulk, "Force use of vchiq bulk for audio");
static void bcm2835_audio_lock(struct bcm2835_audio_instance *instance)
{
	mutex_lock(&instance->vchi_mutex);
	vchi_service_use(instance->service_handle);
	vchiq_use_service(instance->service_handle);
}

static void bcm2835_audio_unlock(struct bcm2835_audio_instance *instance)
{
	vchi_service_release(instance->service_handle);
	vchiq_release_service(instance->service_handle);
	mutex_unlock(&instance->vchi_mutex);
}

@@ -132,7 +132,7 @@ vc_vchi_audio_init(struct vchiq_instance *vchiq_instance,
	int status;

	/* Open the VCHI service connections */
	status = vchi_service_open(vchiq_instance, &params,
	status = vchiq_open_service(vchiq_instance, &params,
				    &instance->service_handle);

	if (status) {
@@ -143,7 +143,7 @@ vc_vchi_audio_init(struct vchiq_instance *vchiq_instance,
	}

	/* Finished with the service for now */
	vchi_service_release(instance->service_handle);
	vchiq_release_service(instance->service_handle);

	return 0;
}
@@ -153,10 +153,10 @@ static void vc_vchi_audio_deinit(struct bcm2835_audio_instance *instance)
	int status;

	mutex_lock(&instance->vchi_mutex);
	vchi_service_use(instance->service_handle);
	vchiq_use_service(instance->service_handle);

	/* Close all VCHI service connections */
	status = vchi_service_close(instance->service_handle);
	status = vchiq_close_service(instance->service_handle);
	if (status) {
		dev_err(instance->dev,
			"failed to close VCHI service connection (status=%d)\n",
@@ -171,14 +171,14 @@ int bcm2835_new_vchi_ctx(struct device *dev, struct bcm2835_vchi_ctx *vchi_ctx)
	int ret;

	/* Initialize and create a VCHI connection */
	ret = vchi_initialise(&vchi_ctx->instance);
	ret = vchiq_initialise(&vchi_ctx->instance);
	if (ret) {
		dev_err(dev, "failed to initialise VCHI instance (ret=%d)\n",
			ret);
		return -EIO;
	}

	ret = vchi_connect(vchi_ctx->instance);
	ret = vchiq_connect(vchi_ctx->instance);
	if (ret) {
		dev_dbg(dev, "failed to connect VCHI instance (ret=%d)\n",
			ret);
@@ -195,7 +195,7 @@ int bcm2835_new_vchi_ctx(struct device *dev, struct bcm2835_vchi_ctx *vchi_ctx)
void bcm2835_free_vchi_ctx(struct bcm2835_vchi_ctx *vchi_ctx)
{
	/* Close the VCHI connection - it will also free vchi_ctx->instance */
	WARN_ON(vchi_disconnect(vchi_ctx->instance));
	WARN_ON(vchiq_shutdown(vchi_ctx->instance));

	vchi_ctx->instance = NULL;
}
@@ -226,7 +226,7 @@ int bcm2835_audio_open(struct bcm2835_alsa_stream *alsa_stream)
		goto deinit;

	bcm2835_audio_lock(instance);
	vchi_get_peer_version(instance->service_handle,
	vchiq_get_peer_version(instance->service_handle,
			       &instance->peer_version);
	bcm2835_audio_unlock(instance);
	if (instance->peer_version < 2 || force_bulk)
+0 −1
Original line number Diff line number Diff line
@@ -10,7 +10,6 @@
#include <sound/pcm.h>
#include <sound/pcm-indirect.h>
#include "interface/vchiq_arm/vchiq_if.h"
#include "interface/vchi/vchi.h"

#define MAX_SUBSTREAMS   (8)
#define AVAIL_SUBSTREAMS_MASK  (0xff)
+0 −59
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/* Copyright (c) 2010-2012 Broadcom. All rights reserved. */

#ifndef VCHI_H_
#define VCHI_H_

/******************************************************************************
 * Global funcs - implementation is specific to which side you are on
 * (local / remote)
 *****************************************************************************/

// Routine used to initialise the vchi on both local + remote connections
extern int32_t vchi_initialise(struct vchiq_instance **instance);

extern int32_t vchi_connect(struct vchiq_instance *instance);

//When this is called, ensure that all services have no data pending.
//Bulk transfers can remain 'queued'
extern int32_t vchi_disconnect(struct vchiq_instance *instance);

/******************************************************************************
 * Global service API
 *****************************************************************************/
// Routine to open a named service
extern int vchi_service_open(struct vchiq_instance *instance,
			    struct vchiq_service_params *params,
			    unsigned *handle);

extern int32_t vchi_get_peer_version(unsigned handle, short *peer_version);

// Routine to close a named service
extern int32_t vchi_service_close(unsigned handle);

// Routine to increment ref count on a named service
extern int32_t vchi_service_use(unsigned handle);

// Routine to decrement ref count on a named service
extern int32_t vchi_service_release(unsigned handle);

// Routine to look at a message in place.
// The message is dequeued, so the caller is left holding it; the descriptor is
// filled in and must be released when the user has finished with the message.
struct vchiq_header *vchi_msg_hold(unsigned handle);

/*******************************************************************************
 * Global service support API - operations on held messages
 * and message iterators
 ******************************************************************************/

// Routine to release a held message after it has been processed
extern int32_t vchi_held_msg_release(unsigned handle, struct vchiq_header *message);

/******************************************************************************
 * Configuration plumbing
 *****************************************************************************/

#endif /* VCHI_H_ */

/****************************** End of file **********************************/
Loading