Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1591744ybj; Wed, 6 May 2020 01:19:01 -0700 (PDT) X-Google-Smtp-Source: APiQypLnbVMI4chcr0+2BLc28wsvZEHRo4Y15LcY/3ppB9NqVQ23v/Lt10I79ECvIvNGiUJi6NBb X-Received: by 2002:a17:906:3004:: with SMTP id 4mr6313070ejz.381.1588753141148; Wed, 06 May 2020 01:19:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588753141; cv=none; d=google.com; s=arc-20160816; b=dUQWmDiOKK5v2a0X/y3upQ1Y7JnkYuHp1IiOumiLjmcX41Gek+nk4jQQbKa1++hIpj J6DSu6GZjdonIocFT78wcALJDZp/22Xso8fmHi9PoSYmUWKZFRJn/5eqybWcpGcuC+Gs Tu3VH3ZnLM2Zn7R2jewUWjCO8Q2gQmZOP9HTMHaiMF0RMT44jYYx/On1inMk7BKPMFhp e+W/3ff2KWMT8DOSKc7mo6TttibxZWE7ckpt7vOR0OxWgxGnjVLRDzfOlsQqc1UvVX14 9mSCEq0SCnDpdI9Uf+F8CEqDbOzCxhoBYEYDpU5CRTpzfa7kT5R32z+zYOXPDqwsJ/i2 VmWA== 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=zT2PyviPI6WmwpewBRRMY4OPcaquIanX34HCcCIb7Oo=; b=kW4ajpRIJSnroSva0+i7ddHga0HfUkd/SIsZtIM/LzWDzE5YHpHFaxlRK7ASsYsblb bx4wMmd41pMhZxJlH2oSEZJloBUqRpWr2xwCiiv9wm4qwCG8YMVuTO6wx1+/3StsyRTb J1ZuG9jUwjoWYfZKsjfpnspYBhCTPGn1QzwToMOQJoOCbPLIE8uOt8OwjpNmsDRIQXWS UL14c/2qv5s/99pqCEvnnTvxLJ7YJ3fMpIizTCQhfdJu0bZBgfUx+/vFgXuMaPIJOWR/ nZFjyHt24G17mFnMRr5fpnDt/RboUId9vIgOSWh4X63zsWAKr0S8539VVSYoJNOJdPlp OwMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=fQEu0342; 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 d9si738864ejb.387.2020.05.06.01.18.38; Wed, 06 May 2020 01:19:01 -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=fQEu0342; 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 S1728760AbgEFIQi (ORCPT + 99 others); Wed, 6 May 2020 04:16:38 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:7851 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728607AbgEFIQL (ORCPT ); Wed, 6 May 2020 04:16:11 -0400 X-UUID: 47efbb74689345b6a8cd1d1a2edb826a-20200506 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=zT2PyviPI6WmwpewBRRMY4OPcaquIanX34HCcCIb7Oo=; b=fQEu0342m8I8zTiooFsLnBLVxmvCtyzyKskYdFVrX998Uh0ctKaTvmp70x8UvKiQcAs07BaVcjnxgVEQOTvxFp1USHyaKgAPCi8VTAe420S2HoQZYWWj4CFY1Uz2xO7CbU65ip4l9ZLFuN6BJzseB/yj5ef9YLpcOKi5xFVo0ss=; X-UUID: 47efbb74689345b6a8cd1d1a2edb826a-20200506 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1715595126; Wed, 06 May 2020 16:16:06 +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; Wed, 6 May 2020 16:16:05 +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; Wed, 6 May 2020 16:16:05 +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 v14 06/11] soc: mediatek: Add subsys clock control for bus protection Date: Wed, 6 May 2020 16:15:58 +0800 Message-ID: <1588752963-19934-7-git-send-email-weiyi.lu@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1588752963-19934-1-git-send-email-weiyi.lu@mediatek.com> References: <1588752963-19934-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 ZCB0byBiZSBlbmFibGVkDQpiZWZvcmUgcmVsZWFzaW5nIHRoZSBwcm90ZWN0aW9uLCBhbmQgdmlj ZSB2Z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