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: 4113191 Return-Path: X-Original-To: patchwork-linux-arm@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 70544BFF02 for ; Mon, 5 May 2014 09:30:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A6C052024C for ; Mon, 5 May 2014 09:30:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C47F22022D for ; Mon, 5 May 2014 09:30:04 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WhFBu-0006xd-9K; Mon, 05 May 2014 09:28:06 +0000 Received: from mail-pa0-f42.google.com ([209.85.220.42]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WhFBk-0006qE-RB for linux-arm-kernel@lists.infradead.org; Mon, 05 May 2014 09:27:57 +0000 Received: by mail-pa0-f42.google.com with SMTP id bj1so9185878pad.29 for ; Mon, 05 May 2014 02:27:39 -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:in-reply-to :references; bh=ARXGsT0v+MkLAjS06fzgrvzZLSjC6KTEapISJ/2dYlo=; b=SPNCgIRiB6KrZ7fZqxFNE78Cgp8tR7OLYSdCYhXpGa4shz+W77at5Y3P7WtQ0TbzPk LxlwJyY5xoN9T9cNNFrK2RspeB8mhPBr/E3SavcDk40h9fi21Pj7FvxQ2gF1zZJDjfLp NZRxOgRR2W9fIPyIPpNiuW4Jg8wK9YaTzta4qi1RX+Ztb8d0zV8IFvhXIBKqo+2X+Yxl nDxK0fd6CwvpB9aGphsZWyxbzZvUXU44Br/dHiaEI02xPB/4rWOEZsxDpiLrlwAqJhf3 hiuWqQzxcuypesCeP6Ct20NqSr2a2ZISMJIZAu3Q9s1fqwp4yiQ42i/X2BtxLQFGh26i htAA== X-Gm-Message-State: ALoCoQneBbFqXjcSH5CHPxxDYgRzpgbrKI43HS6lEfL71MUV861xdBy03xrLgjizgJKKYJUAxAVZ 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140505_022756_898990_0D4B5B90 X-CRM114-Status: GOOD ( 14.65 ) X-Spam-Score: -0.7 (/) Cc: Chander Kashyap , kgene.kim@samsung.com, daniel.lezcano@linaro.org, rjw@rjwysocki.net, Chander Kashyap , lorenzo.pieralisi@arm.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,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 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