From patchwork Thu May 22 18:02:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Rui" X-Patchwork-Id: 4225361 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DA0E2BF90B for ; Thu, 22 May 2014 18:04:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 158D32037A for ; Thu, 22 May 2014 18:04:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 33A9B201D3 for ; Thu, 22 May 2014 18:04:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752730AbaEVSER (ORCPT ); Thu, 22 May 2014 14:04:17 -0400 Received: from mga02.intel.com ([134.134.136.20]:43912 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751435AbaEVSDg (ORCPT ); Thu, 22 May 2014 14:03:36 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 22 May 2014 11:03:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.98,888,1392192000"; d="scan'208";a="516172129" Received: from unknown (HELO rzhang1-toshiba.ccr.corp.intel.com) ([10.255.20.115]) by orsmga001.jf.intel.com with ESMTP; 22 May 2014 11:03:06 -0700 From: Zhang Rui To: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: bhelgaas@google.com, matthew.garrett@nebula.com, rafael.j.wysocki@intel.com, dmitry.torokhov@gmail.com, mika.westerberg@linux.intel.com, Zhang Rui Subject: [PATCH V7 09/11] ACPI: introduce platform_id flag Date: Fri, 23 May 2014 02:02:31 +0800 Message-Id: <1400781753-2682-10-git-send-email-rui.zhang@intel.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1400781753-2682-1-git-send-email-rui.zhang@intel.com> References: <1400781753-2682-1-git-send-email-rui.zhang@intel.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Only certain kind of ACPI device objects can be enumerated to platform bus. These ACPI device objects include 1. ACPI device objects that have _HID control method. 2. some ACPI device objects that have Linux specified HID strings. In order to distinguish those device objects from the others, a new flag platform_id and a new function acpi_add_platform_id() are introduced in this patch. Currently, only devices with _HID method have this flag set. If you want platform devices to be created for device objects without _HID, use acpi_add_platform_id() when adding artificial Linux-specific ID strings to them. Signed-off-by: Zhang Rui --- drivers/acpi/scan.c | 9 ++++++++- include/acpi/acpi_bus.h | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index e9c2f6f..6d50916 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -1730,6 +1730,13 @@ static void acpi_add_id(struct acpi_device_pnp *pnp, const char *dev_id) pnp->type.hardware_id = 1; } +static void acpi_add_platform_id(struct acpi_device_pnp *pnp, + const char *dev_id) +{ + acpi_add_id(pnp, dev_id); + pnp->type.platform_id = 1; +} + /* * Old IBM workstations have a DSDT bug wherein the SMBus object * lacks the SMBUS01 HID and the methods do not have the necessary "_" @@ -1794,7 +1801,7 @@ static void acpi_set_pnp_ids(acpi_handle handle, struct acpi_device_pnp *pnp, } if (info->valid & ACPI_VALID_HID) - acpi_add_id(pnp, info->hardware_id.string); + acpi_add_platform_id(pnp, info->hardware_id.string); if (info->valid & ACPI_VALID_CID) { cid_list = &info->compatible_id_list; for (i = 0; i < cid_list->count; i++) diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index ba679af..ec92ad3 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -233,7 +233,8 @@ struct acpi_hardware_id { struct acpi_pnp_type { u32 hardware_id:1; u32 bus_address:1; - u32 reserved:30; + u32 platform_id:1; + u32 reserved:29; }; struct acpi_device_pnp {