[i2c] [PATCH] DS1339: oscillator code added.

Rodolfo Giometti giometti at enneenne.com
Tue Jun 26 09:55:11 CEST 2007


On Mon, Jun 25, 2007 at 10:40:31AM -0700, David Brownell wrote:
>  	case ds_1337:
>  	case ds_1339:
> -		ds1307->type = ds_1337;
> -

If you remove this setting, are you sure that here:

        /* assume 20YY not 19YY */
        tmp = t->tm_year - 100;
        buf[DS1307_REG_YEAR] = BIN2BCD(tmp);

        if (ds1307->type == ds_1337)
                buf[DS1307_REG_MONTH] |= DS1337_BIT_CENTURY;
        else if (ds1307->type == ds_1340)
                buf[DS1307_REG_HOUR] |= DS1340_BIT_CENTURY_EN
                                | DS1340_BIT_CENTURY;

the century bit is correct?

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti at enneenne.com
Linux Device Driver                             giometti at gnudd.com
Embedded Systems                     		giometti at linux.it
UNIX programming                     phone:     +39 349 2432127
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.lm-sensors.org/pipermail/i2c/attachments/20070626/063b44ab/attachment.bin 


More information about the i2c mailing list