Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5047457ybl; Mon, 9 Dec 2019 22:48:44 -0800 (PST) X-Google-Smtp-Source: APXvYqwQd07xJZwg+ueL0uy3wcumfreeCcUf6PiV0uu/7KyA816SYEhyX7ppWCLIUHxFsjnkc2FU X-Received: by 2002:aca:4911:: with SMTP id w17mr2715427oia.22.1575960524351; Mon, 09 Dec 2019 22:48:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575960524; cv=none; d=google.com; s=arc-20160816; b=XCC9h1JdRPcMqv3oHsV2HBg5vA0VOC2pRa3N1f/AYZOVjjfv5QM72ef2XhbXK16oRH J3I3AlzsRHidW4XECnMsK7OkYXzEZrUjUTm0XTFnMqJTCMy6fd2N8ehJ84V/+597wAXj 6vSDqFal/bVDMT4Gj5zpaChtD8Khaio+/AnB6fj/TMFcK7xbzygOl+CIMJ/3aLR+hvla jG0K7p6kEKkPc92wFunE8m49DfkMajtbTRGCtiq7/lC0dw5cclASFT4Hasxa8JhONb/b Smn4P46AGKFX0UKdFsGxSmPuqJSyzIdt+J0d6styuwMvB22mAHriV9aAvbUJt3INr8Xj R5lg== 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=in7Y5b66xLTUNL/z1DPJEMQwq3nkM02rQJiwoMm9JDM=; b=QT1em89OAg/W2C/e9ovFPrAGGKkNN8IOE2WvX81+Dzx/HhnArXXiKB5+OeLZFLNpcU ajkgw1LSY2ZVdn/T36vP1byKMjrWePzRyTlTL44BC6PKnxxPoWCjTj7B+K8CXWNkvrtK yZ3mGpL8yUE193haVvWzfR0WDK9LS/lU86GbBGjLVlcvt+0oCCkFwLKauTeqqnBuXuvX mO37MixDTI7FcLT/8jga74keuocIAZbUmFUhlkuV/1swOBH9Ujd7ufmWr4f1umuVfz4U AI8ymBINKitU0RW/MOuoq2Ygaz+LSXiwXCAXKmKvI2XUF1CoSQ26cvshxO2bI//VXE0U xpyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="K/85qNAD"; 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 h9si1451710otb.49.2019.12.09.22.48.32; Mon, 09 Dec 2019 22:48:44 -0800 (PST) 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="K/85qNAD"; 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 S1727473AbfLJGrk (ORCPT + 99 others); Tue, 10 Dec 2019 01:47:40 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:5886 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727370AbfLJGr0 (ORCPT ); Tue, 10 Dec 2019 01:47:26 -0500 X-UUID: 49dd00b415b14cd5b018863f2d05ef92-20191210 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=in7Y5b66xLTUNL/z1DPJEMQwq3nkM02rQJiwoMm9JDM=; b=K/85qNAD/T0PGlPkJEj6vNtcP0wndNazq5G0UaVkFL4xRBVszABJZ+dveNCBKSF1wxaVpeIYb3L4sTkQOsvYuP6fSo7EuwP/ahPKv0iW3FqsefOYjAKXnfRlgkRpu+TFDR3NKqnA39bVVEbzNLkATaS1YQIKV3R90Ae2jZeYt4Y=; X-UUID: 49dd00b415b14cd5b018863f2d05ef92-20191210 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 257667490; Tue, 10 Dec 2019 14:47:16 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 10 Dec 2019 14:46:48 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 10 Dec 2019 14:47:17 +0800 From: Weiyi Lu To: Nicolas Boichat , Matthias Brugger , Rob Herring CC: James Liao , Fan Chen , , , , , Weiyi Lu , Yong Wu Subject: [PATCH v9 5/9] soc: mediatek: Add subsys clock control for bus protection Date: Tue, 10 Dec 2019 14:46:49 +0800 Message-ID: <1575960413-6900-6-git-send-email-weiyi.lu@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1575960413-6900-1-git-send-email-weiyi.lu@mediatek.com> References: <1575960413-6900-1-git-send-email-weiyi.lu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 1BBD55928583D5DDB6E38E71781926C209F97AED79BFEBF7DEC76C276F0DEC212000: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.org QWRkIHN1YnN5cyBDRyBjb250cm9sIGZsb3cgYmVmb3JlL2FmdGVyIHRoZSBidXMgcHJvdGVjdCBj b250cm9sDQpkdWUgdG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