Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1866666pxk; Sun, 13 Sep 2020 20:07:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytrIMzs3QdlM0dTYyD0uSJ+rNKTkn5zRepo5VmBCVltDySvPs/Zkouue1G0uq7nMN3jw66 X-Received: by 2002:a17:906:6a50:: with SMTP id n16mr12324898ejs.107.1600052844756; Sun, 13 Sep 2020 20:07:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600052844; cv=none; d=google.com; s=arc-20160816; b=UgEgMO9DN69WKt9u2ndFUZAgFmeUwQ8KBH5wA6cmSTCikYXDXJt1lreP/bvRB5zJY2 d4WJ2Mln/Tfw9YbEKrGE9B0ih4snsauIULV4Dm64bpfh1Vo0XSnYswjE9MMXiikVJmfM AxpKxUT8hc8HkUK1ZuoZ6KHBWDFMu7Fu1qJqqjqqlhO17zHPkRUCVTBFgXHPlQx9iLh0 f4RE2OsmzNFpwMiPk+1pHvlvldlu6bVFsuYaGkS8LoRWLves1pHbA+Yuk7NIhJoxsEaE 51jCxKhLX014vIy24x77KUOIsl8okzHmfMIM2Lhhc+08wgxX6cxkY9fuSXsOZ/6bkb7m qbUQ== 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=gjbZ7EKE7bYC9s+TAJMXV+z2AM8mP9qQSnfSBopillU=; b=pHApV36Oh7sHPvDYlawVsQecqusACBEbnVSRFqXEq6sn/0WJCrEn9GPSNzhXkuxA7h XyO8Rj9i1YCtNldtf6Oj/WGmtZcMUSwXZydXOSN15BivaVmgCI97aaqt1mEurLWJdnY/ 3Q1PrAFN9lDd+P0CMo8i9jESrpFMGRjyAQGS4WbObThFJ2yN28JgfQYPOW4RmK09Qnl2 VcwWvMOH3QJlj7HZE1oLLN+QANf5C793+93eqUo9wZm0HQWlsGsFzCKD7ncuuM9q7atu YN3/9ojlg+lngJ6PsLSRq0SZH7XEHwPGTr12jcVlfyU2B10mhsjUE2fij4L1qc1YKgGF F2SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=i1c9IFI+; 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 v17si6343951eje.376.2020.09.13.20.07.02; Sun, 13 Sep 2020 20:07:24 -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=i1c9IFI+; 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 S1726184AbgINDGB (ORCPT + 99 others); Sun, 13 Sep 2020 23:06:01 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:11909 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726130AbgINDFY (ORCPT ); Sun, 13 Sep 2020 23:05:24 -0400 X-UUID: d5e13a062ea44bbaabc9f5e32a426af2-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=gjbZ7EKE7bYC9s+TAJMXV+z2AM8mP9qQSnfSBopillU=; b=i1c9IFI+n1lw2kNLqrdH/9nRJkSgcyz34114SBZZwZDvmJIRLSQBRdFg3WeWC56ltO0lQOsWsV4YnxyDAJTA3ROZ/is1ED3BhqhUm+JXLrwOisY3a0g4anGJt9Jw+QBhb0nLpu2PdcP34A1CiJkqz8mZQGPRt+LPl+FjG8mpDmQ=; X-UUID: d5e13a062ea44bbaabc9f5e32a426af2-20200914 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] 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 1235267071; Mon, 14 Sep 2020 11:05:02 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs01n2.mediatek.inc (172.21.101.79) 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:48 +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 06/17] soc: mediatek: add driver for dvfsrc support Date: Mon, 14 Sep 2020 11:04:33 +0800 Message-ID: <1600052684-21198-7-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-TM-SNTS-SMTP: 5298DCA3361E2D22C6AA253035DFF938DC9B689EC198D5F934C9C7B4230BF4EC2000:8 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.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