linux/drivers/platform/chrome/cros_ec_i2c.c

// SPDX-License-Identifier: GPL-2.0
// I2C interface for ChromeOS Embedded Controller
//
// Copyright (C) 2012 Google, Inc

#include <linux/acpi.h>
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/platform_data/cros_ec_commands.h>
#include <linux/platform_data/cros_ec_proto.h>
#include <linux/platform_device.h>
#include <linux/slab.h>

#include "cros_ec.h"

/*
 * Request format for protocol v3
 * byte 0	0xda (EC_COMMAND_PROTOCOL_3)
 * byte 1-8	struct ec_host_request
 * byte 10-	response data
 */
struct ec_host_request_i2c {} __packed;


/*
 * Response format for protocol v3
 * byte 0	result code
 * byte 1	packet_length
 * byte 2-9	struct ec_host_response
 * byte 10-	response data
 */
struct ec_host_response_i2c {} __packed;

static inline struct cros_ec_device *to_ec_dev(struct device *dev)
{}

static int cros_ec_pkt_xfer_i2c(struct cros_ec_device *ec_dev,
				struct cros_ec_command *msg)
{}

static int cros_ec_cmd_xfer_i2c(struct cros_ec_device *ec_dev,
				struct cros_ec_command *msg)
{}

static int cros_ec_i2c_probe(struct i2c_client *client)
{}

static void cros_ec_i2c_remove(struct i2c_client *client)
{}

#ifdef CONFIG_PM_SLEEP
static int cros_ec_i2c_suspend(struct device *dev)
{}

static int cros_ec_i2c_resume(struct device *dev)
{}
#endif

static const struct dev_pm_ops cros_ec_i2c_pm_ops =;

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

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

#ifdef CONFIG_ACPI
static const struct acpi_device_id cros_ec_i2c_acpi_id[] =;
MODULE_DEVICE_TABLE(acpi, cros_ec_i2c_acpi_id);
#endif

static struct i2c_driver cros_ec_driver =;

module_i2c_driver();

MODULE_LICENSE();
MODULE_DESCRIPTION();