Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BCC5C433F5 for ; Thu, 2 Dec 2021 02:24:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354799AbhLBC2T (ORCPT ); Wed, 1 Dec 2021 21:28:19 -0500 Received: from mailgw01.mediatek.com ([60.244.123.138]:48416 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S231411AbhLBC2O (ORCPT ); Wed, 1 Dec 2021 21:28:14 -0500 X-UUID: 0f68d2f4c5b24904ab84f28d041a0082-20211202 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=AHmsPye+oS64Ia2j1cF6tOC8bwi1WXzPgbpY1A+/Zes=; b=gVwC207Hd9CF1d89Sv/Gp16WE5bj+VcaByiMs8DFovLK4rH5LIXQ4TMkP1uyjPtlcX7kBtpFLQPWYE4wbeeWawLqiQ5v+wHDzOmBogxXH8x4flv+U0QYeqvIrAYc0d3SrUZYI82eLMxB8uBZwlQPhTi895PkqGWPV++0LiKnRKg=; X-UUID: 0f68d2f4c5b24904ab84f28d041a0082-20211202 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 196802609; Thu, 02 Dec 2021 10:24:48 +0800 Received: from mtkexhb01.mediatek.inc (172.21.101.102) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Thu, 2 Dec 2021 10:24:47 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkexhb01.mediatek.inc (172.21.101.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 2 Dec 2021 10:24:46 +0800 Received: from mhfsdcap04 (10.17.3.154) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 2 Dec 2021 10:24:45 +0800 Message-ID: Subject: Re: [PATCH v11, 01/19] media: mtk-vcodec: Get numbers of register bases from DT From: "yunfei.dong@mediatek.com" To: Benjamin Gaignard , Alexandre Courbot , Hans Verkuil , "Tzung-Bi Shih" , Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Tomasz Figa CC: Hsin-Yi Wang , Fritz Koenig , Dafna Hirschfeld , Daniel Vetter , dri-devel , Irui Wang , , , , , , , Date: Thu, 2 Dec 2021 10:24:44 +0800 In-Reply-To: <5e350a02-eb4b-5080-8d13-fe01ccf5dd70@collabora.com> References: <20211129034201.5767-1-yunfei.dong@mediatek.com> <20211129034201.5767-2-yunfei.dong@mediatek.com> <5e350a02-eb4b-5080-8d13-fe01ccf5dd70@collabora.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SGkgQmVuamFtaW4sDQoNClRoYW5rcyBmb3IgeW91ciBzdWdnZXN0aW9uLg0KT24gVHVlLCAyMDIx LTExLTMwIGF0IDE0OjIwICswMTAwLCBCZW5qYW1pbiBHYWlnbmFyZCB3cm90ZToNCj4gTGUgMjkv MTEvMjAyMSDDoCAwNDo0MSwgWXVuZmVpIERvbmcgYSDDqWNyaXQgOg0KPiA+IERpZmZlcmVudCBw bGF0Zm9ybSBtYXkgaGFzIGRpZmZlcmVudCBudW1iZXJzIG9mIHJlZ2lzd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