mei: Add transport driver for IVSC device

The Intel visual sensing controller (IVSC) device is designed to control
the camera sharing between host IPU for media usage and IVSC for context
sensing (face detection).

IVSC is exposed to HOST as an SPI device and the message protocol over
the SPI BUS for communicating with the IVSC device is implemented. This
is the backend of mei framework for IVSC device, which usually handles
the hardware data transfer. The mei_csi and mei_ace are the clients of
IVSC mei framework.

The firmware downloading for the IVSC device is implemented as well.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Hao Yao <hao.yao@intel.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Link: https://lore.kernel.org/r/1701651344-20723-2-git-send-email-wentong.wu@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Wentong Wu
2023-12-04 08:55:43 +08:00
committed by Greg Kroah-Hartman
parent 5dac2a98f6
commit 566f5ca976
5 changed files with 1442 additions and 0 deletions

View File

@@ -60,6 +60,17 @@ config INTEL_MEI_GSC
tasks such as graphics card firmware update and security
tasks.
config INTEL_MEI_VSC_HW
tristate "Intel visual sensing controller device transport driver"
depends on ACPI && SPI
depends on GPIOLIB || COMPILE_TEST
help
Intel SPI transport driver between host and Intel visual sensing
controller (IVSC) device.
This driver can also be built as a module. If so, the module
will be called mei-vsc-hw.
source "drivers/misc/mei/hdcp/Kconfig"
source "drivers/misc/mei/pxp/Kconfig"
source "drivers/misc/mei/gsc_proxy/Kconfig"

View File

@@ -31,3 +31,7 @@ CFLAGS_mei-trace.o = -I$(src)
obj-$(CONFIG_INTEL_MEI_HDCP) += hdcp/
obj-$(CONFIG_INTEL_MEI_PXP) += pxp/
obj-$(CONFIG_INTEL_MEI_GSC_PROXY) += gsc_proxy/
obj-$(CONFIG_INTEL_MEI_VSC_HW) += mei-vsc-hw.o
mei-vsc-hw-y := vsc-tp.o
mei-vsc-hw-y += vsc-fw-loader.o

File diff suppressed because it is too large Load Diff

555
drivers/misc/mei/vsc-tp.c Normal file

File diff suppressed because it is too large Load Diff

50
drivers/misc/mei/vsc-tp.h Normal file
View File

@@ -0,0 +1,50 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2023, Intel Corporation.
* Intel Visual Sensing Controller Transport Layer Linux driver
*/
#ifndef _VSC_TP_H_
#define _VSC_TP_H_
#include <linux/types.h>
#define VSC_TP_CMD_WRITE 0x01
#define VSC_TP_CMD_READ 0x02
#define VSC_TP_CMD_ACK 0x10
#define VSC_TP_CMD_NACK 0x11
#define VSC_TP_CMD_BUSY 0x12
struct vsc_tp;
/**
* typedef vsc_event_cb_t - event callback function signature
* @context: the execution context of who registered this callback
*
* The callback function is called in interrupt context and the data
* payload is only valid during the call. If the user needs access
* the data payload later, it must copy the payload.
*/
typedef void (*vsc_tp_event_cb_t)(void *context);
int vsc_tp_rom_xfer(struct vsc_tp *tp, const void *obuf, void *ibuf,
size_t len);
int vsc_tp_xfer(struct vsc_tp *tp, u8 cmd, const void *obuf, size_t olen,
void *ibuf, size_t ilen);
int vsc_tp_register_event_cb(struct vsc_tp *tp, vsc_tp_event_cb_t event_cb,
void *context);
void vsc_tp_intr_enable(struct vsc_tp *tp);
void vsc_tp_intr_disable(struct vsc_tp *tp);
void vsc_tp_intr_synchronize(struct vsc_tp *tp);
void vsc_tp_reset(struct vsc_tp *tp);
bool vsc_tp_need_read(struct vsc_tp *tp);
int vsc_tp_init(struct vsc_tp *tp, struct device *dev);
#endif