linux/drivers/hid/i2c-hid/i2c-hid-core.c

/*
 * HID over I2C protocol implementation
 *
 * Copyright (c) 2012 Benjamin Tissoires <[email protected]>
 * Copyright (c) 2012 Ecole Nationale de l'Aviation Civile, France
 * Copyright (c) 2012 Red Hat, Inc
 *
 * This code is partly based on "USB HID support for Linux":
 *
 *  Copyright (c) 1999 Andreas Gal
 *  Copyright (c) 2000-2005 Vojtech Pavlik <[email protected]>
 *  Copyright (c) 2005 Michael Haboustak <[email protected]> for Concept2, Inc
 *  Copyright (c) 2007-2008 Oliver Neukum
 *  Copyright (c) 2006-2010 Jiri Kosina
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file COPYING in the main directory of this archive for
 * more details.
 */

#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/input.h>
#include <linux/irq.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/pm.h>
#include <linux/pm_wakeirq.h>
#include <linux/device.h>
#include <linux/wait.h>
#include <linux/err.h>
#include <linux/string.h>
#include <linux/list.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/hid.h>
#include <linux/mutex.h>
#include <linux/unaligned.h>

#include <drm/drm_panel.h>

#include "../hid-ids.h"
#include "i2c-hid.h"

/* quirks to control the device */
#define I2C_HID_QUIRK_NO_IRQ_AFTER_RESET
#define I2C_HID_QUIRK_BOGUS_IRQ
#define I2C_HID_QUIRK_RESET_ON_RESUME
#define I2C_HID_QUIRK_BAD_INPUT_SIZE
#define I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET
#define I2C_HID_QUIRK_NO_SLEEP_ON_SUSPEND
#define I2C_HID_QUIRK_DELAY_WAKEUP_AFTER_RESUME

/* Command opcodes */
#define I2C_HID_OPCODE_RESET
#define I2C_HID_OPCODE_GET_REPORT
#define I2C_HID_OPCODE_SET_REPORT
#define I2C_HID_OPCODE_GET_IDLE
#define I2C_HID_OPCODE_SET_IDLE
#define I2C_HID_OPCODE_GET_PROTOCOL
#define I2C_HID_OPCODE_SET_PROTOCOL
#define I2C_HID_OPCODE_SET_POWER

/* flags */
#define I2C_HID_STARTED
#define I2C_HID_RESET_PENDING

#define I2C_HID_PWR_ON
#define I2C_HID_PWR_SLEEP

#define i2c_hid_dbg(ihid, ...)

struct i2c_hid_desc {} __packed;

/* The main device structure */
struct i2c_hid {};

static const struct i2c_hid_quirks {} i2c_hid_quirks[] =;

/*
 * i2c_hid_lookup_quirk: return any quirks associated with a I2C HID device
 * @idVendor: the 16-bit vendor ID
 * @idProduct: the 16-bit product ID
 *
 * Returns: a u32 quirks value.
 */
static u32 i2c_hid_lookup_quirk(const u16 idVendor, const u16 idProduct)
{}

static int i2c_hid_probe_address(struct i2c_hid *ihid)
{}

static int i2c_hid_xfer(struct i2c_hid *ihid,
			u8 *send_buf, int send_len, u8 *recv_buf, int recv_len)
{}

static int i2c_hid_read_register(struct i2c_hid *ihid, __le16 reg,
				 void *buf, size_t len)
{}

static size_t i2c_hid_encode_command(u8 *buf, u8 opcode,
				     int report_type, int report_id)
{}

static int i2c_hid_get_report(struct i2c_hid *ihid,
			      u8 report_type, u8 report_id,
			      u8 *recv_buf, size_t recv_len)
{}

static size_t i2c_hid_format_report(u8 *buf, int report_id,
				    const u8 *data, size_t size)
{}

/**
 * i2c_hid_set_or_send_report: forward an incoming report to the device
 * @ihid: the i2c hid device
 * @report_type: 0x03 for HID_FEATURE_REPORT ; 0x02 for HID_OUTPUT_REPORT
 * @report_id: the report ID
 * @buf: the actual data to transfer, without the report ID
 * @data_len: size of buf
 * @do_set: true: use SET_REPORT HID command, false: send plain OUTPUT report
 */
static int i2c_hid_set_or_send_report(struct i2c_hid *ihid,
				      u8 report_type, u8 report_id,
				      const u8 *buf, size_t data_len,
				      bool do_set)
{}

static int i2c_hid_set_power_command(struct i2c_hid *ihid, int power_state)
{}

static int i2c_hid_set_power(struct i2c_hid *ihid, int power_state)
{}

static int i2c_hid_start_hwreset(struct i2c_hid *ihid)
{}

static int i2c_hid_finish_hwreset(struct i2c_hid *ihid)
{}

static void i2c_hid_get_input(struct i2c_hid *ihid)
{}

static irqreturn_t i2c_hid_irq(int irq, void *dev_id)
{}

static int i2c_hid_get_report_length(struct hid_report *report)
{}

/*
 * Traverse the supplied list of reports and find the longest
 */
static void i2c_hid_find_max_report(struct hid_device *hid, unsigned int type,
		unsigned int *max)
{}

static void i2c_hid_free_buffers(struct i2c_hid *ihid)
{}

static int i2c_hid_alloc_buffers(struct i2c_hid *ihid, size_t report_size)
{}

static int i2c_hid_get_raw_report(struct hid_device *hid,
				  u8 report_type, u8 report_id,
				  u8 *buf, size_t count)
{}

static int i2c_hid_output_raw_report(struct hid_device *hid, u8 report_type,
				     const u8 *buf, size_t count, bool do_set)
{}

static int i2c_hid_output_report(struct hid_device *hid, u8 *buf, size_t count)
{}

static int i2c_hid_raw_request(struct hid_device *hid, unsigned char reportnum,
			       __u8 *buf, size_t len, unsigned char rtype,
			       int reqtype)
{}

static int i2c_hid_parse(struct hid_device *hid)
{}

static int i2c_hid_start(struct hid_device *hid)
{}

static void i2c_hid_stop(struct hid_device *hid)
{}

static int i2c_hid_open(struct hid_device *hid)
{}

static void i2c_hid_close(struct hid_device *hid)
{}

static const struct hid_ll_driver i2c_hid_ll_driver =;

static int i2c_hid_init_irq(struct i2c_client *client)
{}

static int i2c_hid_fetch_hid_descriptor(struct i2c_hid *ihid)
{}

static int i2c_hid_core_power_up(struct i2c_hid *ihid)
{}

static void i2c_hid_core_power_down(struct i2c_hid *ihid)
{}

static void i2c_hid_core_shutdown_tail(struct i2c_hid *ihid)
{}

static int i2c_hid_core_suspend(struct i2c_hid *ihid, bool force_poweroff)
{}

static int i2c_hid_core_resume(struct i2c_hid *ihid)
{}

/*
 * Check that the device exists and parse the HID descriptor.
 */
static int __i2c_hid_core_probe(struct i2c_hid *ihid)
{}

static int i2c_hid_core_register_hid(struct i2c_hid *ihid)
{}

static int i2c_hid_core_probe_panel_follower(struct i2c_hid *ihid)
{}

static void ihid_core_panel_prepare_work(struct work_struct *work)
{}

static int i2c_hid_core_panel_prepared(struct drm_panel_follower *follower)
{}

static int i2c_hid_core_panel_unpreparing(struct drm_panel_follower *follower)
{}

static const struct drm_panel_follower_funcs i2c_hid_core_panel_follower_funcs =;

static int i2c_hid_core_register_panel_follower(struct i2c_hid *ihid)
{}

int i2c_hid_core_probe(struct i2c_client *client, struct i2chid_ops *ops,
		       u16 hid_descriptor_address, u32 quirks)
{}
EXPORT_SYMBOL_GPL();

void i2c_hid_core_remove(struct i2c_client *client)
{}
EXPORT_SYMBOL_GPL();

void i2c_hid_core_shutdown(struct i2c_client *client)
{}
EXPORT_SYMBOL_GPL();

static int i2c_hid_core_pm_suspend(struct device *dev)
{}

static int i2c_hid_core_pm_resume(struct device *dev)
{}

const struct dev_pm_ops i2c_hid_core_pm =;
EXPORT_SYMBOL_GPL();

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