From patchwork Thu Jul 30 10:17:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 51685 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 patches.linaro.org (Postfix) with ESMTPS id A3D3222E7D for ; Thu, 30 Jul 2015 10:17:50 +0000 (UTC) Received: by lbcjf8 with SMTP id jf8sf12661760lbc.0 for ; Thu, 30 Jul 2015 03:17:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :in-reply-to:user-agent:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=wQUJtWwZIzIeKBTrXcBH/kXvnPRNhURur8Z6oxP+TO8=; b=iE6CLgU05bs6rTvbQ1xdb1wv2lT05q8c6u9qXyv1HC4met/lHLyVqHlTpCZ0dzk+aP Vmu4y2uCPo99Fqp73+UGthMPQLinxxKSxFqFYQVJunlJulqMlkTBL2rAMH5Igb6wpS8i bMZghSRFb4ari/hnpKizg6k9ioQbeoDq21MH+Gl1GhnSNfo+UITGgMv4zlSqVdvu/KMw 0ooSsWMTAt5pjyCE/i3ML9RIg9EoqSPxiEhkNiMnjLbANbFIFQLnrCM0ZTTNzSDxXXQ/ L4m9egJIGjkkd2JoaLMUwl5cAEmry2q3+6IjtUsee6osPyosJ6fiWA61rnIzk8FAlAji A2oQ== X-Gm-Message-State: ALoCoQntKKjGjswIvlmKb4JHzk9szG8XQcGq578g608inZIyqjUsvDzqYfhThUe48EX0gx2IiOWw X-Received: by 10.180.75.49 with SMTP id z17mr817178wiv.7.1438251469607; Thu, 30 Jul 2015 03:17:49 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.200 with SMTP id u8ls152634lau.55.gmail; Thu, 30 Jul 2015 03:17:49 -0700 (PDT) X-Received: by 10.152.205.67 with SMTP id le3mr43465709lac.50.1438251469436; Thu, 30 Jul 2015 03:17:49 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id n4si472622laj.18.2015.07.30.03.17.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jul 2015 03:17:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by lahh5 with SMTP id h5so22130516lah.2 for ; Thu, 30 Jul 2015 03:17:49 -0700 (PDT) X-Received: by 10.152.5.228 with SMTP id v4mr43338074lav.36.1438251469332; Thu, 30 Jul 2015 03:17:49 -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.112.7.198 with SMTP id l6csp480017lba; Thu, 30 Jul 2015 03:17:48 -0700 (PDT) X-Received: by 10.70.127.140 with SMTP id ng12mr105953304pdb.94.1438251467438; Thu, 30 Jul 2015 03:17:47 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yo7si1323773pac.224.2015.07.30.03.17.45; Thu, 30 Jul 2015 03:17:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750866AbbG3KRp (ORCPT + 12 others); Thu, 30 Jul 2015 06:17:45 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:32935 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750762AbbG3KRo (ORCPT ); Thu, 30 Jul 2015 06:17:44 -0400 Received: by padck2 with SMTP id ck2so21429588pad.0 for ; Thu, 30 Jul 2015 03:17:43 -0700 (PDT) X-Received: by 10.66.155.36 with SMTP id vt4mr106366970pab.32.1438251463868; Thu, 30 Jul 2015 03:17:43 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id j3sm1300749pdf.76.2015.07.30.03.17.42 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 30 Jul 2015 03:17:43 -0700 (PDT) Date: Thu, 30 Jul 2015 15:47:37 +0530 From: Viresh Kumar To: Stephen Boyd Cc: Bartlomiej Zolnierkiewicz , mturquette@baylibre.com, Rafael Wysocki , rob.herring@linaro.org, nm@ti.com, linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, arnd.bergmann@linaro.org, broonie@kernel.org, Sudeep.Holla@arm.com, viswanath.puttagunta@linaro.org, l.stach@pengutronix.de, thomas.petazzoni@free-electrons.com, linux-arm-kernel@lists.infradead.org, ta.omasab@gmail.com, kesavan.abhilash@gmail.com, khilman@linaro.org, santosh.shilimkar@oracle.com Subject: Re: [PATCH 05/10] opp: Add support to parse "operating-points-v2" bindings Message-ID: <20150730101737.GB9121@linux> References: <1b5a393f2162752cbb773956dff15739e7525a1d.1434369079.git.viresh.kumar@linaro.org> <2910042.ys2zsBBKt2@amdc1976> <20150727030239.GG19944@linux> <55B80A34.1010805@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <55B80A34.1010805@codeaurora.org> User-Agent: Mutt/1.5.21 (2010-09-15) 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.215.41 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: , On 28-07-15, 16:03, Stephen Boyd wrote: > There is talk about moving to 64 bits for the frequency in the clk API. > It's not actively being developed though and I'm not sure when we'll get > there. From a DT perspective though, I don't see why it would be bad to > have two cells instead of one cell for the frequency here. It would > allow up to 64 bits of frequency so that when we change the clk API we > won't need to do anything in the OPP bindings to handle it. Just because > we have problems in the kernel doesn't mean we should put the same > problems into DT. Updated the code as: diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c index d9ebbd739b23..73e4e1ce60a1 100644 --- a/drivers/base/power/opp.c +++ b/drivers/base/power/opp.c @@ -743,6 +743,7 @@ static int _opp_add_static_v2(struct device *dev, struct device_node *np) { struct device_opp *dev_opp; struct dev_pm_opp *new_opp; + u64 rate; int ret; /* Hold our list modification lock here */ @@ -754,12 +755,18 @@ static int _opp_add_static_v2(struct device *dev, struct device_node *np) goto unlock; } - ret = of_property_read_u32(np, "opp-hz", (u32 *)&new_opp->rate); + ret = of_property_read_u64(np, "opp-hz", &rate); if (ret < 0) { dev_err(dev, "%s: opp-hz not found\n", __func__); goto free_opp; } + /* + * Rate is defined as an unsigned long in clk API, and so casting + * explicitly to its type. Must be fixed once rate is 64 bit + * guaranteed in clk API. + */ + new_opp->rate = (unsigned long)rate; new_opp->turbo = of_property_read_bool(np, "turbo-mode"); new_opp->np = np;