[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100115163712.3e54861d@linux.lan.towertech.it>
Date: Fri, 15 Jan 2010 16:37:12 +0100
From: Alessandro Zummo <a.zummo@...ertech.it>
To: rtc-linux@...glegroups.com
Cc: lethal@...ux-sh.org, Dale Farnsworth <dale@...nsworth.org>,
linux-kernel@...r.kernel.org
Subject: Re: [rtc-linux] [PATCH] rtc: rtc-max6900: SMBus support.
On Thu, 14 Jan 2010 20:32:35 +0900
Paul Mundt <lethal@...ux-sh.org> wrote:
> The current rtc-max6900 driver only supports getting and setting the time
> through bursting, which requires a controller capable of such. As
> bursting is merely an optimization, we can also opt for the non-burst
> fallback path that pokes at the date/time registers individually.
almost ok, review below.
> -static int max6900_i2c_read_regs(struct i2c_client *client, u8 *buf)
> +static unsigned int smbus_mode; /* disabled by default, prefer bursting */
that one should be per-device.
> +static int max6900_i2c_smbus_read(struct i2c_client *client, u8 *buf)
> +{
> + int rc = 0, i;
no need to init rc
> +static int max6900_i2c_smbus_write(struct i2c_client *client, u8 const *buf)
> +{
> + int rc = 0, i;
> +
> + for (i = 0; i < MAX6900_REG_LEN; i++)
> + rc |= i2c_smbus_write_byte_data(client,
> + MAX6900_REG_WRITE(i), buf[i]);
please check rc at each write.
you might want to check if you'll have troubles if you read/write
when the minutes are changing.
you might also want to investigate block SMbus messages.
--
Best regards,
Alessandro Zummo,
Tower Technologies - Torino, Italy
http://www.towertech.it
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists