Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp276535ybt; Wed, 17 Jun 2020 00:11:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmvVQKIHx1WI94PxIWCM0haU5k0bEv5HcabX649dEMaY/x/LrxeUHBSvPwfTMIElgf4L03 X-Received: by 2002:a05:6402:6cc:: with SMTP id n12mr5753434edy.266.1592377897959; Wed, 17 Jun 2020 00:11:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592377897; cv=none; d=google.com; s=arc-20160816; b=YAJ2dIkQz2/mtUCNjyd7sAl6rA9fRvlG9kuV0F01Nj5zsZQfgSsP3mvTOuuCbdZ1fY VTmJHX94Ok0HY7VVsnZTg3HQMf45iu82Dj3aarTAerVv+ocYhuiL14bNTnSBDfp9SV+v AZLeFlnv+W9uL1UN8EFBWqf/ZDvBYz+8gwM0PLeJrxtwaDNlPtznOBEFi6szTJLNwgGM FrjdGqouCFqc9utuqhtN7vcX2CGMfQyjAzQY9EfyKKYpnaLnc9/ERFTLtR8nJYgHQg/z S38rk1SkW9xnltTRkh66b226ESRblaPZ/I4KmH6OzQiPFUjO5JL9RwxvS0H+f5XqBUK2 BL5A== 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=oknxkN93lM10p7H+ZOPQmB3ANyUU8TNjZxsOq9hhIMc=; b=nTs3IROYCfuOkc9knIoeabAnA3EJ4zqgMXcxhZZ2zlBV+YOdFybvE+eYwEN7f+rt+0 kW6RkYiRDWMQ80NSzT+xonACY9PLfvgYI7iRBepe1BCqIw2FFhwB5XQ4rWyVf8TP2Vkr yuCsHGvCrFjLVkVWdkPGsn/ExI8S9aO0i8xir7yM4nugp1ob7BRDuGFai2BKMo91ff5N gqkLgPdowh4Kqutg/EjSnXhVz1v8d7KNqX6GbuKsDZq5BbiGE8eR5VvgrhiCLctg4MXd zcX66vQN9wT3orHGAkiVwQeeYuSYomYsMMN78SpUktGLNTDH6fYVvyJHSbfpqGgCcOeg 7mkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=UQuFKEjh; 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 n19si5818616ejb.704.2020.06.17.00.11.16; Wed, 17 Jun 2020 00:11:37 -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=UQuFKEjh; 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 S1726969AbgFQHGK (ORCPT + 99 others); Wed, 17 Jun 2020 03:06:10 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:48341 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725929AbgFQHFc (ORCPT ); Wed, 17 Jun 2020 03:05:32 -0400 X-UUID: e9f94bcedf7641428b89275b1f55790a-20200617 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=oknxkN93lM10p7H+ZOPQmB3ANyUU8TNjZxsOq9hhIMc=; b=UQuFKEjhqAh7OKPmv4EzqpQgbAqDbCBfh8HRf+sHmkOvhP3U649f++4Lkfz+arz1GsS8pRFDFE0/FW8vIhURkcOWKs/9P9+kBmiyZz6h118K4xvA3crQ7lKsCFYd1rx7Xpvh0LaxaLqIf17jS97XWRaIc1+Oy+U5qMmiKI9QL1U=; X-UUID: e9f94bcedf7641428b89275b1f55790a-20200617 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1095072231; Wed, 17 Jun 2020 15:05:25 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 17 Jun 2020 15:05:24 +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.1497.2 via Frontend Transport; Wed, 17 Jun 2020 15:05:23 +0800 From: Weiyi Lu To: Enric Balletbo Serra , Matthias Brugger , Nicolas Boichat , "Rob Herring" , Sascha Hauer CC: James Liao , Fan Chen , , , , , , Weiyi Lu , Wendell Lin Subject: [PATCH v16 06/11] soc: mediatek: Add subsys clock control for bus protection Date: Wed, 17 Jun 2020 15:05:12 +0800 Message-ID: <1592377517-14817-7-git-send-email-weiyi.lu@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1592377517-14817-1-git-send-email-weiyi.lu@mediatek.com> References: <1592377517-14817-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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