linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: "Albrecht Dreß" <albrecht.dress@arcor.de>
Cc: linuxppc-dev@ozlabs.org, devicetree-discuss@lists.ozlabs.org
Subject: Re: [Patch] mpc5200b: improve baud rate calculation (reach high baud rates, better accuracy)
Date: Tue, 2 Mar 2010 13:06:44 -0700	[thread overview]
Message-ID: <fa686aa41003021206v773b30d1vef6362704dca9e61@mail.gmail.com> (raw)
In-Reply-To: <14429243.1267517383754.JavaMail.ngmail@webmail14.arcor-online.net>

On Tue, Mar 2, 2010 at 1:09 AM, Albrecht Dre=DF <albrecht.dress@arcor.de> w=
rote:
>> > + =A0 /* Check only once if we are running on a mpc5200b or not */
>> > + =A0 if (is_mpc5200b =3D=3D -1) {
>> > + =A0 =A0 =A0 =A0 =A0 struct device_node *np;
>> > +
>> > + =A0 =A0 =A0 =A0 =A0 np =3D of_find_compatible_node(NULL, NULL, "fsl,=
mpc5200b-immr");
>>
>> This should be handled using a new compatible-entry
>> "fsl,mpc5200b-psc-uart".
>
> I agree that this would be a lot cleaner, but it's also a lot more intrus=
ive. =A0CC'ing the device tree discussion list here... comments, please!!

fsl,mpc5200b-psc-uart is already in the compatible list for all
MPC500b boards currently in the kernel tree.

>> > + =A0 =A0 =A0 =A0 =A0 if (np) {
>> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 is_mpc5200b =3D 1;
>> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_dbg(&op->dev, "mpc5200b: usi=
ng /4 prescaler\n");
>>
>> Does this message respect the fallback case?
>
> See comment above...
>
>> You could also have a set_divisor-function for 5200 and 5200B and set it
>> here
>> in the function struct (one reason less for the static ;))
>
> Hmmm, but then I would need a 'static struct psc_ops mpc5200b_psc_ops', w=
here only two functions differ from the generic 52xx struct as it is implem=
ented now. =A0Using the static int needs less space. =A0However, in combina=
tion with the new compatible entry, it would of course make sense.
>
> Again, any insight from the device tree gurus would be appreciated!

Wolfram is correct, you should set the correct divisor function in the
ops structure.  Much clearer code that way.

g.

  parent reply	other threads:[~2010-03-02 20:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-02  8:09 [Patch] mpc5200b: improve baud rate calculation (reach high baud rates, better accuracy) Albrecht Dreß
2010-03-02  8:28 ` Wolfram Sang
2010-03-02  8:56 ` Albrecht Dreß
2010-03-02 15:27   ` Wolfram Sang
2010-03-02 20:12   ` Grant Likely
2010-03-02 20:06 ` Grant Likely [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-03-01 18:11 Albrecht Dreß
2010-03-02  0:32 ` Wolfram Sang
2010-03-02 20:22 ` Grant Likely

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=fa686aa41003021206v773b30d1vef6362704dca9e61@mail.gmail.com \
    --to=grant.likely@secretlab.ca \
    --cc=albrecht.dress@arcor.de \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=linuxppc-dev@ozlabs.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).