linux/drivers/media/pci/cx25821/cx25821-i2c.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  Driver for the Conexant CX25821 PCIe bridge
 *
 *  Copyright (C) 2009 Conexant Systems Inc.
 *  Authors  <[email protected]>, <[email protected]>
 *	Based on Steven Toth <[email protected]> cx23885 driver
 */

#define pr_fmt(fmt)

#include <linux/module.h>
#include <linux/i2c.h>
#include "cx25821.h"

static unsigned int i2c_debug;
module_param(i2c_debug, int, 0644);
MODULE_PARM_DESC();

static unsigned int i2c_scan;
module_param(i2c_scan, int, 0444);
MODULE_PARM_DESC();

#define dprintk(level, fmt, arg...)

#define I2C_WAIT_DELAY
#define I2C_WAIT_RETRY

#define I2C_EXTEND
#define I2C_NOSTOP

static inline int i2c_slave_did_ack(struct i2c_adapter *i2c_adap)
{}

static inline int i2c_is_busy(struct i2c_adapter *i2c_adap)
{}

static int i2c_wait_done(struct i2c_adapter *i2c_adap)
{}

static int i2c_sendbytes(struct i2c_adapter *i2c_adap,
			 const struct i2c_msg *msg, int joined_rlen)
{}

static int i2c_readbytes(struct i2c_adapter *i2c_adap,
			 const struct i2c_msg *msg, int joined)
{}

static int i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num)
{}


static u32 cx25821_functionality(struct i2c_adapter *adap)
{}

static const struct i2c_algorithm cx25821_i2c_algo_template =;

static const struct i2c_adapter cx25821_i2c_adap_template =;

static const struct i2c_client cx25821_i2c_client_template =;

/* init + register i2c adapter */
int cx25821_i2c_register(struct cx25821_i2c *bus)
{}

int cx25821_i2c_unregister(struct cx25821_i2c *bus)
{}

#if 0 /* Currently unused */
static void cx25821_av_clk(struct cx25821_dev *dev, int enable)
{
	/* write 0 to bus 2 addr 0x144 via i2x_xfer() */
	char buffer[3];
	struct i2c_msg msg;
	dprintk(1, "%s(enabled = %d)\n", __func__, enable);

	/* Register 0x144 */
	buffer[0] = 0x01;
	buffer[1] = 0x44;
	if (enable == 1)
		buffer[2] = 0x05;
	else
		buffer[2] = 0x00;

	msg.addr = 0x44;
	msg.flags = I2C_M_TEN;
	msg.len = 3;
	msg.buf = buffer;

	i2c_xfer(&dev->i2c_bus[0].i2c_adap, &msg, 1);
}
#endif

int cx25821_i2c_read(struct cx25821_i2c *bus, u16 reg_addr, int *value)
{}

int cx25821_i2c_write(struct cx25821_i2c *bus, u16 reg_addr, int value)
{}