Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4327755ybv; Sun, 16 Feb 2020 19:37:07 -0800 (PST) X-Google-Smtp-Source: APXvYqyZhK3YIcBxDuSEPsNbjMDhLm/5im5qGoIztEBUQMq+KOwX+wU1taIKeU2llcwa0DQpC9bQ X-Received: by 2002:a9d:5786:: with SMTP id q6mr10322155oth.164.1581910627161; Sun, 16 Feb 2020 19:37:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581910627; cv=none; d=google.com; s=arc-20160816; b=Srvsf0xI3624/l72VpoY8ZmA3FSnx3QILF1/vRW62+SdfRnPS+/JLuW5X7gGZPlJMy 0S6+Xj/2gE03f5/RtMHKAdcQp+hGryf/rc2kASdA7VzD+xyXt/RLcuXq94HdbmYY7PNh AR+6YpQ3T/p3yx8+PfqOqt6IiQNUZHYijzNS/zWBHsjIqaGcu9S39WHkYBo2NK0fEF2l y7VmJ5MtHjAF0T9PczF7W/RhZx0jQbDaX02+3Hg1WnFTEYu7HUVznxMtIUG9AslYiVvj doo3DRI3y2gtLIGRxG5OkzSKlItmLaRioJvtxJO9EZhbRUnBHV2r8iIwv3DjbO277WLY Bhbg== 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=9X5uWL1YgmrDZcTKHn0A/YVVUbEE9hPvqMSvyGyBAwc=; b=wEdBkQV7n+LK/Lz03+O8uyGRFHJDV9AXG8zm9gudLL72Oa/qmt/lQyX1Z/m3aheU84 QbEYrmPsDO/oF2QtfRglO2UBqmCC5ZoIWrGbLMyCX3DgxH+W32kmdsFK+QJovXQxX6c3 THwJbmw4YfmBh0GGFqaoYckcpPy/D2nPeg1+YUqH27wKvVlOVA/uT9OM5RsE80EQb7H/ 6MXoUfbyl+wCRPd/2QUI8p3K9CIbiA0otsnQnN1K4VYDkCwixymQ31NDgrgplGz7beJp WM940JUuIS62a2i77Yzbbgh2nxf8VkP90FTam5A0HQ7XAHXUUwKyfp/N+r8KOjVRAjgF Eitw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=gQ77otS5; 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 b141si6118999oii.79.2020.02.16.19.36.54; Sun, 16 Feb 2020 19:37:07 -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=gQ77otS5; 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 S1727874AbgBQDfh (ORCPT + 99 others); Sun, 16 Feb 2020 22:35:37 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:50592 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727794AbgBQDfh (ORCPT ); Sun, 16 Feb 2020 22:35:37 -0500 X-UUID: 887cdb48842244b58faabcdd25859af8-20200217 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=9X5uWL1YgmrDZcTKHn0A/YVVUbEE9hPvqMSvyGyBAwc=; b=gQ77otS54Lr8AiKwhwydlR1cUVzUQgeyK08dkUyW/hJmyksbMRAOyAQNdnImDseHrXXFRKKK3NwxN3v78vSuUGZTVq8M75dQWGIMBgly2m4K1fVDG+0lW9ew20PpdXKpVfppOpBnWmdRNe7SpvQ/NL4cFfaBg1fhGTJtcos/PRc=; X-UUID: 887cdb48842244b58faabcdd25859af8-20200217 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 2000701831; Mon, 17 Feb 2020 11:35:31 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 17 Feb 2020 11:33: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; Mon, 17 Feb 2020 11:35:08 +0800 From: Weiyi Lu To: Matthias Brugger , Nicolas Boichat , Rob Herring , Sascha Hauer CC: James Liao , Fan Chen , , , , , Weiyi Lu Subject: [PATCH v12 06/10] soc: mediatek: Add subsys clock control for bus protection Date: Mon, 17 Feb 2020 11:35:23 +0800 Message-ID: <1581910527-1636-7-git-send-email-weiyi.lu@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1581910527-1636-1-git-send-email-weiyi.lu@mediatek.com> References: <1581910527-1636-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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