Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1012751pxa; Wed, 12 Aug 2020 20:34:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1gK853G8hICJNFXyrz81coc8O0UIhGCsunqQYmsKuYlMNl28WAr9TndcskNajSTDt0T/X X-Received: by 2002:a17:906:b08:: with SMTP id u8mr2919422ejg.401.1597289689706; Wed, 12 Aug 2020 20:34:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597289689; cv=none; d=google.com; s=arc-20160816; b=FoDsusJk2uKgdtETFhWlQANAKIATCsLxqTAbdnyPcpmQ5I+V2bO0dlWv87AST24rwP SbsQkM5aKJcLHbFdUquvDbJ/WaFKjlix/91xTY707Io+VK3sbVovp0k4VZrrMfdjhsgZ V1tsgE22msIIWkkCS+MgBjokJOJF+8SonzNXPoil4ArXceaZ8K0y4qee7cor4GWylvRJ d7w9zy4LnfKQ3KZ7stKlL4C3kkp9pyvmHKM3/2f4kWTzHbdiYV7f4/MdHIFYmKXmFAWF 5fa5j2jVPfPKVIUZ3q/p0fjqHm1MSeTItJX1ZjDnCYIGDht3BupiGw1tuE9MFxA7yA12 YGRA== 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=JK+09SHKelx5uYbhLG31iT0QlDQrxU3vG473RkjzUG8=; b=lMcfGPMBs3zZ5qFKQF8A1DWOywTcuV+wec/ihXBkuALvmWQiv4XN6Bw/W7Sl1h2ppg MXtZw7b8zhB1WrMWB/+hcFmMzSYBpK5l+2q19Fz0OWtyVRf2lYRSV+1MmFk9xnt/CzxA x4Kf8xP0kOWAEtu8UgfvUqnqgZaQW3y5dHRA+jp+sUPa67hCavCbJqq6ruDC37ypVXmQ 1M/m9K92WF4EPKk+9eFGarOTVzMV7Ih8A8ofdmUJm/NZ3QXImWkv6/uOqaRNA3i+v14Q qvYjIN3uhGpAR5waPcrOS7OrzVhcGINh+F/K4X5olgdHqrzE90RBr8+/v9Wk14XNxZOb frNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=V4CY5B05; 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 gh12si2507403ejb.75.2020.08.12.20.34.26; Wed, 12 Aug 2020 20:34:49 -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=V4CY5B05; 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 S1726697AbgHMDdA (ORCPT + 99 others); Wed, 12 Aug 2020 23:33:00 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:22210 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726676AbgHMDc7 (ORCPT ); Wed, 12 Aug 2020 23:32:59 -0400 X-UUID: cccc8dfa4e4a4b61b776866872ad424d-20200813 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=JK+09SHKelx5uYbhLG31iT0QlDQrxU3vG473RkjzUG8=; b=V4CY5B05bGkoelg9SzTRSGFdR16L5d4V4ysVxKwUP56/nY/m89J+y6kl4Qj+rDtweWcC6WNknjXBiJqOfUg8U/9Uvu5k7zjUeqUTwIoFuJ+QTfWwVjquoCIimM3Sz6TYV8uDcYKg300XQe4++C9VUhfU8s+u9Uidnb6qArx8cDM=; X-UUID: cccc8dfa4e4a4b61b776866872ad424d-20200813 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 1257724778; Thu, 13 Aug 2020 11:32:47 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 13 Aug 2020 11:32:45 +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; Thu, 13 Aug 2020 11:32:45 +0800 From: Neal Liu To: Rob Herring , Matthias Brugger CC: Neal Liu , , , , lkml , Subject: [PATCH v6 2/2] soc: mediatek: add mt6779 devapc driver Date: Thu, 13 Aug 2020 11:32:44 +0800 Message-ID: <1597289564-17030-3-git-send-email-neal.liu@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1597289564-17030-1-git-send-email-neal.liu@mediatek.com> References: <1597289564-17030-1-git-send-email-neal.liu@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 TWVkaWFUZWsgYnVzIGZhYnJpYyBwcm92aWRlcyBUcnVzdFpvbmUgc2VjdXJpdHkgc3VwcG9ydCBh bmQgZGF0YQ0KcHJvdGVjdGlvbiB0byBwcmV2ZW50IHNsYXZlcyBmcm9tIGJlaW5nIGFjY2Vzc2Vk IGJ5IHVuZXhwZWN0ZWQNCm1hc3RlcnMuDQpUaG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