From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Alexander Clouter <alex@digriz.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: driver model advice
Date: Mon, 8 Jun 2009 08:36:36 +0200 [thread overview]
Message-ID: <10f740e80906072336n5e7b3d4te5834ff89b277bd0@mail.gmail.com> (raw)
In-Reply-To: <20090607224519.GO2014@woodchuck>
On Mon, Jun 8, 2009 at 00:45, Alexander Clouter<alex@digriz.org.uk> wrote:
> For a while I have been maintaining the TS-7800 mainline support[1] and
> decided to attempt to properly address support for the FPGA on the
> board.
>
> Currently the solution I'm using[2] is not very flexible and scalable as
> for every device that is added the platform code grows with it. I also
> think it's just not very pretty.
>
> I have been reading various sources of documentation regarding the
> driver model and relevant sections in the LDD tomb and felt that making
> the FPGA behave as a bus seemed a neat way to do things.
>
> A quick overview of the approach I'm using is that the bus code adds and
> removes the devices depending on the bus's state ('online' or
> 'offline'). When going online (or as new drivers are insmod'ed) the bus
> decides if the 'discover' function should be executed depending on the
> FPGA bitstream magic number and then if the driver's discover() function
> decides the device is present it is added to the bus.
You can make it a separate bus...
> The code for my amendments can be found (it's 30kB hence why it's not
> inline), it's been written against 2.6.30-rc7:
>
> http://stuff.digriz.org.uk/ts78xx-fpga/fpga-device-work.diff
>
> and the my .config file is:
>
> http://stuff.digriz.org.uk/ts78xx-fpga/ts78xx.config
>
> One thing that might make people 'queasy' is that there is some wrapper
> code for platform drivers. Although all the examples I have coded up
> use platform drivers and create platform devices, there are some drivers
> that are non-platform based in the works (GPIO, AVR, ISA bus, etc). I
> felt the appropriate approach was (bearing in mind that different FPGA
> bitstreams implement possibly overlapping/partial duplicate
> functionality) to use a platform wrapper, the platform device being a
> child of my ts78xx-fgpa device.
... or you can make the ts78xx-fpga device a multi-function device
(drivers/mfd).
(In case the mfd-ers read this: recently I've been looking at using the mfd code
for Amiga Zorro expansion boards. As most Zorro boards are made from discrete
components, several of them are actually multi-function devices,
which prohibits
me from just using zorro_driver).
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
prev parent reply other threads:[~2009-06-08 6:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-07 22:45 Alexander Clouter
2009-06-08 6:36 ` Geert Uytterhoeven [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=10f740e80906072336n5e7b3d4te5834ff89b277bd0@mail.gmail.com \
--to=geert@linux-m68k.org \
--cc=alex@digriz.org.uk \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®