All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alessandro Zummo <a.zummo@towertech.it>
To: rtc-linux@googlegroups.com
Cc: lethal@linux-sh.org, Dale Farnsworth <dale@farnsworth.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [rtc-linux] [PATCH] rtc: rtc-max6900: SMBus support.
Date: Fri, 15 Jan 2010 16:37:12 +0100	[thread overview]
Message-ID: <20100115163712.3e54861d@linux.lan.towertech.it> (raw)
In-Reply-To: <20100114113235.GA20473@linux-sh.org>

On Thu, 14 Jan 2010 20:32:35 +0900
Paul Mundt <lethal@linux-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


      parent reply	other threads:[~2010-01-15 15:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-14 11:32 [PATCH] rtc: rtc-max6900: SMBus support Paul Mundt
2010-01-14 14:39 ` Dale Farnsworth
2010-01-15 15:37 ` Alessandro Zummo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100115163712.3e54861d@linux.lan.towertech.it \
    --to=a.zummo@towertech.it \
    --cc=dale@farnsworth.org \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.