linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Sylvain Munaut <tnt@246tNt.com>
To: Dan Malek <dan@embeddededge.com>
Cc: Linux/PPC Development <linuxppc-dev@ozlabs.org>,
	linux-arm-kernel@lists.arm.linux.org.uk,
	Linux Kernel Development <linux-kernel@vger.kernel.org>,
	Embedded PPC Linux list <linuxppc-embedded@ozlabs.org>
Subject: Re: Second Attempt: Driver model usage on embedded processors
Date: Wed, 08 Dec 2004 15:53:32 +0100	[thread overview]
Message-ID: <41B7156C.2000702@246tNt.com> (raw)
In-Reply-To: <CC280DE6-485F-11D9-AEAC-003065F9B7DC@embeddededge.com>

Dan Malek wrote:

> Why don't you just use the feature_call() model like we currently
> use for PowerPC on the PMac?  Isolate those places in the driver
> that need that information and call the function with a 
> selector/information
> request (and varargs) to get it. 


> For example,
> a driver could:
>
> feature_call(SOC_FTR, Fast_Ethernet1, INIT_IO_PINS);
>
> to configure the IO pins associated with the device, then it could:
>
> feature_call(SOC_FTR, Fast_Ethernet1, GET_CLKS, &txclk, &rxclk);
>
> to get the routing for the transmit and receive clocks, and finally:
>
> feature_call(SOC_FTR, Fast_Ethernet1, GET_PHY_IRQ, &phy_irq);
>
> to get the external interrupt number associated with the PHY.
>

FWIW, I really like this model.

Just as another example, for the I2C driver i2c-mpc, almost the only
variation between model is the clock selection and that forced to put
some processor specific stuff into the driver. With that model, you could
easly avoid theses platform/cpu specific stuff and isolate them.

USB with some really alike bus glues comes to mind too ...

Being able to do "action" in plus of just passing parameters is really nice
IMHO.


    Sylvain

  reply	other threads:[~2004-12-08 14:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-07  5:03 Second Attempt: Driver model usage on embedded processors Kumar Gala
2004-12-07 12:02 ` McMullan, Jason
2004-12-07 14:53 ` Dan Malek
2004-12-08 14:53   ` Sylvain Munaut [this message]
2004-12-08 16:10   ` Andy Fleming
2004-12-08 17:11     ` Dan Malek

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=41B7156C.2000702@246tNt.com \
    --to=tnt@246tnt.com \
    --cc=dan@embeddededge.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=linuxppc-embedded@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).