From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7743524EAB1 for ; Thu, 14 Aug 2025 16:07:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755187628; cv=none; b=WrkbAz1C8mY0k//WwbMuuzksKvhc+MlCvSjbp394zMVZDtzA+Ql9FW23uQTGczSVEL+XQRu0i8BB6PpimvMs95Nv9giZi2bIJ7rUhYNwKi1OgN9CJjxNrJ4cHvbZUZl/3o/O95lZyOKoTae0qUqoWO95GCa+A4qNc+f0cpLvTBQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755187628; c=relaxed/simple; bh=CLq0x//RJ1+g8/wsiBtMX89qchTr6zzzAuw6KnvXyPQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rVkx6rWkf9TwD4fi5AlgT1o6JODNNtTRxFb2zGldkeQrDd22FSCVkPLvQeLNgr3i4IyZDhCoqyTs/8rX76xwSYDSIjrVZcaryrq9VRoNtsDxn91nHtHnKQSGkm0MsZk/BtMNQXgaRVg4GbspYZb49FUPydckoM1ai4vEwX7nppg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=BfNbBkm+; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BfNbBkm+" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-45a1b0bd237so8669685e9.2 for ; Thu, 14 Aug 2025 09:07:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1755187624; x=1755792424; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=G4vuRjFCf3vC4nZa1AB/3PAeoOAW0nxzKRYHE4PiFcg=; b=BfNbBkm+/qP+o+hsycsZUgAJKmo1n5950rHNgCZoNG7Bxm0swDxb296pqAzlQib5/v G0QBZ5Vk8qXutb5tAHpQTwv8aYYj1XdWK+3POUzsPBCGLbC6SrTp8Jnzj/JjYQ6ySsmD 9rFXPONjArHuPbpAAA+q6bLhSQd9h7VYmDIupH50jfZRNSE+hJNrSJWNdhsTCHXWOY/j Of4K6SJl+FKCx1yXwVT0dyH9fpTFmwS4Kr/HnsxZOLWdzjNaXSKr+YeIuMSkClhklofA ICxgdbJfIrbBMUiPzfoOu3ePUC08itzVNBZfvrk6HA5jRhEGEU2MzzemXv0q+q81+6CC pTAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755187624; x=1755792424; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G4vuRjFCf3vC4nZa1AB/3PAeoOAW0nxzKRYHE4PiFcg=; b=kXc71wyZmBlxO3KjAYVLnzzzYA+Bwn+BEuwgvCY+mOjPUQWZeyNWO/Ca6hpLr93pnM 8v6RszUhBJZ2/K0cRvnYecGmdpYOjsyQDtS/X3feLtDhkJneyVVsWnarq0dNsr3iHjIb YWOzWfMuqBXPPd1nmFS7inMi64rHfov7UbJl0F+dESZArhmkMeskroSebyJI+oU9znxA OFznSOS1YP3sB1Q54+bnPEzLP/NKAxD12XMNyZKUfizAUf8Q5zVHMGB72CyClccXrEo3 wsctkulfG1+uuyTwze58x2x6sqkpMa2r9CtyQmTdOP9gHEbdcpXvEolLrNauujTSz1QW 67rw== X-Forwarded-Encrypted: i=1; AJvYcCXwAKihBQjDPBWkKcxO908PFrUmjVvM27QKywZ2rMIjY2BEkXggy5yuPERUMX3rmxYwbcI1PhPpsgFq@vger.kernel.org X-Gm-Message-State: AOJu0YxlXIfd8bC2n5MT1W4WlPdeOyrdMHeYrEw1g8MV5zIXqwJF1vFl 4AKNttfh0/dUhi0KpYYmT/YtqzZySDErd2EkSMIFN0jHse0jagKBymZcqTcSJBK+fc0= X-Gm-Gg: ASbGnct7o96vHFrrFCeUysZwuoOb3YgUyHOcjq0gSkZRaYh8ZndQc/yFubWd7s4Xf9B IJrrxtICl9kPNlDAxCeaIeMC/RbELux5+xZ9kgv+2kMFKUNla/mAEh2raIuzXGIBSENRohaSPzh pkNIhBgWYv9CHMQHb5TxbocSdbsPQX8d8JoiuxBD/7saIk8GY06OipxrGhsUKngLBA0WFNuFSPi 4sftbf1v7tg/TmKtL36bECjY2DQ/++9QNOsq5zXJG4FQ65WiXMfWIbg/XCaSTu75SsPeocc6EDU 3yrT/cb9JN49VWgK15xrdvvkt3xed8eDHRqR4iv1AtijJStpEoEg0BqTOiNnAdE9tyyofDuVNGB DEQIaJE3+7hfsl7NNo8R/w8UR2xfrENk= X-Google-Smtp-Source: AGHT+IH/+4jZEpKRE7MfihNgsJ2kDCK+C5ucKz6591vTGYsk5Mbo7reqdiCgmL0v7c+F3KACTVzlYA== X-Received: by 2002:a05:600c:1c97:b0:459:ddd6:1cc7 with SMTP id 5b1f17b1804b1-45a1b597881mr34789795e9.0.1755187623699; Thu, 14 Aug 2025 09:07:03 -0700 (PDT) Received: from ho-tower-lan.lan ([185.48.76.109]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45a1c6bd172sm28363495e9.6.2025.08.14.09.07.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Aug 2025 09:07:03 -0700 (PDT) From: James Clark Date: Thu, 14 Aug 2025 17:06:42 +0100 Subject: [PATCH 02/13] spi: spi-fsl-lpspi: Set correct chip-select polarity bit Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20250814-james-nxp-lpspi-v1-2-9586d7815d14@linaro.org> References: <20250814-james-nxp-lpspi-v1-0-9586d7815d14@linaro.org> In-Reply-To: <20250814-james-nxp-lpspi-v1-0-9586d7815d14@linaro.org> To: Frank Li , Mark Brown , Clark Wang , Fugang Duan , Gao Pan , Fugang Duan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Fabio Estevam , Larisa Grigore , Larisa Grigore , Ghennadi Procopciuc , Ciprianmarian Costea , s32@nxp.com Cc: James Clark , linux-spi@vger.kernel.org, imx@lists.linux.dev, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org X-Mailer: b4 0.14.0 From: Larisa Grigore 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 --- drivers/spi/spi-fsl-lpspi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c index d44a23f7d6c1..c65eb6d31ee7 100644 --- a/drivers/spi/spi-fsl-lpspi.c +++ b/drivers/spi/spi-fsl-lpspi.c @@ -70,7 +70,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_HOST BIT(0) #define FSR_TXCOUNT (0xFF) @@ -425,7 +425,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.34.1