From patchwork Mon May 5 09:27:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chander Kashyap X-Patchwork-Id: 29630 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 51D922055D for ; Mon, 5 May 2014 09:27:47 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id ih12sf6265277qab.4 for ; Mon, 05 May 2014 02:27:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=oBklebk1EbxXv5m0bIOC3KaaUAzU6EN8NP8vKQquP5I=; b=RfpujIl9q7fn42Xdww7YcdTKII2Gw105tkmAwdG8Spuv97f+hWOcR6Q7PPnfyb5V8E NszoZF9ZJGncvYzbYhGLz/A2j3XqXLwVLFWfN3ZKxsQq0cPOy/t6st4tbU2lwYXrrrNw fUVETeIwPQ5kKfbO+BUajfRjL0Ynr3OWLIKrcfrIKX64Q/wZAi8RShUOvXIMQnoYRWd4 mVSMIPsfS655WobLqNRmklhMDRkqXVswFA6Oyk9OuTciFt2Eo16WxXJ2D/IJ51K3X3m4 J76nW8TcJ31SmbdmzHYXKnPjhQcwWvLtv9jbdkfoJexzQVRD/oJtpkdqdatvyvhtaWac Bnow== X-Gm-Message-State: ALoCoQmTkf7KyauQwAVCzmR9OeWSx4WBtYGiV8dSG5zCaSv2NmCYlIN49kSL57lL8g8jRLLRkt/U X-Received: by 10.58.30.78 with SMTP id q14mr16073747veh.10.1399282067050; Mon, 05 May 2014 02:27:47 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.49.112 with SMTP id p103ls2457594qga.41.gmail; Mon, 05 May 2014 02:27:46 -0700 (PDT) X-Received: by 10.221.4.66 with SMTP id ob2mr990331vcb.28.1399282066924; Mon, 05 May 2014 02:27:46 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id z14si1427159vcf.100.2014.05.05.02.27.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 May 2014 02:27:46 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id lg15so5513178vcb.35 for ; Mon, 05 May 2014 02:27:46 -0700 (PDT) X-Received: by 10.58.187.9 with SMTP id fo9mr26996710vec.4.1399282066837; Mon, 05 May 2014 02:27:46 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp125527vcb; Mon, 5 May 2014 02:27:46 -0700 (PDT) X-Received: by 10.66.180.141 with SMTP id do13mr27056438pac.93.1399282066078; Mon, 05 May 2014 02:27:46 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pn4si7860106pac.298.2014.05.05.02.27.45; Mon, 05 May 2014 02:27:45 -0700 (PDT) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755894AbaEEJ1l (ORCPT + 12 others); Mon, 5 May 2014 05:27:41 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:46350 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755478AbaEEJ1k (ORCPT ); Mon, 5 May 2014 05:27:40 -0400 Received: by mail-pa0-f41.google.com with SMTP id lj1so6258888pab.14 for ; Mon, 05 May 2014 02:27:39 -0700 (PDT) X-Received: by 10.66.197.201 with SMTP id iw9mr69386497pac.151.1399282059447; Mon, 05 May 2014 02:27:39 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPSA id ry10sm67210414pab.38.2014.05.05.02.27.34 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 May 2014 02:27:38 -0700 (PDT) From: Chander Kashyap To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: lorenzo.pieralisi@arm.com, daniel.lezcano@linaro.org, rjw@rjwysocki.net, kgene.kim@samsung.com, Chander Kashyap , Chander Kashyap Subject: [Patch v4 1/5] driver: cpuidle-big-little: add of_device_id structure Date: Mon, 5 May 2014 14:57:16 +0530 Message-Id: <1399282040-8995-2-git-send-email-chander.kashyap@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1399282040-8995-1-git-send-email-chander.kashyap@linaro.org> References: <1399278444-8312-3-git-send-email-chander.kashyap@linaro.org> <1399282040-8995-1-git-send-email-chander.kashyap@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: chander.kashyap@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This driver will be used by many big.Little Soc's. As of now it does string matching of hardcoded compatible string to init the driver. This comparison list will keep on growing with addition of new SoC's. Hence add of_device_id structure to collect the compatible strings of SoC's using this driver. Signed-off-by: Chander Kashyap Signed-off-by: Chander Kashyap --- drivers/cpuidle/cpuidle-big_little.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/cpuidle/cpuidle-big_little.c b/drivers/cpuidle/cpuidle-big_little.c index b45fc62..4cd02bd 100644 --- a/drivers/cpuidle/cpuidle-big_little.c +++ b/drivers/cpuidle/cpuidle-big_little.c @@ -163,14 +163,23 @@ static int __init bl_idle_driver_init(struct cpuidle_driver *drv, int cpu_id) return 0; } +static const struct of_device_id compatible_machine_match[] = { + { .compatible = "arm,vexpress,v2p-ca15_a7" }, + {}, +}; + static int __init bl_idle_init(void) { int ret; + struct device_node *root = of_find_node_by_path("/"); + + if (!root) + return -ENODEV; /* * Initialize the driver just for a compliant set of machines */ - if (!of_machine_is_compatible("arm,vexpress,v2p-ca15_a7")) + if (!of_match_node(compatible_machine_match, root)) return -ENODEV; /* * For now the differentiation between little and big cores