[i2c] [PATCH] Add driver for Dallas DS1682 elapsed time recorder

Jean Delvare khali at linux-fr.org
Tue May 15 14:58:15 CEST 2007


Hi Grant,

On Mon, 14 May 2007 12:25:52 -0600, Grant Likely wrote:
> Tested on a MPC5200 based board using the integrated i2c adapter.
> 
> Signed-off-by: Grant Likely <grant.likely at secretlab.ca>
> ---
> 
> 4th revision.  I think I've delt with all the comments.
> 
> This is a new-style i2c driver.  You can register this driver for your
> board with the following code snippits in your board setup code:
> 
> static struct i2c_board_info my_i2c_board_info[] = {
> 	{
> 		.driver_name = "ds1682",
> 		.addr = 0x6b,
> 	},
> };
> 
> 	/* somewhere in your init function (assuming i2c bus #0) */
> 	pr_debug("registering i2c device list\n");
> 	i2c_register_board_info(0, my_i2c_board_info, 1);
> 
> 
> 
>  drivers/i2c/chips/Kconfig  |   10 ++
>  drivers/i2c/chips/Makefile |    1 
>  drivers/i2c/chips/ds1682.c |  260 ++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 271 insertions(+), 0 deletions(-)

Patch applied, thanks. With one minor fix:

> +static int ds1682_probe(struct i2c_client *client)
> +{
> +	int rc;
> +
> +	if (!i2c_check_functionality(client->adapter,
> +				     I2C_FUNC_SMBUS_READ_I2C_BLOCK |
> +				     I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)) {

This can be simplified to I2C_FUNC_SMBUS_I2C_BLOCK, so I did that.

-- 
Jean Delvare



More information about the i2c mailing list