linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Anton Vorontsov <avorontsov@mvista.com>
Cc: "a.zummo@towertech.it" <a.zummo@towertech.it>,
	"rtc-linux@googlegroups.com" <rtc-linux@googlegroups.com>,
	"p_gortmaker@yahoo.com" <p_gortmaker@yahoo.com>,
	Jain Priyanka-B32167 <B32167@freescale.com>,
	Tabi Timur-B04825 <B04825@freescale.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [rtc-linux] Re: [PATCH] Add support for pt7c4338 (rtc device) in rtc-ds1307 driver
Date: Fri, 3 Jun 2011 12:03:05 -0600	[thread overview]
Message-ID: <20110603180305.GF15616@ponder.secretlab.ca> (raw)
In-Reply-To: <20110530165745.GA2758@oksana.dev.rtsoft.ru>

On Mon, May 30, 2011 at 08:57:45PM +0400, Anton Vorontsov wrote:
> On Mon, May 30, 2011 at 02:29:58PM +0000, Tabi Timur-B04825 wrote:
> > On Mon, May 30, 2011 at 3:24 AM, Wolfram Sang <w.sang@pengutronix.de> wrote:
> > 
> > > The first place where this should be mentioned is the datasheet of the
> > > pt-chip, so you might ask the producer to add this information (don't
> > > expect much to happen, though).
> > 
> > It's true that the data sheet does not mention that it's identical to
> > the DS1307, but that's still no excuse for not noticing it and writing
> > a whole driver for it.  :-(
> > 
> > > IIRC I asked you explicitly for the differences between the chips. If
> > > there are none, you can use the driver directly, right? :)
> > 
> > Yes.  The device tree node for the PT7C4338 device should just say
> > 
> >    /* The board has a PT7C4338, which is compatible with the DS1307 */
> >    compatible = "dallas,ds1307";
> 
> While it seems to be 100% compatible, there could be chip-specific
> bugs or some interesting features that are hidden behind "reserved"
> bits and registers.
> 
> So I think device tree should not lie about the chip model. Doing
> 'compatible = "pericom,pt7c4338", "dallas,ds1307"' is perfectly fine.

Correct.  It's fine (and encouraged) to claim compatibility, but the
node should always specify the exact part in the compatible list.

> 
> Note that today the several compatible entries approach gives you
> almost nothing, as you will need to add pt7c4338 entry into the driver
> anyway.
> 
> I tried to improve this, i.e. make linux do OF-matching on the most
> generic compatible entry (the last one):
> 
> http://www.mail-archive.com/linuxppc-dev@lists.ozlabs.org/msg21196.html
> 
> It was received coldly though:
> 
> http://www.mail-archive.com/linuxppc-dev@lists.ozlabs.org/msg22041.html
> http://www.mail-archive.com/linuxppc-dev@lists.ozlabs.org/msg21273.html

On that note, device-tree-style of_match_table binding now works for
i2c devices, so the problems you were having with that thread should
now be solved.

The of_find_i2c_driver() approach was only ever a heuristic to get
things working in the short term.  of_match_table is is better in the
long run.

g.

      reply	other threads:[~2011-06-03 18:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-26  7:03 [PATCH] Add support for pt7c4338 (rtc device) in rtc-ds1307 driver Priyanka Jain
2011-05-26  9:10 ` Wolfram Sang
2011-05-30  4:47   ` Jain Priyanka-B32167
2011-05-30  8:24     ` Wolfram Sang
2011-05-30 14:29       ` [rtc-linux] " Tabi Timur-B04825
2011-05-30 14:50         ` Wolfram Sang
2011-05-30 16:57         ` Anton Vorontsov
2011-06-03 18:03           ` Grant Likely [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=20110603180305.GF15616@ponder.secretlab.ca \
    --to=grant.likely@secretlab.ca \
    --cc=B04825@freescale.com \
    --cc=B32167@freescale.com \
    --cc=a.zummo@towertech.it \
    --cc=akpm@linux-foundation.org \
    --cc=avorontsov@mvista.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=p_gortmaker@yahoo.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;
as well as URLs for NNTP newsgroup(s).