From patchwork Sun Jul 29 18:48:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Witold Szczeponik X-Patchwork-Id: 1252731 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 32DE23FC33 for ; Sun, 29 Jul 2012 18:48:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753377Ab2G2Ss0 (ORCPT ); Sun, 29 Jul 2012 14:48:26 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:40641 "HELO mailout-de.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753375Ab2G2Ss0 (ORCPT ); Sun, 29 Jul 2012 14:48:26 -0400 Received: (qmail invoked by alias); 29 Jul 2012 18:48:24 -0000 Received: from mnhm-590c28e3.pool.mediaWays.net (EHLO [10.239.1.176]) [89.12.40.227] by mail.gmx.net (mp029) with SMTP; 29 Jul 2012 20:48:24 +0200 X-Authenticated: #787645 X-Provags-ID: V01U2FsdGVkX1/Xq0Mqt6XXP4B+UElfcKzTXli/qF99Yv/YDGToL4 FOYcJyU0/2L7zv Message-ID: <50158577.7060908@gmx.net> Date: Sun, 29 Jul 2012 20:48:23 +0200 From: Witold Szczeponik User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: bhelgaas@google.com, lenb@kernel.org CC: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org Subject: [PATCH V3 2/3] PNP: Allow resources to be set as disabled References: <50158321.4030007@gmx.net> In-Reply-To: <50158321.4030007@gmx.net> X-Enigmail-Version: 1.5a1pre X-Y-GMX-Trusted: 0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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 "" 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 "" 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.5.x. Signed-off-by: Witold Szczeponik Reviewed-by: Bjorn Helgaas --- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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, "", 6)) { + buf += 6; + *flags |= IORESOURCE_DISABLED; + } else if (start) { *start = simple_strtoull(buf, &buf, 0); if (end) { buf = skip_spaces(buf);