msm: wigig_sensing: initial commit of wigig_sensing SPI driver

This driver adds support for sensing use cases over 60GHz frequency band.
Sensing uses 60GHz radio signal to 'sense' the environment, allowing
various use cases such as proximity detection, face recognition, gesture
detection and more.

The driver communicates with the QCA6436 HW using SPI bus. The driver
requires SPI and wil6210 drivers to operate.

Change-Id: Ieaae89de8ef77617a24efafea0f476a3546cf27f
Signed-off-by: Gidon Studinski <gidons@codeaurora.org>
Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
This commit is contained in:
Alexei Avshalom Lazar 2020-02-25 13:30:25 +02:00
commit 444434b54a
7 changed files with 1746 additions and 0 deletions

View file

@ -0,0 +1,92 @@
/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
/*
* Copyright (c) 2020, The Linux Foundation. All rights reserved.
*/
#ifndef __WIGIG_SENSING_UAPI_H__
#define __WIGIG_SENSING_UAPI_H__
#if !defined(__KERNEL__)
#define __user
#endif
#include <linux/types.h>
#include <linux/ioctl.h>
enum wigig_sensing_mode {
WIGIG_SENSING_MODE_SEARCH = 1,
WIGIG_SENSING_MODE_FACIAL_RECOGNITION = 2,
WIGIG_SENSING_MODE_GESTURE_DETECTION = 3,
WIGIG_SENSING_MODE_STOP = 7,
WIGIG_SENSING_MODE_CUSTOM = 15
};
struct wigig_sensing_change_mode {
enum wigig_sensing_mode mode;
bool has_channel;
uint32_t channel;
};
enum wigig_sensing_event {
WIGIG_SENSING_EVENT_FW_READY,
WIGIG_SENSING_EVENT_RESET,
};
#define WIGIG_SENSING_IOC_MAGIC 'r'
#define WIGIG_SENSING_IOCTL_SET_AUTO_RECOVERY (0)
#define WIGIG_SENSING_IOCTL_GET_MODE (1)
#define WIGIG_SENSING_IOCTL_CHANGE_MODE (2)
#define WIGIG_SENSING_IOCTL_CLEAR_DATA (3)
#define WIGIG_SENSING_IOCTL_GET_NUM_DROPPED_BURSTS (4)
#define WIGIG_SENSING_IOCTL_GET_EVENT (5)
/**
* Set auto recovery, which means that the system will go back to search mode
* after an error
*/
#define WIGIG_SENSING_IOC_SET_AUTO_RECOVERY \
_IO(WIGIG_SENSING_IOC_MAGIC, WIGIG_SENSING_IOCTL_SET_AUTO_RECOVERY)
/**
* Get current system mode of operation *
*
* Returns struct wigig_sensing_mode
*/
#define WIGIG_SENSING_IOC_GET_MODE \
_IOR(WIGIG_SENSING_IOC_MAGIC, WIGIG_SENSING_IOCTL_GET_MODE, \
sizeof(enum wigig_sensing_mode))
/**
* Change mode of operation and optionaly channel
*
* Note: Before issuing a CHANGE_MODE operation, the application must stop
* reading data from the device node and clear any cached data. This comes to
* prevent loss of burst boundary synchronization in the application.
*
* Returns burst size
*/
#define WIGIG_SENSING_IOC_CHANGE_MODE \
_IOWR(WIGIG_SENSING_IOC_MAGIC, WIGIG_SENSING_IOCTL_CHANGE_MODE, \
sizeof(struct wigig_sensing_change_mode))
/**
* Clear data buffer
*/
#define WIGIG_SENSING_IOC_CLEAR_DATA \
_IO(WIGIG_SENSING_IOC_MAGIC, WIGIG_SENSING_IOCTL_CLEAR_DATA)
/**
* Get number of bursts that where dropped due to data buffer overflow
*/
#define WIGIG_SENSING_IOC_GET_NUM_DROPPED_BURSTS \
_IOR(WIGIG_SENSING_IOC_MAGIC, \
WIGIG_SENSING_IOCTL_GET_NUM_DROPPED_BURSTS, uint32_t)
/**
* Get number of bursts that where dropped due to data buffer overflow
*/
#define WIGIG_SENSING_IOC_GET_EVENT \
_IOR(WIGIG_SENSING_IOC_MAGIC, WIGIG_SENSING_IOCTL_GET_EVENT, \
sizeof(enum wigig_sensing_event))
#endif /* ____WIGIG_SENSING_UAPI_H__ */