From patchwork Sun Mar 16 17:03:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Rui X-Patchwork-Id: 3839671 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8898A9F334 for ; Sun, 16 Mar 2014 17:06:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B6D2D20225 for ; Sun, 16 Mar 2014 17:06:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 92DEE20222 for ; Sun, 16 Mar 2014 17:06:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752709AbaCPRGa (ORCPT ); Sun, 16 Mar 2014 13:06:30 -0400 Received: from mga09.intel.com ([134.134.136.24]:56398 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932072AbaCPREG (ORCPT ); Sun, 16 Mar 2014 13:04:06 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 16 Mar 2014 09:59:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,665,1389772800"; d="scan'208";a="501094194" Received: from unknown (HELO rzhang1-mobl4.ccr.corp.intel.com) ([10.255.21.226]) by orsmga002.jf.intel.com with ESMTP; 16 Mar 2014 10:03:38 -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 V3 06/11] ACPI: introduce platform_id flag Date: Mon, 17 Mar 2014 01:03:12 +0800 Message-Id: <1394989397-2733-7-git-send-email-rui.zhang@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1394989397-2733-1-git-send-email-rui.zhang@intel.com> References: <1394989397-2733-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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 | 8 +++++++- include/acpi/acpi_bus.h | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 399257e..58bdc03 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -1679,6 +1679,12 @@ 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 "_" @@ -1729,7 +1735,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 8c5e235..f998746 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -217,7 +217,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 {