/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
&mod_miscops, /* type of module - misc */
"I2C module",
NULL,
};
0
};
int i2csvcdebug = 0;
int
_init(void)
{
int error;
}
return (error);
}
int
_fini(void)
{
int error;
}
return (error);
}
int
{
}
/*
* i2c_client_register is called by I2C client drivers,
* typically in attach, but before starting any bus transfers.
*
* dip - the client device's dip.
* i2c_hdl - pointer to a handle returned on success.
*
*/
int
{
/*
* search parent reg list to find dip's parent.
*/
break;
}
}
return (I2C_FAILURE);
}
return (I2C_SUCCESS);
}
/*
* i2c_client_unregister() is called by the I2C client driver
* when it no longer wishes to transmit on the I2C bus, typically
* during its detach routine.
*
* hdl - handle previously returned by i2c_client_register().
*
*/
void
{
}
/*
* i2c_transfer() is called by client drivers to handle
* I2C data transfers. It performs some basic sanity checking of
* flags vs. i2c_len and i2c_wlen values, and then calls the
* parent's i2c_transfer() function to handle the actual transfer.
*/
int
{
case I2C_WR:
return (EINVAL);
}
break;
case I2C_RD:
return (EINVAL);
}
break;
case I2C_WR_RD:
return (EINVAL);
}
break;
default:
return (EINVAL);
}
return (i2c_tran->i2c_result);
} else {
return (ENOTSUP);
}
}
/*
* i2c_transfer_alloc() allocates a i2c_transfer structure along
* with read and write buffers of size rlen and wlen respectively.
*
* i2c_hdl - handle returned previously by i2c_client_register()
* i2c - address of pointer to allocated buffer returned on success.
* wlen - write size buffer to allocate. May be 0.
* rlen - read size buffer to allocate. May be 0.
* flags - I2C_SLEEP or I2C_NOSLEEP
*/
/*ARGSUSED*/
int
{
int sleep;
int size;
/*
* set i2c to NULL in case the caller just checks i2c
* to determine failures.
*/
} else if (flags & I2C_NOSLEEP) {
sleep = KM_NOSLEEP;
} else {
sleep = KM_NOSLEEP;
}
return (I2C_FAILURE);
}
if (wlen != 0) {
sizeof (i2c_transfer_alloc_t);
}
if (rlen != 0) {
sizeof (i2c_transfer_alloc_t) + wlen;
}
return (I2C_SUCCESS);
}
/*
* i2c_transfer_free() is called to free a buffer previously
* allocated by i2c_transfer_allocate().
*
* i2c_hdl - handle returned previously by i2c_client_register()
* i2c - buffer previously allocated by i2c_transfer_allocate()
*/
/*ARGSUSED*/
void
{
}
/*
* i2c_nexus_register() is called by the nexus driver to inform
* I2C services that it is ready to accept transactions, and
* give the I2C services a vector of functions.
*
* dip - dip of the bus controller
* nexus_reg - pointer to reg structure of vector functions
*/
void
{
KM_SLEEP);
}
/*
* i2c_nexus_unregister() is called by the nexus driver when
* it is no longer able to accept transactions for its I2C
* children.
*
* dip - dev_info pointer passed to i2c_nexus_register().
*/
void
{
/*
* reg_list is the address of the pointer to an element on
* the reg list. It starts out being the address of the
* list head, but then is changed to the address of the
* next pointer in a list element. Once the element to
* delete is found, then we change the pointer to the
* address found in the next pointer of the element to
* be deleted.
*/
/* prev next pointer adjusted to point */
break;
}
}
} else {
}
}