From patchwork Mon Dec 1 11:41:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 41761 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5A09524001 for ; Mon, 1 Dec 2014 11:42:32 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id f15sf6504783lbj.7 for ; Mon, 01 Dec 2014 03:42:31 -0800 (PST) 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: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=aK9fJBt8wm0+hHGyFPHRFYeojcBB40SoVre5zmgzjMc=; b=GdtqaChBnugvU/SZ0cGxOvkGu1a4HbrYtwq4vjiPqKlrShFcX1zG8qzZIe+B2CtU0S YQsEMS5mnNcrZI5VuXHVRXfc92b9UzMGhlVO96bI4TCfn+EOHv9+mX0fpeYaQU5AF5pL p76/X2+HraFCNh/QoD+MJ+elkCN9VQU9etFsgf5djv972O4mugtxsGh4VrjD1AVNgZbP jWxsGEyNZX1qMVlE9NYyJ7u2wj7qzPlazFk7LgZJ5Sg4MqCUPmleiV/Ya6SrsNGsj7h6 ccO39mW8+JaZv8Ls7mld6lmtDkdaKXd5ud1LIMRvxZvNtKKkzzYzTLbGsBYi1YR/Ea8Z 0t+Q== X-Gm-Message-State: ALoCoQl98RmtjF29ZtPrWXBRqx9ZpltAZHssplthtp/XUQwp62ZgsECgX0aFUrzF0GaYUoD5fXnc X-Received: by 10.180.24.131 with SMTP id u3mr4435455wif.4.1417434151312; Mon, 01 Dec 2014 03:42:31 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.77 with SMTP id be13ls746090lab.40.gmail; Mon, 01 Dec 2014 03:42:30 -0800 (PST) X-Received: by 10.112.150.136 with SMTP id ui8mr56481023lbb.60.1417434150970; Mon, 01 Dec 2014 03:42:30 -0800 (PST) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id k10si8968311lam.2.2014.12.01.03.42.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Dec 2014 03:42:30 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by mail-lb0-f172.google.com with SMTP id u10so8497552lbd.17 for ; Mon, 01 Dec 2014 03:42:30 -0800 (PST) X-Received: by 10.112.14.69 with SMTP id n5mr56333859lbc.34.1417434150865; Mon, 01 Dec 2014 03:42:30 -0800 (PST) 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.112.184.201 with SMTP id ew9csp269077lbc; Mon, 1 Dec 2014 03:42:29 -0800 (PST) X-Received: by 10.67.30.194 with SMTP id kg2mr100693224pad.8.1417434149151; Mon, 01 Dec 2014 03:42:29 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xr5si28398938pbc.116.2014.12.01.03.42.27 for ; Mon, 01 Dec 2014 03:42:29 -0800 (PST) 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 S1753407AbaLALmX (ORCPT + 12 others); Mon, 1 Dec 2014 06:42:23 -0500 Received: from mail-pd0-f171.google.com ([209.85.192.171]:56141 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753409AbaLALmV (ORCPT ); Mon, 1 Dec 2014 06:42:21 -0500 Received: by mail-pd0-f171.google.com with SMTP id y13so10768530pdi.30 for ; Mon, 01 Dec 2014 03:42:21 -0800 (PST) X-Received: by 10.68.202.104 with SMTP id kh8mr99022082pbc.95.1417434141140; Mon, 01 Dec 2014 03:42:21 -0800 (PST) Received: from localhost ([122.166.92.172]) by mx.google.com with ESMTPSA id v4sm17347154pbs.10.2014.12.01.03.42.19 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 01 Dec 2014 03:42:20 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , Arnd Bergmann , Rob Herring , Grant Likely Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Nishanth Menon , Sudeep Holla , Stephen Boyd , devicetree@vger.kernel.org, santosh shilimkar , Lorenzo Pieralisi , Mike Turquette , kesavan.abhilash@gmail.com, catalin.marinas@arm.com, k.chander@samsung.com, olof@lixom.net, ta.omasab@gmail.com, linux-arm-kernel@lists.infradead.org, Viresh Kumar Subject: [RFC V1 8/8] cpufreq: exynos: reuse dt_device.c to create cpufreq platform device Date: Mon, 1 Dec 2014 17:11:29 +0530 Message-Id: X-Mailer: git-send-email 2.0.3.693.g996b0fd In-Reply-To: References: In-Reply-To: References: 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: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) 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: , We now have a common interface for create platform device required to probe cpufreq-dt driver (and others as well). Lets create devices from dt_device.c instead of platform specific code. For exynos, we are updating the blacklist instead of DT because the newer kernel should be backwards compatible with older DT as well. We can update the "compatible" property in DT but it wouldn't make a difference as we already have imx in the blacklist. Signed-off-by: Viresh Kumar --- arch/arm/mach-exynos/exynos.c | 27 ++++++++------------------- drivers/cpufreq/dt_device.c | 6 +++++- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index a1be294..15a4bbd 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c @@ -283,30 +283,17 @@ static void __init exynos_init_irq(void) } static const struct of_device_id exynos_cpufreq_matches[] = { - { .compatible = "samsung,exynos5420", .data = "arm-bL-cpufreq-dt" }, - { .compatible = "samsung,exynos5250", .data = "cpufreq-dt" }, - { .compatible = "samsung,exynos4210", .data = "cpufreq-dt" }, - { .compatible = "samsung,exynos5440", .data = "exynos5440-cpufreq" }, + { .compatible = "samsung,exynos5420" }, + { .compatible = "samsung,exynos5250" }, + { .compatible = "samsung,exynos4210" }, + { .compatible = "samsung,exynos5440" }, { /* sentinel */ } }; -static void __init exynos_cpufreq_init(void) -{ - struct device_node *root = of_find_node_by_path("/"); - const struct of_device_id *match; - - match = of_match_node(exynos_cpufreq_matches, root); - if (!match) { - platform_device_register_simple("exynos-cpufreq", -1, NULL, 0); - return; - } - - platform_device_register_simple(match->data, -1, NULL, 0); -} - static void __init exynos_dt_machine_init(void) { struct device_node *i2c_np; + struct device_node *root = of_find_node_by_path("/"); const char *i2c_compat = "samsung,s3c2440-i2c"; unsigned int tmp; int id; @@ -343,7 +330,9 @@ static void __init exynos_dt_machine_init(void) of_machine_is_compatible("samsung,exynos5250")) platform_device_register(&exynos_cpuidle); - exynos_cpufreq_init(); + /* Other devices are created by dt_device.c */ + if (!of_match_node(exynos_cpufreq_matches, root)) + platform_device_register_simple("exynos-cpufreq", -1, NULL, 0); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); } diff --git a/drivers/cpufreq/dt_device.c b/drivers/cpufreq/dt_device.c index 8b5ac05..bc4bc97 100644 --- a/drivers/cpufreq/dt_device.c +++ b/drivers/cpufreq/dt_device.c @@ -24,6 +24,9 @@ static const struct of_device_id compatible_machine_match[] = { { .compatible = "arm-bL-cpufreq-dt", .data = "arm-bL-cpufreq-dt" }, /* BLACKLIST of existing users of cpufreq-dt below */ + { .compatible = "samsung,exynos5250", .data = "cpufreq-dt" }, + { .compatible = "samsung,exynos4210", .data = "cpufreq-dt" }, + { .compatible = "fsl,imx27", .data = "cpufreq-dt" }, { .compatible = "fsl,imx51", .data = "cpufreq-dt" }, @@ -38,9 +41,10 @@ static const struct of_device_id compatible_machine_match[] = { { .compatible = "calxeda,ecx-2000", .data = "cpufreq-dt" }, /* BLACKLIST of existing users of arm-bL-cpufreq-dt below */ + { .compatible = "samsung,exynos5420", .data = "arm-bL-cpufreq-dt" }, /* BLACKLIST of existing users of other drivers below */ - + { .compatible = "samsung,exynos5440", .data = "exynos5440-cpufreq" }, {}, };