[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081016234108.1268f65c@i1501.lan.towertech.it>
Date: Thu, 16 Oct 2008 23:41:08 +0200
From: Alessandro Zummo <alessandro.zummo@...ertech.it>
To: rtc-linux@...glegroups.com
Cc: akpm@...ux-foundation.org,
Jüri Reitel <juri.reitel@...wenthal.ee>,
linux-kernel@...r.kernel.org, David Brownell <david-b@...bell.net>,
Jean Delvare <khali@...ux-fr.org>,
Rodolfo Giometti <giometti@...ux.it>
Subject: Re: [rtc-linux] Re: invalid default values in RTC chip
On Thu, 16 Oct 2008 13:58:46 -0700
Andrew Morton <akpm@...ux-foundation.org> wrote:
> > My question relates to RTC driver linux/drivers/rtc/rtc-ds1307.c for
> > device m41t00. Driver probe function will fail if some of the chip's
> > registers contain invalid date time values i.e. if month register is 32
> > or minutes is 61. Is this correct behavior? Probe function's purpose is
> > to check if the device is as was assumed (this time RTC and it is). The
> > chip's values are incorrect but the chip works, even the m41t00 chip
> > manual states that after initial powerup (RTC battery power applied)
> > internal registers will contain random data.
> >
> > There are two solutions first is driver patch and another is i2c-dev and
> > i2cset tool to use from user space during bootup. Whitch one should be used?
Given we transitioned to the new i2c model, which mandates
a platform device to be declared, there's no more the need
to check for the device in the probing function.
this should be fixed in the driver.
however, a driver may still return a failure when reading
the time if there are inappropriate values in the registers.
the solution is to patch the driver for detection and then
use a recent hwclock on bootup to write the time if required.
--
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