Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2605054lqo; Tue, 14 May 2024 04:08:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUL/aDEP9b/Lq4rE1CouEPOMnrNTjj91DQRFbTGz4mRvgKF+NvJPRpYUUHqssjIwuD5Z17/MqI+UTUbzv6yt/wcYAydKqyp5i1puI3VdA== X-Google-Smtp-Source: AGHT+IEncwzksR0+PGScG1heoPKKe8QiDw2Jy/Xb+1jQj6Rkla7P5v3bk+WVxn5fnM1qDvqwLsdb X-Received: by 2002:a05:6a00:1a8f:b0:6ec:f097:1987 with SMTP id d2e1a72fcca58-6f4e03840e4mr14678655b3a.31.1715684886465; Tue, 14 May 2024 04:08:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715684886; cv=pass; d=google.com; s=arc-20160816; b=ASIqKRPRmh1Dox9oT/CwT58SDHWuhCUeUfQ1c4bSXyWCEVYfy1LH5uR6elZBN42EUq GVrTYgFG5S22s+Oml5LTF9bJSzmDojvZdc09fMy8w4Msyi6OO4zpAVaWkmLr4eItTrbg BdGp8850DY0xjTQCY6/DmItKwGFDQq29AHeGgtalS70PdGtym/9wPjaxdJaSk/mPYfrM E5uHaQy0mbBtybCBYEyI/gxkxYtBqPuobmqObSEqMSpS3JROhoUEFPHnnxflHWp37qZj VukmLr5gwXg5HewrXWqFqXfSnCBiSXyYA5GMhqPOC1x9CkOB4PMQOpSMvHCZwuNxgO2P FADw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=n/t8tpr2uVKIKPNasThs5wFaKtGpaQDxh2SpJUT9oMU=; fh=GT/osuVW8xNTdhrA3dhbdtgVGAyEv0TL58bxJ0HD0XQ=; b=xmbhAIkP2bxnYQpG4DYFbbRzjhk7O3P5R5D4MtiiQBlE5u9Cju13Rw4gNndXVYTYDC psceyZTsU6j2iYO7ttyZxCyMyTQpBxYlOLgq8M/ayubRa6A+0/PKj+VMCcpnbLmctAke UqxFm86HtvZoO5KzESCo1Oqb9x93ZWzLgjUX8po5iCj4N1mWTB6DBeDqRL4NQ6SKt/9K H4YAB2EeV4R9hJ+skZ/mh337ax1rgGhH1eF8gOCBcFOjZDf7Tug0i7RhfXUAAAObPCAk 0K7iqdHVLIDAe2YyHL6BUne3QlXxG0sDN26UtNNX1LmYmiLt7FUfwhb5T9sGSOkRI7CY c6Lw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=BnLoj0zt; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-178571-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178571-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2b1bad4si11203061b3a.253.2024.05.14.04.08.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 04:08:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178571-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=BnLoj0zt; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-178571-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178571-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 17D282816E5 for ; Tue, 14 May 2024 11:08:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF5DE13E02A; Tue, 14 May 2024 10:45:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="BnLoj0zt" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (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 3F3F213DDAB; Tue, 14 May 2024 10:45:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715683519; cv=none; b=NzwM9JXLIUCF/fwFLWOlwlH4AS5MQo/K0DlTtACV8GuPmGBT89JmRsvJ6wLODi1IV9Mr7c/gFPf4BEev1S6Q3woiJ1P90NPQq4NGlGprp1Vw+R3lh68aEjS9VX6wh0+Zm4OMKpL1MTBXjkuDAI0MSMaRxtZLtrRMCqyHgAlOKhk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715683519; c=relaxed/simple; bh=rlzB6/rDQbIjLk5lmcHcPcaK9fFkQm1X7kDxNwBZFVc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IiHjP5Dyp3X2hX7LAnF0KDqxXGXDnpOqAp3+Izdu7s3mZqGBvBsGqp4gIccJYuqZfSLhNty3LYx0mouXh2PbC5d48kM1k64JknuSV2/aFWP7X6p9gIs6BHOarwhZRfxhpDITz1Tc7uQmhub1yxbzOZFjn1F4pN8cMGqOwHB1drQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=BnLoj0zt; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1715683517; x=1747219517; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rlzB6/rDQbIjLk5lmcHcPcaK9fFkQm1X7kDxNwBZFVc=; b=BnLoj0ztel0mdFjT7MM5or7uNFkU0AAJURHbwYZkuaxssXVXV3w9WOa+ TiitbXaBATX+o2Qa02AnccCPinVF0J2wsMBh6i6cfpIZxrW8+oXTzr52R AB70VzJzkNXF+VZEoDVQ+vxdgPMpjXBOOS0+oczJ/WYR+YixE2Xq7uaEP q6RDe05/seD4Kk/lVuZkXXlyv02rheceFomnJauIt2s3i1o7OYbC6TVqH czkwfgbB0yJIPVT+4SP1UxNr4c7YgEyfkAxoZ+ynSaqvES3a/kWlWx5vg pDhWMgjVOCiob+jqDiwr4WfLR6YOiNsJtVpn6f6nNP/T/UONsUcojKgC7 w==; X-CSE-ConnectionGUID: CRVhllyDQl2XuPQNxlB5Rg== X-CSE-MsgGUID: nK6nDysRTn+Y+1qP6SwjEQ== X-IronPort-AV: E=Sophos;i="6.08,159,1712646000"; d="scan'208";a="24625780" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 14 May 2024 03:45:14 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 14 May 2024 03:45:03 -0700 Received: from Lily.microchip.com (10.10.85.11) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Tue, 14 May 2024 03:45:01 -0700 From: Prajna Rajendra Kumar To: Mark Brown CC: Rob Herring , Krzysztof Kozlowski , , , , , Conor Dooley , Daire McNamara , , Subject: [PATCH v2 3/3] spi: spi-microchip-core: Add support for GPIO based CS Date: Tue, 14 May 2024 11:45:08 +0100 Message-ID: <20240514104508.938448-4-prajna.rajendrakumar@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240514104508.938448-1-prajna.rajendrakumar@microchip.com> References: <20240514104508.938448-1-prajna.rajendrakumar@microchip.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain The SPI "hard" controller within the PolarFire SoC is capable of handling eight CS lines, but only one CS line is wired. Therefore, use GPIO descriptors to configure additional CS lines. Signed-off-by: Prajna Rajendra Kumar --- drivers/spi/spi-microchip-core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/spi/spi-microchip-core.c b/drivers/spi/spi-microchip-core.c index c10de45aa472..6246254e1dff 100644 --- a/drivers/spi/spi-microchip-core.c +++ b/drivers/spi/spi-microchip-core.c @@ -258,6 +258,9 @@ static int mchp_corespi_setup(struct spi_device *spi) struct mchp_corespi *corespi = spi_controller_get_devdata(spi->controller); u32 reg; + if (spi_is_csgpiod(spi)) + return 0; + /* * Active high targets need to be specifically set to their inactive * states during probe by adding them to the "control group" & thus @@ -516,6 +519,7 @@ static int mchp_corespi_probe(struct platform_device *pdev) host->num_chipselect = num_cs; host->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH; + host->use_gpio_descriptors = true; host->setup = mchp_corespi_setup; host->bits_per_word_mask = SPI_BPW_MASK(8); host->transfer_one = mchp_corespi_transfer_one; -- 2.25.1