lkml.org 
[lkml]   [2012]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH V2 2/3] PNP: Allow resources to be set as disabled
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@gmx.net>


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);

\
 
 \ /
  Last update: 2012-04-11 22:53    [W:0.077 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site