From patchwork Mon May 25 21:51:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashwin Chaugule X-Patchwork-Id: 6477261 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7CD20C0020 for ; Mon, 25 May 2015 21:52:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 16CAF20414 for ; Mon, 25 May 2015 21:52:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 37BF3203DF for ; Mon, 25 May 2015 21:52:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751209AbbEYVv7 (ORCPT ); Mon, 25 May 2015 17:51:59 -0400 Received: from mail-yk0-f177.google.com ([209.85.160.177]:34048 "EHLO mail-yk0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751215AbbEYVv7 (ORCPT ); Mon, 25 May 2015 17:51:59 -0400 Received: by ykfl8 with SMTP id l8so12591756ykf.1 for ; Mon, 25 May 2015 14:51:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=IQ/Zwip2aLmOsX6q+NolAD6l6n4rllEgBnyw8kqwWAI=; b=Q/iHUuK+BVmUeVwbawc0PvXr623RKQXM8EF15Xb6YPBiGbL1WnX6QVEcLTmxIZ3M6R iZrAm0kJSmrEqM6EP8BS8Ml3jH+jlvTigmLXWSPkLRqjznHQkyRu+eRcJGFZygODhoQ8 +CfJS3X42y3KQPghOMPrXy5KGEds2Oa0uqCLwGF0VAkbT0QGe30jpGUU06FYMZEm2b1T AY50Bs8wXSRXpYtVczjaLoNrSUjRLGHLo2RbKw/K7qBBteOic797IqOY8bDPZ+6y/lYB 9x22z1OyyrOKLyWpiA+ed42mfop3rmzVPankQidARnoPm0s/bqaYufVPrqUVN82vRELe x6tQ== X-Gm-Message-State: ALoCoQlA8r0auoXR0i58NAhHpeJqqmcGx/2fsA4bRAVhIH4JQXkmMFpvkOlAY26DQRf1dUnyNwOx X-Received: by 10.170.84.215 with SMTP id b206mr24399072yka.21.1432590718366; Mon, 25 May 2015 14:51:58 -0700 (PDT) Received: from esagroth.lan (cpe-174-109-47-171.nc.res.rr.com. [174.109.47.171]) by mx.google.com with ESMTPSA id c23sm9855418yha.45.2015.05.25.14.51.57 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 May 2015 14:51:58 -0700 (PDT) From: Ashwin Chaugule To: rjw@rjwysocki.net Cc: linux-pm@vger.kernel.org, linaro-acpi@lists.linaro.org, patches@linaro.org, jaswinder.singh@linaro.org, viresh.kumar@linaro.org, sudeep.holla@arm.com, Ashwin Chaugule Subject: [PATCH v5 5/6] CPPC: Probe for CPPC tables for each ACPI Processor object Date: Mon, 25 May 2015 17:51:51 -0400 Message-Id: <1432590711-9149-1-git-send-email-ashwin.chaugule@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 For each detected ACPI Processor object (ACPI0007), search its device handle for CPPC specific tables (i.e. _CPC) and extract CPU specific performance capabilites. Signed-off-by: Ashwin Chaugule --- drivers/acpi/processor_driver.c | 4 ++++ include/acpi/processor.h | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index f61c09b..8554496 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c @@ -245,6 +245,10 @@ static int __acpi_processor_start(struct acpi_device *device) if (pr->flags.need_hotplug_init) return 0; + result = acpi_cppc_processor_probe(pr); + if (result) + return -ENODEV; + if (!cpuidle_get_driver() || cpuidle_get_driver() == &acpi_idle_driver) acpi_processor_power_init(pr); diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 659edd6..0b51117 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h @@ -339,6 +339,15 @@ phys_cpuid_t acpi_get_phys_id(acpi_handle, int type, u32 acpi_id); int acpi_map_cpuid(phys_cpuid_t phys_id, u32 acpi_id); int acpi_get_cpuid(acpi_handle, int type, u32 acpi_id); +#ifdef CONFIG_ACPI_CPPC +extern int acpi_cppc_processor_probe(struct acpi_processor *pr); +#else +static inline int acpi_cppc_processor_probe(struct acpi_processor *pr) +{ + return 0; +} +#endif /* CONFIG_ACPI_CPPC */ + /* in processor_pdc.c */ void acpi_processor_set_pdc(acpi_handle handle);