From patchwork Fri Sep 7 10:19:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 1421111 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 87FBB3FC85 for ; Fri, 7 Sep 2012 10:19:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932942Ab2IGKTs (ORCPT ); Fri, 7 Sep 2012 06:19:48 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]:46113 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932651Ab2IGKTs (ORCPT ); Fri, 7 Sep 2012 06:19:48 -0400 Received: by mail-bk0-f46.google.com with SMTP id j10so1284302bkw.19 for ; Fri, 07 Sep 2012 03:19:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=EnbX20gP3I8v+L2KVpe8ffvtVQ6jYWQYpWsE2HNWIzE=; b=dg21XhMjHbLptN+5a+axCG1XKqqH/kONZQ94xchTQBAjW0kn1N7y7P/AIivGRx3Rla tVcByUZXDio2u7Hjs6Cqt/gnkHf/hIj4KstaXXNRbQvid/5QVsNZGqBsGTwzv1JHU+DR gxmR1uqcDJHsfQHzSqT7zK7O1SgBIsK3Rks+x3HBZwhdWuTZ5CRqFe2J7WB8PPwXwHuF 9B2t+Sp5JyIQDxEOJoLEak9LyB+EVACJ8O3QIsxNA6K0Hj1SzEc1I6JuUw2iLezIBe0u wvvDdKosZ5Xs4D86YGHstLNVsO1zFGzrM4CaHenkVIh/JL0Mzfw41q3Cy4i6eZJd9xUM roWQ== Received: by 10.204.152.211 with SMTP id h19mr2415140bkw.45.1347013187391; Fri, 07 Sep 2012 03:19:47 -0700 (PDT) Received: from localhost.localdomain (AToulouse-651-1-16-21.w92-149.abo.wanadoo.fr. [92.149.191.21]) by mx.google.com with ESMTPS id n5sm3018481bkv.14.2012.09.07.03.19.44 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 07 Sep 2012 03:19:46 -0700 (PDT) From: Daniel Lezcano To: rjw@sisk.pl, lenb@kernel.org Cc: linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org, patches@linaro.org, linaro-dev@lists.linaro.org, pdeschrijver@nvidia.com, lorenzo.pieralisi@arm.com Subject: [PATCH 4/6] cpuidle : add a pointer for cpuidle_state in the cpuidle_device Date: Fri, 7 Sep 2012 12:19:30 +0200 Message-Id: <1347013172-12465-5-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1347013172-12465-1-git-send-email-daniel.lezcano@linaro.org> References: <1347013172-12465-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQkEpdSxvY/UaaCQx/6PMT7TS5ZLobFheCetQsTklxRrOccnXyysM5qx5IitXERwvRpGPV0+ Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org This patch adds a pointer to the cpuidle_state array in the cpuidle_device structure. When the cpuidle_device is initialized, the pointer is assigned from the driver's cpuidle states array. Signed-off-by: Daniel Lezcano Acked-by: Santosh Shilimkar Acked-by: Peter De Schrijver Tested-by: Peter De Schrijver --- drivers/cpuidle/cpuidle.c | 4 +++- include/linux/cpuidle.h | 1 + 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index e28f6ea..ef0e936 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -317,8 +317,10 @@ int cpuidle_enable_device(struct cpuidle_device *dev) return 0; if (!drv || !cpuidle_curr_governor) return -EIO; - if (!dev->state_count) + if (!dev->state_count) { dev->state_count = drv->state_count; + dev->states = drv->states; + } if (dev->registered == 0) { ret = __cpuidle_register_device(dev); diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 279b1ea..5cf18b5 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -96,6 +96,7 @@ struct cpuidle_device { int last_residency; int state_count; + struct cpuidle_state *states; struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX]; struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX];