Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp995959yba; Sun, 31 Mar 2019 19:31:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqwg5mUlangMHxtTjB5s+3HHczdGMpWj0PIhVDTE/Bxk7/LfJpUCt6hD30ajK8GVKnwJJCIe X-Received: by 2002:a17:902:6b48:: with SMTP id g8mr61248994plt.21.1554085917942; Sun, 31 Mar 2019 19:31:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554085917; cv=none; d=google.com; s=arc-20160816; b=z3RODplg6oebHJlbpK4he9gfivt8RnSxjyWQRur3Z1GEcesz9u6Je1ZDoHvPvNBMjM hdq0lCv7Ix+85j4XtFjNiGa0HkuZEh85u1bkVkSAPjdwXrDf3aZgqMfgMNkP5YulJzMl XKXg66FVzDSOgy50goTp0omnVQHJ1I3aeSYLKDD9Y8PmpLeSZRjGKW5hVra1JWA3kOaI RZiY/9t9tIX7jexneH+TlCh+DERWCTstHllv2yigpOJufDrTpwscd3/jOX4RyvFxHANU ZOkqiXB7EbouqMkUDPVP1e6UcQ29YM65bB0GSfEbJ7rwtMLsNEHMX3BhB03jpJSDnAOR ijsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type :content-transfer-encoding:date:message-id:in-reply-to:cc:to:from :reply-to:subject:mime-version:dkim-signature:dkim-filter; bh=p215Nw9ojHoHyStauLGQUl59d9hLA/l+1GdV84x/O9A=; b=zlLsld9axxT54pZ9aCChQUBbbALd/+2kgy9kgBwTxh6oyN8uyiR/ZDieoAvGIVe9lq KtyAW1hSxfTPD/Z8JGrZktjXAQRtD5TmB8ck5Z9jpgThHat4LyTn+Ppc5L39k6C8LK7m KjJwUxe6tp7oFMEzP+8HWPTZvuTta6N5VlaRnGw46Y5ET/Wh9ruRVRGbklO6At0M4iOi O9it25qXFCUOgUrrzoXClmK2FwPy3CyRpXRe/tyPHAGTYwELdIEevdnWqPBbPHl7t0xl WPW198Kvu3UYF3eSV++xSqOBhNJ/RH+FLNvZidmbkdAxDAZbqYcIlHrKQAXmOgzGKD4E cIWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=F+VcR4+D; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si9174110pfm.253.2019.03.31.19.31.42; Sun, 31 Mar 2019 19:31:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=F+VcR4+D; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731658AbfDACbJ (ORCPT + 99 others); Sun, 31 Mar 2019 22:31:09 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:56940 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731529AbfDACbI (ORCPT ); Sun, 31 Mar 2019 22:31:08 -0400 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20190401023104epoutp04da2fa56f566bb9e431c3a560bd995478~RONwnpBmJ0977309773epoutp04u for ; Mon, 1 Apr 2019 02:31:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20190401023104epoutp04da2fa56f566bb9e431c3a560bd995478~RONwnpBmJ0977309773epoutp04u DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1554085864; bh=p215Nw9ojHoHyStauLGQUl59d9hLA/l+1GdV84x/O9A=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=F+VcR4+Dgxn7DU+UpL282c0J5W0381jxM/RWis0DpE4iF34rm+X/cpLU5NvHuFsxz kHINVbNgMv3kCB9XHbzn7z1wtwLjvIHOm5+QatOBq0099Q5w051Vfo7lnPFxU4CQ9M CkscZaWIP4iyMyjh75i1leJRSgm8xR2XIbSkyoTo= Received: from epsmges1p2.samsung.com (unknown [182.195.40.155]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20190401023056epcas1p1ec2fe7f2d7af9adf14a5c61743c95b68~RONpUMv870160301603epcas1p1h; Mon, 1 Apr 2019 02:30:56 +0000 (GMT) X-AuditID: b6c32a36-ce1ff7000000102e-e6-5ca177d72ad0 Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 8D.67.04142.7D771AC5; Mon, 1 Apr 2019 11:30:47 +0900 (KST) Mime-Version: 1.0 Subject: RE: [PATCH v2 2/4] opp: add API which get max freq by voltage Reply-To: myungjoo.ham@samsung.com From: MyungJoo Ham To: Kyungmin Park , Chanwoo Choi , Rob Herring , Mark Rutland , Matthias Brugger , "Rafael J. Wysocki" , Viresh Kumar CC: "linux-pm@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-mediatek@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "srv_heupstream@mediatek.com" , "fan.chen@mediatek.com" , "Andrew-sh.Cheng" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <1553841972-19737-3-git-send-email-andrew-sh.cheng@mediatek.com> X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20190401023047epcms1p888e2dba45fcbc1de98d71d8a37acb976@epcms1p8> Date: Mon, 01 Apr 2019 11:30:47 +0900 X-CMS-MailID: 20190401023047epcms1p888e2dba45fcbc1de98d71d8a37acb976 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-CPGSPASS: Y X-CPGSPASS: Y CMS-TYPE: 101P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrIJsWRmVeSWpSXmKPExsWy7bCmnu718oUxBtMuK1hsX/+C1eLlIU2L 61+es1rMP3KO1eLbnd9MFmeb3rBbbHp8jdXi8q45bBaXmy8yWnzuPcJosfT6RSaLphZjizOn L7FatO49wm4x/a6QxcavHg4CHmvmrWH02DnrLrvHplWdbB53ru1h89i8pN6j5eR+Fo8tV9tZ PPq2rGL0+LxJLoAzKtsmIzUxJbVIITUvOT8lMy/dVsk7ON453tTMwFDX0NLCXEkhLzE31VbJ xSdA1y0zB+gFJYWyxJxSoFBAYnGxkr6dTVF+aUmqQkZ+cYmtUmpBSk6BZYFecWJucWleul5y fq6VoYGBkSlQYUJ2xqpPO9kL7rNXzP/XxdjAuIeti5GDQ0LAROLzlIouRi4OIYEdjBLNF9aw gMR5BQQl/u4Q7mLk5BAWcJO4MeMTC4gtJKAk0XBzHzNEXF+i48E2RhCbTUBXYuuGuywgc0QE 5jBJnDi0AsxhFvjNLNH+5QA7SJWEAK/EjPanLBC2tMT25VvBujkFfCV+HPkJVSMqcXP1Wzj7 /bH5jBC2iETrvbPMELagxIOfuxlh5syY8h9qZrXEtemL2UEWSwi0MEr0rp4CVaQvcWbuSTYQ mxdo2dkVM8EWsAioSny9t4YJosZFonfFObAaZgF5ie1v5zCDQoJZQFNi/S59mPsbNv5mR2cz C/BJvPvawwoT3zHvCdRINYlDu5dA1ctInJ6+EOp+D4m+FR9YJzAqzkKE9Swki2chLF7AyLyK USy1oDg3PbXYsMAIOXY3MYKTs5bZDsZF53wOMQpwMCrx8CowLIwRYk0sK67MPcQowcGsJMJ7 pn9BjBBvSmJlVWpRfnxRaU5q8SFGU6D/JzJLiSbnAzNHXkm8oamRsbGxhYmhmamhoZI473oH 5xghgfTEktTs1NSC1CKYPiYOTqkGxvoFJSK+fDmKwa8u9/1K39NtfMH5r8+y7mCpKXP5xFjD hVu71a98KG02ELEuPtw6uyJ7Ztyt2THeXBk2UQ5xuVyW1xK1dC2dl89xzeWJVP0bUrnk74mZ 8TZfzoZuiXiffGiTXyKXjezJIOmXbq93vbf/P69N5tzt267XLQpmOZiu2XS+Y0aEEktxRqKh FnNRcSIAKOOq9+QDAAA= DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20190329064632epcas2p4d10ea099bfea4ad682d7312a75bfbe68 References: <1553841972-19737-3-git-send-email-andrew-sh.cheng@mediatek.com> <1553841972-19737-1-git-send-email-andrew-sh.cheng@mediatek.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >This API will get voltage as input parameter. >Search all opp items for the item which with max frequency, >and the voltae is smaller than provided voltage. > >Signed-off-by: Andrew-sh.Cheng >--- > drivers/opp/core.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ > include/linux/pm_opp.h | 8 ++++++++ > 2 files changed, 63 insertions(+) > >diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h >index 24c757a..57deef9 100644 >--- a/include/linux/pm_opp.h >+++ b/include/linux/pm_opp.h >@@ -102,6 +102,8 @@ struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev, > > struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev, > unsigned long *freq); >+struct dev_pm_opp *dev_pm_opp_find_max_freq_by_volt(struct device *dev, >+ unsigned long u_volt); For the symmetricity, wouldn't it be better to name it dev_pm_opp_find_volt_ceiling(dev, u_volt); ? Cheers, MyungJoo