Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Kumba <kumba@gentoo.org>
To: Linux MIPS List <linux-mips@linux-mips.org>
Subject: [PATCH 0/2]: Add support for Dallas/Maxim DS1685/1687 RTC
Date: Tue, 15 Feb 2011 06:38:10 -0500	[thread overview]
Message-ID: <4D5A65A2.7040101@gentoo.org> (raw)

Okay, it's been a while since I last did this, so bear with me if I make any 
mistakes.

Following this are two parts of a patch to add an RTC class driver for the 
Dallas/Maxim DS1685/1687 RTC chip.  I'm routing it through this ML because A) I 
don't know any better and B) only the SGI O2 currently makes use of it.  Plus 
people here have a really keen eye for things and can tell me if I need to do 
something better.

The first patch is derived from an older version of the DS1685 driver I found on 
Google. That patch apparently made it up to akpm's -mm branch, but never made it 
into a -mm release and as far as I can tell, died at some undetermined point.  I 
haven't tried contacting the original author, either.  I just used the DS1685 
data sheet, O2's original CMOS RTC driver, and the old code for the IP30 
(Octane) RTC driver (which is the same chip) to get this working.

The second patch adds in the IP32-specific bits.  I can't think of a sane way to 
avoid mixing arch-specific code with generic code, but the register padding that 
IP32 needs is, as far as I can tell, unavoidable.  The second patch also adds in 
minor differences for the DS17285/17287 RTC, which is extremely similar to the 1685.

IRIX suggests IP32 is supposed to have the 17287 chips by default, but I 
examined four separate O2 boards and all of them have DS1687-5 chips.  Even two 
of my Octane system boards had DS1687-5 chips.  But the differences were minor 
enough, that they can be enabled by flipping a menuconfig item.  You can even 
run them w/ a 1687-5 chip with no ill effects.

Also, the second patch removes the old RTC access code from IP32, but it does 
NOT touch the power down code.  That can be modified to include the ds1685.h 
file and allow for the deletion of 17287rtc.h down the road.  The current RTC 
framework doesn't appear to support the extended registers used for power down 
anyways, so there's no way to build this into the driver itself.  Though it 
wouldn't be very hard to add it once the base RTC class code picks up the support.

Thoughts?
-- 
Joshua Kinard
Gentoo/MIPS
kumba@gentoo.org

"The past tempts us, the present confuses us, the future frightens us.  And our 
lives slip away, moment by moment, lost in that vast, terrible in-between."

--Emperor Turhan, Centauri Republic

                 reply	other threads:[~2011-02-15 11:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4D5A65A2.7040101@gentoo.org \
    --to=kumba@gentoo.org \
    --cc=linux-mips@linux-mips.org \
    /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