From patchwork Sat Oct 12 09:53:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Gorski X-Patchwork-Id: 835175 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (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 B93AB610D; Sat, 12 Oct 2024 09:54:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728726866; cv=none; b=WkOds66HvzY6qaTNPTtskmSezSBZhx7JmFo4dZkqsqXyrjk+XpIQHY/mbPBX3C9W81x9ZrYZ3VjOUnHJYt4y5wsVsVcJgAZz6vCYCZ9hI3C7QEIDXt3FYKYZTM45dM4X7XJkWPhPWsqd7jeWdGinm7We9d7B2VQM74dPen1+9mI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728726866; c=relaxed/simple; bh=TfawiNnYj5zNLv+jVcmBc+6b6S3nRECwPwGfhLaSrzg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qd830aEkz2BoTQ4PVwZ9CJSmkJAIv+mMO7WupxUz7Mzb8R3lrbcnsKddv7GsPQWiZDk7iYEUyisTVskv1kiWLR59u1qZszzZfwCiza0Cs9fsr7jTB+WJ4Y3dp6uzAUiJ5yM+aNaag67tz8YIVc6Gvfqt6IAej+OO8AguZsh/FlM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Qrrth7nF; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Qrrth7nF" Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a99f646ff1bso12117666b.2; Sat, 12 Oct 2024 02:54:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728726863; x=1729331663; 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=U8ZC9ITCPhenAYf/vv6uhGh5WumL2pziZ+L10pLWJTM=; b=Qrrth7nFem0y6gHUgoyr4KXK9gW1tE8HPTEJrR+PJGpfGypoBo32/1SRQvV1R3QAsS Y4W9VoMMwO1Rrtl/zLIe+pcgxGT5lGbIKQ16UJNq6z89ZtDl9wfBJv8aFrbkxinbfSXk 92PPTqJ81zgHa4MqI7NX+EGLgkT8fqv83VCLuJLrigtBhkPGh90iP5Yv96435VVShPXZ L+Lo/HJlAC/uW74pfng0TXP/N1pLCw5sjYoLmeJ75O9zUN9a2JQ9QdF1P49YNsRQYsM4 tD6oq8joFr9lkhFrTj7VRewhwM3BRRp1mr4qvwxEiQr2httWWPWqwLrQeLbQ34dwdzWS I4dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728726863; x=1729331663; 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=U8ZC9ITCPhenAYf/vv6uhGh5WumL2pziZ+L10pLWJTM=; b=bKqJMolylAbcyNW+WIrGiGvzzEN+01mwWMpiMWBf6CHiMRSsUfd35kB01dKN9LQvSb XhFM9eVWrgjRuEYZ62tdZ+lBxMwZyocZremaRntDnJrmlcUoQ+c2Gh881SYJ62LDD7uh XXR+NRnZvFbWKEeE/Ml8Qzz0E83JNzASUpgOIGX19n3vB1SUkAAiVREn9Z9kgjp0I65H AavfMoLnOFhGDJfGYpVPcI/dHs9F7qCtPl55VRTm4/3Zm2nbg4VTCPeAtkBwO5KIRTn7 ObcfSsD4c095sO1nRUF81iOMeKwVjmJDCmv9kK7xibmNQuxtWd7ZbIYf6z7RMb4Yu7+t vzTg== X-Forwarded-Encrypted: i=1; AJvYcCV4P9kkIBe9pEIQiOtLbDol/79glWvYmSGAueJmfeKN15Nk06/M2Mej32RBAMkhVHIE/GQHXJzzxn7HKOw=@vger.kernel.org X-Gm-Message-State: AOJu0YwYSTPoUi5CjKv/AKZJd755BkqMomEjGY6U6g1vGso96L5GCUEu bb++fESAJfzlmzTmfABaeaSL6wiJzsJHIJ/ixG9NiEBMbVBNsztvBHPsQpZ8v80= X-Google-Smtp-Source: AGHT+IEhaqnA7LkNOsegegkcVESQ2FBN7VOw9DUl/+LSCE2rE4OAG0X1A4zwpgwynNerFXfpeqoRFA== X-Received: by 2002:a17:907:2cc3:b0:a8d:3338:a497 with SMTP id a640c23a62f3a-a99b93239f6mr488486566b.4.1728726862748; Sat, 12 Oct 2024 02:54:22 -0700 (PDT) Received: from localhost (dslb-002-200-173-220.002.200.pools.vodafone-ip.de. [2.200.173.220]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99a80efe57sm308258366b.188.2024.10.12.02.54.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2024 02:54:22 -0700 (PDT) From: Jonas Gorski Date: Sat, 12 Oct 2024 11:53:35 +0200 Subject: [PATCH 1/6] spi: fix return code when spi device has too many chipselects Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241012-spi_multi_cs_cleanup-v1-1-dc491113880d@gmail.com> References: <20241012-spi_multi_cs_cleanup-v1-0-dc491113880d@gmail.com> In-Reply-To: <20241012-spi_multi_cs_cleanup-v1-0-dc491113880d@gmail.com> To: Mark Brown , Amit Kumar Mahapatra Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 Don't return a positive value when there are too many chipselects. Fixes: 4d8ff6b0991d ("spi: Add multi-cs memories support in SPI core") Signed-off-by: Jonas Gorski --- drivers/spi/spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 7c5e76b154212585af1c3893005cb353a0eaeafc..ab38978e9c58517bb671d7bda017c8550cc82d58 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -2452,7 +2452,7 @@ static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi, if (rc > ctlr->num_chipselect) { dev_err(&ctlr->dev, "%pOF has number of CS > ctlr->num_chipselect (%d)\n", nc, rc); - return rc; + return -EINVAL; } if ((of_property_read_bool(nc, "parallel-memories")) && (!(ctlr->flags & SPI_CONTROLLER_MULTI_CS))) { From patchwork Sat Oct 12 09:53:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Gorski X-Patchwork-Id: 835174 Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (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 3DEFB1547E7; Sat, 12 Oct 2024 09:54:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728726869; cv=none; b=eiou0dEo/efmOROcPWmGWxlJDfEPqmafD7QFDK/a+AlN+G4x+wU97cW7KhOdb3J3oudMp6fJozR2LPoj8K1YC+Y0sQlkWRJTub53CotBOva1uHh28gSKgDt0f1H45v7uBWeY+w57065gK4I0+DUQgEF3if2er9QRc97IPc2odU8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728726869; c=relaxed/simple; bh=YcKm+sOPug8u9u63+P+tGGXBa1Xo8VYubGbrOh8hcGU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jLU0uHOEZD7m+j35EeCRtrqQPcc0/5suAdM5ieSw+nWTTH303n3Yc2j6a01tlVpDpg2IKV9Sgu0+x0N3B6gMzDOkO0ZiNAubbWpLdfBX/KPvcyABVfB6P98LXQoZfJN7p5/7nq9sDk6W62Si082GxN/KSCkPBJNsdUMMhuzRYv0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lOX3/CAk; arc=none smtp.client-ip=209.85.208.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lOX3/CAk" Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-5c40aea5c40so5324292a12.0; Sat, 12 Oct 2024 02:54:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728726866; x=1729331666; 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=Rn+arkCODA8DGO4i9/YKd4mdYzdhdyNcf7NV++kFN6w=; b=lOX3/CAkJlnRq7zhbaTOU6Gl3D1nmaQ+OW0lbA7nJm8nZzI6jixTmzdNmhEk049LYi y1WovBhHPqqye2qgrqoASdXS+1atNN0lkfVJst64NLglXyWU/RRaDk3SasPUF3RTglI5 MYw8IveOMBn8wounQX/fvKKCgsx+v8VZMaWuyIEDtmTi9Yo9C10QHQAJ0N/HdREdWEUD MJRSo2G3W9zvN6zhu36CY0/WjoqT66Z6Mmfrx/ZqJd02JzViZn9l4DIDxfclQWv7U3eW t8ZJdTFCBUHnen8mS6mCqnwQBwi+wxLxiJX2T102sVLFfFCuaUM12j5ItHIi3DrwZMui psVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728726866; x=1729331666; 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=Rn+arkCODA8DGO4i9/YKd4mdYzdhdyNcf7NV++kFN6w=; b=UiM5VkDZs5rRotu8ZDwk55K++ifToJsEC95kVtVPchtOnZ9sMKBPXFoeIOrOHPbAvG Ka2oreujSCnoFWILwhKEwCfdU4wED3cjiAiA8/H8QBgTGcsP+B6iYjhJAnpAVMIyY7gm KQjRT2DtWda7QgvLMRcPrQIaVAYFLpUjhEv6GQglKAkIR0EaaI0Ziyo18Ex2A5F/zbOV TTzCxhGrFleGx7Ih9lixX7CpPhzKcXurTPU9aMEeCUXSmdHBhB02xpcHsEr2zwFMWa54 rY6C6ON9vaPqcPR+QrbUfc4hbgfBJu7RQ0pfmHoU+vle/8e5X/eD/4gNZpSnLUIt0JpF zcVA== X-Forwarded-Encrypted: i=1; AJvYcCU45F8yf0cOydopdnYGCTO1q531RZneOFKJH66q7DUtOQM5JJ340sOVHR5fRvOLVMjC2mti+43u5qwiqxs=@vger.kernel.org X-Gm-Message-State: AOJu0Yy7lsE5rGgjasPJxSgXBjwULONKoo+IlQYQpFU3HTGpamaWO5V5 1joISXf0H3TwhajYMkVuFotlPLZRzCSj6RlAzgyQppfOJrHmx5OD9B2k9ccpFV8= X-Google-Smtp-Source: AGHT+IEEIZy962sS0NqhiAH+/P2/pIf6YHJDUZ/5UnHVdtEXH3Fq9ewNxPFXkoswpQkUFlUKGQc8Ww== X-Received: by 2002:a05:6402:50d0:b0:5c8:a2b8:cab3 with SMTP id 4fb4d7f45d1cf-5c947417730mr4682541a12.4.1728726866227; Sat, 12 Oct 2024 02:54:26 -0700 (PDT) Received: from localhost (dslb-002-200-173-220.002.200.pools.vodafone-ip.de. [2.200.173.220]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c9370d2251sm2733449a12.12.2024.10.12.02.54.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2024 02:54:25 -0700 (PDT) From: Jonas Gorski Date: Sat, 12 Oct 2024 11:53:37 +0200 Subject: [PATCH 3/6] spi: do not initialize device chipselects to SPI_INVALID_CS Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241012-spi_multi_cs_cleanup-v1-3-dc491113880d@gmail.com> References: <20241012-spi_multi_cs_cleanup-v1-0-dc491113880d@gmail.com> In-Reply-To: <20241012-spi_multi_cs_cleanup-v1-0-dc491113880d@gmail.com> To: Mark Brown , Amit Kumar Mahapatra Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 Now that we know the number of valid chipselects, we don't need to initialize them to SPI_INVALID_CS to be able to know if they are valid, so we can drop both the initialization to SPI_INVALID_CS, as well as the check for it. We cannot drop the define itself though, since it is still used for spi_controller::last_cs[]'s state. Signed-off-by: Jonas Gorski --- drivers/spi/spi.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 15b2f4e02a685b2c778b27473289197ab08987d8..495b391710d69a46beaa56c1a4332eb6677d2f45 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -624,11 +624,6 @@ static void spi_dev_set_name(struct spi_device *spi) */ #define SPI_INVALID_CS ((s8)-1) -static inline bool is_valid_cs(s8 chip_select) -{ - return chip_select != SPI_INVALID_CS; -} - static inline int spi_dev_check_cs(struct device *dev, struct spi_device *spi, u8 idx, struct spi_device *new_spi, u8 new_idx) @@ -639,7 +634,7 @@ static inline int spi_dev_check_cs(struct device *dev, cs = spi_get_chipselect(spi, idx); for (idx_new = new_idx; idx_new < new_spi->num_chipselect; idx_new++) { cs_new = spi_get_chipselect(new_spi, idx_new); - if (is_valid_cs(cs) && is_valid_cs(cs_new) && cs == cs_new) { + if (cs == cs_new) { dev_err(dev, "chipselect %u already in use\n", cs_new); return -EBUSY; } @@ -685,7 +680,7 @@ static int __spi_add_device(struct spi_device *spi) for (idx = 0; idx < spi->num_chipselect; idx++) { /* Chipselects are numbered 0..max; validate. */ cs = spi_get_chipselect(spi, idx); - if (is_valid_cs(cs) && cs >= ctlr->num_chipselect) { + if (cs >= ctlr->num_chipselect) { dev_err(dev, "cs%d >= max %d\n", spi_get_chipselect(spi, idx), ctlr->num_chipselect); return -EINVAL; @@ -727,8 +722,7 @@ static int __spi_add_device(struct spi_device *spi) for (idx = 0; idx < spi->num_chipselect; idx++) { cs = spi_get_chipselect(spi, idx); - if (is_valid_cs(cs)) - spi_set_csgpiod(spi, idx, ctlr->cs_gpiods[cs]); + spi_set_csgpiod(spi, idx, ctlr->cs_gpiods[cs]); } } @@ -781,14 +775,6 @@ int spi_add_device(struct spi_device *spi) } EXPORT_SYMBOL_GPL(spi_add_device); -static void spi_set_all_cs_unused(struct spi_device *spi) -{ - u8 idx; - - for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) - spi_set_chipselect(spi, idx, SPI_INVALID_CS); -} - /** * spi_new_device - instantiate one new SPI device * @ctlr: Controller to which device is connected @@ -824,7 +810,6 @@ struct spi_device *spi_new_device(struct spi_controller *ctlr, WARN_ON(strlen(chip->modalias) >= sizeof(proxy->modalias)); /* Use provided chip-select for proxy device */ - spi_set_all_cs_unused(proxy); spi_set_chipselect(proxy, 0, chip->chip_select); proxy->max_speed_hz = chip->max_speed_hz; @@ -2450,8 +2435,6 @@ static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi, return -EINVAL; } - spi_set_all_cs_unused(spi); - /* Device address */ rc = of_property_read_variable_u32_array(nc, "reg", &cs[0], 1, SPI_CS_CNT_MAX); @@ -2596,7 +2579,6 @@ struct spi_device *spi_new_ancillary_device(struct spi_device *spi, strscpy(ancillary->modalias, "dummy", sizeof(ancillary->modalias)); /* Use provided chip-select for ancillary device */ - spi_set_all_cs_unused(ancillary); spi_set_chipselect(ancillary, 0, chip_select); /* Take over SPI mode/speed from SPI main device */ @@ -2844,7 +2826,6 @@ struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr, return ERR_PTR(-ENOMEM); } - spi_set_all_cs_unused(spi); spi_set_chipselect(spi, 0, lookup.chip_select); ACPI_COMPANION_SET(&spi->dev, adev); From patchwork Sat Oct 12 09:53:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Gorski X-Patchwork-Id: 835173 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (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 6840C155321; Sat, 12 Oct 2024 09:54:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728726872; cv=none; b=MmHDn3CecY8ewfZuamhb01VkCd+rKaNsijPD0NNdX8/U8yZFOt0AiPDqi9Xrcir6WysxVmgiCB71nyWHDxQtQeXkwkHWfKcDtejgoocRTgM0AcTkoBSN8Jf4lzAm55YbX+HV25r0oz6sK5s5Oot27UT4+WWnDZOXjoNrjYkrW9M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728726872; c=relaxed/simple; bh=tT90fDfKY662Oo3574ntryYhNPrGX12nSuc69yzLIig=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eFOIhVAk9/HtwZYqYo9XAEh21MP7RreAc7bCXnHA1XvUlZ0/L57zh0sTxIA3WxC4XVOb5aUpbHctFq5omVE+POnV1+vjA87u8kuD7nfxPnyGWo7vpgicYpYAZL0pIDPSeebMwz9uzbHlWuP/3Vzbr4i3bEcMIyYGXSBVQyIcfpA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=O+9JsbE/; arc=none smtp.client-ip=209.85.218.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="O+9JsbE/" Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a99ebb390a5so69441366b.1; Sat, 12 Oct 2024 02:54:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728726869; x=1729331669; 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=uRAJK2lijZlZ7uqxAhRv6bavE6DAc/XMDZFicjzd2Mw=; b=O+9JsbE/OGT3Lo+fB5ktgV27knhSJs0Lwb7Rn7Ufn0RTkLOZHb9Op5zx90qjUNIRhe XKxpgC9OdUCUi9naDZXreyBwmGv8WeniaMX4oQrx/MAIMJ/KMKIx3bJg17AIPppHtS9k crlGdPolVYtgMJ6q1/EjvUiBWsIW79xiCN12O/B7cAGCQPsSJREU5sDVwkyBoyy0Fojk 7+EISEQkyCk5zoFrayfSFFu9Fhf/aSN1frNpjaWXGTXq+sLal/axsAsF8DevFVtsPdsk xGcAu60RHbeF/R2LMRnj62YyU8Tj4cAeTW1FLy/YbrD3C/8yAEah8Oc8uZLBlsunOvEf eswA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728726869; x=1729331669; 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=uRAJK2lijZlZ7uqxAhRv6bavE6DAc/XMDZFicjzd2Mw=; b=tqjWM7qPU0tjVlYGXJadvszLtEVoN8uq99cdbG2R4UtOhmige+j5iCIm/w8GV4jF5+ OE9pMMJ3upoG6OlTqukmqLrdGOJh8Mae74yXOKs08WBPVmFD8h8PF2tmEpXqJ4iZFoT9 IV+wSJK5CsVVJBUifdLbFnQ9YvoIPjboj2VB6RpW3ZzoaAoO+LqGVzilSOzcWBLWz8Ya 0Y2Ew3jzkOxjNSJV5uTzUSSa1ooAvvsYlv+bsNi91zNpONIreEfgDlo5d2rhaDVWUlMG ZpkZ6VmPBUIympdv3uDdeleIVxwxHQJD8w1U+zYfZaoI9Jcx0aSBibRS6wl3rtfdV5Av cS0g== X-Forwarded-Encrypted: i=1; AJvYcCV0Rom4199rknubye8K1DurvITc84H1GkBNEqJPbNcRB11F2m/LJfUs9RNbfDjbg3pqqE2d6RgEOywTaR0=@vger.kernel.org X-Gm-Message-State: AOJu0Yw9UnQtPkPHG+J03D1dL1A6+iezBRyawBtrpMAtyv5sVpaNEyCZ ngFtLQrbPvPe56gmzLLUTsO5kxv5acdvwdr7L8UmLbJ8W6EPa9Vpaxn29M1ba4w= X-Google-Smtp-Source: AGHT+IHWzyYyIAL16jaxtcVte9iq4246C5sBQphF02aft7y1/jpOQGJdIeLeIKYwtpignkTd3q54UQ== X-Received: by 2002:a17:907:a0c9:b0:a99:ee23:dfb8 with SMTP id a640c23a62f3a-a99ee23e019mr106568766b.20.1728726868333; Sat, 12 Oct 2024 02:54:28 -0700 (PDT) Received: from localhost (dslb-002-200-173-220.002.200.pools.vodafone-ip.de. [2.200.173.220]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99f5ff0cf7sm14740766b.155.2024.10.12.02.54.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2024 02:54:27 -0700 (PDT) From: Jonas Gorski Date: Sat, 12 Oct 2024 11:53:39 +0200 Subject: [PATCH 5/6] Revert "spi: Raise limit on number of chip selects" Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241012-spi_multi_cs_cleanup-v1-5-dc491113880d@gmail.com> References: <20241012-spi_multi_cs_cleanup-v1-0-dc491113880d@gmail.com> In-Reply-To: <20241012-spi_multi_cs_cleanup-v1-0-dc491113880d@gmail.com> To: Mark Brown , Amit Kumar Mahapatra Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 Now that we removed the limit of chip selects for the controller, we can reduce the amount of chip selects per device again to its original value. This reverts commit 2f8c7c3715f2c6fb51a4ecc0905c04dd78a3da29. Signed-off-by: Jonas Gorski --- include/linux/spi/spi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 77511c7d40df7085644cecaae325c982fb306afa..fe99f46c7d926eeb75398f4dddc5ef64d8f7736e 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -21,7 +21,7 @@ #include /* Max no. of CS supported per spi device */ -#define SPI_CS_CNT_MAX 16 +#define SPI_CS_CNT_MAX 4 struct dma_chan; struct software_node;