#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/of_device.h>
#define I2C_PCF_START (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_ENI | I2C_PCF_STA | I2C_PCF_ACK)
#define I2C_PCF_STOP (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_STO | I2C_PCF_ACK)
#define I2C_PCF_REPSTART ( I2C_PCF_ESO | I2C_PCF_STA | I2C_PCF_ACK)
#define I2C_PCF_IDLE (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_ACK)
static void set_device_claimage(struct bbc_i2c_bus *bp, struct platform_device *op, int val)
for (i = 0; i < NUM_CHILDREN; i++) {
if (bp->devs[i].device == op) {
bp->devs[i].client_claimed = val;
#define claim_device(BP,ECHILD) set_device_claimage(BP,ECHILD,1)
#define release_device(BP,ECHILD) set_device_claimage(BP,ECHILD,0)
struct platform_device *bbc_i2c_getdev(struct bbc_i2c_bus *bp, int index)
struct platform_device *op = NULL;
for (i = 0; i < NUM_CHILDREN; i++) {
if (!(op = bp->devs[i].device))
struct bbc_i2c_client *bbc_i2c_attach(struct bbc_i2c_bus *bp, struct platform_device *op)
struct bbc_i2c_client *client;