Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1866308pxk; Sun, 13 Sep 2020 20:06:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjhvVCOaLKh9tnDmHaXohMjG1fTLoPpr/E5wvM2Vad94nvWCAPdwIyxouogMduQV//HUWu X-Received: by 2002:a17:906:1157:: with SMTP id i23mr4887669eja.440.1600052791473; Sun, 13 Sep 2020 20:06:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600052791; cv=none; d=google.com; s=arc-20160816; b=Imhczlkc/EEkIr6ZRpYTroTmFd0sQBzZKdK1tW/RyRp4lj28A5AScnedh5dsz50vF0 2nQAqPtoRFfrQVg7j0aXDD72pMEN8SztJjex0mHljW8hL5vd4jfc4q/OkPAuodR2Mkz6 EHM5UrmAOCdRN1erZ/9rvkobrxtbhFjTDq7aQ4ighAmxIVLhjIWsuYrqnYcOPjSm2nrd 6tam89ot/tgiCyzFTCbtanCi62cnvE2JsXEkmZ79nKlgxF5u70lTlmmah0L4liNdzcma uuuxKkurJ4M0PowDk2uE6yXr/lgCTimmAbpWtwdO4/Wa7qzwm+mKT/KCieWk7XL4C09s Cg2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=b+P99K3c89W+s3w0wcI++BC4dbvHHPlV6NYVkc5ibts=; b=Z0rYXIObKEp/yxogWcTottSW1BIzozQPMDJR/53nhp327IdBQhy9xFKBPM+HDmSVmJ 788/ZYLFc65aWj5eqHenUTtIydwybq1cUiFn8TgypW9IYEWtRLWKS6q1lAAoIigyOFvW GAYFpq2tneCzTdalRZX/gujwMptEGOytB4RrNCC4XK5tYXs6ni/H+59pzglb9ixsTp6Y wQOBN+jayi1xYi5Ug3m97S7TR7P+zXBWjLpoG/uas+M+xuYW8qPuYAuhxGtom/i7TQTC nnJ33XkXOakk7qMhHNiQ/A4dREGs1LC8mo0GvzfnngCaRttm3eKkwlzutypYyDk+rI2N nNLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=oGUDn1Ey; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oy13si6039973ejb.481.2020.09.13.20.06.09; Sun, 13 Sep 2020 20:06:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=oGUDn1Ey; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726122AbgINDFS (ORCPT + 99 others); Sun, 13 Sep 2020 23:05:18 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:35987 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726069AbgINDE5 (ORCPT ); Sun, 13 Sep 2020 23:04:57 -0400 X-UUID: d4a8afd103f74f9b937809069c4aee82-20200914 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=b+P99K3c89W+s3w0wcI++BC4dbvHHPlV6NYVkc5ibts=; b=oGUDn1Ey7pV4eduBlg+svcToa2UAQkQcj3dS7i5S135AHWIe7sH4BTP95gXeJwg7uo+xF1p9opZrOgmkZ8K8RSeomhAp470bG82u7VhHgO4zyQZOvW7CPFQ/FB3mSDZlX3BW1eCp1y3pdNOLDi3PLkFiMyhYN4jczNeJgSN5wSU=; X-UUID: d4a8afd103f74f9b937809069c4aee82-20200914 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1991007190; Mon, 14 Sep 2020 11:04:49 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 14 Sep 2020 11:04:48 +0800 Received: from mtksdaap41.mediatek.inc (172.21.77.4) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 14 Sep 2020 11:04:47 +0800 From: Henry Chen To: Georgi Djakov , Rob Herring , Matthias Brugger , Viresh Kumar , Stephen Boyd , Ryan Case , Mark Brown CC: Mark Rutland , Nicolas Boichat , Fan Chen , James Liao , Arvin Wang , Mike Turquette , , , , , , Henry Chen Subject: [PATCH V5 03/17] soc: mediatek: add support for the performance state Date: Mon, 14 Sep 2020 11:04:30 +0800 Message-ID: <1600052684-21198-4-git-send-email-henryc.chen@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1600052684-21198-1-git-send-email-henryc.chen@mediatek.com> References: <1600052684-21198-1-git-send-email-henryc.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Content-Transfer-Encoding: base64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org U3VwcG9ydCBwb3dlciBkb21haW4gcGVyZm9ybWFuY2Ugc3RhdGUsIGFkZCBoZWFkZXIgZmlsZSBm b3Igc2NwIGV2ZW50Lg0KDQpTaWduZWQ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