Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp936481ybg; Wed, 29 Jul 2020 01:20:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5XkU/8v2JvFry6Vul8SXvtcwaKRRv7J0J27JQNqAa7xeHaRaEPgUZIeUB8qD5BQKQRZAh X-Received: by 2002:aa7:ca4b:: with SMTP id j11mr24894732edt.385.1596010852105; Wed, 29 Jul 2020 01:20:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596010852; cv=none; d=google.com; s=arc-20160816; b=eV4G3wuNDWEWX32qwwNGlh52RkaKaaowF4oEk8szT28LeQ8JQYeTIh78PwDJCYOFqB wyUIZL7fVNFnzo/Iks0rWDE1xB4FblDwrtJVPhVObVimpK1yaZqKPx1OUugRtvO/mWT/ 5nwA9gdP+mpTjR7eeUZVgpPLUOb4HNR8Zqs0y9jSYwWwm55FbQtDZLAWpa/2f8xuZlYc Q57bn/0gTUejwrjfXoafuL7GphT80OYJQsreGD8z/YB5seNmnZcybePbWBJmhUEVATvQ k7q6bZtJtK7uDv8cCt9t6kPMbaKBhiPF7cv38YzLES3c30eoPlkTfLX0yvWlVMsB7dc+ BG2g== 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=4HoCUm1VKa+OVqJwqdlK9Is/oFM+0Id/fxBkQMe/9cU=; b=BkL7qedtDJOLZygU6RvCDdsccuHHwAoyTWBAQN4N//loTf2FkxsvPD+0/MZBM2JHO0 cfYKuWV3d6XlTih9GFh4tf0UPuYzIgyXnUBKg29xY/p75ZR+x3OB9EJjc/Ov7EpdQzgG WBBPhI+Oj3R39o3spGsGKsk6I+R8uuacqUoeTB/TTyfbZM0kJQrRb9/0W+7qr6xO9YXP EQozAjxRe0/yqe+mlz3gN17hDM5pP0o5WApFGTVsT+m1bJOx1NydEjLUJN8FqQqp6Huh kv2Wa+rgnJt0WCXwFmCGCVHJPY9MZhohx1vJZuPoB0fFpDVtU68DJ4C6RmQmSLN2jkOu IKkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=iDiyH8sJ; 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 j22si932328eds.273.2020.07.29.01.20.25; Wed, 29 Jul 2020 01:20:52 -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=iDiyH8sJ; 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 S1728049AbgG2IS2 (ORCPT + 99 others); Wed, 29 Jul 2020 04:18:28 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:53386 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727907AbgG2ISZ (ORCPT ); Wed, 29 Jul 2020 04:18:25 -0400 X-UUID: f9ca2b709783475f8fbce760d8f49a8e-20200729 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=4HoCUm1VKa+OVqJwqdlK9Is/oFM+0Id/fxBkQMe/9cU=; b=iDiyH8sJRZXAJXv3rFoV5pML4Thnsjy759HPsYVFLWpEDKwuJQRv7bA1Xe/6+NwWC1fgSlh4Zd9bv0t58XTlWlgBqkcuOFllKqp3wD3+Z0ex8vpVvSGhkf6L50Mj6rQaalbJs754nkH95aQ/sXtEvLTod/CsoIplHVN/e7zYgxk=; X-UUID: f9ca2b709783475f8fbce760d8f49a8e-20200729 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 1070123174; Wed, 29 Jul 2020 16:18:13 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 29 Jul 2020 16:18:10 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 29 Jul 2020 16:18:10 +0800 From: Neal Liu To: Rob Herring , Matthias Brugger CC: Neal Liu , , , , lkml , Subject: [PATCH v4 2/2] soc: mediatek: add mtk-devapc driver Date: Wed, 29 Jul 2020 16:18:10 +0800 Message-ID: <1596010690-13178-3-git-send-email-neal.liu@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1596010690-13178-1-git-send-email-neal.liu@mediatek.com> References: <1596010690-13178-1-git-send-email-neal.liu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: F4037C3EF092712B35F92E4A59BA033C2B72336223F6C9CDEDC4DC3748514F6C2000: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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