From patchwork Wed May 14 08:03:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chander Kashyap X-Patchwork-Id: 4173491 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 6D33DBFF02 for ; Wed, 14 May 2014 08:05:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 94AB22035C for ; Wed, 14 May 2014 08:05:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BAB3B2034E for ; Wed, 14 May 2014 08:05:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753151AbaENIE2 (ORCPT ); Wed, 14 May 2014 04:04:28 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:35978 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752993AbaENIET (ORCPT ); Wed, 14 May 2014 04:04:19 -0400 Received: by mail-pa0-f49.google.com with SMTP id lj1so1361883pab.8 for ; Wed, 14 May 2014 01:04:19 -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=J8fYR0s7WgWskZ+2ihcafX71p7K2oACCZBNWxrtbEhpeM3o6M2BOjj2U1KY+aI1nPl 4LizVMvpuqoGG0+XN7qb3yBojJY0gFaNwmE7qKP27Xiuvy5xw1n8vPV3oLhJV/xaT+rz 5YuOvNN/IrMLK8P5V9S3HoDIWYihqoVl64PMNIyESfdN0eUUHkgQeKBroBgplLT85CuP z+brPGL6e0XYdHfXzmWyxxZiBjN+aYOeWXYeH5t8oSGAUpesDI2a4oz+IUqPJZnswQ/Z qjJ42EK4pUVOF3NKftThj1zAKPddD3KZNe0vDRG4rXrY2sWt2bJZnxW6RY1wZApZZhWd Pdpw== X-Gm-Message-State: ALoCoQlKohhTYYaz8jBqoNSfwJHC+DVftPNOpJaZ3RQBPQZSAu6fi92MC3awLywb6PMoVTREwj2X X-Received: by 10.66.163.2 with SMTP id ye2mr2532019pab.110.1400054659090; Wed, 14 May 2014 01:04:19 -0700 (PDT) Received: from localhost.localdomain ([14.140.216.146]) by mx.google.com with ESMTPSA id as12sm4807422pac.43.2014.05.14.01.04.14 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 May 2014 01:04:18 -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: daniel.lezcano@linaro.org, lorenzo.pieralisi@arm.com, rjw@rjwysocki.net, kgene.kim@samsung.com, Chander Kashyap , Chander Kashyap Subject: [PATCH v5 1/6] driver: cpuidle-big-little: add of_device_id structure Date: Wed, 14 May 2014 13:33:52 +0530 Message-Id: <1400054637-21505-2-git-send-email-chander.kashyap@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1400054637-21505-1-git-send-email-chander.kashyap@linaro.org> References: <1400054637-21505-1-git-send-email-chander.kashyap@linaro.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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