Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1219551pxa; Thu, 6 Aug 2020 02:33:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkExaZuKCS/DJU5AbsfZ7a1h/zVEeuE0JFpxPtco/DmPBR5xS70jYb0mqvVC7fyOynogw3 X-Received: by 2002:a17:906:4e57:: with SMTP id g23mr3347664ejw.92.1596706389471; Thu, 06 Aug 2020 02:33:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596706389; cv=none; d=google.com; s=arc-20160816; b=qUQgTjVeDkxdDUnnLpCQ4woPvU+UMnj/6LtRLk4mPse8RD+WPfSoaQHQ3uMUoYWjvO xyFCPAtxPmml7kngpdAUEyP0EJ7YAOoZ0+L4TEPjD+oiUqCi8MHZyCUPGMPxWS91H5vl Cw7zWRmCmIb6QX4H2+njevbrHU+VrxzGM94nh/McR5KVZLCpAWlEDUmYfxix6wZr56Nz 0MvwAJHcgwxfhr9SOiI9+qpbRQTAFIF1gqsUtSfZYPMwZ9Q9UHsm9F+fGs4WPjjouG8Z A/yGzYbBmTHPPhVkvwLCi69MvVO0BYqafc/N83MwfIW/xHnWJazDxnripy33wp/QVFZa eTMg== 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=nV+1VPDViPYhiu9TwtqZGVPTCpQQXdDn8Cms96SrwTc=; b=kcQ9R6NYzcaup+eyJEXp3LhRru73+atUcEOqPDaskdr6ATGLKlIfjn5ScgYdqEc5uH 7IBRhP6N4uvv4cHiUHVkhg8+v8u2ZY0klGwWNuIfzetSbNeNrEKTyXP2IGt4ipdv/JMP uKdM9Rv/3DD0goOD7q6aPifNhFCxP40EkUmI4u6F2FFTa/YdDSzeZcZNjP/2vjyY9kC6 FGRrs4TX0Zk0N2tMbgBCVBpAD8q07NfvsNZKlNb01yjX4XwMLfGGd7YwCj2frejNkTF4 kINSvLTT38rYK3bd3+sKEBbf9aY5txFwcNCUWz+k0LW1o94XqV/RrlX6c98CsEjrOh0d jXPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=NMPiME1g; 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 r18si2858369edo.272.2020.08.06.02.32.46; Thu, 06 Aug 2020 02:33:09 -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=NMPiME1g; 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 S1729123AbgHFJ3g (ORCPT + 99 others); Thu, 6 Aug 2020 05:29:36 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:15338 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729125AbgHFJXy (ORCPT ); Thu, 6 Aug 2020 05:23:54 -0400 X-UUID: 9e0d86cab91b406ca54e43ba3d261a5f-20200806 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=nV+1VPDViPYhiu9TwtqZGVPTCpQQXdDn8Cms96SrwTc=; b=NMPiME1gvLs6mV8YUHlx/a+TjdUv3ZvCWvMEHXkZigoChZ2+QQfBD3up3h9zIGp3Hd0vekqn4xCvgcFyN+kguZOQJuIGRC+wKKYsZUqk0FbijK9CgjGmuH75X+m6QrZXOMKuyQIA7OBjvknUWU9BntEQ5C7GcXTArkuA0DGqOVU=; X-UUID: 9e0d86cab91b406ca54e43ba3d261a5f-20200806 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 126296518; Thu, 06 Aug 2020 17:22:02 +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, 6 Aug 2020 17:21:59 +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, 6 Aug 2020 17:21:59 +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 v17 07/12] soc: mediatek: Add subsys clock control for bus protection Date: Thu, 6 Aug 2020 17:21:50 +0800 Message-ID: <1596705715-15320-8-git-send-email-weiyi.lu@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1596705715-15320-1-git-send-email-weiyi.lu@mediatek.com> References: <1596705715-15320-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 ZCB0byBiZSBlbmFibGVkDQpiZWZvcmUgcmVsZWFzaW5nIHR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