From patchwork Mon Apr 7 16:06:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Rui X-Patchwork-Id: 3946561 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 ED637BFF02 for ; Mon, 7 Apr 2014 17:35:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 127882027D for ; Mon, 7 Apr 2014 17:35:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3099E20268 for ; Mon, 7 Apr 2014 17:35:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755523AbaDGReg (ORCPT ); Mon, 7 Apr 2014 13:34:36 -0400 Received: from mga09.intel.com ([134.134.136.24]:62689 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755564AbaDGRbZ (ORCPT ); Mon, 7 Apr 2014 13:31:25 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 07 Apr 2014 09:04:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,810,1389772800"; d="scan'208";a="516253386" Received: from unknown (HELO rzhang1-mobl4.ccr.corp.intel.com) ([10.255.20.33]) by orsmga002.jf.intel.com with ESMTP; 07 Apr 2014 09:07:30 -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, Zhang Rui Subject: [PATCH V5 06/12] ACPI: introduce platform_id flag Date: Tue, 8 Apr 2014 00:06:53 +0800 Message-Id: <1396886819-2637-7-git-send-email-rui.zhang@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1396886819-2637-1-git-send-email-rui.zhang@intel.com> References: <1396886819-2637-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.2 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 c82ab73..451e7d9 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 {