Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp252711pxk; Tue, 1 Sep 2020 23:35:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhrOnUVwisgU2obsf5Nyra9K8lC410TgEmnZkquoR+byKYKp3JE/0ygMtW8drAdsZHlosv X-Received: by 2002:aa7:db89:: with SMTP id u9mr4825611edt.267.1599028529721; Tue, 01 Sep 2020 23:35:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599028529; cv=none; d=google.com; s=arc-20160816; b=ZOtgyobJdn9Dam5SxZiol/Sn9JmxRiWZwcM2ZqZZ9WIyOM2sMIk6PGVgP95gabQVzn bt4EJMLdp/kXDeS+e7uZd4TjFTNPkB8sp4mnajan7ac55zr5WN/iy3DY88vqkBFQEwy5 tgK4NptJV4TZSSImZTaLYDmJddkZxF2iSxler+N+84x48ORVQSIrVm8+dXT2gLwNbniU qgd9g4QPCWdQR58tEzfTaxwTLPQ5n4E+Jr+KwoENGnX261BAjEcti+/JcJinuwB6p4L9 Jpnu98dN7VbhBcmfUZNSWUEVUjEruSr/iILZfsFpljA6tO298kDwRNFXOq1AAOq4zC3N ruzA== 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=kxH3tHGksx8HMp2pVMJOe2I26SY3rM5VW3ZL8QVRR+w=; b=D0GygvL3POASdNCOB/+DRta67Z9ZzxW/lPOZXQZik5eIITexx0OxH6tAMADaD+purz YolWnw8sGxaFPqh8GcgoJ5TARKJ8SSS1+B58zjEyEN7Q5u3aid/BUlaEQ34br0G8jhFv NcOcEsTEFQPpDm3TqdwGJ1WE774ECWNuHM8/QskKynb/LjcZbkfISDiG82rt3vc3qunw xw8A7ueueMaart1b/+fO312TB+lTQrYdGiQO9KihrhU+nTuLiCEQJj9QpbPQex/MGWnS Ap+elWMgQzXcMg3KgXcLrrdpB6df3OHZnJYAoIp+r1CIvzL1Ge8reDMNP56oOBfqlqlY GmZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=tTlVqBt5; 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 z15si2130363ejr.114.2020.09.01.23.35.06; Tue, 01 Sep 2020 23:35:29 -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=tTlVqBt5; 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 S1726657AbgIBGeT (ORCPT + 99 others); Wed, 2 Sep 2020 02:34:19 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:6506 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726312AbgIBGeQ (ORCPT ); Wed, 2 Sep 2020 02:34:16 -0400 X-UUID: c5f78bce01224232ac8d6165bfaf697c-20200902 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=kxH3tHGksx8HMp2pVMJOe2I26SY3rM5VW3ZL8QVRR+w=; b=tTlVqBt5KGW7hJrtFvpexygtXonaW3wdHHGfALgKhgCCTHZPfLpjTtiUHbG0kS2/PJDnxU14UEsOaNDsQE+Try4F0Q1UQj0MsSwtMIiupxfiaSiSxRvPc1duw4Q/OQHpFRhIwdfH/reKU7jCg5/pVCT2zVeeIlDGqNPpbmEh0hI=; X-UUID: c5f78bce01224232ac8d6165bfaf697c-20200902 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1460731781; Wed, 02 Sep 2020 14:34:06 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs06n2.mediatek.inc (172.21.101.130) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 2 Sep 2020 14:34:05 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 2 Sep 2020 14:34:04 +0800 From: Mark-PK Tsai To: , CC: , , , , , , , , , , Subject: [PATCH v3 1/2] irqchip: irq-mst: Add MStar interrupt controller support Date: Wed, 2 Sep 2020 14:33:43 +0800 Message-ID: <20200902063344.1852-2-mark-pk.tsai@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200902063344.1852-1-mark-pk.tsai@mediatek.com> References: <20200902063344.1852-1-mark-pk.tsai@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: C1AD1E4F07400650ADD964CC6309425B7922614FDC0368EF2EA93CEBD55586AB2000: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 QWRkIE1TdGFyIGludGVycnVwdCBjb250cm9sbGVyIHN1cHBvcnQgdXNpbmcgaGllcmFyY2h5IGly cQ0KZG9tYWluLg0KDQpTaWduZWQtb2ZmLWJ5OiBNYXJrLVBLIFRzYWkgPG1hcmstc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