devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: "jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
	<jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
	Thomas Petazzoni
	<thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: CPU revision IDs
Date: Fri, 13 Jun 2014 15:20:22 +0200	[thread overview]
Message-ID: <20140613132022.GJ3448@lukather> (raw)
In-Reply-To: <CAKON4Ox+tCgiu6N988ds7ED2KbECw=60Y6BRqV_2UcM+vshw4Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1801 bytes --]

On Fri, Jun 13, 2014 at 09:14:45AM -0400, jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:
> On Fri, Jun 13, 2014 at 9:08 AM, Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org> wrote:
> > On Friday 13 June 2014 09:05:14 jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:
> >> I was adding the CPU revision ID to the top level compatible string,
> >> nothing specific to the device.  By knowing the CPU revision I know
> >> which errata to apply.
> >>
> >> If you patch the device strings, then you have to maintain knowledge
> >> of which devices are broken in two places -- the device driver and the
> >> machine file where you are patching the strings.
> >
> > IMHO, the driver only has to know what device versions exist, it
> > shouldn't need to know which soc has which version of the device.
> >
> > Can you describe which kind of quirk you are looking at in the driver,
> > and how common it is?
> 
> Allwinner wired the volume control for their on-chip codec up
> backwards on the A revsion of the the A10 chip. In later revisions is
> it fixed to work in the right direction.
> 
> I was wanting to add code like this to the device driver...
> 
> if (of_machine_is_compatible("allwinner,sun7i-a20a")) {
>       fix bug
> }
> 
> Another solution would be for me to detect the chip revision in the
> init code of the driver and remember it.

The point is that you don't have that kind of constructs. You can
associate any number of compatibles to your driver, and data to each
of these compatibles. So, with different compatibles, you will be
probed and retrieved these data directly, without even having this in
your driver.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2014-06-13 13:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-13 12:29 CPU revision IDs jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
     [not found] ` <CAKON4OwNULPeQFHwRhRfri86yexMvvKfrw_dthim4_oPWvMD3g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-13 12:43   ` Thomas Petazzoni
     [not found]     ` <20140613144355.20412fa6-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-06-13 12:56       ` Arnd Bergmann
2014-06-13 13:05         ` jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
     [not found]           ` <CAKON4OxzJ7UoKnMgf+sckksjG-rx8NG1tUvPj2qaHNsda0j3jQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-13 13:08             ` Arnd Bergmann
2014-06-13 13:14               ` jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
     [not found]                 ` <CAKON4Ox+tCgiu6N988ds7ED2KbECw=60Y6BRqV_2UcM+vshw4Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-13 13:20                   ` Maxime Ripard [this message]
2014-06-13 13:34                     ` jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
     [not found]                       ` <CAKON4OxZLaL9sJFPjnUhec_LMZKGvGXrKyUjW-whHzY6byVUxw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-13 13:58                         ` Maxime Ripard
2014-06-13 14:37                           ` jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
     [not found]                             ` <CAKON4Oz44X7G+yM2R-XX_D_6FV4ekWiOKY2t_p0Y3+gUXJ17iw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-18  8:07                               ` Maxime Ripard

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=20140613132022.GJ3448@lukather \
    --to=maxime.ripard-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.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;
as well as URLs for NNTP newsgroup(s).