Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp385733ybb; Fri, 20 Mar 2020 00:34:52 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtdlqfaN5heF+gytxABhE8rbFdf5s/22KzgchlSbN6llZEW2J/RYMNA5WSuA8RUPjmUkphU X-Received: by 2002:a9d:7cd1:: with SMTP id r17mr1818238otn.183.1584689692604; Fri, 20 Mar 2020 00:34:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584689692; cv=none; d=google.com; s=arc-20160816; b=fCGpv4nYB3mKRDId4MoGIgqW8FnsOCnrijIRbyXyuZt7BWTUpkh2t8YPWuF1op8a7R q/D/oNuyS4NB+16OPUNq87imIKcwSM8JGhCE/4zZxWveia9f+6ncr9EyqV3CewCNSPHJ W57v0VZJ1RQ2qVNai/ftwKqYq3yuURYJ1fVue7tPu+xOJdJiYVpP8f0WYZJ26lG1Zz+o g90YTt/WcxKU2T28hjZTTxg2WRyfgGNaLRLeD5bMRNtovLKYGwSOi3LPaK47we/NTPTc lFaCktW39t7XTfA/fjNWbxMPqjgUngmzOiuE28oBMDyJKHl6ce1a4WeA10IR8Ejc3cqL RL8g== 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=9X5uWL1YgmrDZcTKHn0A/YVVUbEE9hPvqMSvyGyBAwc=; b=Ctr+ist1rtp2GouQF4fsAYdbw1aSaPAV8lcDmCQyOY68WYQgy8qM4WA2PTDKut5cmJ j7WsyQATnlL+UogkKl7aqmaYxQRo7IC0VbNJJfabkEAQMW2dJH9yx1kIEiJUD6f7ONGL ii2y0UAf0DFwrU/rh60KSC+gmeJ0UDgz3/dRQyLhrTrAGDkHgDPmqSlQDfKDn4RrvaNt 0L0e2Kw27R4DWFZ1qWfuet3PN4qt+N3ooweMbu1ldq8OtOcfeZw0T8OKzI5vLSbqmREi PJbPstj1u0TDgRRB45dzNlIESjna+CTAdO4/jhsYdeC/sS4h6sct2A6jzP3twsErU+fh DHRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=npDHTsLp; 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=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v10si2410088oth.136.2020.03.20.00.34.40; Fri, 20 Mar 2020 00:34:52 -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=@mediatek.com header.s=dk header.b=npDHTsLp; 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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727231AbgCTHdO (ORCPT + 99 others); Fri, 20 Mar 2020 03:33:14 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:23390 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726614AbgCTHcl (ORCPT ); Fri, 20 Mar 2020 03:32:41 -0400 X-UUID: ec5da989951e4654b6ce6b5cc8626d7d-20200320 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=9X5uWL1YgmrDZcTKHn0A/YVVUbEE9hPvqMSvyGyBAwc=; b=npDHTsLp09QKtFP8h7dJT5qeUz2rCZrCCV39Ft2OBQTp48hyXaCnSdwVl1JnRF1yyl47C0M4TFjK5B8qHXWIYdkIktNK7ebgEKxwOVnCt/7QnoWlHx+elgDne5A7mUojOmSYEdsmfIyZCECK63RbylVk/F7qazE7KSGdMomOMmM=; X-UUID: ec5da989951e4654b6ce6b5cc8626d7d-20200320 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1222437964; Fri, 20 Mar 2020 15:32:26 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 20 Mar 2020 15:31:26 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 20 Mar 2020 15:29:19 +0800 From: Weiyi Lu To: Matthias Brugger , Nicolas Boichat , Rob Herring , Sascha Hauer CC: James Liao , Fan Chen , , , , , Weiyi Lu Subject: [PATCH v13 06/11] soc: mediatek: Add subsys clock control for bus protection Date: Fri, 20 Mar 2020 15:32:15 +0800 Message-ID: <1584689540-5227-7-git-send-email-weiyi.lu@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1584689540-5227-1-git-send-email-weiyi.lu@mediatek.com> References: <1584689540-5227-1-git-send-email-weiyi.lu@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 Rm9yIHRoZSBidXMgcHJvdGVjdGlvbiBvcGVyYXRpb25zLCBzb21lIHN1YnN5cyBjbG9ja3MgbmVl ZCB0byBiZSBlbmFibGVkDQpiZWZvcmUgcmVsZWFzaW5nIHRoZSBwcm90ZWN0aW9uLC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