From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C76871CDFAC; Sun, 7 Sep 2025 20:09:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757275773; cv=none; b=bBmYNDY5dVZE90sI3D7fTvgphrBN74V+ZwlYFCyO0vB23RKVZPbJvo7+S9Wpcx6jlMEBOq3vCNP9dnwdrdk1t2q2OZCeCO7zosmA1fk+T9PqAkuzs9GFYSDMOEa4m9JIQdl1++CQn9xVmur4+n61fK2c/jrPYUr73UmBQQsgGi0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757275773; c=relaxed/simple; bh=KERRDahLAzuGf1WFj2Z0h8dPYEYO5NcsltgDwjGN0Bk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YaB9HhYOaa/uyCGyZkHR91utpvqUcQhpKRjQgXvi6WhY2d26US6zk8Cx9CGXs5WpIOce2wEIC0uKENpVeDEgbTfNHVVOsIoGbA+NXdk6cE1b+bu1h6bU9W2VEcQ5tqGQQHvSSQ7bPKtZfhw2nGLgTXq8KJ+PUEbeqTP96K2LNAU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wDLGmUsi; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="wDLGmUsi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C1F7C4CEF0; Sun, 7 Sep 2025 20:09:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1757275773; bh=KERRDahLAzuGf1WFj2Z0h8dPYEYO5NcsltgDwjGN0Bk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wDLGmUsi3q1Pw4qHk4PJ8rtkGfR9VPmx8su7JutwDzvzwQm/WUa7ldrMP7W8xRkVm WYHEmjM0bF5di5Q7/kYv8bUbo6Q9lrm6UQgDeg1V4T2xD0NFzwSG76vxY62OKr7EVW vbGAcMamaDPJnJRt6Zb8RkvJbaiYF+zqs8Hdt9JY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Larisa Grigore , James Clark , Frank Li , Mark Brown , Sasha Levin Subject: [PATCH 5.10 48/52] spi: spi-fsl-lpspi: Set correct chip-select polarity bit Date: Sun, 7 Sep 2025 21:58:08 +0200 Message-ID: <20250907195603.353950192@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250907195601.957051083@linuxfoundation.org> References: <20250907195601.957051083@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Larisa Grigore [ Upstream commit cbe33705864ba2697a2939de715b81538cf32430 ] The driver currently supports multiple chip-selects, but only sets the polarity for the first one (CS 0). Fix it by setting the PCSPOL bit for the desired chip-select. Fixes: 5314987de5e5 ("spi: imx: add lpspi bus driver") Signed-off-by: Larisa Grigore Signed-off-by: James Clark Reviewed-by: Frank Li Link: https://patch.msgid.link/20250828-james-nxp-lpspi-v2-2-6262b9aa9be4@linaro.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-fsl-lpspi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c index 7ece48667f52d..ab096368a1fd5 100644 --- a/drivers/spi/spi-fsl-lpspi.c +++ b/drivers/spi/spi-fsl-lpspi.c @@ -5,6 +5,7 @@ // Copyright 2016 Freescale Semiconductor, Inc. // Copyright 2018, 2023, 2025 NXP +#include #include #include #include @@ -71,7 +72,7 @@ #define DER_TDDE BIT(0) #define CFGR1_PCSCFG BIT(27) #define CFGR1_PINCFG (BIT(24)|BIT(25)) -#define CFGR1_PCSPOL BIT(8) +#define CFGR1_PCSPOL_MASK GENMASK(11, 8) #define CFGR1_NOSTALL BIT(3) #define CFGR1_MASTER BIT(0) #define FSR_TXCOUNT (0xFF) @@ -395,7 +396,9 @@ static int fsl_lpspi_config(struct fsl_lpspi_data *fsl_lpspi) else temp = CFGR1_PINCFG; if (fsl_lpspi->config.mode & SPI_CS_HIGH) - temp |= CFGR1_PCSPOL; + temp |= FIELD_PREP(CFGR1_PCSPOL_MASK, + BIT(fsl_lpspi->config.chip_select)); + writel(temp, fsl_lpspi->base + IMX7ULP_CFGR1); temp = readl(fsl_lpspi->base + IMX7ULP_CR); -- 2.51.0