public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alessandro Zummo <alessandro.zummo@towertech.it>
To: rtc-linux@googlegroups.com
Cc: anemo@mba.ocn.ne.jp, linux-kernel@vger.kernel.org, ab@mycable.de,
	mgreer@mvista.com, khali@linux-fr.org, david-b@pacbell.net
Subject: Re: [rtc-linux] [PATCH 1/2] rtc: add rtc-m41txx driver
Date: Wed, 20 Jun 2007 00:28:28 +0200	[thread overview]
Message-ID: <20070620002828.483ea029@inspiron> (raw)
In-Reply-To: <20070620.005926.52130307.anemo@mba.ocn.ne.jp>

On Wed, 20 Jun 2007 00:59:26 +0900 (JST)
Atsushi Nemoto <anemo@mba.ocn.ne.jp> wrote:

>
> This driver supports M41T80, M41T81 and M41ST85.  The old m41t00
> driver supports M41T00, M41T81 and M41T85(M41ST85).  While the M41T00
> chip is now supported by rtc-ds1307 driver, this driver does not
> include support for the chip.

 Hi,

  I'd prefer if you change the name in rtc-m41t80 and add
 the names of the supported chips in the Kconfig entry.

> +/* Sets the given date and time to the real time clock. */
> +static int m41txx_set_datetime(struct i2c_client *client, struct rtc_time *tm)
> +{
> +	unsigned char wbuf[1 + M41TXX_REG_YEAR + 1];

 would be easier to understand if you have some #defines 
 with the sizes you require for the various buffers.


> +#if defined(CONFIG_RTC_INTF_PROC) || defined(CONFIG_RTC_INTF_PROC_MODULE)
> +static int m41txx_rtc_proc(struct device *dev, struct seq_file *seq)
> +{
> +	struct i2c_client *client = to_i2c_client(dev);
> +	struct m41txx_data *clientdata = i2c_get_clientdata(client);
> +	unsigned char reg;
> +
> +	if (clientdata->chip->features & M41TXX_FEATURE_BL) {
> +		reg = i2c_smbus_read_byte_data(client, M41TXX_REG_FLAGS);
> +		seq_printf(seq, "battery\t\t: %s\n",
> +			   (reg & M41TXX_FLAGS_BATT_LOW) ? "exhausted" : "ok");
> +	}
> +	return 0;
> +}

 the proc interface will go away sooner or later, would be better to expose
 the battery status with a sysfs attribute.


> +++ b/include/linux/m41txx.h
> @@ -0,0 +1,40 @@
> +/*
> + * Definitions for the ST M41TXX family of i2c rtc chips.
> + *
> + * Based on m41t00.h by Mark A. Greer <mgreer@mvista.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.

 Unless this include is required by other files, please place
 it in drivers/rtc calling it rtc-drivername.h

 Other than the comments above, the driver
 seems fine to me.

-- 

 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it


  parent reply	other threads:[~2007-06-19 22:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-19 15:59 [PATCH 1/2] rtc: add rtc-m41txx driver Atsushi Nemoto
2007-06-19 19:25 ` Mark A. Greer
2007-06-19 22:28 ` Alessandro Zummo [this message]
2007-06-20  2:16   ` [rtc-linux] " Atsushi Nemoto

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=20070620002828.483ea029@inspiron \
    --to=alessandro.zummo@towertech.it \
    --cc=ab@mycable.de \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=david-b@pacbell.net \
    --cc=khali@linux-fr.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgreer@mvista.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox