Re: [PATCH] Add VIA VX855 multi-function device support

From: Daniel Drake
Date: Wed Sep 29 2010 - 14:21:52 EST


On 27 September 2010 17:57, Samuel Ortiz <sameo@xxxxxxxxxxxxxxx> wrote:
> We do have an MFD API for registering sub devices as platform devices. See
> mfd_add_devices(). You'd have to define cells (statically or not) and set the
> cell->platform_data pointer properly. I'd prefer to see this driver using this
> API.

Thanks. I've made the change locally but have run into a problem.

mfd_add_devices calls acpi_check_resource_conflict() on each resource.
And as noted in the earlier patch, ACPI also has a region reserved.
Because acpi_check_resource_conflict() says there is a conflict,
mfd_add_devices() bails out before registering the devices.

So I've researched the conflict.
The GPIO driver is trying to reserve region 0x420 - 0x452
ACPI reports a conflict on "PRIE" 0x434

Indeed, 0x434 is something ACPI-specific, so ACPI is right to say "get
off my turf", and actually there are a whole host of non-GPIO things
intermixed with GPIO things within the region 0x420 - 0x452.

So, I thought about making the driver only reserve the 2 ports that it
uses: 0x448, 0x44c

However, ACPI has also reserved 0x448. This is because the XO-1.5 also
uses GPIOs for the lid switch and ebook switch, which are basically
presented to the OS as normal ACPI buttons. This particular byte
includes a range of GPIOs including the ones that ACPI uses internally
(the switches) plus the ones that we want to make available through
the gpio driver.

So, we're running into a limitation with Linux's model that
--
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/