Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754296AbcDAOPb (ORCPT ); Fri, 1 Apr 2016 10:15:31 -0400 Received: from mail-yw0-f179.google.com ([209.85.161.179]:34784 "EHLO mail-yw0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751067AbcDAOP3 (ORCPT ); Fri, 1 Apr 2016 10:15:29 -0400 MIME-Version: 1.0 In-Reply-To: <20160401102350.GA5532@vireshk-i7> References: <12972545.Mi9sHiNJpR@wuerfel> <20160330032240.GB8773@vireshk-i7> <7250220.227umpmTug@wuerfel> <20160401102350.GA5532@vireshk-i7> From: Rob Herring Date: Fri, 1 Apr 2016 09:15:09 -0500 Message-ID: Subject: Re: [PATCH V1 Resend 2/3] cpufreq: dt: Add generic platform-device creation support To: Viresh Kumar Cc: Arnd Bergmann , Rob Herring , =?UTF-8?Q?Krzysztof_Koz=C5=82owski?= , Kukjin Kim , =?UTF-8?Q?Heiko_St=C3=BCbner?= , "linux-pm@vger.kernel.org" , Matthew McClintock , xf@rock-chips.com, Rafael Wysocki , "linux-kernel@vger.kernel.org" , "linaro-kernel@lists.linaro.org" , Mason Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2309 Lines: 60 On Fri, Apr 1, 2016 at 5:23 AM, Viresh Kumar wrote: > Cc'ing Rob and Mason. > > On 30-03-16, 09:53, Arnd Bergmann wrote: >> I think it should be something in the /cpus or the /opp_table hierarchy, >> not the root of the device tree, but other than that I don't care much >> whether it's a variation of the oppv2 compatible string or an additional >> property in any of the nodes. > > So you mean for future DT files we can have something like this: > > cpus { > compatible = "operation-points-v2"; > #address-cells = <1>; > #size-cells = <0>; > > cpu@0 { > compatible = "arm,cortex-a9"; > reg = <0>; > next-level-cache = <&L2>; > operating-points-v2 = <&cpu0_opp_table>; > }; > }; > > cpu0_opp_table: opp_table0 { > opp@1000000000 { > opp-hz = /bits/ 64 <1000000000>; > opp-microvolt = <970000 975000 985000>; > opp-microamp = <70000>; > clock-latency-ns = <300000>; > opp-suspend; > }; > opp@1100000000 { > opp-hz = /bits/ 64 <1100000000>; > opp-microvolt = <980000 1000000 1010000>; > opp-microamp = <80000>; > clock-latency-ns = <310000>; > }; > }; > }; > > > And the cpufreq-dt driver can match /cpus node's compatible string against > "operating-points-v2" and create a device at runtime ? > > @Rob: Will that be acceptable to you? We are discussing (again) about how to > probe cpufreq-dt driver automatically for platforms :) No, I don't think that belongs in /cpus. Part of the problem is this requires a DT change if you switch between a platform-specific driver and generic driver. I don't understand the issue having a little bit of code to parse the DT and create the device. If you are worried about having a long list of platforms, you could instead check the tree for operating-points-v2 property in the cpu node and create the device unless the platform is black-listed. Rob