From patchwork Fri Feb 16 07:05:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 201969 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp343259dyb; Thu, 15 Feb 2024 23:07:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUsJxci7CDJuPfEtD0NOVP6QJthAY6E9gtd4A3MZHUyVTuU3xQcUuzrN6V1x+XzGwldB1i2R+X4w2LQAGShpF6uVhHCVQ== X-Google-Smtp-Source: AGHT+IEb8u2IFUWQ3PBDJR6rfalbhIwEaXt7LK8h7NTVnP0l6tjeBHIJEkGwl8PDxcHWn6Oh8XWt X-Received: by 2002:a05:6402:165a:b0:561:f7da:ee30 with SMTP id s26-20020a056402165a00b00561f7daee30mr2373084edx.42.1708067261535; Thu, 15 Feb 2024 23:07:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708067261; cv=pass; d=google.com; s=arc-20160816; b=0Ciex94spsoKhQRy/gAUx3kAuLZ3St8Eml4X4NR+GwCkOkuEK5YVS1V3OEUJRTU25/ DQVTlEMQmv6F0xObIO2Q4dbz+xvUuDzsdiAqDySW2NK6LOlFb4r17e+F2q0Wb9BQLKO/ xTbvx+/pYfma/u/3e3Z0ibyNPv4ZK80ZDZh+UPAQEqB/T+UWolrBiWyfLSbJO7afTXwb cLrntGasz6S63yzo9HH8svshZHjuZ6LNWn6OWbyRKaUC5RHKKboiYT88DrFrw+A0l4Mh h/WBhjtLd52QG0KsCqITk+m2MU3bhwvL36qmixq+THgYTRd4e2gCFthym8cyAn4gCfzD +QFg== 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=hs676vE1oPrjFgO93552CvPBZ3kPEUhKELlxqPQ87Xc=; fh=oLAz6oHAlburzxXxe0hrXDcZGB3gEV3XK8IK70tX3BY=; b=JP2h5e0QlQL+GwILmWYrAD5/YjoRAQrg7VSmliPth7S6Ge8AYX9+m2Iuv3dFSzetWX M0OHZJJSHPnr1iTBu1RmbCRS/cFENuIpoCxudhOtRUPrSbsOi+TrLxn02xVkiAm777Oi Xab8rUnuGRxXpDubRABPndvAqKn6aEdaIoahIlh+cw0B3+anKdYYc7Gc+navliJTTj8+ S4I6eFnwSllNhqQzFAuQFclpC+cGaI5/FC1gI7wyUXbImDahpBlhwEs4WnxR2fWhdMwf rTawpr+seLQvgi9DZcxlf01qwGuaSIrKjfI5UTqtOMgfC/jJtCOwTv9uOsDei1+y4a4C dsLA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hhhqgbgK; 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-68146-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68146-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id j6-20020a05640211c600b0056178b386cesi1485394edw.0.2024.02.15.23.07.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 23:07:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68146-ouuuleilei=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=hhhqgbgK; 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-68146-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68146-ouuuleilei=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 059861F21443 for ; Fri, 16 Feb 2024 07:07:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3F8421BC2C; Fri, 16 Feb 2024 07:06:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="hhhqgbgK" Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.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 C950A17BC5 for ; Fri, 16 Feb 2024 07:06:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708067168; cv=none; b=WI6gAfqAFxNCt9Ys7Wz1YtrDNXuwmnCyD4vBxNwA7q0GcM4boz39/lKhiDQ5+36BuN/zUAxN5u3YuGxw4eCDU/NYscsJ2lZv1v8MginCuh+3gWaq8UL0HBbDNKGtzHPX1anJmyQTF+ypDhilTvNiFBv+MxpBGkqZdaVU13SL8Kw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708067168; c=relaxed/simple; bh=A6brHfiw3JDp5JkUp4QyeFF8EuAKOKzvuHfjCHdzjtk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m7t+W8urYhO78sR7X5uUEAlKpXdZgp4DYoyIVJqDBS6Em+/mRWOK7awH8Zo5Gc02XCoup1k3AfOjVLXxKwmjJ/sj5Lg3PUvgZvx3aZjmRdr/MF0Iqnpb0PNAaUf+bnzeVVl1NXemsXbs2imrlnfVoVsNZmys0qgs/lrxSGlWJsw= 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=hhhqgbgK; arc=none smtp.client-ip=209.85.221.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-wr1-f45.google.com with SMTP id ffacd0b85a97d-33d10936af1so797822f8f.1 for ; Thu, 15 Feb 2024 23:06:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708067165; x=1708671965; 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=hs676vE1oPrjFgO93552CvPBZ3kPEUhKELlxqPQ87Xc=; b=hhhqgbgKwqAfvCySjHTt9sGCLKlL2A7CJ7SmC9fZhG44dNv78FIP1zSPAgIxtTA7lg 7TbCAjWLj9IggIjOVZAB6yFrYoFKizKXbLkoALr7kI1E/5+b9RVmyZkaLdrIvNdE+qqw Fdb5mSuh0vmqXWfHiVgcH3qUMrP9ym2Asy8lDED9iBNQPi4JECOGoMAg4OhE390NEDcn R4W23LxdZsZFw71UHTF9/A4RKRf8eiBv6eZF7M4yIj3oxT/Gb9I70e0Q7VaZJfEm+T7Q LC6c8d6lcg+b7RNXrZ0PaBScUN5EMIzouSAmI2TMsP8TvtjWfWEPMD2yNSnnYOkMczaS 5wsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708067165; x=1708671965; 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=hs676vE1oPrjFgO93552CvPBZ3kPEUhKELlxqPQ87Xc=; b=mxr1k6twXs6fd/Xvq0bhms9zj30301YiXI14Ug6t/0saq6Gtqt3lCzl+ngttiqRMka gGMbN0gpUAS9Ir/2BC0TGbsUyOJXrA3yTb6b1IQaP6YMCiQkborL2Gu1M5ZDeAf9NcHw PbCR1FTHv7EdE5qP/0gqfcorb6ooDz+wbqLNfej2toVwYR19G+g0scgz17eZW3XBU9ze ysM2Ifij4CZtQBa1uqZydTF0kO4KZluqF3uZMUGETEw1F7aqDhf6+VaMfy4ClOcKxcma ToMEb/R/+Q/ESF8+Gk1uNY9nf6fjlevBOhSy1EKxeeLxONQBcOmpNyn406UVaNUfj1MT CAww== X-Forwarded-Encrypted: i=1; AJvYcCXEw1pI6+3FGigUtO5cgcO+WHATFPQHbswdPiO4jf1+8asNSpSeE9kK8vNTkvk5j+3CIm+lRavpyTZixKFwZr+506VR/kXUbCdMp9yz X-Gm-Message-State: AOJu0Yzl5n20Ry2u0rymZltqWkinC1mfHT6hVesJgc//w3Hf4MMw/WEr nrBqG87pyLMXzRVyrAtWiEXhhJ66qptOXXzRgRDrPh3AHO6ugTGtp81p0l+CilA= X-Received: by 2002:adf:a446:0:b0:33d:4fa:5e0 with SMTP id e6-20020adfa446000000b0033d04fa05e0mr2453175wra.66.1708067165166; Thu, 15 Feb 2024 23:06:05 -0800 (PST) Received: from ta2.c.googlers.com.com (105.168.195.35.bc.googleusercontent.com. [35.195.168.105]) by smtp.gmail.com with ESMTPSA id k18-20020a5d66d2000000b0033940016d6esm1298839wrw.93.2024.02.15.23.06.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 23:06:04 -0800 (PST) From: Tudor Ambarus To: broonie@kernel.org, robh@kernel.org, andi.shyti@kernel.org, krzysztof.kozlowski@linaro.org, semen.protsenko@linaro.org, conor+dt@kernel.org Cc: alim.akhtar@samsung.com, linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, devicetree@vger.kernel.org, Tudor Ambarus Subject: [PATCH v3 05/12] spi: s3c64xx: retrieve the FIFO depth from the device tree Date: Fri, 16 Feb 2024 07:05:48 +0000 Message-ID: <20240216070555.2483977-6-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog In-Reply-To: <20240216070555.2483977-1-tudor.ambarus@linaro.org> References: <20240216070555.2483977-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791038336786670035 X-GMAIL-MSGID: 1791038336786670035 There are SoCs that configure different FIFO depths for their instances of the SPI IP. See the fifo_lvl_mask defined for exynos4_spi_port_config for example: .fifo_lvl_mask = { 0x1ff, 0x7F, 0x7F }, The first instance of the IP is configured with 256 bytes FIFOs, whereas the last two are configured with 64 bytes FIFOs. Instead of mangling with the .fifo_lvl_mask and its dependency of the DT alias ID, allow such SoCs to determine the FIFO depth via the ``fifo-depth`` DT property. Signed-off-by: Tudor Ambarus --- drivers/spi/spi-s3c64xx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 72572e23cde5..b1c63f75021d 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1263,7 +1263,9 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) sdd->port_id = pdev->id; } - sdd->fifo_depth = FIFO_DEPTH(sdd); + if (of_property_read_u32(pdev->dev.of_node, "fifo-depth", + &sdd->fifo_depth)) + sdd->fifo_depth = FIFO_DEPTH(sdd); s3c64xx_spi_set_fifomask(sdd);