From patchwork Thu Jan 25 14:50:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13531003 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2D3DBC47258 for ; Thu, 25 Jan 2024 14:52:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6SZYgqTOq8XRXk9O9/Kn2sEFVEWrC0QK1GIN1iPggg0=; b=SO7yqrqNXK4FdY ScFmO85dC+yDSuhi55sGsttJ8l/+2pHGBDXQWkusfAM842F8g/3EhEBeCFHayPLMeYt60e9zpJLKn xEi6BoDdDg9ZMDjKnCcVhhl07K2WG6j4woCcU3aDzD00D27RGF6TAEUMoYW87W1IAnpWs9wGg76Xa UfQ18b3Onbrd2bEBKWV7te8Xuy7PoeYfmYAs7PbMpZ0BD7r3CE5WweQReScBiBJGLmODjbZBBRB+Q ADWFE999Y5s64Lg5cLg0aMTsM3P2O4twbH8IdOI22YLZrsbCOwCZUJPjUrLcWrwArK0P62cNSslv4 npeLBThzITBMdSRTWrrA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT15D-00000000TMJ-28es; Thu, 25 Jan 2024 14:51:59 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13o-00000000S7N-2cFo for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:33 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40e490c2115so5196165e9.0 for ; Thu, 25 Jan 2024 06:50:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194231; x=1706799031; darn=lists.infradead.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=CMqsjIhOEflMDX7oqOa6AkuuI1YZ588dX5VCpeNlZQnxK84vKtKeKd8ZZUv+gAzYCR iresmrkDItib+/dvCOvJB2Cgq6a2vJzWI+iQlb502U4BHg4KJMSWepBMexGE/mhNxCui oh+XaUQqV+fzu9PMKuxnf77l6ABivVlrhBimymP9i82DDTtsFIEL7NIH5025B6TCNBBd RWTRx4pLBUM4CUJraafqurMhxbrLgWzOYitdhVfEozIrhuRNDeL4+YEGVLZqMXNgdvwd 4p59c6BTQmM6n7aTMwp0KSGvw/o2Em6K111jyQhmmvvul99A6V1iS55v0DMIDAxGpWaJ aqcw== 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=pjJYUxDMKXlxQ1bFL/qsyfvrMnAXfo5Q9xUU3dHLXYQAJqbJN+O2Dw2WFNZLYj5xab sL6ZVhY2L5GtfU3tm1M4d0yy6qMy4C4OyZBSrQ3oHIAvVTe//HAcTsXH7LNCwcftgJjr 7TnFMgl3I50lYY9UfHIw9MPg0GL0pPvcRN9xFgmWgQT79OudXaVIMckovkPsQDmc7IfH W5Bj3uxCvTFMVti0yCcOjSElqk8zV7DIWuYLO2jWycUGHBblwNgJSAPbHwXxTxbeaLu+ zisZmdr4OPdLYAonoXx4Tfi0kvK47iaOu4RsXG7xVq5qK9g19xaYCY1U++hTFosPczOl 4lXA== X-Gm-Message-State: AOJu0YxDdDn09bOuAEEljU0TvVJQOedUnAFIXpplCGUjjsRY9ziJLc0K c0tvpKQ8T9kVGl2VyrokHBv3JJLZ2TkNMiuweKKfDO+ujVhJCUsOH00Xv01dQQ4= X-Google-Smtp-Source: AGHT+IHn/vvZP7VTE8gLvRJTbIrhs+lai/+3E8kxtC0AH0lm9QMKCYePRA6TuhvSm1o24YFRjyjFqA== 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240125_065032_712972_4E6BC49F X-CRM114-Status: GOOD ( 13.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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,