#include <linux/auxiliary_bus.h>
#include <linux/cleanup.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/irqreturn.h>
#include <linux/lockdep.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/notifier.h>
#include <linux/slab.h>
#include <linux/platform_data/lenovo-yoga-c630.h>
#define LENOVO_EC_RESPONSE_REG …
#define LENOVO_EC_REQUEST_REG …
#define LENOVO_EC_UCSI_WRITE …
#define LENOVO_EC_UCSI_READ …
#define LENOVO_EC_READ_REG …
#define LENOVO_EC_REQUEST_NEXT_EVENT …
#define LENOVO_EC_UCSI_VERSION …
struct yoga_c630_ec { … };
static int yoga_c630_ec_request(struct yoga_c630_ec *ec, u8 *req, size_t req_len,
u8 *resp, size_t resp_len)
{ … }
int yoga_c630_ec_read8(struct yoga_c630_ec *ec, u8 addr)
{ … }
EXPORT_SYMBOL_GPL(…);
int yoga_c630_ec_read16(struct yoga_c630_ec *ec, u8 addr)
{ … }
EXPORT_SYMBOL_GPL(…);
u16 yoga_c630_ec_ucsi_get_version(struct yoga_c630_ec *ec)
{ … }
EXPORT_SYMBOL_GPL(…);
int yoga_c630_ec_ucsi_write(struct yoga_c630_ec *ec,
const u8 req[YOGA_C630_UCSI_WRITE_SIZE])
{ … }
EXPORT_SYMBOL_GPL(…);
int yoga_c630_ec_ucsi_read(struct yoga_c630_ec *ec,
u8 resp[YOGA_C630_UCSI_READ_SIZE])
{ … }
EXPORT_SYMBOL_GPL(…);
static irqreturn_t yoga_c630_ec_thread_intr(int irq, void *data)
{ … }
int yoga_c630_ec_register_notify(struct yoga_c630_ec *ec, struct notifier_block *nb)
{ … }
EXPORT_SYMBOL_GPL(…);
void yoga_c630_ec_unregister_notify(struct yoga_c630_ec *ec, struct notifier_block *nb)
{ … }
EXPORT_SYMBOL_GPL(…);
static void yoga_c630_aux_release(struct device *dev)
{ … }
static void yoga_c630_aux_remove(void *data)
{ … }
static int yoga_c630_aux_init(struct device *parent, const char *name,
struct yoga_c630_ec *ec)
{ … }
static int yoga_c630_ec_probe(struct i2c_client *client)
{ … }
static const struct of_device_id yoga_c630_ec_of_match[] = …;
MODULE_DEVICE_TABLE(of, yoga_c630_ec_of_match);
static const struct i2c_device_id yoga_c630_ec_i2c_id_table[] = …;
MODULE_DEVICE_TABLE(i2c, yoga_c630_ec_i2c_id_table);
static struct i2c_driver yoga_c630_ec_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;