[PATCH V2 2/3] PNP: Allow resources to be set as disabled

From: Witold Szczeponik
Date: Wed Apr 11 2012 - 16:50:02 EST


This patch allows to set PNP resources as "disabled". As such, the patch is
a follow-up to commit 18fd470a48396c8795ba7256c5973e92ffa25cb3 where parsing
of ACPI PNP resources that can be disabled was made possible.

The patch achieves this by allowing the strings "disabled" and "<none>" to be
used as a valid PNP resource value. The value "disabled" is used because it
also appears when reporting PNP resources, whereas the string "<none>" is
used when reporting PNP options.

The patch is required in order to support the setting of "disabled" IRQs like
described in the commit 29df8d8f8702f0f53c1375015f09f04bc8d023c1, i.e., with
this patch applied, some vintage IBM ThinkPads like the 600E can allocate the
resources such that all devices can be used simultaneously.

The patch is applied against Linux 3.3.x.


Signed-off-by: Witold Szczeponik <Witold.Szczeponik@xxxxxxx>


Index: linux/drivers/pnp/interface.c
===================================================================
--- linux.orig/drivers/pnp/interface.c
+++ linux/drivers/pnp/interface.c
@@ -311,10 +311,14 @@ static char *pnp_get_resource_value(char
if (flags)
*flags = 0;

- /* TBD: allow for disabled resources */
-
buf = skip_spaces(buf);
- if (start) {
+ if (flags && !strnicmp(buf, "disabled", 8)) {
+ buf += 8;
+ *flags |= IORESOURCE_DISABLED;
+ } else if (flags && !strnicmp(buf, "<none>", 6)) {
+ buf += 6;
+ *flags |= IORESOURCE_DISABLED;
+ } else if (start) {
*start = simple_strtoull(buf, &buf, 0);
if (end) {
buf = skip_spaces(buf);
--
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/