linux/drivers/input/rmi4/rmi_f54.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2012-2015 Synaptics Incorporated
 * Copyright (C) 2016 Zodiac Inflight Innovations
 */

#include <linux/kernel.h>
#include <linux/rmi.h>
#include <linux/input.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/videobuf2-v4l2.h>
#include <media/videobuf2-vmalloc.h>
#include "rmi_driver.h"

#define F54_NAME

/* F54 data offsets */
#define F54_REPORT_DATA_OFFSET
#define F54_FIFO_OFFSET
#define F54_NUM_TX_OFFSET
#define F54_NUM_RX_OFFSET

/*
 * The smbus protocol can read only 32 bytes max at a time.
 * But this should be fine for i2c/spi as well.
 */
#define F54_REPORT_DATA_SIZE

/* F54 commands */
#define F54_GET_REPORT
#define F54_FORCE_CAL

/* F54 capabilities */
#define F54_CAP_BASELINE
#define F54_CAP_IMAGE8
#define F54_CAP_IMAGE16

/**
 * enum rmi_f54_report_type - RMI4 F54 report types
 *
 * @F54_REPORT_NONE:	No Image Report.
 *
 * @F54_8BIT_IMAGE:	Normalized 8-Bit Image Report. The capacitance variance
 *			from baseline for each pixel.
 *
 * @F54_16BIT_IMAGE:	Normalized 16-Bit Image Report. The capacitance variance
 *			from baseline for each pixel.
 *
 * @F54_RAW_16BIT_IMAGE:
 *			Raw 16-Bit Image Report. The raw capacitance for each
 *			pixel.
 *
 * @F54_TRUE_BASELINE:	True Baseline Report. The baseline capacitance for each
 *			pixel.
 *
 * @F54_FULL_RAW_CAP:   Full Raw Capacitance Report. The raw capacitance with
 *			low reference set to its minimum value and high
 *			reference set to its maximum value.
 *
 * @F54_FULL_RAW_CAP_RX_OFFSET_REMOVED:
 *			Full Raw Capacitance with Receiver Offset Removed
 *			Report. Set Low reference to its minimum value and high
 *			references to its maximum value, then report the raw
 *			capacitance for each pixel.
 *
 * @F54_MAX_REPORT_TYPE:
 *			Maximum number of Report Types.  Used for sanity
 *			checking.
 */
enum rmi_f54_report_type {};

static const char * const rmi_f54_report_type_names[] =;

struct f54_data {};

/*
 * Basic checks on report_type to ensure we write a valid type
 * to the sensor.
 */
static bool is_f54_report_type_valid(struct f54_data *f54,
				     enum rmi_f54_report_type reptype)
{}

static enum rmi_f54_report_type rmi_f54_get_reptype(struct f54_data *f54,
						unsigned int i)
{}

static void rmi_f54_create_input_map(struct f54_data *f54)
{}

static int rmi_f54_request_report(struct rmi_function *fn, u8 report_type)
{}

static size_t rmi_f54_get_report_size(struct f54_data *f54)
{}

static int rmi_f54_get_pixel_fmt(enum rmi_f54_report_type reptype, u32 *pixfmt)
{}

static const struct v4l2_file_operations rmi_f54_video_fops =;

static int rmi_f54_queue_setup(struct vb2_queue *q, unsigned int *nbuffers,
			       unsigned int *nplanes, unsigned int sizes[],
			       struct device *alloc_devs[])
{}

static void rmi_f54_buffer_queue(struct vb2_buffer *vb)
{}

static void rmi_f54_stop_streaming(struct vb2_queue *q)
{}

/* V4L2 structures */
static const struct vb2_ops rmi_f54_queue_ops =;

static const struct vb2_queue rmi_f54_queue =;

static int rmi_f54_vidioc_querycap(struct file *file, void *priv,
				   struct v4l2_capability *cap)
{}

static int rmi_f54_vidioc_enum_input(struct file *file, void *priv,
				     struct v4l2_input *i)
{}

static int rmi_f54_set_input(struct f54_data *f54, unsigned int i)
{}

static int rmi_f54_vidioc_s_input(struct file *file, void *priv, unsigned int i)
{}

static int rmi_f54_vidioc_g_input(struct file *file, void *priv,
				  unsigned int *i)
{}

static int rmi_f54_vidioc_fmt(struct file *file, void *priv,
			      struct v4l2_format *f)
{}

static int rmi_f54_vidioc_enum_fmt(struct file *file, void *priv,
				   struct v4l2_fmtdesc *fmt)
{}

static int rmi_f54_vidioc_g_parm(struct file *file, void *fh,
				 struct v4l2_streamparm *a)
{}

static const struct v4l2_ioctl_ops rmi_f54_video_ioctl_ops =;

static const struct video_device rmi_f54_video_device =;

static void rmi_f54_work(struct work_struct *work)
{}

static int rmi_f54_config(struct rmi_function *fn)
{}

static int rmi_f54_detect(struct rmi_function *fn)
{}

static int rmi_f54_probe(struct rmi_function *fn)
{}

static void rmi_f54_remove(struct rmi_function *fn)
{}

struct rmi_function_handler rmi_f54_handler =;