Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5587106ybc; Wed, 27 Nov 2019 06:26:25 -0800 (PST) X-Google-Smtp-Source: APXvYqz/gtR09YmmpgOGoSk6y8IXmVpxrXVsy4E9Ir5sYVXG/jK9a7oq/Izk+6GJ/L+dn6tr/8h6 X-Received: by 2002:a17:906:6403:: with SMTP id d3mr50169052ejm.258.1574864785114; Wed, 27 Nov 2019 06:26:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574864785; cv=none; d=google.com; s=arc-20160816; b=apNVO/u+/9ovp3w4UVJjx0PoeTZnWfruXRzQTGgvZEga40tTtC+RzjtyX8rlNgeGhP sWKYayHZCVDcE9Tp7I27kNlSaAN1edV9xNsSRZvNgbxo3d5zj6Q9upko8esGGJDWsIul ytDjkrSHEDJrBwS1EyrxMbt1/puhw7Vippd7RYM0AwaInTEYIVBT1jFypizKNlHs/21z LbWP3uQkBFZlbQ8th9njXS9cImzwA+204gcQm/6d3izMD96h+pAsBJrzTwCSr1zixiGX Rdd/G9FOGUyh+iRg6g8D36mH+PdmjPpTm46AUKL2bhcJ/zVIp/35dxYB2zRqCuhzYTuC 1gzg== 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=WFphvlMRaDKdtjVxAem+AWZT/bf0cnW1dQzo9Dpt9Co=; b=wLyKsclfLN6AB4EUuHfn5hm8Pv3dX3X6GyJ9t5kkmLLN1xu8ix7V1H/p693hf39JbQ xZjIPUy8eDqX9MiOnvyaskynNhDtO2sbmstyJXORciF9gMe8CkQg+pYbBdPRJWiD8ORY 5z4rDK1lolWAAdAhU05dxt2r01LMGudWJ3NOy7AFk5oKkpuYb6i+jMdoHV0HgW6h5JBB 7bGTBIXodgQGiqWZdbhGfQaGrVajalhJ6f7HwJD3PEE0k+fQCgC+qVQpK4QdZwWB+dgF BC+RgfHATapNyqz1VYx2qDZvGxq9aHMumK5GYP3bnEQ+0fT9VRvb2fIImWHhQB4GMjwl BufA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=BAVmAcet; 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 uz17si2498029ejb.266.2019.11.27.06.25.59; Wed, 27 Nov 2019 06:26:25 -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=BAVmAcet; 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 S1727207AbfK0OXV (ORCPT + 99 others); Wed, 27 Nov 2019 09:23:21 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:15498 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727118AbfK0OXT (ORCPT ); Wed, 27 Nov 2019 09:23:19 -0500 X-UUID: f8ae20a4f1ad42c1ba79108682bc28a7-20191127 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=WFphvlMRaDKdtjVxAem+AWZT/bf0cnW1dQzo9Dpt9Co=; b=BAVmAcettnKIN1LE0bkG5QTvcqrXyT6Lq4JIDlH38hYhfJ8FTOlxN3QoH1xjhx1wWhwxunCIiuk/H10ksaFLNX9EmECaOLGB0dOp2Gq5OUwYBI76/NEVoOh6EpOkq9vVtUI/U3c8mH5lnHnhQTvLPen0WfOhLgbefYONPOT/2Dw=; X-UUID: f8ae20a4f1ad42c1ba79108682bc28a7-20191127 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 433868931; Wed, 27 Nov 2019 22:23:10 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 27 Nov 2019 22:23:05 +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.1395.4 via Frontend Transport; Wed, 27 Nov 2019 22:23:03 +0800 From: Neal Liu To: Matt Mackall , Herbert Xu , Rob Herring , Mark Rutland , Matthias Brugger , Sean Wang CC: Neal Liu , Crystal Guo , , , , , , Subject: [PATCH v5 3/3] hwrng: add mtk-sec-rng driver Date: Wed, 27 Nov 2019 22:22:58 +0800 Message-ID: <1574864578-467-4-git-send-email-neal.liu@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1574864578-467-1-git-send-email-neal.liu@mediatek.com> References: <1574864578-467-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 Rm9yIE1lZGlhVGVrIFNvQ3Mgb24gQVJNdjggd2l0aCBUcnVzdFpvbmUgZW5hYmxlZCwgcGVyaXBo ZXJhbHMgbGlrZQ0KZW50cm9weSBzb3VyY2VzIGlzIG5vdCBhY2Nlc3NpYmx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