Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1244576ybk; Thu, 21 May 2020 02:08:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJlD/ReDzhGCB4RoWV8LVGMqb2Mnlc+gveUQdrgmSFsg3In86NY9O2j7O/iT5q0Pfd19/y X-Received: by 2002:a05:6402:14d3:: with SMTP id f19mr6648810edx.135.1590052121063; Thu, 21 May 2020 02:08:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590052121; cv=none; d=google.com; s=arc-20160816; b=tT5LtJH1pFk7FqAnlo/wDRjWhN8i3uKq1x+54XWmbuRJqgf8r0we2koYugpJMjh2Ao NSmogX7IHNmJkF0Bd801QZk2UyMH2ITHNHJMw6tVE7dagU+/HkexEBy/4onYpNww146H GNyZmkz3x7hWTRejhnoqRz8Ru0eanpieTYxW4xXuhzLtlMIcn8hvnrV4zOVuXvgxzmWi r1b49ZY6huPzgtiLW1aeSI5fJJhY9LVdm8WSevIfriwhyubRJcSSKmHZF/kYxWGx5A1c JGydDHcNA2bYzzrkFQU9w7CkHIVJY4X+WtTYgz3Z93rnR6uoE8v11VCpuK1tnrnav8/v ONPQ== 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=0rM0q4hkZ0DNqIzZUdev1uMbsurkkv21fpGoS3vOqow=; b=ZlHd5GRY9+F7MqqGFlqQ1qsUEmxlya/qxHZsji1AlkhTb+lNqLIhxdmkWf+x5bvvTv S7f5azBfV/Mz/73zVuwSL3pHjx2rtBVnDE6y8JMkjS3zDV4SXCyY66HA5M4lRMBo7BT7 daxCYS4Fa7+408p4HTzAr1bCQCr8TU+frD+oTdHgVeVssQsiQ2ZvIhyUDEmmC2NI9+TM 9ohKKxr4WyOcO7KvbbDCHfjrWuDTVtlQVgIC/zSEKoICFvjZqvLInSoGI20b1532kyb3 vWk0NM4ZFW5V9Oy+8B2tbuuv9sJ69AF10cOI8LbdH7UIhaWZ9k1GGhZdozmppevt1WPY 669Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=JanaI9bL; 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 m14si2952813ejx.544.2020.05.21.02.08.17; Thu, 21 May 2020 02:08:41 -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=JanaI9bL; 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 S1728813AbgEUJGp (ORCPT + 99 others); Thu, 21 May 2020 05:06:45 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:11823 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728769AbgEUJGi (ORCPT ); Thu, 21 May 2020 05:06:38 -0400 X-UUID: 1ffef90f52b4403eafbe27e1ae4d8041-20200521 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=0rM0q4hkZ0DNqIzZUdev1uMbsurkkv21fpGoS3vOqow=; b=JanaI9bL1l2RzrYJ3umvkHGHDgZ9KONu+XkmU95qnotc5sorVjlCnK2Vw8TjiRgxL6gDn/UB7RJJC9DrtTh0hkzED9/PlHH3YLdRQk3wHrsTmQCLYjHPYXZxID7C55w5x3Cn6B2HOPRbSLyA/KWyEG7MKn8xXgUiQTw8Nzd5QpU=; X-UUID: 1ffef90f52b4403eafbe27e1ae4d8041-20200521 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1656432827; Thu, 21 May 2020 17:06:32 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 21 May 2020 17:06:29 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 21 May 2020 17:06:29 +0800 From: Weiyi Lu To: Enric Balletbo Serra , Matthias Brugger , Nicolas Boichat , Rob Herring , Sascha Hauer CC: James Liao , Fan Chen , , , , , , Weiyi Lu Subject: [PATCH v15 06/11] soc: mediatek: Add subsys clock control for bus protection Date: Thu, 21 May 2020 17:06:19 +0800 Message-ID: <1590051985-29149-7-git-send-email-weiyi.lu@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1590051985-29149-1-git-send-email-weiyi.lu@mediatek.com> References: <1590051985-29149-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 ZCB0byBiZSBlbmFibGVkDQpiZWZvcmUgcmVsZWFzaW5nIHRoZSBwcm90ZWN0aW9uLCBhbmQ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