From patchwork Tue Apr 25 13:45:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 13223356 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A6BEC77B76 for ; Tue, 25 Apr 2023 13:46:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=swjVOF4gIKDL8X4K7If6Wa5bBity6cgGW8s5O+AZ9GY=; b=aVQwSMrStH2fw2 SVwOQPYMFSBSVjXpgZdSbzSZS0R6ikjTTIOUyvrTQGxiu2GPHT62E22Y6Z1MblHEJ1hT+6ABNfU2W xR3CID9GHiJMuQOVIUJHPfmstcY4+RnjEFLrCIjXR9y6ehmKO2SfUNPcPxePKZIfUdtYmoIENe1NQ Q+FoNDqWz9Cmf54o920m9EyKATP/VrYNIWHTn3A3mMAqhcPmfhf81DGiGBVOSPkYnDnZjlcDJ3HHX Zea/XTNv4eF80W6P6tQm1bKfw+sBnt3LTRuvsGzBZVd10OrU4ZywjrTBEE0HMp+yIGyUt55mO1mA3 5f6DPGIZk1psmyHUxplQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1prIzF-001IKz-1B; Tue, 25 Apr 2023 13:45:41 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1prIzC-001IIk-0V for linux-arm-kernel@lists.infradead.org; Tue, 25 Apr 2023 13:45:39 +0000 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-959a626b622so376355766b.0 for ; Tue, 25 Apr 2023 06:45:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; t=1682430334; x=1685022334; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zRgabKLq7eTacDKoRbI9FK/SG7BfFMCRKhP9HGH7/VI=; b=DpdsldsksNbrlYrHx72q3FsmVTygzQ8+ILEy/6Z47oNp9+CIsnm7sxSovUbiQbZgg7 imHgDTz+AF0pXiJXTeaGHUgYJ3ib0U2en5rmsPCF0yP23sLsX4UntZCS+HMGFgBqxlkA Cj5e7wrWZ+8OKjCeMrv7BQItLrjPiqb0hugP8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682430334; x=1685022334; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zRgabKLq7eTacDKoRbI9FK/SG7BfFMCRKhP9HGH7/VI=; b=TTOuKB8mHnvBcrNixEODp+OfL+BLWW81oI9POMo0Wx126QKBCu26kkH/ybXry9NOHD kFRkHnZxBHhtGal95NUROiztPiTajN1hvLQhnj3Dwog45UyzAGlNXzXMeSQBoG1o2dxv 8fru1owPUEIluCgZjKhssEB/1h4e4zJVwAntZJikzBk1uyrEXeJhrQxz8ngsfb0hXx9e r0QWcZND1wU8VgplZ9EiG1akrnAb04UUNCoPBRDw4hXQ2yXeULezfhTscVRpxbGYDVxB oO5pWr1yk9/D7lPxBDkQKvwHWHY5Fmuoo1JCtPsUPdL0V8EcsLRo0+4fFD5pPDCDTnjI 84Pg== X-Gm-Message-State: AAQBX9crYwuKwcy7pyGq5jUSou1gVldyfN+hRjzXs/VMEnYyPa1VB9rP /lOyEK4Ayv9Uu3c+UAzjHahLRg== X-Google-Smtp-Source: AKy350Z83jsGizwNJRA+mohLxhjiEvtuoiSejIRimuqtdjKMN2jPVPuP7+Lhh1bC8E1iH8chq3akuw== X-Received: by 2002:a17:907:7e9c:b0:957:28b2:560a with SMTP id qb28-20020a1709077e9c00b0095728b2560amr13750121ejc.46.1682430334339; Tue, 25 Apr 2023 06:45:34 -0700 (PDT) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id f10-20020a170906048a00b0094eeea5c649sm6806822eja.114.2023.04.25.06.45.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 06:45:34 -0700 (PDT) From: Rasmus Villemoes To: Mark Brown , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: Marc Kleine-Budde , Rasmus Villemoes , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] spi: spi-imx: set max_native_cs for imx51/imx53/imx6 variants Date: Tue, 25 Apr 2023 15:45:26 +0200 Message-Id: <20230425134527.483607-3-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230425134527.483607-1-linux@rasmusvillemoes.dk> References: <20230425134527.483607-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230425_064538_196716_4B510199 X-CRM114-Status: GOOD ( 12.47 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The ecspi IP block on imx51/imx53/imx6 have four native chip selects. Tell that to the spi core so that any non-gpio chip selects get validated against that upper bound. Also set the SPI_MASTER_GPIO_SS so that the core verifies that, in the case where both native and gpio chip selects are in use, there is at least one leftover native chip select (or "channel", in the ecspi language) for use by the slaves sitting on gpio chip selects. Signed-off-by: Rasmus Villemoes --- drivers/spi/spi-imx.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 6fa53a82674a..e8f7afbd9847 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -1749,6 +1749,11 @@ static int spi_imx_probe(struct platform_device *pdev) */ controller->mode_bits |= SPI_CS_WORD; + if (is_imx51_ecspi(spi_imx) || is_imx53_ecspi(spi_imx)) { + controller->max_native_cs = 4; + controller->flags |= SPI_MASTER_GPIO_SS; + } + spi_imx->spi_drctl = spi_drctl; init_completion(&spi_imx->xfer_done);