Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp10113rdb; Thu, 25 Jan 2024 06:57:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGfXGrPykc6r3NOyKJ62MWHziYmkj0tECTJsOJloPc+I01daFZiQZCkLKHOAdnaLRSe+lWJ X-Received: by 2002:a17:907:8693:b0:a31:3da4:76a8 with SMTP id qa19-20020a170907869300b00a313da476a8mr1525653ejc.47.1706194633124; Thu, 25 Jan 2024 06:57:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706194633; cv=pass; d=google.com; s=arc-20160816; b=CmhSIgDQxAQ2lD5Ui1RcPVUPhxyQP2d0/focn3lxYAP+cCaWD9rZOxZ/tJtzcUMwxO e9z8cWzMhBpHISgrC/xGkzp8Kfqqby5S/IINz8iYc+/PCeE+4wzvlYBotYcgTWetVQFO I/HYISxSGU/Ho8uJFiMBvmLH1fawXFAy0LWAMxfMCZ39b+DC17AQPMdlatrzlOPFe/Rl bmTx4pxQKOKkXUgn5xgo2gSceN9zfk0F03l4HOOaXHB/BRAlkMHPtpJnkvgDTgZtXLmX Z5S7Yjs8H0Jh1vBBtLMRi4Z5BgGRJq3yDgzZLYEoVrMs/1cLVcIzD1T8J9ZD5VZct6Xv UF0g== 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=7ctbl026rEaxCXBh6UNhTj+BYRrS9dWFgcVUWrGAOSk=; fh=neYYEYDDBiloBUX0offulAnrRZM+Gy1+1fqKS4b9oG8=; b=XwqBZewYEPxzYz7PUSA9xFsfMXMV9cluSF3aFlX9grfs3hf/iK1el2KxPRkn83Db3/ zRQrmkQK0E00ybdbobMVfMAPfeFohouXN62AwosHt8fcbgwzF/lqWzeA58rcybd/59Vr nX9oG6cY4Q8awPK3doaswo9OUAHlRO+p734mXzazPDgoFVMJVncqP+pdoK5f0PNxT/G4 ehOAq+Y+nnbTOt76/OUcopIPYlE2VVaGLCKSbklNfvNbf11C3J4MpI743Nri7/LoS7fs JBw33T4oiX7T17MMS131oTX/EUlZSHrG3DfALEm6JHvnLs0hRyGIu0G/Y3a0txEr6nLs 7cMg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VtSOmR6S; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-38772-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38772-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id fx6-20020a170906b74600b00a3176023c73si707562ejb.211.2024.01.25.06.57.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:57:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38772-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VtSOmR6S; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-38772-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38772-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 658E91F234B0 for ; Thu, 25 Jan 2024 14:57:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6AA48129A8B; Thu, 25 Jan 2024 14:50:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VtSOmR6S" Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.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 64E311292EA for ; Thu, 25 Jan 2024 14:50:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706194235; cv=none; b=XgZuz3g624PEoR/w3xXI84a1oJHWJ/6WMoCxF6IlbHdSxNFXXtdo3rLqfk5fYsKZAtj5/pFKM9afkBKir8Pkt/WgFlxqisEkDElfWvsyxFtGgrbONLn2v6Wy+X6AWkPEJk4xlBnhC71pUyZJSCCmK5y5WJq+X1ZUXxdxoFaWll8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706194235; c=relaxed/simple; bh=YK7CI4nDuPciHv9GXS1oQ3uH/9jR2Lt4ExN1jBo4lQ8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oPevVPyOLKj9Ok0UwuKftXFDL3YEWJACzHP/9feamwwKL2bTswogxlB8uhj01wO36ldYqQWYNAEpjrrjQsBf4LNiMg9SYF1QvmacK0JgiTnBclHJL4pD2/yDKxenFEPfy5Iuj1LDh0raVbmIuQycSwcVuqLAk3GwpW6tyYIpEUY= 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=VtSOmR6S; arc=none smtp.client-ip=209.85.128.45 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 Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-40e80046246so5181765e9.1 for ; Thu, 25 Jan 2024 06:50:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194231; x=1706799031; darn=vger.kernel.org; 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=7ctbl026rEaxCXBh6UNhTj+BYRrS9dWFgcVUWrGAOSk=; b=VtSOmR6SK/lbSoCJJ1UE4iV1prt6C66wIs0CrGaac6nyXGstYpcBuGiy1y4Wu9imdn r5/4j2prvu9JXaACCAyEwc34I5HaEV8TKibIMtfWSUZHJGp7UqCy/w3rvLPM540O08oq PSsMIm0mxQ0CIwGLFVeH0dmn25yWGd22UC/FYVU+wvFgnhCtB2l4W5v6hKK1+18jMAvh JKbG+iJ3rYA1KD7aEe2YlGwZGrQp+53SUco7l+Wd1p1H5arRKCTArD7x/HrVUJI7faun HqlF2hEHIInPiE9I+dbfHWHdlc97nhjZV06mCn5yNO3SYW9gh1m5yW+uTPv68lNzHWi1 ySow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194231; x=1706799031; 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=7ctbl026rEaxCXBh6UNhTj+BYRrS9dWFgcVUWrGAOSk=; b=FeAvazsdCLFxr85eiIZ5cO3Zg7Z7oQrJ13CXaqF6/s6pYzyrXUOa6MIqJ250Yg20d8 dB+T7J9t5VwLBLZAHo0KUr54/eqZPhoJsma5AqvOBWLZnUYBNEE8IGCEtWb8UJOGukb3 2gKoZeoyjfDQdps5KzK6QTdk+RVbN6gEnGb7ABktDdtea6qQCLLJAUMOj3pr4K2Stbga 8grfsF7qAZGxcb4vpuEcFEmAd2rZ4JyMCZq0WaKL7DmOqATY/vuvKxaww0AZGOsQM/h7 CEXNNkQ8ucu4ZZgQSyIuvlwbkJRO2C0GohtRnJCWxf6Z9z7XzKpRBpJSAZCbbwrUc/Z7 xAhw== X-Gm-Message-State: AOJu0Yzm520qUnuL7c6n/s6sGYkc1evJMlZcwzToIGvVuqkNwE4SWNmb AhZfNcK8N09XEeLA+QWtl/dFoL+1LLRbsooA1vX1/+cXRt69nPBirXZUbEWPDXc= X-Received: by 2002:a05:600c:1c25:b0:40e:a5d8:6a93 with SMTP id j37-20020a05600c1c2500b0040ea5d86a93mr739037wms.32.1706194231407; Thu, 25 Jan 2024 06:50:31 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id v17-20020a05600c471100b0040d91fa270fsm2875875wmo.36.2024.01.25.06.50.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:30 -0800 (PST) From: Tudor Ambarus To: broonie@kernel.org, andi.shyti@kernel.org, arnd@arndb.de Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, alim.akhtar@samsung.com, linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, semen.protsenko@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH v2 23/28] spi: s3c64xx: retrieve the FIFO size from the device tree Date: Thu, 25 Jan 2024 14:50:01 +0000 Message-ID: <20240125145007.748295-24-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240125145007.748295-1-tudor.ambarus@linaro.org> References: <20240125145007.748295-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Allow SoCs that have multiple instances of the SPI IP with different FIFO sizes to specify their FIFO size via the "samsung,spi-fifosize" device tree property. With this we can break the dependency between the SPI alias, the fifo_lvl_mask and the FIFO size. Signed-off-by: Tudor Ambarus --- drivers/spi/spi-s3c64xx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 7a99f6b02319..3e7797d915c5 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1114,7 +1114,7 @@ static int s3c64xx_spi_get_fifosize(const struct platform_device *pdev, const struct s3c64xx_spi_port_config *port = sdd->port_conf; const int *fifo_lvl_mask = port->fifo_lvl_mask; struct device_node *np = pdev->dev.of_node; - int id; + int id, ret; if (!np) { if (pdev->id < 0) @@ -1130,6 +1130,10 @@ static int s3c64xx_spi_get_fifosize(const struct platform_device *pdev, return 0; } + ret = of_property_read_u32(np, "samsung,spi-fifosize", &sdd->fifosize); + if (ret == 0) + return 0; + id = of_alias_get_id(np, "spi"); if (id < 0) return dev_err_probe(&pdev->dev, id, -- 2.43.0.429.g432eaa2c6b-goog