linux/drivers/input/rmi4/rmi_i2c.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2011-2016 Synaptics Incorporated
 * Copyright (c) 2011 Unixphere
 */

#include <linux/i2c.h>
#include <linux/rmi.h>
#include <linux/of.h>
#include <linux/delay.h>
#include <linux/regulator/consumer.h>
#include "rmi_driver.h"

#define BUFFER_SIZE_INCREMENT

/**
 * struct rmi_i2c_xport - stores information for i2c communication
 *
 * @xport: The transport interface structure
 * @client: The I2C client device structure
 *
 * @page_mutex: Locks current page to avoid changing pages in unexpected ways.
 * @page: Keeps track of the current virtual page
 *
 * @tx_buf: Buffer used for transmitting data to the sensor over i2c.
 * @tx_buf_size: Size of the buffer
 *
 * @supplies: Array of voltage regulators
 * @startup_delay: Milliseconds to pause after powering up the regulators
 */
struct rmi_i2c_xport {};

#define RMI_PAGE_SELECT_REGISTER
#define RMI_I2C_PAGE(addr)

/*
 * rmi_set_page - Set RMI page
 * @xport: The pointer to the rmi_transport_dev struct
 * @page: The new page address.
 *
 * RMI devices have 16-bit addressing, but some of the transport
 * 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 rmi_i2c_xport *rmi_i2c, u8 page)
{}

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

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

static const struct rmi_transport_ops rmi_i2c_ops =;

#ifdef CONFIG_OF
static const struct of_device_id rmi_i2c_of_match[] =;
MODULE_DEVICE_TABLE(of, rmi_i2c_of_match);
#endif

static void rmi_i2c_regulator_bulk_disable(void *data)
{}

static void rmi_i2c_unregister_transport(void *data)
{}

static int rmi_i2c_probe(struct i2c_client *client)
{}

static int rmi_i2c_suspend(struct device *dev)
{}

static int rmi_i2c_resume(struct device *dev)
{}

static int rmi_i2c_runtime_suspend(struct device *dev)
{}

static int rmi_i2c_runtime_resume(struct device *dev)
{}

static const struct dev_pm_ops rmi_i2c_pm =;

static const struct i2c_device_id rmi_id[] =;
MODULE_DEVICE_TABLE(i2c, rmi_id);

static struct i2c_driver rmi_i2c_driver =;

module_i2c_driver();

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