From patchwork Mon Mar 22 05:52:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leilk Liu X-Patchwork-Id: 12153817 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7BD1DC433C1 for ; Mon, 22 Mar 2021 06:04:53 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2805761966 for ; Mon, 22 Mar 2021 06:04:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2805761966 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TFGBSwwRMnZsbHbSLJr8Mm0zZes94f+xTzlZttn7Gsg=; b=CLWstbeKlYUhcjOC6hHS1sild Kc+WTSIRAx+e3EdCY8P7GWHumYbFN3+NXEP36PaeJfrerwxw7379pm+z4eQcrZwL0W8svhoALIofn Uce38rbxrUNND+jlYTTeEbyzpsHRN/VeP/y6rZtBlSxhc6K/kkj20vdXenAN0z5PItyD/7j5hcMqG cecl9Eox+q6sFR23Wczi4qghnuTCtpse8QYqwbolUq5bwcSp1Co3Zn9p6E+TwvygZ7JoEopndytmJ 1yfSm9IvMdeLMRXVAkdrCleIODoMwfHuRG2peI2IPC+LdCZEaHRVVEICErq0znhSdv8/xjItpu4e1 LFGHxQuUQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lODg7-00AyUL-Ak; Mon, 22 Mar 2021 06:04:39 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lODen-00Ay4n-DS; Mon, 22 Mar 2021 06:03:22 +0000 X-UUID: a1de3f1b7fc44b5ab7236d2a62fe6e6d-20210321 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=cPhbu4oFo/dFLHNZuFeBBDy1LoKfSc9x7YN1dHK55+s=; b=NpmYmOM4X8jApetYpgY4lcNgCZf+GxwuadB+OyD8Hx9Rue7S6EjB/Vu5tn6CVpK5mmk8S96Ru72BMz7GQLat0SjtOOy9fsalzXyHkY8uhtLNtTA1kT2q5p5IanN/mge4asNMBvGO3zDggOPk2NBgrMtYeNAYShYGqXDcwSC0joI=; X-UUID: a1de3f1b7fc44b5ab7236d2a62fe6e6d-20210321 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1245153073; Sun, 21 Mar 2021 22:03:12 -0800 Received: from MTKMBS31N2.mediatek.inc (172.27.4.87) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 21 Mar 2021 22:53:11 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by MTKMBS31N2.mediatek.inc (172.27.4.87) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 22 Mar 2021 13:53:05 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 22 Mar 2021 13:53:04 +0800 From: Leilk Liu To: Mark Brown CC: Mark Rutland , Matthias Brugger , , , , , , , Leilk Liu Subject: [PATCH 1/4] spi: update spi master bindings for MT8195 SoC Date: Mon, 22 Mar 2021 13:52:41 +0800 Message-ID: <20210322055244.30179-2-leilk.liu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210322055244.30179-1-leilk.liu@mediatek.com> References: <20210322055244.30179-1-leilk.liu@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: 1AE6737A00D13FA30C1AF666ACECCA53224FDDC1BEDF3E087571B5E5460E21FF2000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210322_060321_279362_A068A0D2 X-CRM114-Status: UNSURE ( 9.60 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Add a DT binding documentation for the MT8195 soc. Signed-off-by: leilk.liu --- Documentation/devicetree/bindings/spi/spi-mt65xx.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/spi/spi-mt65xx.txt b/Documentation/devicetree/bindings/spi/spi-mt65xx.txt index 7bae7eef26c7..4d0e4c15c4ea 100644 --- a/Documentation/devicetree/bindings/spi/spi-mt65xx.txt +++ b/Documentation/devicetree/bindings/spi/spi-mt65xx.txt @@ -12,6 +12,7 @@ Required properties: - mediatek,mt8173-spi: for mt8173 platforms - mediatek,mt8183-spi: for mt8183 platforms - "mediatek,mt8192-spi", "mediatek,mt6765-spi": for mt8192 platforms + - "mediatek,mt8195-spi", "mediatek,mt6765-spi": for mt8195 platforms - "mediatek,mt8516-spi", "mediatek,mt2712-spi": for mt8516 platforms - "mediatek,mt6779-spi", "mediatek,mt6765-spi": for mt6779 platforms From patchwork Mon Mar 22 05:52:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leilk Liu X-Patchwork-Id: 12153815 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65CD5C433C1 for ; Mon, 22 Mar 2021 06:04:43 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E393261931 for ; Mon, 22 Mar 2021 06:04:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E393261931 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zjiSmWy5G/IVh2WgrGsYNEIuM0hgzxBU+lv9zLt8ITQ=; b=ZvKh0Erjhg3KbKkwd0XJiW4X+ 07PNQPn99JJdBoRffP45jBUb3FhH+iO1DiVUP5uEIgxCKGuIFHkNFZZ434tcxZsF5r6sB1Xe/jEVR QSXj5flPeAW0cpy/BbO/U8RGTGU9GQm/KhOnmUYVzfgKgNTkKdHeIHzdMWPOmfYOXOkUsmi2429Kg YfLVAwI4llRCHCFyAehVLN4HCyUasbNuk9rjJzSHuHotHjCTDLXrFV7MIkDUlAw4cm9pK6a/KqT7y iC8LfyEaeefgtihyPPOSsQ1bhuatmhSjT14a5/dS0FDrQ2NsovdhCb77G4qeqyh+7+309YfCnB2mZ m+xl2jFiQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lODfn-00AyMU-GI; Mon, 22 Mar 2021 06:04:19 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lODem-00Ay4m-VU; Mon, 22 Mar 2021 06:03:21 +0000 X-UUID: 6d677d052584455881e91714442c7214-20210321 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=uylxYbXL2VWOWwwtS3jNvk8Jyvt/z26BMQ+/v7Ce7ak=; b=WuwHf40how8nCOUxrkDuqRntRj3XA5vfXnQn/Bkxnoip68BmNchSKCH2ph+/LzeobRg2DfLmEPQ8V1epbeGhVsi2sFy36jFsMI+2JUFf/81kf/DZlbngRk4LpVZfif9/Sl0UlMSJwETEOD/BGkIZp+XAacEAQz4xO7ifdJLJXwQ=; X-UUID: 6d677d052584455881e91714442c7214-20210321 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 216630061; Sun, 21 Mar 2021 22:03:12 -0800 Received: from MTKMBS31N2.mediatek.inc (172.27.4.87) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 21 Mar 2021 22:53:11 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by MTKMBS31N2.mediatek.inc (172.27.4.87) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 22 Mar 2021 13:53:06 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 22 Mar 2021 13:53:05 +0800 From: Leilk Liu To: Mark Brown CC: Mark Rutland , Matthias Brugger , , , , , , , Leilk Liu Subject: [PATCH 2/4] spi: update spi slave bindings for MT8195 SoC Date: Mon, 22 Mar 2021 13:52:42 +0800 Message-ID: <20210322055244.30179-3-leilk.liu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210322055244.30179-1-leilk.liu@mediatek.com> References: <20210322055244.30179-1-leilk.liu@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: 9F79E37BABE1F44B1C4A109126999E2848C35006EB447B3433E3E6030C2D2E6A2000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210322_060318_054225_49582E7C X-CRM114-Status: GOOD ( 10.94 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Add a DT binding documentation for the MT8195 soc. Signed-off-by: Leilk Liu --- Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt b/Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt index c37e5a179b21..9192724540fd 100644 --- a/Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt +++ b/Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt @@ -3,6 +3,7 @@ Binding for MTK SPI Slave controller Required properties: - compatible: should be one of the following. - mediatek,mt2712-spi-slave: for mt2712 platforms + - mediatek,mt8195-spi-slave: for mt8195 platforms - reg: Address and length of the register set for the device. - interrupts: Should contain spi interrupt. - clocks: phandles to input clocks. From patchwork Mon Mar 22 05:52:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leilk Liu X-Patchwork-Id: 12153765 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4195C433C1 for ; Mon, 22 Mar 2021 05:54:03 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 783D861966 for ; Mon, 22 Mar 2021 05:54:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 783D861966 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RZg3lLuLTW1RbEX+0dMG8SEG5bTKCBMq8FVcEQJPiM8=; b=lp5kjrp5HhKR3/MJTadRV12E8 cXi57jIpyoqnTleYs+XTLKMp2UpbiUf5OIYtojoFKr24AIWb3IW/hHzPiSd8bgn8r8a7U5pj7R86o V1jS6QUVuDJpyMZq2lHUA4H0H69jH7ioXPznoEeTP1bp31ljWNNegbjcx1nB7DeZkcCHFVE9nSl77 dYBDGj0OlZ5Ge8Bg6S+nwyThVuDcKt+CAWOliBq6ydR2ZtTZKJqVZ44mriYcT4ZziLYjtCjKeY5l/ SzZXe95oQ6DFJOpgFva+sIuWg1sxspz1xJ9D66UGNxI+k6Q8RbTTI9qJ3BJj0Z2cW9GjZDSsRYz5V /wxABtPJw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lODVd-00AwyQ-8B; Mon, 22 Mar 2021 05:53:49 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lODVN-00AwwO-Nd; Mon, 22 Mar 2021 05:53:38 +0000 X-UUID: a9f0f9c83302419bb58130ce0668ade3-20210321 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=DWhSzNDumgJNux8c1EtdJDcy6q/zzayTMpOqiZ8Wy2c=; b=NkMzGfBdIWVDevvZ1CWXbPdGPsDsUr1A4tY1qp3mvqp+bsaOYCfeFX8rPEh9CmJ4PtT0d8ecRPn7GDs0aTYSvX1nYyhthfpepchLaJeoqSOTS8lAWy1wQ4pLP9i5qFoOUbbkLk62EZGKwPl/FLof+qCTu02pOAejkctsF8rtDnc=; X-UUID: a9f0f9c83302419bb58130ce0668ade3-20210321 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 103482881; Sun, 21 Mar 2021 21:53:19 -0800 Received: from MTKMBS31N1.mediatek.inc (172.27.4.69) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 21 Mar 2021 22:53:17 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 22 Mar 2021 13:53:07 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 22 Mar 2021 13:53:06 +0800 From: Leilk Liu To: Mark Brown CC: Mark Rutland , Matthias Brugger , , , , , , , Leilk Liu Subject: [PATCH 3/4] spi: mediatek: add mtk_spi_compatible support Date: Mon, 22 Mar 2021 13:52:43 +0800 Message-ID: <20210322055244.30179-4-leilk.liu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210322055244.30179-1-leilk.liu@mediatek.com> References: <20210322055244.30179-1-leilk.liu@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: 569023D4B5FEB7772D85FCDC49AC3136A05674D1807D11B39F8C6507BF24F9562000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210322_055337_166933_CB9F6DA6 X-CRM114-Status: GOOD ( 16.32 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org this patch adds max_fifo_size and must_rx compat support. Signed-off-by: Leilk Liu --- drivers/spi/spi-slave-mt27xx.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-slave-mt27xx.c b/drivers/spi/spi-slave-mt27xx.c index 44edaa360405..7e6fadc88cef 100644 --- a/drivers/spi/spi-slave-mt27xx.c +++ b/drivers/spi/spi-slave-mt27xx.c @@ -10,6 +10,8 @@ #include #include #include +#include + #define SPIS_IRQ_EN_REG 0x0 #define SPIS_IRQ_CLR_REG 0x4 @@ -61,8 +63,6 @@ #define SPIS_DMA_ADDR_EN BIT(1) #define SPIS_SOFT_RST BIT(0) -#define MTK_SPI_SLAVE_MAX_FIFO_SIZE 512U - struct mtk_spi_slave { struct device *dev; void __iomem *base; @@ -70,10 +70,19 @@ struct mtk_spi_slave { struct completion xfer_done; struct spi_transfer *cur_transfer; bool slave_aborted; + const struct mtk_spi_compatible *dev_comp; }; +struct mtk_spi_compatible { + const u32 max_fifo_size; + bool must_rx; +}; +static const struct mtk_spi_compatible mt2712_compat = { + .max_fifo_size = 512, +}; static const struct of_device_id mtk_spi_slave_of_match[] = { - { .compatible = "mediatek,mt2712-spi-slave", }, + { .compatible = "mediatek,mt2712-spi-slave", + .data = (void *)&mt2712_compat,}, {} }; MODULE_DEVICE_TABLE(of, mtk_spi_slave_of_match); @@ -272,7 +281,7 @@ static int mtk_spi_slave_transfer_one(struct spi_controller *ctlr, mdata->slave_aborted = false; mdata->cur_transfer = xfer; - if (xfer->len > MTK_SPI_SLAVE_MAX_FIFO_SIZE) + if (xfer->len > mdata->dev_comp->max_fifo_size) return mtk_spi_slave_dma_transfer(ctlr, spi, xfer); else return mtk_spi_slave_fifo_transfer(ctlr, spi, xfer); @@ -369,6 +378,7 @@ static int mtk_spi_slave_probe(struct platform_device *pdev) struct spi_controller *ctlr; struct mtk_spi_slave *mdata; int irq, ret; + const struct of_device_id *of_id; ctlr = spi_alloc_slave(&pdev->dev, sizeof(*mdata)); if (!ctlr) { @@ -386,7 +396,17 @@ static int mtk_spi_slave_probe(struct platform_device *pdev) ctlr->setup = mtk_spi_slave_setup; ctlr->slave_abort = mtk_slave_abort; + of_id = of_match_node(mtk_spi_slave_of_match, pdev->dev.of_node); + if (!of_id) { + dev_err(&pdev->dev, "failed to probe of_node\n"); + ret = -EINVAL; + goto err_put_ctlr; + } mdata = spi_controller_get_devdata(ctlr); + mdata->dev_comp = of_id->data; + + if (mdata->dev_comp->must_rx) + ctlr->flags = SPI_MASTER_MUST_RX; platform_set_drvdata(pdev, ctlr); From patchwork Mon Mar 22 05:52:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leilk Liu X-Patchwork-Id: 12153819 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0651DC433DB for ; Mon, 22 Mar 2021 06:05:04 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A9A4F61927 for ; Mon, 22 Mar 2021 06:05:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A9A4F61927 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qBJrNpBW+QQ0DMMcx/tIjV5L5k8WfhVKMYmQthrAg8A=; b=p8s9zbEEVnDnzRvYBZNZnO25a /G+hlSO+vij7TYrB6VTk/Y60RVgOSPXy6HaAAQDYu0hhRPWwd2LxGIKnsXwzv1tBkq0SaOXhYlmG0 L4wHRn6jiatD3W7WjxrVycsLoZlqUOjctjGLsC+qYQBOVHND4L0yfJpokWzZlRi3jHucgEUtY39SF DuP87CgbJaQlCpCnuWT1ABB4ttG/rP3iI30dmzhZK+jV2iDLbyZmwg7UUslpT1hRYp++gUoCGXAZK zITBg9M6vHNhd2cnsfhV9NCjOj4lQrtgBUXibyb2cDjWG2nCNX2g3e1K0obAImLYxSZHndi0S9vob DGFovZgOQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lODgK-00AybM-9w; Mon, 22 Mar 2021 06:04:52 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lODes-00Ay4m-Kb; Mon, 22 Mar 2021 06:03:24 +0000 X-UUID: 14bc75c1613b43e790b234e8ce482379-20210321 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=xFm2PB9tWmB7j4znqor7I6l0wxTRPSztnH4Dcx3dB+c=; b=r0q4WeO3CfrgPl6Gg/KUBm/zrt3rWQrk2LP2769NhZHAtsN10O05V/Y2SpfqYWbyOj+9inLILgp5MZpjbCv9SsddgXhFkMrDBC0DN2tpdDQqyBUbYJbYQIx49dUjrpj4hQvg6P3Bza3eWoqDMGtb+lH1mtPgYiskY+iW5d4dnPk=; X-UUID: 14bc75c1613b43e790b234e8ce482379-20210321 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1982307289; Sun, 21 Mar 2021 22:03:12 -0800 Received: from MTKMBS31N2.mediatek.inc (172.27.4.87) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 21 Mar 2021 22:53:12 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by MTKMBS31N2.mediatek.inc (172.27.4.87) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 22 Mar 2021 13:53:08 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 22 Mar 2021 13:53:07 +0800 From: Leilk Liu To: Mark Brown CC: Mark Rutland , Matthias Brugger , , , , , , , Leilk Liu Subject: [PATCH 4/4] spi: mediatek: add mt8195 spi slave support Date: Mon, 22 Mar 2021 13:52:44 +0800 Message-ID: <20210322055244.30179-5-leilk.liu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210322055244.30179-1-leilk.liu@mediatek.com> References: <20210322055244.30179-1-leilk.liu@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: 3597F3A5F9E48644A278F10701EA652FB15E6B1057F2215D5892DC25101ABE122000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210322_060323_395702_0097DDA6 X-CRM114-Status: GOOD ( 10.43 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org this patch adds mt8195 spi slave compatible support. Signed-off-by: Leilk Liu --- drivers/spi/spi-slave-mt27xx.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/spi/spi-slave-mt27xx.c b/drivers/spi/spi-slave-mt27xx.c index 7e6fadc88cef..f199a6c4738a 100644 --- a/drivers/spi/spi-slave-mt27xx.c +++ b/drivers/spi/spi-slave-mt27xx.c @@ -77,12 +77,20 @@ struct mtk_spi_compatible { const u32 max_fifo_size; bool must_rx; }; + static const struct mtk_spi_compatible mt2712_compat = { .max_fifo_size = 512, }; +static const struct mtk_spi_compatible mt8195_compat = { + .max_fifo_size = 128, + .must_rx = true, +}; + static const struct of_device_id mtk_spi_slave_of_match[] = { { .compatible = "mediatek,mt2712-spi-slave", .data = (void *)&mt2712_compat,}, + { .compatible = "mediatek,mt8195-spi-slave", + .data = (void *)&mt8195_compat,}, {} }; MODULE_DEVICE_TABLE(of, mtk_spi_slave_of_match);