Re: [PATCH v2 2/2] gpio: Add a driver for Sodaville GPIO controller

From: Grant Likely
Date: Mon Jul 04 2011 - 12:19:25 EST


On Mon, Jun 27, 2011 at 09:26:23AM +0200, Sebastian Andrzej Siewior wrote:
> Sodaville has GPIO controller behind the PCI bus. To my suprissed it is
> not the same as on PXA.
>
> The interrupt & gpio chip can be referenced from the device tree like
> from any other driver. Unfortunately the driver which uses the gpio
> interrupt has to use irq_of_parse_and_map() instead of
> platform_get_irq(). The problem is that the platform device (which is
> created from the device tree) is most likely created before the
> interrupt chip is registered and therefore irq_of_parse_and_map() fails.
>
> In theory the driver works as module. In reality most of the irq
> functions are not exported to modules and it is possible that _this_
> module is unloaded while the provided irqs are still in use.
>
> Signed-off-by: Hans J. Koch <hjk@xxxxxxxxxxxxx>
> [torbenh@xxxxxxxxxxxxx: make it work after the irq namespace cleanup,
> add some device tree entries.]
> Signed-off-by: Torben Hohn <torbenh@xxxxxxxxxxxxx>
> [bigeasy@xxxxxxxxxxxxx: convert to generic irq & gpio chip]
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
> ---
> .../devicetree/bindings/gpio/sodaville.txt | 48 +++
> arch/x86/platform/ce4100/falconfalls.dts | 7 +-
> drivers/gpio/Kconfig | 8 +
> drivers/gpio/Makefile | 1 +
> drivers/gpio/gpio-sodaville.c | 302 ++++++++++++++++++++

I tried to apply this, but it failed to build:

/home/grant/hacking/linux-2.6/drivers/gpio/gpio-sodaville.c:101:36:
error: expected declaration specifiers or â...â before
âirq_hw_number_tâ
/home/grant/hacking/linux-2.6/drivers/gpio/gpio-sodaville.c: In
function âsdv_xlateâ:
/home/grant/hacking/linux-2.6/drivers/gpio/gpio-sodaville.c:106:15:
error: âstruct irq_domainâ has no member named âof_nodeâ
/home/grant/hacking/linux-2.6/drivers/gpio/gpio-sodaville.c:113:3:
error: âout_hwirqâ undeclared (first use in this function)
/home/grant/hacking/linux-2.6/drivers/gpio/gpio-sodaville.c:113:3:
note: each undeclared identifier is reported only once for each
function it appears in
/home/grant/hacking/linux-2.6/drivers/gpio/gpio-sodaville.c: At top
level:
/home/grant/hacking/linux-2.6/drivers/gpio/gpio-sodaville.c:129:15:
error: variable âirq_domain_sdv_opsâ has initializer but incomplete
type
/home/grant/hacking/linux-2.6/drivers/gpio/gpio-sodaville.c:130:2:
error: unknown field âdt_translateâ specified in initializer
/home/grant/hacking/linux-2.6/drivers/gpio/gpio-sodaville.c:130:2:
warning: excess elements in struct initializer
/home/grant/hacking/linux-2.6/drivers/gpio/gpio-sodaville.c:130:2:
warning: (near initialization for âirq_domain_sdv_opsâ)
/home/grant/hacking/linux-2.6/drivers/gpio/gpio-sodaville.c: In
function âsdv_register_irqsupportâ:
/home/grant/hacking/linux-2.6/drivers/gpio/gpio-sodaville.c:152:8:
error: âstruct irq_domainâ has no member named âirq_baseâ
/home/grant/hacking/linux-2.6/drivers/gpio/gpio-sodaville.c:153:8:
error: âstruct irq_domainâ has no member named âof_nodeâ
/home/grant/hacking/linux-2.6/drivers/gpio/gpio-sodaville.c:154:8:
error: âstruct irq_domainâ has no member named âopsâ
/home/grant/hacking/linux-2.6/drivers/gpio/gpio-sodaville.c:182:2:
error: implicit declaration of function âirq_domain_addâ
/home/grant/hacking/linux-2.6/drivers/gpio/gpio-sodaville.c: In
function âsdv_gpio_removeâ:
/home/grant/hacking/linux-2.6/drivers/gpio/gpio-sodaville.c:263:2:
error: implicit declaration of function âirq_domain_delâ
make[3]: *** [drivers/gpio/gpio-sodaville.o] Error 1
make[3]: *** Waiting for unfinished jobs....
CC kernel/trace/trace_export.o
make[2]: *** [drivers/gpio] Error 2
make[2]: *** Waiting for unfinished jobs....

I assume there is a missing #include, you can either send a fixup
patch or a new version, your choice.

Also...

> diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
> index 0fbdd75..cc6d662 100644
> --- a/drivers/gpio/Makefile
> +++ b/drivers/gpio/Makefile
> @@ -41,6 +41,7 @@ obj-$(CONFIG_GPIO_S5PV210) += gpio-s5pv210.o
>
> obj-$(CONFIG_GPIO_SCH) += gpio-sch.o
> obj-$(CONFIG_GPIO_STMPE) += gpio-stmpe.o
> +obj-$(CONFIG_GPIO_SODAVILLE) += gpio-sodaville.o
> obj-$(CONFIG_GPIO_SX150X) += gpio-sx150x.o
> obj-$(CONFIG_GPIO_TC3589X) += gpio-tc3589x.o
> obj-$(CONFIG_ARCH_TEGRA) += gpio-tegra.o

Last I checked, SO comes before ST in alphabetized lists. :-)

g.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/