linux/drivers/staging/greybus/i2c.c

// SPDX-License-Identifier: GPL-2.0
/*
 * I2C bridge driver for the Greybus "generic" I2C module.
 *
 * Copyright 2014 Google Inc.
 * Copyright 2014 Linaro Ltd.
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/greybus.h>

#include "gbphy.h"

struct gb_i2c_device {};

/*
 * Map Greybus i2c functionality bits into Linux ones
 */
static u32 gb_i2c_functionality_map(u32 gb_i2c_functionality)
{}

/*
 * Do initial setup of the i2c device.  This includes verifying we
 * can support it (based on the protocol version it advertises).
 * If that's OK, we get and cached its functionality bits.
 *
 * Note: gb_i2c_dev->connection is assumed to have been valid.
 */
static int gb_i2c_device_setup(struct gb_i2c_device *gb_i2c_dev)
{}

/*
 * Map Linux i2c_msg flags into Greybus i2c transfer op flags.
 */
static u16 gb_i2c_transfer_op_flags_map(u16 flags)
{}

static void
gb_i2c_fill_transfer_op(struct gb_i2c_transfer_op *op, struct i2c_msg *msg)
{}

static struct gb_operation *
gb_i2c_operation_create(struct gb_connection *connection,
			struct i2c_msg *msgs, u32 msg_count)
{}

static void gb_i2c_decode_response(struct i2c_msg *msgs, u32 msg_count,
				   struct gb_i2c_transfer_response *response)
{}

/*
 * Some i2c transfer operations return results that are expected.
 */
static bool gb_i2c_expected_transfer_error(int errno)
{}

static int gb_i2c_transfer_operation(struct gb_i2c_device *gb_i2c_dev,
				     struct i2c_msg *msgs, u32 msg_count)
{}

static int gb_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
			      int msg_count)
{}

static u32 gb_i2c_functionality(struct i2c_adapter *adap)
{}

static const struct i2c_algorithm gb_i2c_algorithm =;

static int gb_i2c_probe(struct gbphy_device *gbphy_dev,
			const struct gbphy_device_id *id)
{}

static void gb_i2c_remove(struct gbphy_device *gbphy_dev)
{}

static const struct gbphy_device_id gb_i2c_id_table[] =;
MODULE_DEVICE_TABLE(gbphy, gb_i2c_id_table);

static struct gbphy_driver i2c_driver =;

module_gbphy_driver();
MODULE_DESCRIPTION();
MODULE_LICENSE();