linux/drivers/hid/hid-rmi.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  Copyright (c) 2013 Andrew Duggan <[email protected]>
 *  Copyright (c) 2013 Synaptics Incorporated
 *  Copyright (c) 2014 Benjamin Tissoires <[email protected]>
 *  Copyright (c) 2014 Red Hat, Inc
 */

#include <linux/kernel.h>
#include <linux/hid.h>
#include <linux/input.h>
#include <linux/input/mt.h>
#include <linux/irq.h>
#include <linux/irqdomain.h>
#include <linux/module.h>
#include <linux/pm.h>
#include <linux/slab.h>
#include <linux/wait.h>
#include <linux/sched.h>
#include <linux/rmi.h>
#include "hid-ids.h"

#define RMI_MOUSE_REPORT_ID
#define RMI_WRITE_REPORT_ID
#define RMI_READ_ADDR_REPORT_ID
#define RMI_READ_DATA_REPORT_ID
#define RMI_ATTN_REPORT_ID
#define RMI_SET_RMI_MODE_REPORT_ID

/* flags */
#define RMI_READ_REQUEST_PENDING
#define RMI_READ_DATA_PENDING
#define RMI_STARTED

/* device flags */
#define RMI_DEVICE
#define RMI_DEVICE_HAS_PHYS_BUTTONS
#define RMI_DEVICE_OUTPUT_SET_REPORT

/*
 * retrieve the ctrl registers
 * the ctrl register has a size of 20 but a fw bug split it into 16 + 4,
 * and there is no way to know if the first 20 bytes are here or not.
 * We use only the first 12 bytes, so get only them.
 */
#define RMI_F11_CTRL_REG_COUNT

enum rmi_mode_type {};

/**
 * struct rmi_data - stores information for hid communication
 *
 * @page_mutex: Locks current page to avoid changing pages in unexpected ways.
 * @page: Keeps track of the current virtual page
 * @xport: transport device to be registered with the RMI4 core.
 *
 * @wait: Used for waiting for read data
 *
 * @writeReport: output buffer when writing RMI registers
 * @readReport: input buffer when reading RMI registers
 *
 * @input_report_size: size of an input report (advertised by HID)
 * @output_report_size: size of an output report (advertised by HID)
 *
 * @flags: flags for the current device (started, reading, etc...)
 *
 * @reset_work: worker which will be called in case of a mouse report
 * @hdev: pointer to the struct hid_device
 *
 * @device_flags: flags which describe the device
 *
 * @domain: the IRQ domain allocated for this RMI4 device
 * @rmi_irq: the irq that will be used to generate events to rmi-core
 */
struct rmi_data {};

#define RMI_PAGE(addr)

static int rmi_write_report(struct hid_device *hdev, u8 *report, int len);

/**
 * rmi_set_page - Set RMI page
 * @hdev: The pointer to the hid_device struct
 * @page: The new page address.
 *
 * RMI devices have 16-bit addressing, but some of the physical
 * implementations (like SMBus) only have 8-bit addressing. So RMI implements
 * a page address at 0xff of every page so we can reliable page addresses
 * every 256 registers.
 *
 * The page_mutex lock must be held when this function is entered.
 *
 * Returns zero on success, non-zero on failure.
 */
static int rmi_set_page(struct hid_device *hdev, u8 page)
{}

static int rmi_set_mode(struct hid_device *hdev, u8 mode)
{}

static int rmi_write_report(struct hid_device *hdev, u8 *report, int len)
{}

static int rmi_hid_read_block(struct rmi_transport_dev *xport, u16 addr,
		void *buf, size_t len)
{}

static int rmi_hid_write_block(struct rmi_transport_dev *xport, u16 addr,
		const void *buf, size_t len)
{}

static int rmi_reset_attn_mode(struct hid_device *hdev)
{}

static void rmi_reset_work(struct work_struct *work)
{}

static int rmi_input_event(struct hid_device *hdev, u8 *data, int size)
{}

static int rmi_read_data_event(struct hid_device *hdev, u8 *data, int size)
{}

static int rmi_check_sanity(struct hid_device *hdev, u8 *data, int size)
{}

static int rmi_raw_event(struct hid_device *hdev,
		struct hid_report *report, u8 *data, int size)
{}

static int rmi_event(struct hid_device *hdev, struct hid_field *field,
			struct hid_usage *usage, __s32 value)
{}

static void rmi_report(struct hid_device *hid, struct hid_report *report)
{}

static int rmi_suspend(struct hid_device *hdev, pm_message_t message)
{}

static int rmi_post_resume(struct hid_device *hdev)
{}

static int rmi_hid_reset(struct rmi_transport_dev *xport, u16 reset_addr)
{}

static int rmi_input_configured(struct hid_device *hdev, struct hid_input *hi)
{}

static int rmi_input_mapping(struct hid_device *hdev,
		struct hid_input *hi, struct hid_field *field,
		struct hid_usage *usage, unsigned long **bit, int *max)
{}

static int rmi_check_valid_report_id(struct hid_device *hdev, unsigned type,
		unsigned id, struct hid_report **report)
{}

static struct rmi_device_platform_data rmi_hid_pdata =;

static const struct rmi_transport_ops hid_rmi_ops =;

static void rmi_irq_teardown(void *data)
{}

static int rmi_irq_map(struct irq_domain *h, unsigned int virq,
		       irq_hw_number_t hw_irq_num)
{}

static const struct irq_domain_ops rmi_irq_ops =;

static int rmi_setup_irq_domain(struct hid_device *hdev)
{}

static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id)
{}

static void rmi_remove(struct hid_device *hdev)
{}

static const struct hid_device_id rmi_id[] =;
MODULE_DEVICE_TABLE(hid, rmi_id);

static struct hid_driver rmi_driver =;

module_hid_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();