Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp409461ybh; Mon, 20 Jul 2020 21:00:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZR+x6rso70ssQvR76va29wA8/XVVttDPZ+Qwx1oOWediqjxo8Jl4w+EPpLc9fNQwMv6yl X-Received: by 2002:a05:6402:31bb:: with SMTP id dj27mr24195931edb.387.1595304048430; Mon, 20 Jul 2020 21:00:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595304048; cv=none; d=google.com; s=arc-20160816; b=jcKhr6HjQsXFWjNsAoG07LtjEl+C2qEfXHFkPM2xobKhYxBayK/Mb4+Jf+B+6izX+E 6BNeFyYcZJ6H00eh/92chx/KKhvC6kpqMLsnovhnLh6QY6KnEUeYGp5KJd4NlHCNHvV/ Gf7WnAq9C4jmyAHeUCkZWolpdmebOZ1e3iRR5X0Vg0MUTmPig43lrEeyxeHt7jVnhQbv /wqb04uEetxdR9EYBebjKr5ZJQ8Ca3VjDYxn1JrCbuaMmvkcCGSEMEAVeAen2GSQWePO r4QXfr7YEPyWt//xXb4f+/DV/YfpC52EC5uK+CSRDe1LXVYD402LvhUhxbm9pZe9H/qC xqDw== 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=rwrtl5qkYAB06GIEtyBjVaHw0WmiDOCorWtxIeA5meo=; b=hqLYmqraVv6hDyPiLmZHhPqZePjA7R+8uT7XmS/OU8VBw8mDRMbMYfOsErf5AiMmY2 XbCXj1GNO7KKRw0xSq3HubC1kYyU+xlNh5hzZ1DZuOEy/lOjhAXjx+qaZwJaE7rTEQJB H84Rx/vABeR8rkuPzc4geKNct40Xctf/FkzkdUNiRBUQEfxHFYResNeldqa7dR/Hs9el WNXsky/HDmcC5XBzQC5N4gEJqWkMM5gvFkeAUWo/IV6WNKPfdlUkrcOwguHkrbQVfZ0h cSuuUsuJv9LaZyMRXQZixvb1kiy1W3gYjz1eU8+oPdMZimshOajSbKXo8mWvgoQRZS2u 1Mwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=oZivCz7Z; 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 qp26si11904229ejb.118.2020.07.20.21.00.25; Mon, 20 Jul 2020 21:00:48 -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=oZivCz7Z; 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 S1727799AbgGUD7t (ORCPT + 99 others); Mon, 20 Jul 2020 23:59:49 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:3782 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726089AbgGUD7s (ORCPT ); Mon, 20 Jul 2020 23:59:48 -0400 X-UUID: 6c5c48a71bc44c989db0eb44e81dab6d-20200721 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=rwrtl5qkYAB06GIEtyBjVaHw0WmiDOCorWtxIeA5meo=; b=oZivCz7Zd73cYPb3fHDQyhpzBeG3xOVnBPJEYQ06RbVv4uWPWigl8NxpKy2JT5nr4VqahanGuctHA6sjTe+8uVlMxnMYl4UvtfllYIxuOHgEna7bkWX9qeJWMOeGhtHef861mHyLxEy77/++ppdOm4ec7zDA7SZ8Gvof0K7LnmI=; X-UUID: 6c5c48a71bc44c989db0eb44e81dab6d-20200721 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1653243863; Tue, 21 Jul 2020 11:59:36 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 21 Jul 2020 11:59:33 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 21 Jul 2020 11:59:33 +0800 From: Neal Liu To: Rob Herring , Matthias Brugger CC: Neal Liu , , , , lkml , Subject: [PATCH v3 2/2] soc: mediatek: add mtk-devapc driver Date: Tue, 21 Jul 2020 11:59:31 +0800 Message-ID: <1595303971-8793-3-git-send-email-neal.liu@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1595303971-8793-1-git-send-email-neal.liu@mediatek.com> References: <1595303971-8793-1-git-send-email-neal.liu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 286DBE0385449444B7ED4DFE2B7ECFEB77A4A0B02E7E3BA5B071D643A490BD2D2000: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 TWVkaWFUZWsgYnVzIGZhYnJpYyBwcm92aWRlcyBUcnVzdFpvbmUgc2VjdXJpdHkgc3VwcG9ydCBh bmQgZGF0YQ0KcHJvdGVjdGlvbiB0byBwcmV2ZW50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