From: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
Michael Schmitz <schmitzmic@gmail.com>
Cc: Linux/m68k <linux-m68k@vger.kernel.org>,
Debian m68k <debian-68k@lists.debian.org>
Subject: Re: [PATCH 7/8] ax88796: Add X-Surf 100 zorro driver providing an ax88796 platform device
Date: Tue, 17 Nov 2015 18:59:19 +0100 [thread overview]
Message-ID: <564B6AF7.3010203@mkarcher.dialup.fu-berlin.de> (raw)
In-Reply-To: <CAMuHMdWVWP+uQ8iYD4PraCcMiQ4oOyno1CDe64R_p6XJzuJZTg@mail.gmail.com>
Hello Geert,
thanks for your comments!
On 17.11.2015 09:16, Geert Uytterhoeven wrote:
>> +static int xsurf100_probe(struct zorro_dev *zdev, const struct zorro_device_id *ent)
>> +{
>> + struct platform_device *pdev;
>> + struct ax_plat_data ax88796_data;
>> + struct resource res[2] = {
>> + DEFINE_RES_IRQ(IRQ_AMIGA_PORTS),
>> + DEFINE_RES_IO(zdev->resource.start + XS1000_8390_BASE, 4 * 0x20)
>> + };
>> + int reg;
>> + u32 reg_offsets[32];
>> +
>> + for (reg = 0; reg < 0x20; reg++)
>> + reg_offsets[reg] = 4;
>> +
>> + ax88796_data.flags = AXFLG_HAS_EEPROM;
>> + ax88796_data.wordlength = 2;
>> + ax88796_data.dcr_val = 0x48;
>> + ax88796_data.rcr_val = 0x40;
>> + ax88796_data.reg_offsets = reg_offsets;
>> +
>> + // TODO: xsurf100 specific accelerated data exchange
>> +
>> + pdev = platform_device_register_resndata(
>> + &zdev->dev, "ax88796", zdev->slotaddr,
>> + res, 2,
>> + &ax88796_data, sizeof ax88796_data);
>> +
>> + // TODO: NULL check
>> + zorro_set_drvdata(zdev, pdev);
> This looks a bit strange to me: storing another platform device in the
> driver-specific data. But I guess it's valid ;-)
We get a zorro device from the amiga subsystem for each XSurf 100 board
installed in the machine. I want to bind the platform driver ax88796 to
a subrange of the address space of the XSurf 100. To get the platform
driver bound, I think I need to create a platform device (for each XSurf
100 Zorro device, so I can't have a static platform device allocated in
the Zorro driver). If I dynamically create a platform device, I have to
save the pointer somewhere, so I can remove the platform device when the
module gets unloaded. For me, the obvious place to store the pointer is
the driver-specific data of the Zorro device.
If you have a different suggestion on how to connect the ax88796
platform driver to a Zorro device that looks less strange to you, I am
happy to learn a different way.
> BTW, as most Zorro boards are made of one or more "discrete" devices
> (e.g. an IDE and Ethernet combo), but only one zorro_driver can bind to it,
> I started converting Zorro drivers to MFD drivers a few years ago.
The mfd framework might in fact be the different way I should learn
about. It feels a bit like the approach I used in xsurf100.c is
reinventing the mfd stuff, but I still have to find good documentation
on how to use the mfd framework. I didn't find anything in
linux/Documentation, and the comments in linux/include/linux/mfd/core.h
have a quite steep learning curve.
> Unfortunately I still haven't finished that.
> It would also make it simpler to embed a normal ax88796 platform device.
I don't see yet how your conversion of present Zorro drivers would help
for this new xsurf100 driver. On the other hand, if you just meant to
point out using a mfd driver instead of the "create platform devices by
hand" approach, *like* you are using for other drivers, I got your point
and you are likely right.
>> +static struct zorro_device_id xsurf100_zorro_tbl[] = {
> const
Of course. Thanks for pointing it out.
BTW: for me, the patch-set was trivially forward-ported by git rebasing
to 4.4-rc1
Kind regards,
Michael Karcher
next prev parent reply other threads:[~2015-11-17 18:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-16 23:33 [PATCH 0/8] Amiga XSurf100 patch series, to be submitted to linux-net Michael Schmitz
2015-11-16 23:33 ` [PATCH 1/8] aX88796: Fix MAC address reading Michael Schmitz
2015-11-16 23:33 ` [PATCH 2/8] ax88796: Attach MII bus only when open Michael Schmitz
2015-11-16 23:33 ` [PATCH 3/8] ax88796: Move mii support functions upwards to prevent need of forward declaration Michael Schmitz
2015-11-16 23:33 ` [PATCH 4/8] ax88796: Do not free IRQ that did not get requested Michael Schmitz
2015-11-16 23:33 ` [PATCH 5/8] ax88796: Add block_input/output hooks to ax_plat_data Michael Schmitz
2015-11-16 23:33 ` [PATCH 6/8] ax88796: add interrupt status callback to platform data Michael Schmitz
2015-11-16 23:33 ` [PATCH 7/8] ax88796: Add X-Surf 100 zorro driver providing an ax88796 platform device Michael Schmitz
2015-11-17 8:16 ` Geert Uytterhoeven
2015-11-17 17:59 ` Michael Karcher [this message]
2015-11-17 20:01 ` Geert Uytterhoeven
2015-11-16 23:33 ` [PATCH 8/8] ax88796: use interrupt status callback for XSurf100 driver Michael Schmitz
2015-11-17 8:18 ` [PATCH 0/8] Amiga XSurf100 patch series, to be submitted to linux-net Geert Uytterhoeven
2015-11-17 18:16 ` Michael Karcher
2015-11-17 20:02 ` Geert Uytterhoeven
2015-11-18 1:52 ` Michael Schmitz
2015-11-18 8:09 ` Geert Uytterhoeven
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=564B6AF7.3010203@mkarcher.dialup.fu-berlin.de \
--to=kernel@mkarcher.dialup.fu-berlin.de \
--cc=debian-68k@lists.debian.org \
--cc=geert@linux-m68k.org \
--cc=linux-m68k@vger.kernel.org \
--cc=schmitzmic@gmail.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