From patchwork Mon Jun 16 10:26:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chander Kashyap X-Patchwork-Id: 31927 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1CDBC20E7A for ; Mon, 16 Jun 2014 10:27:09 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id kq14sf4850401pab.4 for ; Mon, 16 Jun 2014 03:27:09 -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=ZLt4esmVq+q7wIbsZc7NDi488bflhBMNuBebP1AUjec=; b=dnKhZdFnNj9gkI1sr5zEfzpw0t1p13+9vpZpV2zQzKMtM/arDYSNFAup+xgSeb0V9Q jKT/i1bUfMWsCvyezAGKbro5haUWIQBmn0gkk46j3yVamMQSn3yF95pjt7xEgcOjx/g5 8wGMSzd2wGJ8GCi2/cUj4/kYGjvS1HTSM0rvCl/vavYJZZ3HyMjrfGWUwF06kkWZlT9B 0cSHOnMSHNmkuPgIFHup58DSDgJoRvvzcgo9lq2h3Rx/uDBWpnXqU/Y46mhhPLm3KYo9 LUyeBh6X8N6JqFMPHUKl+kVtbR3CPLrYIcl5aul0sDsv3bf7p9mcqeR2fX7plZ8vdlLZ 6r0Q== X-Gm-Message-State: ALoCoQkT347U5Yo5LYsgywX3Yxf4NAm85PDQtlR80GmeESXdNBIf9Kse7ybfkhaqO+LBqoGinPuf X-Received: by 10.66.216.130 with SMTP id oq2mr410956pac.44.1402914429294; Mon, 16 Jun 2014 03:27:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.95.6 with SMTP id h6ls1989171qge.45.gmail; Mon, 16 Jun 2014 03:27:09 -0700 (PDT) X-Received: by 10.52.141.74 with SMTP id rm10mr13102286vdb.6.1402914429128; Mon, 16 Jun 2014 03:27:09 -0700 (PDT) Received: from mail-vc0-x22b.google.com (mail-vc0-x22b.google.com [2607:f8b0:400c:c03::22b]) by mx.google.com with ESMTPS id vs2si1250058vcb.69.2014.06.16.03.27.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 03:27:09 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::22b as permitted sender) client-ip=2607:f8b0:400c:c03::22b; Received: by mail-vc0-f171.google.com with SMTP id id10so4646497vcb.2 for ; Mon, 16 Jun 2014 03:27:09 -0700 (PDT) X-Received: by 10.52.52.168 with SMTP id u8mr13041692vdo.25.1402914429037; Mon, 16 Jun 2014 03:27:09 -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.221.54.6 with SMTP id vs6csp124197vcb; Mon, 16 Jun 2014 03:27:08 -0700 (PDT) X-Received: by 10.68.178.194 with SMTP id da2mr22737706pbc.151.1402914428025; Mon, 16 Jun 2014 03:27:08 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ah1si10471911pbc.97.2014.06.16.03.27.07; Mon, 16 Jun 2014 03:27:07 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-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 S1755350AbaFPK0r (ORCPT + 9 others); Mon, 16 Jun 2014 06:26:47 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:32910 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755171AbaFPK0o (ORCPT ); Mon, 16 Jun 2014 06:26:44 -0400 Received: by mail-pd0-f176.google.com with SMTP id ft15so715787pdb.21 for ; Mon, 16 Jun 2014 03:26:43 -0700 (PDT) X-Received: by 10.66.169.136 with SMTP id ae8mr10648505pac.14.1402914403531; Mon, 16 Jun 2014 03:26:43 -0700 (PDT) Received: from localhost.localdomain ([14.140.216.146]) by mx.google.com with ESMTPSA id gr10sm17922046pbc.84.2014.06.16.03.26.39 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 03:26:42 -0700 (PDT) From: Chander Kashyap To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, daniel.lezcano@linaro.org, lorenzo.pieralisi@arm.com, rjw@rjwysocki.net, kgene.kim@samsung.com, tomasz.figa@gmail.com, Chander Kashyap , Chander Kashyap Subject: [Patch v7 1/6] driver: cpuidle-big-little: add of_device_id structure Date: Mon, 16 Jun 2014 15:56:18 +0530 Message-Id: <1402914383-20471-2-git-send-email-k.chander@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1402914383-20471-1-git-send-email-k.chander@samsung.com> References: <1402914383-20471-1-git-send-email-k.chander@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Original-Sender: linux-kernel-owner@vger.kernel.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::22b as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@ 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: , From: Chander Kashyap 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 Reviewed-by: Tomasz Figa Acked-by: Daniel Lezcano --- 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