From patchwork Thu Jan 25 14:49:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13530982 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 9BECAC47258 for ; Thu, 25 Jan 2024 14:50:47 +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=Qf/UfBCBqid3+mkMUJLG81jPcYtx4d6jTHFGQGogFtE=; b=xJF6S9fWRfIwFl wN/saaoGFoivpakJGCDg3MpZhnmyaX1xoE6Bp4NZwDm4k8B4l5d3+nHMV/9OjPWv7Zf8VBp5SPK/V IzlbkUCs/yq8Iz216HIcsz8hy4phcPhqpgSrCOi0WyECHv0QLV5SOhBlmIiLLXWNssfYPCvmikwIz UNdJu4hH9emRgAETH4LpT1X0GTE06TwRKSOsBZP3w+mRK8vlLdOtxeZw67JE9UfiPvGVfCNr11pd8 wlfUeP5jPuR1iRnm/qOJNYOZITgRP2aT/rvjvUG40tF9dFETjezd5cNXH5u2XbT2cFPmK+7XkXVDL ++Bn0DPwJKFfWH1a9gdA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13t-00000000SAI-3XA6; Thu, 25 Jan 2024 14:50:37 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13V-00000000RrV-1Szc for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:16 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40eccccfce0so18418405e9.1 for ; Thu, 25 Jan 2024 06:50:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194211; x=1706799011; 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=600VwywIwYkKhIBCMOdOgBJMPRHlSjpGBD3EGORG+P4=; b=TnlYkoMQqqAClHe5F2uP38xcF8Hsj3PJCEzbF1PKW0FpxezCq9p5O+unoWNHNl2l7l +A8Cgrfa/AVQCPJ7UhhcOarHgzTlTsCGpzFOOvWuJbS7I+7lvzv84/fziy+LwZROsQrq T73Zy4sSLmecBI8YrAXm3YPg43y+dJ8hbZwIiA/KSljdrHfLaMFz595QZdHv5mIX303I ij1xXcKqEJ+80OWEb7sPc34gm0kv4EdpRONRcvR6gzk9AQdIM/sdYdDyQcow2ofOKF58 tMHcgpbD8pSw4d9ng9MJiKXlPT9ppCJwIIwXTxLVfGpbDZqPcjl/c4phT9PIZPxb/4rE B2qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194211; x=1706799011; 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=600VwywIwYkKhIBCMOdOgBJMPRHlSjpGBD3EGORG+P4=; b=mR2n5da7p3Zv7fq/pt3g23f5rkpCFfKgxdyoqQKxsWEipa51K6nCg6krw7Thgk+3kV kN/Lbyx5enDOvtrg54deQvHahWmRTU43wtD6/LpwZkAzRN81HTFE2KdXLxp2P3d75zGs Ye5zV7No+B2uLalj4Vi8FmTvGicR2A8vIHF2szCic/uF2w+TdA6Sf4fX99AhU51dlEei EFFRnlb3m95RS1LRFEUOhWGrYGYA6knmav9700BD4ms6+2pb6p8s3Xtkk4VhL/t14/zu ZAhtQY+HUFulOOVA52nbYpJvXqaXQzBTXT3tRTVQYHm8f2oGOxPcOsonbpwCOBZ5PpBi AKqA== X-Gm-Message-State: AOJu0Yx9zGqXF4z/OwNLOHxO2tTDqh/df/DC5eI45njckblCHfHmS8mQ KEBBofSXU8PqBVL4QWmtgDB5tKdHLh8fFQgyfUVf39Q+VXCkNq5M9fCtx2iwMC0= X-Google-Smtp-Source: AGHT+IEaYzPIhvI7nM66SS0HQQAjOEL9yTE6fWlerWtlckq2lzwAF+Fj0dxMxnPO6we+g9RXHphCpQ== X-Received: by 2002:a05:600c:44c9:b0:40e:50e7:db2c with SMTP id f9-20020a05600c44c900b0040e50e7db2cmr564908wmo.177.1706194211539; Thu, 25 Jan 2024 06:50:11 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:11 -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 01/28] spi: s3c64xx: explicitly include Date: Thu, 25 Jan 2024 14:49:39 +0000 Message-ID: <20240125145007.748295-2-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_065013_539649_1B3D384B X-CRM114-Status: UNSURE ( 9.41 ) X-CRM114-Notice: Please train this message. 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 The driver uses readl() but does not include . It is good practice to directly include all headers used, it avoids implicit dependencies and spurious breakage if someone rearranges headers and causes the implicit include to vanish. Include the missing header. Fixes: 230d42d422e7 ("spi: Add s3c64xx SPI Controller driver") Signed-off-by: Tudor Ambarus --- drivers/spi/spi-s3c64xx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 7f7eb8f742e4..c1cbc4780a3b 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include From patchwork Thu Jan 25 14:49:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13530985 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 76116C47258 for ; Thu, 25 Jan 2024 14:50:54 +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=NYp7+0u265rPPHQPBOkGZPliLkjKCGjPsSGvZyXz8W8=; b=LAAUIrbQLVjpO9 edIbM0uBEhHN7XW+uw+9FkFZaTS0t7QjzgBp1gCQdMFeoXCADsc/VHA7T41haw3q6w5L+Ppf30B1O 1sf29/h8mufIepoGOYtOlMSv/foeIvCxpwJYuqP6vkQSDyR3bYL9UgiURrjzXrNCxmEu8jv7qclI2 20wbElQX3NHZqDFO7PvZi1jtNTr/pYW4nNMZJ2KJbnpVvwyEnLXYSEmwYB4yPPC1hCAuFRXsyHhTr HuUyJV1T5ANlLqNu6HsTr8YYzOMj2BU9XlDpsAaUZvoqI8HcXi8DhACbSUUlkrwCzR7rG3aN8vxxn zQ9vgcidm0Xe+UnCOrUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13w-00000000SCG-1n1R; Thu, 25 Jan 2024 14:50:40 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13W-00000000Rs0-1FZQ for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:16 +0000 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40e86a9fc4bso87287195e9.2 for ; Thu, 25 Jan 2024 06:50:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194212; x=1706799012; 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=Y8tycZHq++FMKvH1QpORqsbZ4vIzt59SLtlLRtqr3vk=; b=Em6tRU0MqiF41vtoruIPElsEl2uN7W98/qr41kGX2BNeDS6G1kLeabgpq3quhExw8S eRWADSsJuLNFDOWPIpmN7qH23PRL4QDGm4B5FFfA/RcpRRnSPs8ZZGNGNojVtniRTw+e +dF2SHQmbnmHkx24m89HF8FAKZvcuSklcqdwzMdiZdUmR07wtW672IMPds1FQeLocRa6 MToI3efRj2Dg82w901EkNZ+dSSmSmamjzpA9N2a4qx03Ic3FQdwHGT2dJ39vEXsgtHWj QbH0XVbWnO4oL3LRG5y6cU/YE/Ah2Py6TyJak4OaATUvVtNVBmjfejS56XVFXWRR2LgH ty3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194212; x=1706799012; 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=Y8tycZHq++FMKvH1QpORqsbZ4vIzt59SLtlLRtqr3vk=; b=g1oshNsGZskj9w0TXJQfC3e8KnWMIj1a7DPzI9hsglG6ChvDUaxB3Cpy5yviVsVNW1 Pz/Rcg9k1Mi/uX70Y82NpxHiVN5Xsq4rrPBDV+atKNy/kPIVcxvkCp3AKGLPgNCwHlAg N3evMOuApEXUbNTUouQAf6y6s7XUVDaJVDHRg23MwIQ/oZjtW+wDkkTcjfKPaJ3N8tdq oxdFoIXuUCLAHcpQP7TmC5PEnQ+rBTAFaKkH4KvIIrz2SeMXSil1/55r74gQZQuf1Fn+ +HcSIES/fXdT2ORMu1DNfBkU2eFH5xto9fA0IM972r/O8L2/d9OY/sS7MGu3UgIphsLH AB6w== X-Gm-Message-State: AOJu0Yw9RWJke/VDzqIa4wdxK9M8sfezljmtieXpccdCyDw2F4JKlM8X CgWkJbDbR35PTjBQLC8H3pivWrA7AbHL9pLRxiNfsTXnvhkt7/U8VwyZApkZ1A4= X-Google-Smtp-Source: AGHT+IHYnZONiZcWx4qZ7LILotRhmsFf3p9jhJElO2+JWwazr0DZjqKuTBjkH5FNJ9qnXfLbjx9uug== X-Received: by 2002:a05:600c:5717:b0:40e:76b7:e8e3 with SMTP id jv23-20020a05600c571700b0040e76b7e8e3mr626383wmb.226.1706194212500; Thu, 25 Jan 2024 06:50:12 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:12 -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 02/28] spi: s3c64xx: explicitly include Date: Thu, 25 Jan 2024 14:49:40 +0000 Message-ID: <20240125145007.748295-3-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_065014_477577_80442A29 X-CRM114-Status: UNSURE ( 9.38 ) X-CRM114-Notice: Please train this message. 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 The driver uses GENMASK() but does not include . It is good practice to directly include all headers used, it avoids implicit dependencies and spurious breakage if someone rearranges headers and causes the implicit include to vanish. Include the missing header. Fixes: 1224e29572f6 ("spi: s3c64xx: Fix large transfers with DMA") Signed-off-by: Tudor Ambarus --- drivers/spi/spi-s3c64xx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index c1cbc4780a3b..2b5bb7604526 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -3,6 +3,7 @@ // Copyright (c) 2009 Samsung Electronics Co., Ltd. // Jaswinder Singh +#include #include #include #include From patchwork Thu Jan 25 14:49:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13530984 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 8E9D5C47DDF for ; Thu, 25 Jan 2024 14:50:52 +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=oSBWUGoShsurpX4UkqPcjqp2QW3rqDgE9oiujgavUQk=; b=Fg0hj+Dfva7RBy raKfnnn5Etnw0fO/rzArbDKr6U2+WabT8fDQEFQY7R07zYhDxHhbOTsbTUuJ+ZEpJTJhrAVw2aBeL wLwitg/7snMd63x9qLdvxXxQIm/vYNt/XtxiLEIuZepK1lXfTg6/4yeB8FqrBUjXq4NSqo8nJ+oI5 NM9PZKbsuvsqNfpYLINsDQLYuuO/MND7nSHe/xtSGqfytA6k2PeCmfNCinRhrpTNR4k2WGEEY5Z0u RGf9gEIfuu0bxqv5UYni5uEKUnNQWjplwMdhh1sHMQRXLRx3ljZDFu+BWF3cwE5geFwcxmF4d2W0o n2q6F35AuJyjeg8b9kHQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13x-00000000SCp-1bGd; Thu, 25 Jan 2024 14:50:41 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13X-00000000Rt7-1UeU for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:17 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40e8d3b29f2so80029195e9.1 for ; Thu, 25 Jan 2024 06:50:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194213; x=1706799013; 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=yRFUn44quLj+PIfBqhHItZqwl4f97FWUBTKk7RiZwVk=; b=KuNoaHrvPj28iwo0LuHiPvouGkWYvbaA0wfBppY5SI2IpHhQwePkdxbyRIQQHonLOw JMKD3Z2zCd8z1pcijGxqXwBF0nxKrwcbL2SSzWenItQQaBnZYQrDQJShZ8YQuT0l3DE4 3oWCmw2/4SZzGzyv+Eq8n757dQXqWzu4I+3DBqhhlg1fmiOxIYcmID7soHGacZTn2Vmz rN8Q/jVfZ18C5cC8H+9lbQByslPxfoWsy2g0RCWm7n9STE02+NZv72l6zT/ZMsuSM7AX I1ThWbRAcA7vUi1bLaKaVu6q1Q/AqAI/xqZ0Oo/86MhvikcfYO6JKWFAlTBAddP2WIHp BA7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194213; x=1706799013; 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=yRFUn44quLj+PIfBqhHItZqwl4f97FWUBTKk7RiZwVk=; b=W80/TJWZOo8buaomruXY4pCZyIVi3EQ7O0BJG8u6AJOD3FBwJgpAKxEv43b5VOtFuy SphOuxnvtqyxgomojxU4WAMrhUT5Enva07JWpxqEZnHkLXp7Lfibr5wNCVFz5KWqcNwG WstJ93h3/XZ1Fj15rceHIZ5Fz9kEdnvfaj79vFvpK04PuWJUvxSMBWSxIb0OJQdBcpBh mT+NT2LhVBBlS7/l3DpBhnAtc7iCPPboAztQdriqqs6xAUVQoT1FvSKqOykJ9392lLXC iAQS0tRWAVgLDGMP+MSgMhCL5pusKUd/gdq960mdmjIcc6RubDiL0zKQAiRQisnvOLB9 ZMFg== X-Gm-Message-State: AOJu0Yzus0+6YX6vwY16o3I3mEZeEITXFi6qk2y/FdiaoIBxhlN3VZi2 H9n88+ziljZu+q8g07Kw8EDQbR5DV3fD+bH+T9nC0KjYEnvJ45cpnCkVS0JxJP8= X-Google-Smtp-Source: AGHT+IFOgajdcjx12foem5jJQ5uVJoa8Xt7GnwMZgRpKmkxOeOk40qisvSZ27ix7km3lnNNA6G3wyw== X-Received: by 2002:a05:600c:cc7:b0:40e:d2bf:5b03 with SMTP id fk7-20020a05600c0cc700b0040ed2bf5b03mr271370wmb.82.1706194213512; Thu, 25 Jan 2024 06:50:13 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:12 -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 03/28] spi: s3c64xx: avoid possible negative array index Date: Thu, 25 Jan 2024 14:49:41 +0000 Message-ID: <20240125145007.748295-4-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_065015_578507_43A9B95A X-CRM114-Status: GOOD ( 11.67 ) 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 The platform id is used as an index into the fifo_lvl_mask array. Platforms can come with a negative device ID, PLATFORM_DEVID_NONE (-1), thus we risked a negative array index. Catch such cases and fail to probe. Fixes: 2b90807549e5 ("spi: s3c64xx: add device tree support") Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/spi/spi-s3c64xx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 2b5bb7604526..c3176a510643 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1189,6 +1189,9 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) "Failed to get alias id\n"); sdd->port_id = ret; } else { + if (pdev->id < 0) + return dev_err_probe(&pdev->dev, -EINVAL, + "Negative platform ID is not allowed\n"); sdd->port_id = pdev->id; } From patchwork Thu Jan 25 14:49:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13530987 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 7BADCC47DDF for ; Thu, 25 Jan 2024 14:50:56 +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=rxpUneLh8NViWSTLJSRLOArY3uLvAcpD7myCDOj0JFc=; b=uOgtotea3CXJS2 DI/Hr/+0mz3pwi+Z4P8Ag8GdwGb5IGb5siW+uGTGL8ObmmO4mC/qRRacAk58szISt9F5msI7V+gcJ PgiI+1KWz2KJqqOSo9NHChFbO8zBpjfI9iduWLUPUS5vimG12tKuo04ubcaofgGmqDvU/VJiJy9vG kvgnrf7tNXudhlLM/mLeJfL7Ga7QdenPz301SWQVol2NNyHM8YzayFFTq3IzQBO95/L8H7kidkt8u kTUtd02vu189Rm7c2Q32enRNNraPzhRTRPuFsdXevNMPd7Qf7gIy3VD6PlVJry+1eSufPk4N66jt4 GD+DTE4alHhZF/em46FA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13y-00000000SDh-0xup; Thu, 25 Jan 2024 14:50:42 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13X-00000000RtT-3cpM for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:17 +0000 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40e800461baso81017395e9.3 for ; Thu, 25 Jan 2024 06:50:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194214; x=1706799014; 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=jF19RJft8z+RVxLTw4w4Iz/5TESrFLzi3P4+GrCzRsY=; b=eAAItLkEivXHrjmK47rXUu2Rz4fgFIoxD8iaIY7cGbn3GPI2YuaLidNGsX06l0I+6x B+OzRE71xXiXeLMhaSmiG4pv2HmssnL102Ov+wV/+X5ngKtLw/nRhKX7GbPslJqbUHnm YKPz9CJtAKCUY9azuKSvnKu/XrZkMsOAMzJ28zuI2usJNX8LcXk3WemppgvMik3XXWLM mx0XgsW/GpiCLCbx7CtqrIMSZTUpSdUz9mEf6u3hFpanowpxaRhagEqOZ5MdU+YOjTpW dreOnrhbjGi0SNJTR01bhawyg57viHz+croWSox15qFZ6u887bVcI8v1D2Vvy81ycEYZ dg8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194214; x=1706799014; 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=jF19RJft8z+RVxLTw4w4Iz/5TESrFLzi3P4+GrCzRsY=; b=wAdgvp7V0scnv8e+3EFBhLvsBYVdfh3YNaz2ghLN0hogdGeOO2Ds+vIqIb6RWnKAO2 aIykslVeqp2NamFbhcEacCrf4iSjIsn6pt6aOJJETQGuJJIZSpiCsB59j4Ac6WsZ5EoW YNDotzec6OJE3RxTIZylRLWj30oApvXB5jI1BFMkeLEZcSZTAHB/Gxy67xfsnpERGBd3 FO33X0ZgP2yJlfhApe+njbjWXkOMjGXq+7ooZsjWRN2Ejus3QK5+LNM5MWazObZNFy6C t7sqbw797ZrqygMNEZSToV5hNvGaBr6InnBNCKggOKN8V1NHymf9KFrbWladzZUhcdTS NPPw== X-Gm-Message-State: AOJu0YwglygF4wFk6U/KiCv3djXdx3U6Kjhz0Oa07jpQRY27CC2VPjAf zyeuNtvXg/hBVVhe+byiqAhWnLuYA3vIpfkF8SMKKmlRISgo0z+npnEMlu5MbQZNS12Y0Mp77OU bpOc= X-Google-Smtp-Source: AGHT+IEHoREsOegc3WurYtU5U/rBHZhVnyI3Hhay3VuRSOXGnBpm1+f1t0k7hs57nCO7FwSA9TxYig== X-Received: by 2002:a1c:7c19:0:b0:40e:67e9:ae0 with SMTP id x25-20020a1c7c19000000b0040e67e90ae0mr366973wmc.235.1706194214090; Thu, 25 Jan 2024 06:50:14 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:13 -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 , Krzysztof Kozlowski Subject: [PATCH v2 04/28] spi: dt-bindings: samsung: add google,gs101-spi compatible Date: Thu, 25 Jan 2024 14:49:42 +0000 Message-ID: <20240125145007.748295-5-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_065016_062973_E90EAED7 X-CRM114-Status: UNSURE ( 8.77 ) X-CRM114-Notice: Please train this message. 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 Add "google,gs101-spi" dedicated compatible for representing SPI of Google GS101 SoC. Reviewed-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Acked-by: Andi Shyti Signed-off-by: Tudor Ambarus --- Documentation/devicetree/bindings/spi/samsung,spi.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/spi/samsung,spi.yaml b/Documentation/devicetree/bindings/spi/samsung,spi.yaml index f71099852653..2f0a0835ecfb 100644 --- a/Documentation/devicetree/bindings/spi/samsung,spi.yaml +++ b/Documentation/devicetree/bindings/spi/samsung,spi.yaml @@ -17,6 +17,7 @@ properties: compatible: oneOf: - enum: + - google,gs101-spi - samsung,s3c2443-spi # for S3C2443, S3C2416 and S3C2450 - samsung,s3c6410-spi - samsung,s5pv210-spi # for S5PV210 and S5PC110 From patchwork Thu Jan 25 14:49:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13530986 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 72402C48260 for ; Thu, 25 Jan 2024 14:50:55 +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=fuEIA2sOpf9p1hpNyusNwfR7eH9gaPVBMEe4tv0GhZ4=; b=3bqIQlpuGgK2nD ETxUlTH7jI/+JBYh78EWFd2J9r8aCfc09Xm3kD9ldsi8yn+pXYSss7ZsJne741MmgwH0p0qG+JZrM BuLaWM6oGrGSV2rGRTB8qfggsDjx17/my9kNdSyfD1KYPVOl7227Q842K6Lkxt3ZtKS18OjyezfG/ 5BXEbGDbHcHoDqqGk7ru+gH2FvrJzOTRCnPIJ7nQL+fsxG0pY3h+MZtNVvmGgRd+KNJPSYqiBkwSN veBYO4tTSGfGt7V1eycb6woYXetm94Ev6Vm+0XnSSzbgpLLqI/y+/svR741dz4gOI5CP6dDU8eNBs ZhT86abXPw28xsmAXuJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13z-00000000SEY-1srx; Thu, 25 Jan 2024 14:50:43 +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 1rT13Y-00000000RuM-2kQt for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:18 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40e86a9fc4bso87287695e9.2 for ; Thu, 25 Jan 2024 06:50:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194215; x=1706799015; 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=7RbS7SdUaAw1K/g37Ed+dGAKWi2x8GPreQeT5KyvnlQ=; b=CCJ0cwx39hIDWwr0851PDc+DPXJJLBRvVBdo11CurxzqFC/BSKQveHEhsKb4hpmCEy mLxIrZpu3UWb9yW5r6yjeHV1MS/OGYfaV2bNx284ZhWMarwTupggXZZmbr/KXVK+22sH h5ZIZcrvgRFARkNhdVaHATrRTAD60kSrADQAISE3ht1AdtQYicFioxMKlfZI1ny8FRk5 y8Ya2YZDiTok5Rv2AhLPQB6oSy1QFRaZLr1Um3oGRzeC4xngKm7n+KpnW1YbRQFKZwWA qJCfsJuPfIc44pPQ+0KIKDUerqmsfSbV45OtksDDEUblh8nOaLuYktQ+vZz10Yjoj99g QEkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194215; x=1706799015; 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=7RbS7SdUaAw1K/g37Ed+dGAKWi2x8GPreQeT5KyvnlQ=; b=qhLeQbIFx3YKgDfVSFWtrK5xGIna8iy+4cOI7k0cHh2Vk7S1ynCRFas+YHSz1PNj9/ KhEYRF5eWzhdu+uvJgmcJpPR4HlGgEO1itJekepgNfz9X6tT523h8Joh03MiKcOklSke xdLobGso5Wa238DaCHsSDsxfwStuDLk5471XFVeArKRKSxSyrc7uHgfFiNVP5Tdj8+Vl T46vbvP7RpwnyaUdTpFyzjty/wwcctxhWgWgMC/ifXkjFxD9SFc5Z6X06dvFWzeOuK1j JU2szMyBPjBIknxpF4WijA9qobQyakpWpdLLk6K+kQ4JBFqaOUWB1sRxAn/YuAFiQhUK dd9g== X-Gm-Message-State: AOJu0YzQmF8+xBNkVvvBqbSWU3xI5rWO0Sh1lIvHuTZCVzw30P5QJaNn KbEWNes7RX1A5U3Xet6/10oMMnT+ie706SgxIFSNNPxe4z7pH8Z95MA8n7Pqw+M= X-Google-Smtp-Source: AGHT+IF3rsjwZxEnfNF6i1Zh7SUR5ZRZ73j3LOKjqeaRMZmPLsyBw6tsN1pEQ9sr6wHSVaZZSQO7zQ== X-Received: by 2002:a05:600c:1c99:b0:40e:cc93:2f6b with SMTP id k25-20020a05600c1c9900b0040ecc932f6bmr604869wms.151.1706194214900; Thu, 25 Jan 2024 06:50:14 -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.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:14 -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 05/28] spi: dt-bindings: samsung: add samsung,spi-fifosize property Date: Thu, 25 Jan 2024 14:49:43 +0000 Message-ID: <20240125145007.748295-6-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_065016_865302_A0C357C8 X-CRM114-Status: GOOD ( 10.32 ) 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 Up to now the SPI alias was used as an index into an array defined in the SPI driver to determine the SPI FIFO size. Drop the dependency on the SPI alias and allow the SPI nodes to specify their SPI FIFO size. Signed-off-by: Tudor Ambarus --- Documentation/devicetree/bindings/spi/samsung,spi.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/spi/samsung,spi.yaml b/Documentation/devicetree/bindings/spi/samsung,spi.yaml index 2f0a0835ecfb..4ad5b8fe57aa 100644 --- a/Documentation/devicetree/bindings/spi/samsung,spi.yaml +++ b/Documentation/devicetree/bindings/spi/samsung,spi.yaml @@ -72,6 +72,11 @@ properties: reg: maxItems: 1 + samsung,spi-fifosize: + description: The fifo size supported by the SPI instance. + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [64, 256] + required: - compatible - clocks From patchwork Thu Jan 25 14:49:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13530989 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 E1D8EC47DDF for ; Thu, 25 Jan 2024 14:50:59 +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=rsVq5sUZGs7O64CQDJqyGI62eEM0FIwJtcucwnw7SZ4=; b=GgTAFFuNuIMFP1 1P6a1cmBua+9FntFQyXjrK3CdBXpIT5KrSjbQxyXg/rf0yjEtBlsqKPuH4jEHN4clrLkWZa+AYyjh NeHsNK586uBLoQpon8qHGUuseWc+RIZ0zVuZvvzjv3UfV8JYPrgfDg2r78qeRz74qkQ9Q/Doqok6R oJ028fSRc0EQKgCI0bxqoob/whSRQqS+r2wJxrpUKzjUiBc/l5WCT6H0Y86MQgjcx+o5W+jVD81ju 5jBNrpSq6rParsvUcMlgKHAIdgn5DlCOsuxoilxexURF4iF5HpgJ5FotvzAVJox95093BvqWekqDc NugwWM51LPCNgx4pPRzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT140-00000000SFN-24eb; Thu, 25 Jan 2024 14:50:44 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13Z-00000000RvH-3yMu for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:19 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40e7e2e04f0so74513335e9.1 for ; Thu, 25 Jan 2024 06:50:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194216; x=1706799016; 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=g2zGHL3l4HfFHILf65OAbwjVhYLd59O+yJnAHxlD6UM=; b=oetEpcj8Bm6l5n/Ly1Wq6OhD2pjO4hdxows1wG3kBVIFMsjziPnRi8cnQjJplXrdGq OOYae7NRdyecnGnZ8hE9gtwGmfSZ/6qWHgaN4S6ePL8y2tuLKSBdohA/CC45/EYJiTFj 5enLunJbdpP+Y88JQq3pBevbqaWjTuyosiUIIZZKBJxKssRoq4nUe7s60hfiL8jlxrjc 0jB8RtiBIf+B4KnboCAFpitEvy46mEK+BpZp98a7qlOfY65ip2n1jJ83qTJuXlS5GDvw uXIW++bZcoKdRMslT0YIBY50MiIOobfzemRrHvVCHTZhMJPi1GdjzVgZGzYok05cVapd ct9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194216; x=1706799016; 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=g2zGHL3l4HfFHILf65OAbwjVhYLd59O+yJnAHxlD6UM=; b=iPQkqVHH/ol90Bov8agUruzU0B0HhA6Gc1LA0t1fo1XQvqwZeLWV3hFEs05Ib6yULG ayMQuZREH97OYyR7G6MTHWZpQ9fHnfQwvu3Z294BciWPeapsETNtIE50JEe89tY2N59i WRuzFSt9x4JPxiBOumTYATSEC2loT27yU+Tsu71gxF9Dw5gtfZsy22t7VRIrg0B33Z7+ o+lukbEn1kDWvX6NM2fHO4JLRlSpjXyWgIfa5nLnKBt+YZHFLrir3NoGbHVCIwfcbjiB YQx0ucUGVKWjS2yYVbfEi9NGFuYCvOSDDBnyVzHzlm4hp/wbsbwkDJi3jrPse5+QIlQX GW2w== X-Gm-Message-State: AOJu0YxDukeMcQW6/iPoEslHAKX2nbiyf6S8lAJ8uddtjL3+sT5HRUNc cK955CUA366EhrMXngjF/HKv8xXBj8bZ79RUntur9+/0y52xOJTTYfQpWWxcslw= X-Google-Smtp-Source: AGHT+IEJ1CIdTrTRD4BA8d8gYFgNBWkIAgKqFXH8Q364GdBqOQzM962Dg8TpAX/PiqTFyXyRbfeI3Q== X-Received: by 2002:a05:600c:17d0:b0:40e:5562:bcda with SMTP id y16-20020a05600c17d000b0040e5562bcdamr513612wmo.155.1706194215945; Thu, 25 Jan 2024 06:50:15 -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.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:15 -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 06/28] spi: s3c64xx: sort headers alphabetically Date: Thu, 25 Jan 2024 14:49:44 +0000 Message-ID: <20240125145007.748295-7-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_065018_073913_91491DAF X-CRM114-Status: GOOD ( 10.31 ) 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 Sorting headers alphabetically helps locating duplicates, and makes it easier to figure out where to insert new headers. Reviewed-by: Andi Shyti Signed-off-by: Tudor Ambarus --- drivers/spi/spi-s3c64xx.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index c3176a510643..230fda2b3417 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -4,20 +4,19 @@ // Jaswinder Singh #include -#include -#include -#include -#include #include +#include #include #include +#include +#include #include +#include +#include +#include #include #include #include -#include - -#include #define MAX_SPI_PORTS 12 #define S3C64XX_SPI_QUIRK_CS_AUTO (1 << 1) From patchwork Thu Jan 25 14:49:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13530988 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 3B07DC48260 for ; Thu, 25 Jan 2024 14:50:58 +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=+i3ago2LM3Tes9cge7VAdEHZPyPiLfRy+22DmS3Uyg8=; b=Q6qRIe8KH04ucz C4L2+Ga9Lz9agDJcAdhxkLWPjLRFkHmXO+V8CzvCSXcdO/dB3WVHONrWMSTNmx2zsaysbtsqorcY8 oxoiZnASEAUf4dcvQWNWN3WfnvwRDwU3PRmLPzPV9r+5lB5cjVuFTDMMcRurZGWg7wqu2fMDonL65 zLGNj7+Xb8vdSMbnkykGLn7BxmTWDA1Nk0oY6XfmPgXn95VJBrO8B5XzMX/SIx+UDphPut7gDqv0+ ORMM7gK/mqpJjWuWBnuYmMWpFlibetbcprr4LdymHc1Hv+sKaXid3C+jYUlBObEy0sZlxQgCr5ov6 +LbQCBJ6+wX+hAoKV6Yg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT142-00000000SHM-1c6i; Thu, 25 Jan 2024 14:50:46 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13a-00000000Rvi-11br for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:20 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40ececef212so8800315e9.1 for ; Thu, 25 Jan 2024 06:50:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194216; x=1706799016; 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=gfapMhR078yFz2BCJ06O4fPl8ddG0C3B6BN3m2+gI9M=; b=NPhP9pjSXWfOIU3vQ3HrOHrKmYVC50Y1lH4waRFeCKHCmpGE80o5H4G7ffyqLhXHgO LUaXICBwuurVHEK0ZLFoK1RCmL8cDN5xgew1Ljkg7064bRCxItkPz6PoMYpzwcX02P1e bS5gPYETZUBUto15KgjmtFfJP7Iv00qIlY+/OQ0R+6PMwv1UtiX3ghcbgvX5A7uW1UiT Xx/haoCHEE9BN8MSCvC2I+75dwjbqjm755RhMIDUW0I1PvvI/cpL3bDcxiefnrdPjhFh kh8lkmNwqrs0gf3OKAmgOLA4c72No0rlJjOU6bn83CpkhQDuO965YCC7dvdtMjMz7pFI Lwsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194216; x=1706799016; 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=gfapMhR078yFz2BCJ06O4fPl8ddG0C3B6BN3m2+gI9M=; b=jfLe+42zonrCj9AtwCd9zOtvui7YPELrPxSNrFYngsKWxhU7XlkOaVy0cSU5KDYc1I PoAcM5DSdKOddSUsh/eDzZn0CWdaqetPMr5fhqvcvi7H1o0R8NN6fgAx85fgcG4OMUWF YCJYtDVEswTSA0eitnX4v9r/xENQWhpxLdPJrDuUz9rX/WgaIGP6kMjlzEPuAGC21FgG Tf93dFv+f1dmhmBnvhf1t5RYE2KtsqQ0MJrPZuG8pq2xjFq9/RoaFEMjRl2vQDo5yBtm LNydeZZZIhH4R1KkN0X3SqSqcVVvigO1aEJpm0cppNyYqd9DgYack92eUYY7XoFdLGmE QYhA== X-Gm-Message-State: AOJu0YzKJKLyqP1e8HPbXO5iBGYVG/EoUh0VCQoVVpff/9G4fYYOFmyc KI0LxhJcGSXhHaOekeoZLddlFS+LskNsiBue8w+4FRsCb8z+h9u+rdz8d8oXo60= X-Google-Smtp-Source: AGHT+IGKMPYcJt5PfYIPyPZWi6QgWizho+wseuLkKZqmdgxi7otGRqXHMWOgPklU52YF7k7f3SrRKA== X-Received: by 2002:a05:600c:378a:b0:40e:a302:5ce9 with SMTP id o10-20020a05600c378a00b0040ea3025ce9mr655114wmr.39.1706194216523; Thu, 25 Jan 2024 06:50:16 -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.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:16 -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 07/28] spi: s3c64xx: remove unneeded (void *) casts in of_match_table Date: Thu, 25 Jan 2024 14:49:45 +0000 Message-ID: <20240125145007.748295-8-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_065018_375032_1FE197AA X-CRM114-Status: GOOD ( 10.68 ) 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 of_device_id::data is an opaque pointer. No explicit cast is needed. Remove unneeded (void *) casts in of_match_table. While here align the compatible and data members. Reviewed-by: Andi Shyti Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/spi/spi-s3c64xx.c | 45 +++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 230fda2b3417..137faf9f2697 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1511,32 +1511,41 @@ static const struct platform_device_id s3c64xx_spi_driver_ids[] = { }; static const struct of_device_id s3c64xx_spi_dt_match[] = { - { .compatible = "samsung,s3c2443-spi", - .data = (void *)&s3c2443_spi_port_config, + { + .compatible = "samsung,s3c2443-spi", + .data = &s3c2443_spi_port_config, }, - { .compatible = "samsung,s3c6410-spi", - .data = (void *)&s3c6410_spi_port_config, + { + .compatible = "samsung,s3c6410-spi", + .data = &s3c6410_spi_port_config, }, - { .compatible = "samsung,s5pv210-spi", - .data = (void *)&s5pv210_spi_port_config, + { + .compatible = "samsung,s5pv210-spi", + .data = &s5pv210_spi_port_config, }, - { .compatible = "samsung,exynos4210-spi", - .data = (void *)&exynos4_spi_port_config, + { + .compatible = "samsung,exynos4210-spi", + .data = &exynos4_spi_port_config, }, - { .compatible = "samsung,exynos7-spi", - .data = (void *)&exynos7_spi_port_config, + { + .compatible = "samsung,exynos7-spi", + .data = &exynos7_spi_port_config, }, - { .compatible = "samsung,exynos5433-spi", - .data = (void *)&exynos5433_spi_port_config, + { + .compatible = "samsung,exynos5433-spi", + .data = &exynos5433_spi_port_config, }, - { .compatible = "samsung,exynos850-spi", - .data = (void *)&exynos850_spi_port_config, + { + .compatible = "samsung,exynos850-spi", + .data = &exynos850_spi_port_config, }, - { .compatible = "samsung,exynosautov9-spi", - .data = (void *)&exynosautov9_spi_port_config, + { + .compatible = "samsung,exynosautov9-spi", + .data = &exynosautov9_spi_port_config, }, - { .compatible = "tesla,fsd-spi", - .data = (void *)&fsd_spi_port_config, + { + .compatible = "tesla,fsd-spi", + .data = &fsd_spi_port_config, }, { }, }; From patchwork Thu Jan 25 14:49:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13530990 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 521EBC47258 for ; Thu, 25 Jan 2024 14:51:04 +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=5B3cP2CP0PnSPZtjTg5S0rFpxODXefuRKBUdBa/c16w=; b=2rqAakj6YBj+T/ 65FVat/moiWLAm5fEWr37p1ToV62NdDRPpJ+M7EXgyHDKFPgucBBcHg5wAFlrHkpIucmArGekAmok +hStrNhxcdP5Lp71ERyLmQ7gzeLLFLt4lXbzaEF9hqWJKvmzmPm1hkIV0iuDscTP7Uc6MujC9ETfR IeXPDjYqw/zwCD/rjvHufSHuwfh7KD7/N+/HYhJJ2IHIGm7H7Es13csVq6kdaj/tLYIj2N+D4tnNi LnJgD1ZjAJUNd3oxmAuOXq1kK3pbsC/vm2B8+dDFxKIA6ejOIqLrmQ7isLSMNf+2M3UpwvUH3SXFz FSz0+3ykeDhPrxsxQGVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT145-00000000SKJ-32vL; Thu, 25 Jan 2024 14:50:49 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13a-00000000RwA-4AVG for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:20 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40ea5653f6bso70947265e9.3 for ; Thu, 25 Jan 2024 06:50:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194217; x=1706799017; 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=M4fz9oIGVOkFGai6Cp4lYWrVDrbEsI2M8XA5EnCVP48=; b=LF96qf+TOkLQ2O4nvILNZ+tSvH70j8tl76mE16/NQy6Qe30ArCwrOUnKjE1eoR/WTF QNp+vD4c/Lq2/v3E6P4nsAnW5TNoqUiQFDQOTVAcMjMsdYbMDjWi/TCU+uM1v7UqmiKD 2RK0wP0fWEbpYWQX4IOyo6Nnpf67HwbHKx7nYsn7C8+gZCdY6wv5N8TqHpGOllYI/Zj+ rgj2bahUpEtsdGjMJfnWrpWNenEz9833jIPdc9enZNF2nM5CbqUn5I2FvyjmLb0bA127 5qE5bOQ+C6jU2PA6mlxSsKXKXjzXFCax66SxJ4VyTw3zSP92bDKlS6VWCtMJGygTgZWT wNYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194217; x=1706799017; 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=M4fz9oIGVOkFGai6Cp4lYWrVDrbEsI2M8XA5EnCVP48=; b=AbIbGtZ4ZV+A13vYX18XGn7LUKlkGn8hRLFAV3ioW4WXjpr0DGb0Yw0A7fh0Ve92jB tkn5bqkppK95tLmpPsb/qiIHwKWuuZdNjDOdHv9461HO1OHV+c3b9MbPi4aofdXqpY4y ZGKKCwupXmMBuZU94h5W3T55lznZSl3edv1PsnHErR2tPtN9t0xAIq5jsQeW14Z1olCV H6Z+HYdXMz2UanAJg/NzKidZECvBOTUmxkAsijpDPKM1fFoHeJlnqdVHmNkEBYcHFJxE 4d5IL/tDj0hfOyS6zNHQw1mpdl1OlAPED7EbQr3+/4+M64qUbKMX8Lchwf8Cw9zsRhPA 1vJw== X-Gm-Message-State: AOJu0YyP/uGKjgYX/KXczKdVT308vlaE/OSgXTQn33SsNx1FdpSkNIjB Tm91EMVwOPacgWJh1+TvOsSn45YFCTABSU2WOAKiqYIHzQGU1WDInSH8TO3lWYc= X-Google-Smtp-Source: AGHT+IH59qBBDJYZqajM3gXZkrFzpTjDsYhh2UwC+Mu4T262n+h9h/yXectShSlu1o5IM3xVnvhLGg== X-Received: by 2002:a05:600c:4510:b0:40d:877d:ca9 with SMTP id t16-20020a05600c451000b0040d877d0ca9mr632702wmo.104.1706194217327; Thu, 25 Jan 2024 06:50:17 -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.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:16 -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 08/28] spi: s3c64xx: remove else after return Date: Thu, 25 Jan 2024 14:49:46 +0000 Message-ID: <20240125145007.748295-9-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_065019_094560_3EA2CBBA X-CRM114-Status: GOOD ( 10.59 ) 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 Else case is not needed after a return, remove it. Reviewed-by: Andi Shyti Reviewed-by: Sam Protsenko Signed-off-by: Tudor Ambarus --- drivers/spi/spi-s3c64xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 137faf9f2697..1e44b24f6401 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -407,12 +407,10 @@ static bool s3c64xx_spi_can_dma(struct spi_controller *host, { struct s3c64xx_spi_driver_data *sdd = spi_controller_get_devdata(host); - if (sdd->rx_dma.ch && sdd->tx_dma.ch) { + if (sdd->rx_dma.ch && sdd->tx_dma.ch) return xfer->len > FIFO_DEPTH(sdd); - } else { - return false; - } + return false; } static int s3c64xx_enable_datapath(struct s3c64xx_spi_driver_data *sdd, From patchwork Thu Jan 25 14:49:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13530991 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 F1F7DC47258 for ; Thu, 25 Jan 2024 14:51:07 +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=/NEzdROtj8dhmSfTe+Jg2/i/YyxytvjFq3xYAkuOH38=; b=q9B6mByvtdTtdn BgHeLrQdf2EkI7PKdkXWkh3zFLDsCk0L7CRfIfT27MHrxj5jbIKESV+XdG0nrYmZ/Wki4mH6bzjeD 8wkEWze9aoHPHwxi/9yeNgh3e1y2a0g/UAv7H7am4tnTZRDYsjbHPh+YD8YIEi+roQozHTcydMvz4 l7BTKUU3ySET05rl68508IeGC3Fvh7da2NEI3RY+pZiE24GIOsNsH1dAuke26PfYRR9cGbkjYL+sE AzlxSmqU2+eQufSsYOVsYbS3XwpW6cxCbwfWXO2y93A3z3Ry2yzpIIW1MDH2ALWrYCTWmMo80B6wQ aTDdAURVBIO+NJ7Jb/ng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT14A-00000000SPL-3BgV; Thu, 25 Jan 2024 14:50:54 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13b-00000000Rx3-3MKb for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:21 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40e8d3b29f2so80030415e9.1 for ; Thu, 25 Jan 2024 06:50:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194218; x=1706799018; 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=/ZXJNN8RsKvqmzY53Rpr/ylvEMUsn8dtNExD4VM14us=; b=N1s7QskAnvcLsTPjGqaoIOOIkrioGnKq++TPogS4qnPCdQBjzSf8WJqqxpVBBAMXs4 hAO4GJHNLxLCNv8bsv6WIHEtEmmOTxL7Q/a4NjlC71UJYtCquWdQmdEt/q4Wci4gVyn4 6JK1P5u6CySy/haWZfFzedKRGi2lmyOtyRNYdl4AHckAtJl21JUeQFZJo/d5SWkyHpHC bsOjjEOCuT8sc9rMfFHstq0K76LYN/l7JhhWoH4DKi/0kfAQPHOUEU+5lQlXF5PDLd4K //F8mGFatZ62uygdYT6eQb9OCV/n57Gg2ZcXjOIhvy1abl3S0ccrkWWCP+8wkd4sTTX6 09yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194218; x=1706799018; 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=/ZXJNN8RsKvqmzY53Rpr/ylvEMUsn8dtNExD4VM14us=; b=JTAouqA2u/BDa6t+IaLFlQltUePOmyzGi1rr1vlJ/8V8appQwraF5f71h9wPaXWB06 YfvUwGbeXxs1PmTxnZziWAy0RwAjZWmCLwJ9Y0tqp+LzTi8Pg//WBe/1xctz3QDhai3M l+cPw/S9pyXvrT/YQcNfUVsW9qrTuruSrUImTNEegE1PMJn6K6TeQEj154RoytrfxkOR 4vbJPUBCxZtyeGJ6rNRTtFHo2NQW4vb2JKBpfkAe1yT3o9qtVdrjbdkFjifd4BYKL9sm xzXJmc9N9mp94K9H2K+GpLN3kvTCWPKSIznNNutL5Gag5X6QCCZJ1yNr65Ml+D7xPdXQ TtAQ== X-Gm-Message-State: AOJu0YziyGKpQ7DB63UdREB6NUeDRETY0SPe4InuDGofrclOO/qPF1Bo cB4qb07ELKy1P9JAeALHo5Sx8p8x0fkvAcK9fwtoE7JN5lFXQ9h6SfWzKgjjmwA= X-Google-Smtp-Source: AGHT+IGE2p0rhmfKyGJh626c+fCS3Cqjbbl0jGZGEMf+qcbsHy/GxSTypKUSAtPDh1RphFOQ/vLjIw== X-Received: by 2002:a05:600c:3c9b:b0:40e:4181:a549 with SMTP id bg27-20020a05600c3c9b00b0040e4181a549mr380407wmb.163.1706194218101; Thu, 25 Jan 2024 06:50:18 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:17 -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 09/28] spi: s3c64xx: use bitfield access macros Date: Thu, 25 Jan 2024 14:49:47 +0000 Message-ID: <20240125145007.748295-10-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_065019_925530_C72E1863 X-CRM114-Status: GOOD ( 14.72 ) 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 Use the bitfield access macros in order to clean and to make the driver easier to read. Signed-off-by: Tudor Ambarus --- drivers/spi/spi-s3c64xx.c | 196 +++++++++++++++++++------------------- 1 file changed, 99 insertions(+), 97 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 1e44b24f6401..d046810da51f 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -4,6 +4,7 @@ // Jaswinder Singh #include +#include #include #include #include @@ -18,91 +19,91 @@ #include #include -#define MAX_SPI_PORTS 12 -#define S3C64XX_SPI_QUIRK_CS_AUTO (1 << 1) -#define AUTOSUSPEND_TIMEOUT 2000 +#define MAX_SPI_PORTS 12 +#define S3C64XX_SPI_QUIRK_CS_AUTO BIT(1) +#define AUTOSUSPEND_TIMEOUT 2000 /* Registers and bit-fields */ -#define S3C64XX_SPI_CH_CFG 0x00 -#define S3C64XX_SPI_CLK_CFG 0x04 -#define S3C64XX_SPI_MODE_CFG 0x08 -#define S3C64XX_SPI_CS_REG 0x0C -#define S3C64XX_SPI_INT_EN 0x10 -#define S3C64XX_SPI_STATUS 0x14 -#define S3C64XX_SPI_TX_DATA 0x18 -#define S3C64XX_SPI_RX_DATA 0x1C -#define S3C64XX_SPI_PACKET_CNT 0x20 -#define S3C64XX_SPI_PENDING_CLR 0x24 -#define S3C64XX_SPI_SWAP_CFG 0x28 -#define S3C64XX_SPI_FB_CLK 0x2C - -#define S3C64XX_SPI_CH_HS_EN (1<<6) /* High Speed Enable */ -#define S3C64XX_SPI_CH_SW_RST (1<<5) -#define S3C64XX_SPI_CH_SLAVE (1<<4) -#define S3C64XX_SPI_CPOL_L (1<<3) -#define S3C64XX_SPI_CPHA_B (1<<2) -#define S3C64XX_SPI_CH_RXCH_ON (1<<1) -#define S3C64XX_SPI_CH_TXCH_ON (1<<0) - -#define S3C64XX_SPI_CLKSEL_SRCMSK (3<<9) -#define S3C64XX_SPI_CLKSEL_SRCSHFT 9 -#define S3C64XX_SPI_ENCLK_ENABLE (1<<8) -#define S3C64XX_SPI_PSR_MASK 0xff - -#define S3C64XX_SPI_MODE_CH_TSZ_BYTE (0<<29) -#define S3C64XX_SPI_MODE_CH_TSZ_HALFWORD (1<<29) -#define S3C64XX_SPI_MODE_CH_TSZ_WORD (2<<29) -#define S3C64XX_SPI_MODE_CH_TSZ_MASK (3<<29) -#define S3C64XX_SPI_MODE_BUS_TSZ_BYTE (0<<17) -#define S3C64XX_SPI_MODE_BUS_TSZ_HALFWORD (1<<17) -#define S3C64XX_SPI_MODE_BUS_TSZ_WORD (2<<17) -#define S3C64XX_SPI_MODE_BUS_TSZ_MASK (3<<17) +#define S3C64XX_SPI_CH_CFG 0x00 +#define S3C64XX_SPI_CLK_CFG 0x04 +#define S3C64XX_SPI_MODE_CFG 0x08 +#define S3C64XX_SPI_CS_REG 0x0C +#define S3C64XX_SPI_INT_EN 0x10 +#define S3C64XX_SPI_STATUS 0x14 +#define S3C64XX_SPI_TX_DATA 0x18 +#define S3C64XX_SPI_RX_DATA 0x1C +#define S3C64XX_SPI_PACKET_CNT 0x20 +#define S3C64XX_SPI_PENDING_CLR 0x24 +#define S3C64XX_SPI_SWAP_CFG 0x28 +#define S3C64XX_SPI_FB_CLK 0x2C + +#define S3C64XX_SPI_CH_HS_EN BIT(6) /* High Speed Enable */ +#define S3C64XX_SPI_CH_SW_RST BIT(5) +#define S3C64XX_SPI_CH_SLAVE BIT(4) +#define S3C64XX_SPI_CPOL_L BIT(3) +#define S3C64XX_SPI_CPHA_B BIT(2) +#define S3C64XX_SPI_CH_RXCH_ON BIT(1) +#define S3C64XX_SPI_CH_TXCH_ON BIT(0) + +#define S3C64XX_SPI_CLKSEL_SRCMSK GENMASK(10, 9) +#define S3C64XX_SPI_ENCLK_ENABLE BIT(8) +#define S3C64XX_SPI_PSR_MASK GENMASK(15, 0) + +#define S3C64XX_SPI_MODE_CH_TSZ_MASK GENMASK(30, 29) +#define S3C64XX_SPI_MODE_CH_TSZ_BYTE 0 +#define S3C64XX_SPI_MODE_CH_TSZ_HALFWORD 1 +#define S3C64XX_SPI_MODE_CH_TSZ_WORD 2 +#define S3C64XX_SPI_MAX_TRAILCNT_MASK GENMASK(28, 19) +#define S3C64XX_SPI_MODE_BUS_TSZ_MASK GENMASK(18, 17) +#define S3C64XX_SPI_MODE_BUS_TSZ_BYTE 0 +#define S3C64XX_SPI_MODE_BUS_TSZ_HALFWORD 1 +#define S3C64XX_SPI_MODE_BUS_TSZ_WORD 2 #define S3C64XX_SPI_MODE_RX_RDY_LVL GENMASK(16, 11) -#define S3C64XX_SPI_MODE_RX_RDY_LVL_SHIFT 11 -#define S3C64XX_SPI_MODE_SELF_LOOPBACK (1<<3) -#define S3C64XX_SPI_MODE_RXDMA_ON (1<<2) -#define S3C64XX_SPI_MODE_TXDMA_ON (1<<1) -#define S3C64XX_SPI_MODE_4BURST (1<<0) - -#define S3C64XX_SPI_CS_NSC_CNT_2 (2<<4) -#define S3C64XX_SPI_CS_AUTO (1<<1) -#define S3C64XX_SPI_CS_SIG_INACT (1<<0) - -#define S3C64XX_SPI_INT_TRAILING_EN (1<<6) -#define S3C64XX_SPI_INT_RX_OVERRUN_EN (1<<5) -#define S3C64XX_SPI_INT_RX_UNDERRUN_EN (1<<4) -#define S3C64XX_SPI_INT_TX_OVERRUN_EN (1<<3) -#define S3C64XX_SPI_INT_TX_UNDERRUN_EN (1<<2) -#define S3C64XX_SPI_INT_RX_FIFORDY_EN (1<<1) -#define S3C64XX_SPI_INT_TX_FIFORDY_EN (1<<0) - -#define S3C64XX_SPI_ST_RX_OVERRUN_ERR (1<<5) -#define S3C64XX_SPI_ST_RX_UNDERRUN_ERR (1<<4) -#define S3C64XX_SPI_ST_TX_OVERRUN_ERR (1<<3) -#define S3C64XX_SPI_ST_TX_UNDERRUN_ERR (1<<2) -#define S3C64XX_SPI_ST_RX_FIFORDY (1<<1) -#define S3C64XX_SPI_ST_TX_FIFORDY (1<<0) - -#define S3C64XX_SPI_PACKET_CNT_EN (1<<16) +#define S3C64XX_SPI_MODE_SELF_LOOPBACK BIT(3) +#define S3C64XX_SPI_MODE_RXDMA_ON BIT(2) +#define S3C64XX_SPI_MODE_TXDMA_ON BIT(1) +#define S3C64XX_SPI_MODE_4BURST BIT(0) + +#define S3C64XX_SPI_CS_NSC_CNT_MASK GENMASK(9, 4) +#define S3C64XX_SPI_CS_NSC_CNT_2 2 +#define S3C64XX_SPI_CS_AUTO BIT(1) +#define S3C64XX_SPI_CS_SIG_INACT BIT(0) + +#define S3C64XX_SPI_INT_TRAILING_EN BIT(6) +#define S3C64XX_SPI_INT_RX_OVERRUN_EN BIT(5) +#define S3C64XX_SPI_INT_RX_UNDERRUN_EN BIT(4) +#define S3C64XX_SPI_INT_TX_OVERRUN_EN BIT(3) +#define S3C64XX_SPI_INT_TX_UNDERRUN_EN BIT(2) +#define S3C64XX_SPI_INT_RX_FIFORDY_EN BIT(1) +#define S3C64XX_SPI_INT_TX_FIFORDY_EN BIT(0) + +#define S3C64XX_SPI_ST_RX_OVERRUN_ERR BIT(5) +#define S3C64XX_SPI_ST_RX_UNDERRUN_ERR BIT(4) +#define S3C64XX_SPI_ST_TX_OVERRUN_ERR BIT(3) +#define S3C64XX_SPI_ST_TX_UNDERRUN_ERR BIT(2) +#define S3C64XX_SPI_ST_RX_FIFORDY BIT(1) +#define S3C64XX_SPI_ST_TX_FIFORDY BIT(0) + +#define S3C64XX_SPI_PACKET_CNT_EN BIT(16) #define S3C64XX_SPI_PACKET_CNT_MASK GENMASK(15, 0) -#define S3C64XX_SPI_PND_TX_UNDERRUN_CLR (1<<4) -#define S3C64XX_SPI_PND_TX_OVERRUN_CLR (1<<3) -#define S3C64XX_SPI_PND_RX_UNDERRUN_CLR (1<<2) -#define S3C64XX_SPI_PND_RX_OVERRUN_CLR (1<<1) -#define S3C64XX_SPI_PND_TRAILING_CLR (1<<0) +#define S3C64XX_SPI_PND_TX_UNDERRUN_CLR BIT(4) +#define S3C64XX_SPI_PND_TX_OVERRUN_CLR BIT(3) +#define S3C64XX_SPI_PND_RX_UNDERRUN_CLR BIT(2) +#define S3C64XX_SPI_PND_RX_OVERRUN_CLR BIT(1) +#define S3C64XX_SPI_PND_TRAILING_CLR BIT(0) -#define S3C64XX_SPI_SWAP_RX_HALF_WORD (1<<7) -#define S3C64XX_SPI_SWAP_RX_BYTE (1<<6) -#define S3C64XX_SPI_SWAP_RX_BIT (1<<5) -#define S3C64XX_SPI_SWAP_RX_EN (1<<4) -#define S3C64XX_SPI_SWAP_TX_HALF_WORD (1<<3) -#define S3C64XX_SPI_SWAP_TX_BYTE (1<<2) -#define S3C64XX_SPI_SWAP_TX_BIT (1<<1) -#define S3C64XX_SPI_SWAP_TX_EN (1<<0) +#define S3C64XX_SPI_SWAP_RX_HALF_WORD BIT(7) +#define S3C64XX_SPI_SWAP_RX_BYTE BIT(6) +#define S3C64XX_SPI_SWAP_RX_BIT BIT(5) +#define S3C64XX_SPI_SWAP_RX_EN BIT(4) +#define S3C64XX_SPI_SWAP_TX_HALF_WORD BIT(3) +#define S3C64XX_SPI_SWAP_TX_BYTE BIT(2) +#define S3C64XX_SPI_SWAP_TX_BIT BIT(1) +#define S3C64XX_SPI_SWAP_TX_EN BIT(0) -#define S3C64XX_SPI_FBCLK_MSK (3<<0) +#define S3C64XX_SPI_FBCLK_MASK GENMASK(1, 0) #define FIFO_LVL_MASK(i) ((i)->port_conf->fifo_lvl_mask[i->port_id]) #define S3C64XX_SPI_ST_TX_DONE(v, i) (((v) & \ @@ -112,18 +113,13 @@ FIFO_LVL_MASK(i)) #define FIFO_DEPTH(i) ((FIFO_LVL_MASK(i) >> 1) + 1) -#define S3C64XX_SPI_MAX_TRAILCNT 0x3ff -#define S3C64XX_SPI_TRAILCNT_OFF 19 - -#define S3C64XX_SPI_TRAILCNT S3C64XX_SPI_MAX_TRAILCNT - #define S3C64XX_SPI_POLLING_SIZE 32 #define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t) #define is_polling(x) (x->cntrlr_info->polling) -#define RXBUSY (1<<2) -#define TXBUSY (1<<3) +#define RXBUSY BIT(2) +#define TXBUSY BIT(3) struct s3c64xx_spi_dma_data { struct dma_chan *ch; @@ -342,8 +338,9 @@ static void s3c64xx_spi_set_cs(struct spi_device *spi, bool enable) } else { u32 ssel = readl(sdd->regs + S3C64XX_SPI_CS_REG); - ssel |= (S3C64XX_SPI_CS_AUTO | - S3C64XX_SPI_CS_NSC_CNT_2); + ssel |= S3C64XX_SPI_CS_AUTO | + FIELD_PREP(S3C64XX_SPI_CS_NSC_CNT_MASK, + S3C64XX_SPI_CS_NSC_CNT_2); writel(ssel, sdd->regs + S3C64XX_SPI_CS_REG); } } else { @@ -666,16 +663,22 @@ static int s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd) switch (sdd->cur_bpw) { case 32: - val |= S3C64XX_SPI_MODE_BUS_TSZ_WORD; - val |= S3C64XX_SPI_MODE_CH_TSZ_WORD; + val |= FIELD_PREP(S3C64XX_SPI_MODE_BUS_TSZ_MASK, + S3C64XX_SPI_MODE_BUS_TSZ_WORD) | + FIELD_PREP(S3C64XX_SPI_MODE_CH_TSZ_MASK, + S3C64XX_SPI_MODE_CH_TSZ_WORD); break; case 16: - val |= S3C64XX_SPI_MODE_BUS_TSZ_HALFWORD; - val |= S3C64XX_SPI_MODE_CH_TSZ_HALFWORD; + val |= FIELD_PREP(S3C64XX_SPI_MODE_BUS_TSZ_MASK, + S3C64XX_SPI_MODE_BUS_TSZ_HALFWORD) | + FIELD_PREP(S3C64XX_SPI_MODE_CH_TSZ_MASK, + S3C64XX_SPI_MODE_CH_TSZ_HALFWORD); break; default: - val |= S3C64XX_SPI_MODE_BUS_TSZ_BYTE; - val |= S3C64XX_SPI_MODE_CH_TSZ_BYTE; + val |= FIELD_PREP(S3C64XX_SPI_MODE_BUS_TSZ_MASK, + S3C64XX_SPI_MODE_BUS_TSZ_BYTE) | + FIELD_PREP(S3C64XX_SPI_MODE_CH_TSZ_MASK, + S3C64XX_SPI_MODE_CH_TSZ_BYTE); break; } @@ -801,7 +804,7 @@ static int s3c64xx_spi_transfer_one(struct spi_controller *host, val = readl(sdd->regs + S3C64XX_SPI_MODE_CFG); val &= ~S3C64XX_SPI_MODE_RX_RDY_LVL; - val |= (rdy_lv << S3C64XX_SPI_MODE_RX_RDY_LVL_SHIFT); + val |= FIELD_PREP(S3C64XX_SPI_MODE_RX_RDY_LVL, rdy_lv); writel(val, sdd->regs + S3C64XX_SPI_MODE_CFG); /* Enable FIFO_RDY_EN IRQ */ @@ -1074,8 +1077,8 @@ static void s3c64xx_spi_hwinit(struct s3c64xx_spi_driver_data *sdd) writel(0, regs + S3C64XX_SPI_INT_EN); if (!sdd->port_conf->clk_from_cmu) - writel(sci->src_clk_nr << S3C64XX_SPI_CLKSEL_SRCSHFT, - regs + S3C64XX_SPI_CLK_CFG); + writel(FIELD_PREP(S3C64XX_SPI_CLKSEL_SRCMSK, sci->src_clk_nr), + regs + S3C64XX_SPI_CLK_CFG); writel(0, regs + S3C64XX_SPI_MODE_CFG); writel(0, regs + S3C64XX_SPI_PACKET_CNT); @@ -1091,8 +1094,7 @@ static void s3c64xx_spi_hwinit(struct s3c64xx_spi_driver_data *sdd) val = readl(regs + S3C64XX_SPI_MODE_CFG); val &= ~S3C64XX_SPI_MODE_4BURST; - val &= ~(S3C64XX_SPI_MAX_TRAILCNT << S3C64XX_SPI_TRAILCNT_OFF); - val |= (S3C64XX_SPI_TRAILCNT << S3C64XX_SPI_TRAILCNT_OFF); + val |= S3C64XX_SPI_MAX_TRAILCNT_MASK; writel(val, regs + S3C64XX_SPI_MODE_CFG); s3c64xx_flush_fifo(sdd); From patchwork Thu Jan 25 14:49: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: 13530992 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 23A52C47DDF for ; Thu, 25 Jan 2024 14:51:15 +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=ezyHASRz+CkzGJxwDrdUyVliAeu5ZzAvmgdfW8U3Ib4=; b=4RSCxBzNBU2/7A GeGExsFo05n0ldX3gFWfx2q+Tvb7fK/ZgFjqRfiBgpOIQ9AehLo43cSP6Jens6w8f3QifrB9S4KyG 9e9vsZG/BZvQuWWRf3d4xoWAgayUjvWaE7mo2ky/5Ipxl4AggI7YG8HiE6vRH+Tc28VSobUgEQaNo iwmvJEgv7kXPVeiOfQ0Ap9t6XI++Mp4heXP1ghsMIPi0kp7v2l0e1EA945E+T8vtyApvSadXo+tdc +n0oDdzSDbRa48dlhoMGCM2mbI0iux+IcXU2u7PV0UyV9I3cNQi8b3y/rBmFb2ao8Jnp/l3y/JRJK dUjs93FAWZCdhYSgv+JQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT14G-00000000SVR-3pSF; Thu, 25 Jan 2024 14:51:00 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13c-00000000Rxr-3oUd for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:22 +0000 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3392d417a9fso3131602f8f.1 for ; Thu, 25 Jan 2024 06:50:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194219; x=1706799019; 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=+YK4QrRGKXAEq9cj4wcWVcTQyistBUqZRkAhUjBW1qI=; b=zE/Vw7QhXSngshxBua3H63JZTVCv3k1sZABzpP3ddR7DuGH5C4HSDJYNGyZ3IiWHmX nJbPPPiINng1v4IZUXibZ0qW5dM055imEf9ZP5smC3ARZrjktiW+BCmN/WtC+CeCs09a wnGWaWwrlF523cGXl8+3P9Fe8p7tKhtzNe3BMHCsjQdfXUN7usdD7rQvZwuCNDCLgDLj xzb5yIn0gM2BU793Zt8JGiSeBhuSfKmJ7P3VFDPzo5jpSkhhCHvDlX38Rl11kF5FHwN8 pJ/4tA7VWQILX47Bt7XRIzPUlLMsCYdKlnNFG0sia1pDgXz7NJ1X7XbcENqi1THU4of0 utqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194219; x=1706799019; 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=+YK4QrRGKXAEq9cj4wcWVcTQyistBUqZRkAhUjBW1qI=; b=MFPYDbHi/MKHUcLXfOPrVNYX2SV/UT11luZkgZXlJFusWchlGjXFslwz+Hoot0Jr0U 7hD1w0sO3XSvWspIoYqt75cunz3ffMFhuh0Ax/6EriWx1dnFvHUfj3P96ruVWwB4cEga GMYQ2PqRuOyes2fSfGh3KKJYophbZy+IMDQIYR8j7J3FbE+4Tvt/uBgdRR9xgJ97vtgZ IJBq0nNjTOQdw/aCWz3bcTZQJZCkytVKdxsQWALPoNlHa5kOiKV8IXEAmmR/1gO9wOuF 0ZR13/9LYTQaO37ptbkHkj36m+PRR8pkTomOAGHb2dHm2omNNdhAm8dzpYcVE4273B9p jR0Q== X-Gm-Message-State: AOJu0YwP/qgNd9pcJ1/5o3B7AlO9bhvk0NLDHr9TWHphX2isIm9+1pzF Og3oSgJz4muotSPeFkVIEiBAJGItCZwh/dcCr9UXwNFxES4wfecs7Om0WBhm5h8= X-Google-Smtp-Source: AGHT+IHBMCy9GK8hqa3QrrWY639ZY25SNTX03FHAyLMwegK28Rkz0B8Db77Il1eM2GZxRB78phDFnA== X-Received: by 2002:a5d:4f90:0:b0:337:d932:4980 with SMTP id d16-20020a5d4f90000000b00337d9324980mr863025wru.143.1706194219101; Thu, 25 Jan 2024 06:50:19 -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.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:18 -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 10/28] spi: s3c64xx: use full mask for {RX, TX}_FIFO_LVL Date: Thu, 25 Jan 2024 14:49:48 +0000 Message-ID: <20240125145007.748295-11-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_065021_078666_0B390829 X-CRM114-Status: GOOD ( 16.37 ) 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 SPI_STATUSn.{RX, TX}_FIFO_LVL fields show the data level in the RX and TX FIFOs. The IP supports FIFOs from 8 to 256 bytes, but apart from the MODE_CFG.{RX, TX}_RDY_LVL fields that configure the {RX, TX} FIFO trigger level in the interrupt mode, there's nothing in the registers that configure the FIFOs depth. Is the responsibility of the SoC that integrates the IP to dictate the FIFO depth and of the SPI driver to make sure it doesn't bypass the FIFO length. {RX, TX}_FIFO_LVL was used to pass the FIFO length information based on the IP configuration in the SoC. Its value was defined so that it includes the entire FIFO length. For example, if one wanted to specify a 64 FIFO length (0x40), it wold configure the FIFO level to 127 (0x7f). This is not only wrong, because it doesn't respect the IP's register fields, it's also misleading. Use the full mask for the SPI_STATUSn.{RX, TX}_FIFO_LVL fields. No change in functionality is expected. Signed-off-by: Tudor Ambarus --- drivers/spi/spi-s3c64xx.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index d046810da51f..b048e81e6207 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -78,6 +78,8 @@ #define S3C64XX_SPI_INT_RX_FIFORDY_EN BIT(1) #define S3C64XX_SPI_INT_TX_FIFORDY_EN BIT(0) +#define S3C64XX_SPI_ST_RX_FIFO_LVL GENMASK(23, 15) +#define S3C64XX_SPI_ST_TX_FIFO_LVL GENMASK(14, 6) #define S3C64XX_SPI_ST_RX_OVERRUN_ERR BIT(5) #define S3C64XX_SPI_ST_RX_UNDERRUN_ERR BIT(4) #define S3C64XX_SPI_ST_TX_OVERRUN_ERR BIT(3) @@ -108,9 +110,6 @@ #define FIFO_LVL_MASK(i) ((i)->port_conf->fifo_lvl_mask[i->port_id]) #define S3C64XX_SPI_ST_TX_DONE(v, i) (((v) & \ (1 << (i)->port_conf->tx_st_done)) ? 1 : 0) -#define TX_FIFO_LVL(v, i) (((v) >> 6) & FIFO_LVL_MASK(i)) -#define RX_FIFO_LVL(v, i) (((v) >> (i)->port_conf->rx_lvl_offset) & \ - FIFO_LVL_MASK(i)) #define FIFO_DEPTH(i) ((FIFO_LVL_MASK(i) >> 1) + 1) #define S3C64XX_SPI_POLLING_SIZE 32 @@ -219,7 +218,7 @@ static void s3c64xx_flush_fifo(struct s3c64xx_spi_driver_data *sdd) loops = msecs_to_loops(1); do { val = readl(regs + S3C64XX_SPI_STATUS); - } while (TX_FIFO_LVL(val, sdd) && loops--); + } while (FIELD_GET(S3C64XX_SPI_ST_TX_FIFO_LVL, val) && loops--); if (loops == 0) dev_warn(&sdd->pdev->dev, "Timed out flushing TX FIFO\n"); @@ -228,7 +227,7 @@ static void s3c64xx_flush_fifo(struct s3c64xx_spi_driver_data *sdd) loops = msecs_to_loops(1); do { val = readl(regs + S3C64XX_SPI_STATUS); - if (RX_FIFO_LVL(val, sdd)) + if (FIELD_GET(S3C64XX_SPI_ST_RX_FIFO_LVL, val)) readl(regs + S3C64XX_SPI_RX_DATA); else break; @@ -499,10 +498,11 @@ static u32 s3c64xx_spi_wait_for_timeout(struct s3c64xx_spi_driver_data *sdd, do { status = readl(regs + S3C64XX_SPI_STATUS); - } while (RX_FIFO_LVL(status, sdd) < max_fifo && --val); + } while (FIELD_GET(S3C64XX_SPI_ST_RX_FIFO_LVL, status) < max_fifo && + --val); /* return the actual received data length */ - return RX_FIFO_LVL(status, sdd); + return FIELD_GET(S3C64XX_SPI_ST_RX_FIFO_LVL, status); } static int s3c64xx_wait_for_dma(struct s3c64xx_spi_driver_data *sdd, @@ -533,7 +533,7 @@ static int s3c64xx_wait_for_dma(struct s3c64xx_spi_driver_data *sdd, if (val && !xfer->rx_buf) { val = msecs_to_loops(10); status = readl(regs + S3C64XX_SPI_STATUS); - while ((TX_FIFO_LVL(status, sdd) + while ((FIELD_GET(S3C64XX_SPI_ST_TX_FIFO_LVL, status) || !S3C64XX_SPI_ST_TX_DONE(status, sdd)) && --val) { cpu_relax(); @@ -568,7 +568,7 @@ static int s3c64xx_wait_for_pio(struct s3c64xx_spi_driver_data *sdd, /* sleep during signal transfer time */ status = readl(regs + S3C64XX_SPI_STATUS); - if (RX_FIFO_LVL(status, sdd) < xfer->len) + if (FIELD_GET(S3C64XX_SPI_ST_RX_FIFO_LVL, status) < xfer->len) usleep_range(time_us / 2, time_us); if (use_irq) { @@ -580,7 +580,8 @@ static int s3c64xx_wait_for_pio(struct s3c64xx_spi_driver_data *sdd, val = msecs_to_loops(ms); do { status = readl(regs + S3C64XX_SPI_STATUS); - } while (RX_FIFO_LVL(status, sdd) < xfer->len && --val); + } while (FIELD_GET(S3C64XX_SPI_ST_RX_FIFO_LVL, status) < xfer->len && + --val); if (!val) return -EIO; From patchwork Thu Jan 25 14:49:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13530993 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 244ACC47258 for ; Thu, 25 Jan 2024 14:51:17 +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=uTdQifmzgyvZzu99jhsVqVJwz1ITAH5i9Aruv93YHp8=; b=KoiwFU/tUWT3ZP pr2zXsQhD1VDaoCZZPzK9AbFogw/RULNP9SAwI0tDHyxFDyExvbK1vvdbORMxy7e+nHgQfRuOvSVi pTi+EKb9OLDVpU/ecIJbzfJqNA9Qh45T8Pw6ja2jKXxpZd3O/hUKSP4Hbs5VzaC6QFPi95b9dom6k b8f3KzWsEWlzyffAu9w0RDeCtrbGEEY5mu2yH6es2041yA5JCKTaKhizEF6+Feb8GO9n/1txE1wuT 3mQ6Zy9dxdsIEoGMx5efsYEmcdAJcKHGLK02yli37du+GmE/H8zVSsMfAdSZi45WZEN7sqjllXrny iN0ALmod6gcYLksJPQNw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT14K-00000000SYc-3vXq; Thu, 25 Jan 2024 14:51:04 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13d-00000000Ryc-2fDi for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:23 +0000 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40eacb6067dso54901685e9.1 for ; Thu, 25 Jan 2024 06:50:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194220; x=1706799020; 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=hyD58l2q8nhDuUGflXpNsuJj2JpRaUrHNBwM4NRI1zM=; b=JflAtwkU64VkQWyUl6LU68BFD90Wu2HtHLPQFMY7bG1fa1i/hM+qRP1Zt8IR0obQy+ X97tIVsJiem83xXCHKr7rO40mnF7KvZky3mlF597ptsu/Mm+6KLmJ8lPA9p0lck2yxX1 MVo2gbWUorcuELMAXBAWdvnOZE5Ph0SnQ9XNAgT0BMZ01/whFN/ue0XMdQD2J/xjJDey ev4pjxYu+RHYsmjiuRhMo83/eqWR+4AEJCE2bDAVf/V0d16CUh8YrnDNmE8ff+M2OKEL PRepGqxKoUKv2SlYMUP02AQBrN882xFReA1knxZf63707jlLnpgvNV5JV9npkUbzR2wq ZPtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194220; x=1706799020; 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=hyD58l2q8nhDuUGflXpNsuJj2JpRaUrHNBwM4NRI1zM=; b=WeXLrFTsWNS6BCfy4PQRNtSApstoYriXNcS9sxfUrcZRCydiu/pqHxTFYQYRexQFJh 60nBCpxbgepsYr1NbJQnQGb+2lemawhPM9w2cc3AIwDJdLszpYHxGwJdtLmfRehtxdoP rY6D5D1EbjXxUBZi6C/1oDiEb0GhOSgn9wQlPlayKQHlF6F4h0PSZy8yGlQtm2/9yK9M HBi3616TvhmY6PBf8qj7kA+g3o+94xDvkffC3/rnP8JuYWO4BvYmw2l1F07//yZRq2wH NnvNTzYqTQKy5p9mCuaRTkkcbI4aCsuKAf/LxaY5z1DtBvXqg2Rn8lVREomGlgkCdUUm Yz0Q== X-Gm-Message-State: AOJu0Yx+BZtocmGkZZIDKxgQXr0nC8kS/reybgdSOmdchvJbMGCxrpRi VQ7ghfeZQjkHx/qC/v20sdh5t1SiHwGEimhQjgOsXjZ71g7ZvEP3orvX65LK9BY= X-Google-Smtp-Source: AGHT+IFZ3UUBgZszn/1wxPMDahDYbmeO132hJ61mryKHgvR3GcuAuY7RIRfAUkP4M4TdvC1n34cQtw== X-Received: by 2002:a05:600c:2a4a:b0:40e:46d5:144f with SMTP id x10-20020a05600c2a4a00b0040e46d5144fmr290304wme.373.1706194220403; Thu, 25 Jan 2024 06:50:20 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:19 -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 11/28] spi: s3c64xx: move common code outside if else Date: Thu, 25 Jan 2024 14:49:49 +0000 Message-ID: <20240125145007.748295-12-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_065021_833066_681B07F0 X-CRM114-Status: GOOD ( 10.42 ) 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 Move common code outside if else to avoid code duplication. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/spi/spi-s3c64xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index b048e81e6207..107b4200ab00 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -286,20 +286,18 @@ static int prepare_dma(struct s3c64xx_spi_dma_data *dma, if (dma->direction == DMA_DEV_TO_MEM) { sdd = container_of((void *)dma, struct s3c64xx_spi_driver_data, rx_dma); - config.direction = dma->direction; config.src_addr = sdd->sfr_start + S3C64XX_SPI_RX_DATA; config.src_addr_width = sdd->cur_bpw / 8; config.src_maxburst = 1; - dmaengine_slave_config(dma->ch, &config); } else { sdd = container_of((void *)dma, struct s3c64xx_spi_driver_data, tx_dma); - config.direction = dma->direction; config.dst_addr = sdd->sfr_start + S3C64XX_SPI_TX_DATA; config.dst_addr_width = sdd->cur_bpw / 8; config.dst_maxburst = 1; - dmaengine_slave_config(dma->ch, &config); } + config.direction = dma->direction; + dmaengine_slave_config(dma->ch, &config); desc = dmaengine_prep_slave_sg(dma->ch, sgt->sgl, sgt->nents, dma->direction, DMA_PREP_INTERRUPT); From patchwork Thu Jan 25 14:49:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13530994 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 B05EFC47258 for ; Thu, 25 Jan 2024 14:51:22 +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=KSYyv1aTp1GJjh21b3tA3sWVyy8lP54ODa3yBYoc/PE=; b=VHgh0MCv/JUAsr M/yr3iQ/7my6aNP7s8o/QFfIWjnG4LNmSptcsMjQqJjcYWb4BCOnV8LMVmz4sotv9GEAi1P4pHfJa nll3TpRnM4vRZzVfTBhfjAHuRIVPvaUtjnGEaL2HR8u1dRx7X0QR+F0EH5NCXIWaIncnmyhVRyrOC 7nUXM8r0U5+/gTfdEHVpg3AHNQNjC6TBJ5HyDG+UPdMjMn0tFvw6APRyJfmT3ksnvBtbDPob7MrX1 KShQyFq0xMSMH2o8KVj4ApJGH4l0GY9H+TzdyxiqedSMRFmUzn06tYhwhRvR+NUkxbD2bAg46H2kB VqIx5my+U9j1dwPPnf3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT14O-00000000SbJ-1SKx; Thu, 25 Jan 2024 14:51:08 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13e-00000000RzL-2Itb for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:23 +0000 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40e7065b7bdso79948595e9.3 for ; Thu, 25 Jan 2024 06:50:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194221; x=1706799021; 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=qMGH3dLP6JGckYmf845pnVvdK2xfKfvG+tA1Jxqwbjo=; b=xNHjoUZlOVPbS83QwdbcxTs1dO04r26Elqx15MBDT0VWGG5P6GnlcgpmYpqiVFTXcg iygFmVLoAdC+Xwj+BGII+P/QYgqYv6e471msiT8cevsCmOQbbL+XyfBp4FUvGDOOvk9U bBFylGjQjUSSD/MwEHJ9FPAaAIHJKDCUhxOLlzQXXq8/xe5npkKiM9+ssP9c0nX7+LoW N0nsE1edZYGRnQBBDbVk52JxnV10d+nUABk017yVwD7bnjK3NazwXqi1fg5yXoN2BXQe t171wuyFMhrR0l2p2mwUhX+xo996yiygm+obhfRaMc7Fb5up3g1XU1YkQEEihnVJR1Jv rAEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194221; x=1706799021; 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=qMGH3dLP6JGckYmf845pnVvdK2xfKfvG+tA1Jxqwbjo=; b=QMGaDm2DRTigp2DcCMuDa8yAs7yUgMHJztVInmkniFUyiVLJ2ykW0BA2kgTfh95M5M uz9yybmA3XzCT/w1UP9kBs8V2UK4y6Ikyq1+zUGgZhP0vu+5MymXT2WVvHvb/C8R0dHz LxH11ffdk6QzQLPJkGF/JzwZcx1SYuzzt/KRLLPKI+u71qtb6WYsXYKuwHEPro9OA5YR HjXl3EFaxJ7shZrK9xyR6wl335FhgXzsoE35O0PKWpWRiIknarylyKCh36QGoLAaSdGF IEDQzGXCqLuwlirV537L1JQGSWvoDJCd8i050+1rRsJjKeL1mMHCiH5VE7u+7ZAy2K7w eVWw== X-Gm-Message-State: AOJu0Yx1EbYOarNczRHLyDbXhA/iOIu1CtrJnlpx828A2YgHB1ubsAF4 h+46SW+Y/vczE9NZJZS+OIq3TB+IY/dwKTKiaak3HliHrC2UhjJGelsyGu5xUoE= X-Google-Smtp-Source: AGHT+IGeP8EArDMSlTRrMTUaMcVjtEt1A1bBBuSDoS/dgt/tngq2Oix/mynKSP5H+4fbXQ/xcWQZog== X-Received: by 2002:a05:600c:2b0d:b0:40e:8f3e:73dc with SMTP id y13-20020a05600c2b0d00b0040e8f3e73dcmr408271wme.105.1706194221342; Thu, 25 Jan 2024 06:50:21 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:20 -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 12/28] spi: s3c64xx: check return code of dmaengine_slave_config() Date: Thu, 25 Jan 2024 14:49:50 +0000 Message-ID: <20240125145007.748295-13-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_065022_639216_14BA1B85 X-CRM114-Status: GOOD ( 11.67 ) 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 Check the return code of dmaengine_slave_config(). Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- 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 107b4200ab00..48b87c5e2dd2 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -297,7 +297,9 @@ static int prepare_dma(struct s3c64xx_spi_dma_data *dma, config.dst_maxburst = 1; } config.direction = dma->direction; - dmaengine_slave_config(dma->ch, &config); + ret = dmaengine_slave_config(dma->ch, &config); + if (ret) + return ret; desc = dmaengine_prep_slave_sg(dma->ch, sgt->sgl, sgt->nents, dma->direction, DMA_PREP_INTERRUPT); From patchwork Thu Jan 25 14:49:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13530995 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 CDD94C47258 for ; Thu, 25 Jan 2024 14:51:25 +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=cyGQgYPWNTNrEeBYd22c2/8fs7pzIePZMooYxHT0cxc=; b=kDajdB63jc0FxL EKd1/LZ3S9Ct8Mk9F6M3gihjvXG2SVvgcw1N+Ki8critBJuyaGXV5+V8QG77xP20F66B6OL1pErrU 9Lz00yWPYE83+k75E7iPeFVbcf6+wgMwuzDrXRIg0qwUuqbfx0ndCUpXWI1ifqd97N+sYK1ws5+Ky w6HHBdYiAEMH+0bLc6gyFZXgIhEriMqZzsgrdbSzBqQl6e0Xistoz5lJyeqb4g5ho/Ms4DxOxK4aV CRemOYM7Qx56AUIALP6LtACqyVwgIuDwilmpIn9KMuBpotN/5Clpl2wvw68/rgJlZi+xZhRLAbreL o69g05H9KFDzC+VbbYVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT14S-00000000See-1Xxx; Thu, 25 Jan 2024 14:51:12 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13f-00000000S0G-2Dl4 for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:24 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40e5afc18f5so73332205e9.3 for ; Thu, 25 Jan 2024 06:50:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194222; x=1706799022; 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=Uo5/6sMsEJXgYbE8BbPRJoYau3RC+fqPHaLcagZG9d0=; b=uvDxHA83peWGogxLRkXRxPgoseZjEf1xZLadWWFXHGaE2DLTh2uEEE/neeqV6yki/6 AoKzjg8PG/tUqAeAEgA5rw31jueIWxHHvwGr8ELtSln85KKlq4SZAbLRXB0SDBOdg2b0 Hlaen5qvoUXqd/BX4vcaJvH9NtTPMLlXsOZuPpS1302VTor/0J0i4mefxbzWKEdXjHpr xnGBeIUh2Ec8mfjG1Ylpn9PTiOuncNsX+dyfzK/8liCvW0WXQU06HulUz+lAdrRpoALt 4DQllhL5J55mf7dEFcKxSlCxh186oIOUIAj0jLLU3mfyiDnBwiw5qd+xuEN1PWHBm4h+ Ro6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194222; x=1706799022; 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=Uo5/6sMsEJXgYbE8BbPRJoYau3RC+fqPHaLcagZG9d0=; b=v47GNWcwQPx+W4EMzP8mw8Xh2tZkQnPUDg7ETTukEvWWXeeA4QXjT+KRcCog+Uot/x QMdAA5PYTBAxfXGT6dDicrEIhvCPx7cE0ghLbYVbVPQYq7iGbc/CYH50/J3OUJOr+kFR 0FsFVJGpIaxF9qjw/nV1LYZo/uW6iQOZQvmjZ/uhMNVAWZeAs9LKNeOUxSwaWb20Hk7P aV0AsEcYetoGmoH6StJ3jIqYKx1J+6RQaAsemmiY50gAKwjaBG0m1qPAWsrmJeMCvh72 9W60MIl7TjJjmlAUk1mqtzzfirK2tp0G2UqbZV0XRL97ZSwEDYB3M4ohOJKuv7UQtFF2 S8Og== X-Gm-Message-State: AOJu0Yx/gfRsM1BKLI2g2ryB2yS6E8m+Fb33ed5hbXm4YcO1LuhblLbx /BoYgSpVOYCJMAlgKHtOTWiO64cLZAoh4PQt9AVJus3EJm5t09iHJ7Mmo7Y7HDM= X-Google-Smtp-Source: AGHT+IHsYPm1PY8Cgk3AI9vhaP569ziBX3qB1QLXw/TjefWa12gW37HqQ58L1YMoxQHBrVjXHblYBg== X-Received: by 2002:a05:600c:511a:b0:40d:8914:cee3 with SMTP id o26-20020a05600c511a00b0040d8914cee3mr611949wms.108.1706194222303; Thu, 25 Jan 2024 06:50:22 -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.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:21 -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 13/28] spi: s3c64xx: propagate the dma_submit_error() error code Date: Thu, 25 Jan 2024 14:49:51 +0000 Message-ID: <20240125145007.748295-14-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_065023_596145_557D3637 X-CRM114-Status: GOOD ( 11.52 ) 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 Propagate the dma_submit_error() error code, don't overwrite it. Signed-off-by: Tudor Ambarus --- drivers/spi/spi-s3c64xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 48b87c5e2dd2..25d642f99278 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -316,7 +316,7 @@ static int prepare_dma(struct s3c64xx_spi_dma_data *dma, ret = dma_submit_error(dma->cookie); if (ret) { dev_err(&sdd->pdev->dev, "DMA submission failed"); - return -EIO; + return ret; } dma_async_issue_pending(dma->ch); From patchwork Thu Jan 25 14:49:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13530996 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 BD29DC47DDF for ; Thu, 25 Jan 2024 14:51:32 +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=soQd/98rq/jRFv24a25Z/53mQr9rdZtaB1bjLPhX/y8=; b=aHbo3/fo7tT5Bj gSaXHzjIva/d4pR67b2HAYzg51QZue9ywx/HJBQF6BRD9hv4QHX70ILXp54cPEJRtttYxgjcKmEmR bFSNksgRARLnDlPaYUgicXvAjhVjfGz4c8gmktVRVeWNn3Dvz1U5Ku+Eut+L018mpT18JTuWlM/Or 5k7LjiO53mZ0UkVQ+ksy2uXyyXCnI2988KEiKKGe+jEGenHnRxYXudnKCk+VgsT2ewK41/xDiJccX tgVXlyaALvJiWW7+AXO/gKfynYdV4I2JB8iUHEc9490fiHYcYs5BaHWTN0KIgYg/mqtLiW18VOhJh zyAmwGnNWxjcA4eY4TxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT14W-00000000SiU-2Fd3; Thu, 25 Jan 2024 14:51:16 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13g-00000000S0c-3Gzs for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:26 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40e76109cdeso75720795e9.0 for ; Thu, 25 Jan 2024 06:50:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194223; x=1706799023; 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=GwSZ9ii64mt7cJNVg0lI8ru0eSDBGUd0YlY2mDEiodU=; b=peR8lBR+upvjUmvC/MhkQazZkVgbyXtM6ImySVfiuCO/gCvgSEcUgcYxk/wuUgeFsz cRbiSqvQAgwWS6tz3CFPa90W0atgOcMWJgj5qUI1i5JoBcv9f0QUXHaqqqkH0vd7E5ol pH45Mcht6XxKq7gDWyYxIdOgDNM1/mNYGZidXaK+g4wAlgxSSUkM/DiFf4+iIscSA9ou q2kRdzDtbjEDRONlm3mTrnZ43Bw1al2cM10xvPCxo9jGr6RlSl79B9deJ891WqQPO67H jOJzgHrsEFZOsi+wEO4JprBc3YnqdZHMQOD92cDvDYD3IEiiJpK30lBCsCdVq8Kxa6az uLcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194223; x=1706799023; 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=GwSZ9ii64mt7cJNVg0lI8ru0eSDBGUd0YlY2mDEiodU=; b=lzco+NUhaHCmk55yhNaEoN9fBxS8m3XMTq/gDgDQAiy4yhzLXZpoxZod/YkQGzPBYV FWYwgIwOYJPrz1ba/iDs+nyCgLzl2Hoy2FantTdcroQJtcd1Dp2zFCDWgIm/87EVO2AQ kjMfVLzDSIrB+krpYLD7OPJc+Aj3wjoxSnuZ0oaQILcr71t0yxZdbq/0NeIRfDdrgyFo SWksbcAFJiw6+Mgep2sdDmlRvyJ8Hyq8zhG7HT2HWAmyrjnmV4QiK5dYqMv+LZTKhbm+ /+NHuMa2tdO408rZmpwgLA/1r0bz1omIp9HDVfuU4OA95z0h+FB46nul0oSB5+J2VVwt 6QhQ== X-Gm-Message-State: AOJu0YxWsMSvozvOK2dqLseGR0IA3dNkLh9+5iiVIHbRzjQxAU3/jHyd uzeaYAqOM/m7DPpET9/1w3iGtq/QcZBM67/bBk6Z2bH6bOba7S59nC60eUfEykE= X-Google-Smtp-Source: AGHT+IHU3uE9VctkwSLc7sy1ouZi/e0ls1mgPCFV1inwCVVGb/ieTXa3QkXnQoUQMDecFLIT7pf3+w== X-Received: by 2002:a05:600c:458b:b0:40e:af93:54f1 with SMTP id r11-20020a05600c458b00b0040eaf9354f1mr697668wmo.5.1706194223137; Thu, 25 Jan 2024 06:50:23 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:22 -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 14/28] spi: s3c64xx: rename prepare_dma() to s3c64xx_prepare_dma() Date: Thu, 25 Jan 2024 14:49:52 +0000 Message-ID: <20240125145007.748295-15-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_065024_882686_F08AA386 X-CRM114-Status: GOOD ( 11.96 ) 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 Don't monopolize the name. Prepend the driver prefix to the function name. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/spi/spi-s3c64xx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 25d642f99278..447320788697 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -273,8 +273,8 @@ static void s3c64xx_spi_dmacb(void *data) spin_unlock_irqrestore(&sdd->lock, flags); } -static int prepare_dma(struct s3c64xx_spi_dma_data *dma, - struct sg_table *sgt) +static int s3c64xx_prepare_dma(struct s3c64xx_spi_dma_data *dma, + struct sg_table *sgt) { struct s3c64xx_spi_driver_data *sdd; struct dma_slave_config config; @@ -440,7 +440,7 @@ static int s3c64xx_enable_datapath(struct s3c64xx_spi_driver_data *sdd, chcfg |= S3C64XX_SPI_CH_TXCH_ON; if (dma_mode) { modecfg |= S3C64XX_SPI_MODE_TXDMA_ON; - ret = prepare_dma(&sdd->tx_dma, &xfer->tx_sg); + ret = s3c64xx_prepare_dma(&sdd->tx_dma, &xfer->tx_sg); } else { switch (sdd->cur_bpw) { case 32: @@ -472,7 +472,7 @@ static int s3c64xx_enable_datapath(struct s3c64xx_spi_driver_data *sdd, writel(((xfer->len * 8 / sdd->cur_bpw) & 0xffff) | S3C64XX_SPI_PACKET_CNT_EN, regs + S3C64XX_SPI_PACKET_CNT); - ret = prepare_dma(&sdd->rx_dma, &xfer->rx_sg); + ret = s3c64xx_prepare_dma(&sdd->rx_dma, &xfer->rx_sg); } } From patchwork Thu Jan 25 14:49:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13531215 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 67F5CC47258 for ; Thu, 25 Jan 2024 16:04:56 +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=bBHhcLMI2viuI428NMk9WH0oxTTJ3jIfKGdrSzLg9M8=; b=3fy/QOTEC9Y7YH OvQtV09Tc32rzP6cgFILd1PGyuzG9mTXSvsod0eFspXnwB1gFHzruwhU9Ki2iN63VHbb7ZH7Bea9E 6oL3xiSu81gWzDs5a0BQZQOt0cMxN2xtRdV6M6MvJ6vyiXsl7M6NPyfZCVBvyIa+80NwPQtO3zrDG OKLJR7fytam++NUI8EqXygKDYf1ZXPG/MiYI09oZEgVeSzYWDuJpojsF2JZYM+5N13Ff3U9knCrTw gRl7xmy7MO22xYFuolC5DaJvny48da6XtCw5vqiAbLpMh3FKlXEdM3tquVNBWAF+JrWB5XCmQgAqp 7ZnaozXPl5Fy5B8G5H4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT2Dd-00000000isP-3DYl; Thu, 25 Jan 2024 16:04:45 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13h-00000000S1O-1dtn for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:26 +0000 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40ed252edd7so6243405e9.0 for ; Thu, 25 Jan 2024 06:50:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194224; x=1706799024; 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=+YODKSwwosS+Boh3Md8IudPiFt2ZVlyI0co3V0SoeDA=; b=a5I8SkiBBEcmt86t+P3wfUIGH+iYO5/G8NPqvjW20NvTEwdzgr7prLEO4fOfcKqQ82 CO+Jyp7GbTDcHY3iRUADXVKARdXrPvH3HKSz/W3U9/lENV3YHiflaP0Qer8YSWNdlqc0 FXgV7tjMsNYTAwgJPE1OkpjFXYB04E38s32VwBX1zXJUyX1CjxVMsmYcmrygaYLh9BqC dNJ3UbGdds++q7y3aQgjKz7kets1/bFSCg9SqbahSS6CiYocD4cWD5vjhMKltEcdu3xh T8LGn/JmeH4l3jki4mHLAPCvJkuqlHA/okjIdvjOC8alZsXnKCuEDSkm4+FYl7S5birW aeZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194224; x=1706799024; 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=+YODKSwwosS+Boh3Md8IudPiFt2ZVlyI0co3V0SoeDA=; b=c+z1jnnuJP6N4t9RSQWKKsjxuX0+5PlEJsC4UjCZMGhMqagB1NgnKIGLbzmuFAYG1V K7DBn50uD1YHmy2PhYWMVZ1mu7s84+uRVM1CxeOnQIGkuzdQ9U3VqAkgj6br9kRH8E9c Rf9G/8vcOmWp+YAbO3W3jT7Nx6OGXy81QGFan5rdxYDEigdxqPYpTqz+KPTwRPUAYGfU nmxlB3TaWeaNRlH1sNFPfnn1QFH6ZktF+IzppsWEVrf+nlO5RlOg5DyCJwxAuTg1k9NI Oe6BHOch1iRsrkClpuQAhjuQ7jUxVaBPf1+71EcfgjlF2g+eRFJFzhgG6RVl/dHmjjjc shkA== X-Gm-Message-State: AOJu0Yz1SCPUXV4/CEW4plpdUOWEH1jDwEFD+W2fuEl3tvdQbIXpKCn8 qC1S1P8hPJgTj36D/yRCC6aGBS/oX/DC844WW928FCUEJv6QdM30FviJR67cO3U= X-Google-Smtp-Source: AGHT+IHQibS5o6WlTuiDCwT7ZjkLtBnPKNQkGAG1I79CB9wOZ7GILO1eVGmHw8GQaGabYq+jMXwkKQ== X-Received: by 2002:a05:600c:6b03:b0:40e:6f03:45b5 with SMTP id jn3-20020a05600c6b0300b0040e6f0345b5mr390308wmb.261.1706194224044; Thu, 25 Jan 2024 06:50:24 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:23 -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 15/28] spi: s3c64xx: return ETIMEDOUT for wait_for_completion_timeout() Date: Thu, 25 Jan 2024 14:49:53 +0000 Message-ID: <20240125145007.748295-16-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_065025_459073_C99AA36A X-CRM114-Status: GOOD ( 11.97 ) 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 ETIMEDOUT is more specific than EIO, use it for wait_for_completion_timeout(). Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/spi/spi-s3c64xx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 447320788697..d2dd28ff00c6 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -523,7 +523,7 @@ static int s3c64xx_wait_for_dma(struct s3c64xx_spi_driver_data *sdd, /* * If the previous xfer was completed within timeout, then - * proceed further else return -EIO. + * proceed further else return -ETIMEDOUT. * DmaTx returns after simply writing data in the FIFO, * w/o waiting for real transmission on the bus to finish. * DmaRx returns only after Dma read data from FIFO which @@ -544,7 +544,7 @@ static int s3c64xx_wait_for_dma(struct s3c64xx_spi_driver_data *sdd, /* If timed out while checking rx/tx status return error */ if (!val) - return -EIO; + return -ETIMEDOUT; return 0; } @@ -574,7 +574,7 @@ static int s3c64xx_wait_for_pio(struct s3c64xx_spi_driver_data *sdd, if (use_irq) { val = msecs_to_jiffies(ms); if (!wait_for_completion_timeout(&sdd->xfer_completion, val)) - return -EIO; + return -ETIMEDOUT; } val = msecs_to_loops(ms); From patchwork Thu Jan 25 14:49:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13531216 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 D23D4C48260 for ; Thu, 25 Jan 2024 16:04:56 +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=DO+K3+D46RA68m5CtePCfbBS5oz4Uj+0H4c6pAbUGjs=; b=gcvcgYmr7HteVD 294Qh/RQxokpsWi0cdqJUZWD7ndeT4kcRKkDgOYGF7bob4/Y3YD3lpHoAhoSko1W5LULqwpG/FW2d /Wvy3nj/ShPmeaDmiDGJHn0ADgppmIZ9RxUK8KcF3oTbVz7N1Ipq2njpxSTBzh1NoUREP77gfXIYT hrp3EQeM73JtkBU6zb0XP4xSnS0/Ei/r98v5RrK9LMoDDSEjFZcqiV1i7JiKotodI0lXCzU/GNGDT PCCkQ8fGSv11sClHZnUDMCjQ8i9nVDrXrzrGELNSjRC/Zkh4Na35eMTGR9RER1UkJE1sx54F5+20+ HA0RszDWgR2XGJy2pprw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT2De-00000000ish-1XvG; Thu, 25 Jan 2024 16:04:46 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13h-00000000S1m-3Z9G for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:27 +0000 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40e80046246so5180955e9.1 for ; Thu, 25 Jan 2024 06:50:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194224; x=1706799024; 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=ZysQ9KAcWXka70FvugQOSV9RayYcqOy7xI0fMhicphA=; b=bn5tm99FVMSJlE2LZAyMM26ij2cBikj1UKUgYl3LoLQbNXRhP2cjsgtxlqBrBEea2H +NP72VCKAXseBkThKD3p1DfYK7MPXkEMY532nVfQcWbjlb+VMi2sxWF3iFofSAfmZezi AnkYskc0+lGc+nqOiixiG86ysX2/CNLVKftgO163aXf4hp9XNpu38w2Abv7CBBcTwIDZ lXQyFbH3wMHIMd2fmQZZy6139zjJbSzJ1k97et/6+59SF9IyPtWJHzflEh9jUl05qrZ9 k1nMZvp8ZUPJWasb350j6vxAuk5GL/qBR5gyidpyXwWndy3QznlP/tsBSqEU0RMn2q0x X5Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194224; x=1706799024; 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=ZysQ9KAcWXka70FvugQOSV9RayYcqOy7xI0fMhicphA=; b=MdvIwMzudUZOemBzGmYwCckDjmXu9qtM8Wp63raYOIlDmGst4M4pHao4vqlN532kkZ fs0FFrnIdgPPMRdz6pnbGNSfRYK/e2sgjnTjp0TcsNhe9Xt02yRuthQvaPFk16BJ5pzC hUhQ1/chChcfB0+aW6qK0vVidNSPHTCwKy+/fpzlr4xLXETPFLpgu5hbHdDn2zTwh8Zx BhqKTce4HeRd02OeFPGoMCn3yCbO7121nePNJh/w5DVLzK5lHF+aIPQsHTocjd3DW7UK fMFhRf1XiHVKUFlR24VT8b5Y1ikhj8ijiIMTp2tbeQ4XgTljH1NIl9lEwc6L6x4IUTRQ lvFw== X-Gm-Message-State: AOJu0YxzLi+KPd+cdu2AegntHUpOsnaev6bHoDFLXkMw87EvsIaMAxbo RxWyR9v0Mhv1u3O3otaiUhPO5B99JyzXrg1Q0P6OVT2cgbBtpg6cIYNmippYc/g= X-Google-Smtp-Source: AGHT+IHA47uO5eGUVzRw3oWrfTT7jpzLSV0hy5JLYr5qdHeliYMcttvj7NVUZtCY33YjGqMtwHdT1Q== X-Received: by 2002:a05:600c:3003:b0:40e:474f:94d8 with SMTP id j3-20020a05600c300300b0040e474f94d8mr577969wmh.177.1706194224662; Thu, 25 Jan 2024 06:50:24 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:24 -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 16/28] spi: s3c64xx: simplify s3c64xx_wait_for_pio() Date: Thu, 25 Jan 2024 14:49:54 +0000 Message-ID: <20240125145007.748295-17-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_065025_943216_E9B73C1F X-CRM114-Status: GOOD ( 16.22 ) 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 s3c64xx_spi_transfer_one() makes sure that for PIO the xfer->len is always smaller than the fifo size. Since we can't receive more that the FIFO size, droop the loop handling, the code becomes less misleading. Signed-off-by: Tudor Ambarus --- drivers/spi/spi-s3c64xx.c | 75 +++++++++------------------------------ 1 file changed, 17 insertions(+), 58 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index d2dd28ff00c6..00a0878aeb80 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -485,26 +485,6 @@ static int s3c64xx_enable_datapath(struct s3c64xx_spi_driver_data *sdd, return 0; } -static u32 s3c64xx_spi_wait_for_timeout(struct s3c64xx_spi_driver_data *sdd, - int timeout_ms) -{ - void __iomem *regs = sdd->regs; - unsigned long val = 1; - u32 status; - u32 max_fifo = FIFO_DEPTH(sdd); - - if (timeout_ms) - val = msecs_to_loops(timeout_ms); - - do { - status = readl(regs + S3C64XX_SPI_STATUS); - } while (FIELD_GET(S3C64XX_SPI_ST_RX_FIFO_LVL, status) < max_fifo && - --val); - - /* return the actual received data length */ - return FIELD_GET(S3C64XX_SPI_ST_RX_FIFO_LVL, status); -} - static int s3c64xx_wait_for_dma(struct s3c64xx_spi_driver_data *sdd, struct spi_transfer *xfer) { @@ -553,13 +533,11 @@ static int s3c64xx_wait_for_pio(struct s3c64xx_spi_driver_data *sdd, struct spi_transfer *xfer, bool use_irq) { void __iomem *regs = sdd->regs; + u8 *buf = xfer->rx_buf; + unsigned long time_us; unsigned long val; - u32 status; - int loops; - u32 cpy_len; - u8 *buf; + u32 status, len; int ms; - unsigned long time_us; /* microsecs to xfer 'len' bytes @ 'cur_speed' */ time_us = (xfer->len * 8 * 1000 * 1000) / sdd->cur_speed; @@ -582,48 +560,29 @@ static int s3c64xx_wait_for_pio(struct s3c64xx_spi_driver_data *sdd, status = readl(regs + S3C64XX_SPI_STATUS); } while (FIELD_GET(S3C64XX_SPI_ST_RX_FIFO_LVL, status) < xfer->len && --val); - if (!val) return -EIO; /* If it was only Tx */ - if (!xfer->rx_buf) { + if (!buf) { sdd->state &= ~TXBUSY; return 0; } - /* - * If the receive length is bigger than the controller fifo - * size, calculate the loops and read the fifo as many times. - * loops = length / max fifo size (calculated by using the - * fifo mask). - * For any size less than the fifo size the below code is - * executed atleast once. - */ - loops = xfer->len / FIFO_DEPTH(sdd); - buf = xfer->rx_buf; - do { - /* wait for data to be received in the fifo */ - cpy_len = s3c64xx_spi_wait_for_timeout(sdd, - (loops ? ms : 0)); - - switch (sdd->cur_bpw) { - case 32: - ioread32_rep(regs + S3C64XX_SPI_RX_DATA, - buf, cpy_len / 4); - break; - case 16: - ioread16_rep(regs + S3C64XX_SPI_RX_DATA, - buf, cpy_len / 2); - break; - default: - ioread8_rep(regs + S3C64XX_SPI_RX_DATA, - buf, cpy_len); - break; - } + len = FIELD_GET(S3C64XX_SPI_ST_RX_FIFO_LVL, status); + + switch (sdd->cur_bpw) { + case 32: + ioread32_rep(regs + S3C64XX_SPI_RX_DATA, buf, len / 4); + break; + case 16: + ioread16_rep(regs + S3C64XX_SPI_RX_DATA, buf, len / 2); + break; + default: + ioread8_rep(regs + S3C64XX_SPI_RX_DATA, buf, len); + break; + } - buf = buf + cpy_len; - } while (loops--); sdd->state &= ~RXBUSY; return 0; From patchwork Thu Jan 25 14:49:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13530997 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 8A85AC47DDF for ; Thu, 25 Jan 2024 14:51:36 +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=iMhjh+IfK65W4LklvcMyYhuqJl25oAyAp9xAMaBsYXI=; b=QlN54GjGzD9uyq m85YHj0139xLvO3znXnuhKqmXm1kY2pN2oD5QnoupjiTRGz0tby07hCyteA4bt1qpttRP/3cucbkW blDD62vJXoDLMo1QkOKjal5IMF0/0MScUYaw9UKYtNK25mWCO2vfiTZJlf2CljVeS818XvqHkJm/b dITtYePhyMhUdz1dZZ98O51IWchXLmP0mqv86WbDDclmKtU6bHHX7tzATsGoP1R4Mixg7mwwpMJ+V DsH+qfTg8Hnf2MUxCMZsecfI33sd7SyrVnThHR9D5GOeRhN2448dkq1ItINj/Cml0M2PwRXD+b476 WgOjduqQPbuIyR7sUc4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT14d-00000000Spe-28ew; Thu, 25 Jan 2024 14:51:23 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13i-00000000S2O-3M2w for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:28 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40e7e2e04f0so74515285e9.1 for ; Thu, 25 Jan 2024 06:50:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194225; x=1706799025; 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=4mb9+bEM/5blhATmtgMhoiewq5VCGJ6TCsXtGi2uVOU=; b=VY4sCrDAqhB9NY9FkH971YKLvpducHuhiFyQnNrz0vEHsqEtvCvMzfMNsnNiSWmsGi pyqhiXuk/YexuxaomFkZOoe/JZOrlhV6+9VvPb/QXiwfHDsoO6g36zx0YyseoWqPraGa PBoD0Lc/t5nbk3ZKIH0Hu9lhjx7FxuRiolAEPHBh7zUzg1ylVsVZSjMjHfKPifZTirHV lC/W2o7yuVhUErr8yIR+NBVA5qAalpDmngDMw0GehIZwaFyvap976vtW9haB/GH/9kmu 56sX2sk8S4rnpp49YRrgGrOMtny/Yfw2xOMy8GnRbJtv12cNX09Fwp+zg5zyRavLwBkN NgnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194225; x=1706799025; 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=4mb9+bEM/5blhATmtgMhoiewq5VCGJ6TCsXtGi2uVOU=; b=o6sMK07jygCK7XraX8e37EdnLiaHZxtSNDNY8frzZDSw0A8bVQaFiAW1ZWlUTZTQCG HX0Ns+V/jFT0swTSPv0sbAejZTcVmxQa78wiPxXIDKdoOu6kG6Tfam4pUxlknTqamVOc x6/Cvx1RVMRKGCuvF764tiWyM3s3AJdtzNqHzZVSJaL2WcmkBU0Cy+ihOhwOSJafgBXa WXrCl/XMJzS1eXNu26LVWME0GtW99cNdml7H+E3tIZdnu5M+llnk0K/pmytvMfnUMb2u g9khlz9pN2VmUwulOxpX4nRku4mqDjjkgbY71fDf0aL5AY4Sj/bBKNQbkow2D0O1CBZc rc8A== X-Gm-Message-State: AOJu0YwoYLz4jw3TIOun71M6oEgMDMDjK70RV1gp9fupQab7Wxdx1Twf Vex2XyYmLnYKs4fi4i8iUiZCpZjMB4fvdwOypjxEs5aDrgRn+TUw1B+a5tGRVKg= X-Google-Smtp-Source: AGHT+IEpkD3F0Js2iaSYc1hvfcPWWEOr3Z70uQBq/1WFhCQpetg0oRQUfIM4XY7tyVLSl4yTXJPtSg== X-Received: by 2002:a05:600c:b8d:b0:40e:d21d:571f with SMTP id fl13-20020a05600c0b8d00b0040ed21d571fmr476176wmb.51.1706194225631; Thu, 25 Jan 2024 06:50:25 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:24 -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 17/28] spi: s3c64xx: drop blank line between declarations Date: Thu, 25 Jan 2024 14:49:55 +0000 Message-ID: <20240125145007.748295-18-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_065026_881575_CA3B1BE5 X-CRM114-Status: GOOD ( 11.47 ) 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 Drop the blank line and move the logical operation in the body of the function rather than in initialization list. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/spi/spi-s3c64xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 00a0878aeb80..bb6d9bf390a8 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1282,8 +1282,9 @@ static int s3c64xx_spi_suspend(struct device *dev) { struct spi_controller *host = dev_get_drvdata(dev); struct s3c64xx_spi_driver_data *sdd = spi_controller_get_devdata(host); + int ret; - int ret = spi_controller_suspend(host); + ret = spi_controller_suspend(host); if (ret) return ret; From patchwork Thu Jan 25 14:49:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13530998 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 89B50C47DDF for ; Thu, 25 Jan 2024 14:51:44 +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=NAlFnP80GvqENEziPcjPWlO7Xnohhh8O7j61sRtXdNk=; b=IhN8j0EXNddXXF OHCqfVlKCrj2YCn24L20p8sWhim+5S+4evsZ7V+HPbF2RxyeJY2PA3sLNbobd1yAnLoBb2kcd0j90 8UNu9sQLo+jQXF0fr7FcDgt+FnjTbusGshcbDFR1KB8o65DpA5cdVG1G+6ZF0JhO6dgfEAUNY+e5P 5srUD9ofG8EhGWbtuAr2v1Bqus64RqS9Jwvu6vLXStksduyw44rgAsGqgaSq3Tk+uaAj80iS8f6IS 9K/C6CQ+4jJZSjnbYV2C9qehRf9kG4Niomm8K7trZ4m1DOh3ib6GplRbJTTRCYVJxk1kT5/7/Cbax 8Ae/FoWXGfAAHVhFO/BQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT14j-00000000SuM-2l4k; Thu, 25 Jan 2024 14:51:29 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13k-00000000S33-0mRl for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:29 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40ea5653f6bso70949625e9.3 for ; Thu, 25 Jan 2024 06:50:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194226; x=1706799026; 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=acZkx4VNztJup6SVFgXWaorvVUHU+cfuLeTiXLRYn7o=; b=jZRO0cRCpnFmwflUAstDeudwUxneFCd+e5xxFbLtLzxofUcy8XSSS3C06oJImV4QH1 M7bipMkyIxut8xrLoBm9hAel3fxxn/vlEOqz2PkKRtgiZO9VmLCYsO0p/dbYhJzIWch7 CCNZ6B2kkb6fE7HcGM8/wfp9kkz7oFso6qq/QWi4JfQe7MMKD/e/Njg8d6xf4M/hA3g6 R97+3KUU6STnpuAIXMk++gdxNR2rI/q57IuMYdxxX3E7u3WaijZKFUc0cyXKMpO+wRFo fBSqMcxLqSge+TuZI8B6LkdY5VqCnH8qf8lCBw7lNGhE5bPeA9r7FF+SM5zVImsDj+XK 5dLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194226; x=1706799026; 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=acZkx4VNztJup6SVFgXWaorvVUHU+cfuLeTiXLRYn7o=; b=xJqmMhIYYcFB/lYjx+IYBTqA4iS9ZApRvvo3i4GeoHTT0LMzM/Lnj6CnUuvs56RnBD dIp5yV/mP7fpvMZqhTmbz6wlW+TzbF/JPYu0vSWkz1aVun1Db7o2vgm+sVFRtbtv2TJx P/2UzJt36fj2xmbPDzfHiyPCJdfkSiJagB6A9j7EN6yydMJk6YkMDH+PIW7tNpdYvali gJyjBuD6dZo2jw9fYg4ZFuEbBJVkaaARrQCJ755R5odPM1UbAAyVA1tX8g2z5ZVWVdxZ s6yd3CcOfu6ot/r1gBUHn0Uvuzv1NliZEVpPyPxr/yjo32YW+tZ8pXc7DGKUYD6y+OyM x/lA== X-Gm-Message-State: AOJu0YxBAT/3UhFHYPxST24nj6bAntPoy1eCpgMe+Hdx+BGBVM/RWNYv XYQTQ73pcVQgnuremCbF2Qohbl69z9UTftyWCgu2QqFggYfWNYNwvITZW7nWzCc= X-Google-Smtp-Source: AGHT+IGcnVEdRBdNCJ7q8be0pWxELhjMkQy9t5rKO4stIGgfq2kH827TzWGaRyRDaSyBrj8tirG34A== X-Received: by 2002:a05:600c:a686:b0:40e:5a0c:21bf with SMTP id ip6-20020a05600ca68600b0040e5a0c21bfmr633707wmb.95.1706194226510; Thu, 25 Jan 2024 06:50:26 -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.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:25 -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 18/28] spi: s3c64xx: fix typo, s/configuartion/configuration Date: Thu, 25 Jan 2024 14:49:56 +0000 Message-ID: <20240125145007.748295-19-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_065028_330534_29445711 X-CRM114-Status: GOOD ( 10.56 ) 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 Fix typo, s/configuartion/configuration. Fixes: 6b8d1e4739f4 ("spi: spi-s3c64xx: Add missing entries for structs 's3c64xx_spi_dma_data' and 's3c64xx_spi_dma_data'") Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/spi/spi-s3c64xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index bb6d9bf390a8..692ccb7828f8 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -174,7 +174,7 @@ struct s3c64xx_spi_port_config { * @cur_speed: Current clock speed * @rx_dma: Local receive DMA data (e.g. chan and direction) * @tx_dma: Local transmit DMA data (e.g. chan and direction) - * @port_conf: Local SPI port configuartion data + * @port_conf: Local SPI port configuration data * @port_id: Port identification number */ struct s3c64xx_spi_driver_data { From patchwork Thu Jan 25 14:49:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13530999 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 AB63BC48260 for ; Thu, 25 Jan 2024 14:51:46 +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=H37NUCqtKt2l9iMmfpdZbBAaF7I+1NcgwDt9JOm2RE8=; b=rlfrtqqW/hhWsr JT7qSnVZCXdwOwK5xrvrPg9RNiKd1y79QuNQBV1FNeg6wN5PuH1raql/mtfPtChs4jySZbidUVhk4 jpJt/jB4gLHxp7Xo87SO61yKZhPXq0ZTPwkI74QlEnzbohFcmIZnroK0I4yUiN2L9o+HTr84R2rTK BU4Pducse4gEtDq+sMv46eWho4KQCinrJCqkrjNEzm0RMhaF9/ILll4F5NBREF/EJC0GLtVyNLy02 hGgSF/L9krpe9Z8xOQvmN4VG5cuhduIqg/2IJG3cWCpsKk0T9zfJVLB0tvRe4IfS2wvb8wXLKUOdH H5KnEDp3Sr8RzZIZ8W8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT14o-00000000SyV-06te; Thu, 25 Jan 2024 14:51:34 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13k-00000000S3l-2zzK for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:30 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40e80046264so85757385e9.0 for ; Thu, 25 Jan 2024 06:50:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194227; x=1706799027; 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=FCsZDfh5Q5K/DwuAunrdWzuUCnvHISTW4ss32NHF9x0=; b=IrQVKynRnfQ33NvAxzgDtMmD4x0O4qRk58MF8JhJAA5Yy3mrExkqRiSlx0qTPzEdka Z/KWtF4Znpe+0N5PSwQwKwUtnYsQn/O4Ua4oUvfMKH4GsL3PBqPQ5HiWgqTjcLKf32b1 yvxrw0tQkh6zAjnkY+B1PjZF309PsFl8lkRClgu9E2E2Y8tC5IpmruoCf7xmrR7r2TFE UQufSnHBiyhzfixoH9X2rcC4T16L4Z/DTFf5WCsuo+3stejLFwiNmgJyK4p+yK7+aMmw UDFbKfWpivMw+NfxhqKJWOTlmEvfmRKeuubbzVKGs6DfERsv2roKYSuVygYS6tnoAd7k 6v8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194227; x=1706799027; 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=FCsZDfh5Q5K/DwuAunrdWzuUCnvHISTW4ss32NHF9x0=; b=S9zvmHYFdx5Z4aAjpDZElSOFwTClnTjSQ463TvC7R95aVVhexq08vHJA9Zg7aRbgGH iCxOsSIitnf5Z/GpzaUOj2RgrVssmwHXQZgsyVeklsICWSWoWtm0fNeucS598Ky0fFZO 09tO7czAxvqg8MjLCnCz2r7r3XqDpdpqXXgv/dfEswe1CYexfL5mJLEsBQqwJmTc2ClH kMcrRH9LeMHvN0/Aa/NB9HRb+Nmz8U77ffbvlQJEOIFGz61WPDWxC6I4dmqSDlOaBOgj thGSCFdfQU0nl2C5sGU43Lo3ZwYWtJ6Qtuv3Jou5YEbdhv2oQRmhUNvyr3Mwt8fdQ+sM kGfg== X-Gm-Message-State: AOJu0Yz+hTuFW+y85eVCTx0TS/BzfE+6qPRIgmUzjHQSwJ3ZIBsyCVHL Uls9reXSFiapRAFjqzHf/A/ljI7Gb2myVRuTiKB8RzJPy/BxOaesBUChmsNaRng= X-Google-Smtp-Source: AGHT+IGh12BcHV/dAPX9rARaa3uM3thpkF0/DbdSBRI+KmJZrJjj10wwGpQaaYX5IgM25eGiIJcLTg== X-Received: by 2002:a05:600c:418a:b0:40e:4ac1:8609 with SMTP id p10-20020a05600c418a00b0040e4ac18609mr575275wmh.86.1706194227540; Thu, 25 Jan 2024 06:50:27 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:26 -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 19/28] spi: s3c64xx: downgrade dev_warn to dev_dbg for optional dt props Date: Thu, 25 Jan 2024 14:49:57 +0000 Message-ID: <20240125145007.748295-20-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_065028_846987_A001DE65 X-CRM114-Status: GOOD ( 12.02 ) 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 "samsung,spi-src-clk" and "num-cs" are optional dt properties. Downgrade the message from warning to debug message. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/spi/spi-s3c64xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 692ccb7828f8..fc5fffc019e0 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1071,14 +1071,14 @@ static struct s3c64xx_spi_info *s3c64xx_spi_parse_dt(struct device *dev) return ERR_PTR(-ENOMEM); if (of_property_read_u32(dev->of_node, "samsung,spi-src-clk", &temp)) { - dev_warn(dev, "spi bus clock parent not specified, using clock at index 0 as parent\n"); + dev_dbg(dev, "spi bus clock parent not specified, using clock at index 0 as parent\n"); sci->src_clk_nr = 0; } else { sci->src_clk_nr = temp; } if (of_property_read_u32(dev->of_node, "num-cs", &temp)) { - dev_warn(dev, "number of chip select lines not specified, assuming 1 chip select line\n"); + dev_dbg(dev, "number of chip select lines not specified, assuming 1 chip select line\n"); sci->num_cs = 1; } else { sci->num_cs = temp; From patchwork Thu Jan 25 14:49:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13531000 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 BF466C47DDF for ; Thu, 25 Jan 2024 14:51:55 +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=79rFrl4W6PutLRPy4ZW7Z5uGIsxIK7Xt54l1qzg4704=; b=1U/rx4RoSMeawC 4s9I7tL9T702sx3fgvqKYCslT0mszkomAvKID6cBOaLciMFgir1cDc4D4aGdJpTy19p9d/d//HsoY VCw8R5qUXmmZuBQ+6GrjmvqWrNpTqkPtfBJ/O/bulxy+zPJ2hlrj35jpXszu5WQHbNsP0w2ecRL64 eqCPPMqgRNxjw4UgRIhfHDh6STzHJBWnRl/tfF8x0NQBl20ztlN2TJgXxISE/pLKcMaRINBXpmxZh pK6YGJo+huyHEvA+dJ/M/I4XW63FzeWX5OZBf3h9APYoNO9ULZsElS+IEs0uQyXoW/2Tq6LRH1wx1 lBaOhNMR6W7ZtWVfa2DQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT14t-00000000T38-16z5; Thu, 25 Jan 2024 14:51:39 +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 1rT13l-00000000S4J-2EdR for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:30 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40e5afc18f5so73333315e9.3 for ; Thu, 25 Jan 2024 06:50:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194228; x=1706799028; 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=vB6EsopWvtU420AL/iiMUAA67gMzrjWCXd94V6Ahudo=; b=mPYRDtROtQzra9rJy5Om8QoJjW1i//CfYSZ7xc+tpQZHoGC8U4UbIEF/1URvfGZzWV 8c0FM4iH/vgTA/RVRmARSlhJHwbeIDO338Tgxqip6QFpGGGpXgzXRWQeWSii8w0fDjrS wj6nV6hNwuzLd6gTX8Xc4r4zIQBk105F7TPuSljqwIVN24Lc2qrT5zVGlRgfrkY2HHcL srk2Hd49SCEXe1LllTrUYty5Krin68U31RrtVs3cYYVCxLwVYl/Qmuki4+JDrd5QNZRA +GA7eOo5UqehJaoY6iRg3cJw80mQvCfkEFLeP0ebVoturQ94Dg1j3hfF8TF5Y6yJDuJC nN6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194228; x=1706799028; 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=vB6EsopWvtU420AL/iiMUAA67gMzrjWCXd94V6Ahudo=; b=QTlhRpcC5wMv6GHa5f/hhjR1iP0OsZp+aw5r6RZ11s7fMC9bcAmWd3kf6ohQV0+flG v0mtZn1zKsL14JXQHjuHSky120hWqiRDXj5t/7uHjxfVk/yxNYLF50vdqVgM3bCjrerM 0Hry1iav0PwaCVvpOW5gLRuSay+oZd2GfVA+mkF1JQHNmbvEYTeUssxCAz4E3U2ssRCj +9QC6F19kexI/Ey0k2W8nIS+7QRpRS0954Rja+Y9wXDM6mLY0era+cYNttntZkUr2RlR lngCoUsQvC9oDRKXw0pXBbBghv0nyXk+G9sXq6ZCNjXIhcOeBRrb/BiO3Eru44N+ZmBE XLPw== X-Gm-Message-State: AOJu0YzE3ubMyvDJIfSFK3ZT73xjqE3RjoLzumPw4itvoYLVHcOmVKQq vj60KcB5G1DiqBEYbiiIwyQ/CfVZXIi9pXGVsRiWfeW9knoJoM8RLr9K2N1X+4Q= X-Google-Smtp-Source: AGHT+IH50gAERtgiD46ap88LMn5K0NCn8Ty3RrpGCSOxNifjs/kTKouYIk3wNzU2y3BB26EWVSG7AQ== X-Received: by 2002:a05:600c:9:b0:40e:59d2:354d with SMTP id g9-20020a05600c000900b0040e59d2354dmr592880wmc.151.1706194228286; Thu, 25 Jan 2024 06:50:28 -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.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:27 -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 20/28] spi: s3c64xx: add support for inferring fifosize from the compatible Date: Thu, 25 Jan 2024 14:49:58 +0000 Message-ID: <20240125145007.748295-21-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_065029_661300_87F30C3A X-CRM114-Status: GOOD ( 18.42 ) 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 The IP supports FIFO sizes from 8 to 256 bytes. The SoC that uses the IP dictates the FIFO depth configuration. Add support for inferring the FIFO size from the compatible for those SoCs that use the same FIFO depth across all the instances of the SPI IP. Parsing of a device tree property to determine the FIFO size for the SoCs that use different FIFO sizes for different instances of the SPI IP will be added in a further patch. The scope of this patch is to break the dependency chain between the device tree SPI alias, the fifo_lvl_mask value and the FIFO size from the driver. Signed-off-by: Tudor Ambarus --- drivers/spi/spi-s3c64xx.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index fc5fffc019e0..5a93ed4125b0 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -132,6 +132,7 @@ struct s3c64xx_spi_dma_data { * @rx_lvl_offset: Bit offset of RX_FIFO_LVL bits in SPI_STATUS regiter. * @tx_st_done: Bit offset of TX_DONE bit in SPI_STATUS regiter. * @clk_div: Internal clock divider + * @fifosize: size of the FIFO * @quirks: Bitmask of known quirks * @high_speed: True, if the controller supports HIGH_SPEED_EN bit. * @clk_from_cmu: True, if the controller does not include a clock mux and @@ -150,6 +151,7 @@ struct s3c64xx_spi_port_config { int tx_st_done; int quirks; int clk_div; + unsigned int fifosize; bool high_speed; bool clk_from_cmu; bool clk_ioclk; @@ -176,6 +178,7 @@ struct s3c64xx_spi_port_config { * @tx_dma: Local transmit DMA data (e.g. chan and direction) * @port_conf: Local SPI port configuration data * @port_id: Port identification number + * @fifosize: size of the FIFO */ struct s3c64xx_spi_driver_data { void __iomem *regs; @@ -195,6 +198,7 @@ struct s3c64xx_spi_driver_data { struct s3c64xx_spi_dma_data tx_dma; const struct s3c64xx_spi_port_config *port_conf; unsigned int port_id; + unsigned int fifosize; }; static void s3c64xx_flush_fifo(struct s3c64xx_spi_driver_data *sdd) @@ -404,7 +408,7 @@ static bool s3c64xx_spi_can_dma(struct spi_controller *host, struct s3c64xx_spi_driver_data *sdd = spi_controller_get_devdata(host); if (sdd->rx_dma.ch && sdd->tx_dma.ch) - return xfer->len > FIFO_DEPTH(sdd); + return xfer->len > sdd->fifosize; return false; } @@ -702,7 +706,7 @@ static int s3c64xx_spi_transfer_one(struct spi_controller *host, struct spi_transfer *xfer) { struct s3c64xx_spi_driver_data *sdd = spi_controller_get_devdata(host); - const unsigned int fifo_len = FIFO_DEPTH(sdd); + const unsigned int fifo_len = sdd->fifosize; const void *tx_buf = NULL; void *rx_buf = NULL; int target_len = 0, origin_len = 0; @@ -1154,6 +1158,11 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) sdd->port_id = pdev->id; } + if (sdd->port_conf->fifosize) + sdd->fifosize = sdd->port_conf->fifosize; + else + sdd->fifosize = FIFO_DEPTH(sdd); + sdd->cur_bpw = 8; sdd->tx_dma.direction = DMA_MEM_TO_DEV; @@ -1243,7 +1252,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) dev_dbg(&pdev->dev, "Samsung SoC SPI Driver loaded for Bus SPI-%d with %d Targets attached\n", sdd->port_id, host->num_chipselect); dev_dbg(&pdev->dev, "\tIOmem=[%pR]\tFIFO %dbytes\n", - mem_res, FIFO_DEPTH(sdd)); + mem_res, sdd->fifosize); pm_runtime_mark_last_busy(&pdev->dev); pm_runtime_put_autosuspend(&pdev->dev); From patchwork Thu Jan 25 14:49:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13531001 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 D8A9CC47258 for ; Thu, 25 Jan 2024 14:52:03 +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=nzNoelU/jUTZ+7tgy2arynyoI5O8zim21anemGS2X94=; b=kyGLx9oz6HHwBQ eiqOHZ7ZyKjKRZqTwjIJreNKlNz/LwFOSneGLOoa5q2WnaCbwVV5b3pfDCmMbF1H7HKQzMum8FtOE tZRjPI+Pt4C7ivx+tck0wP2T0rZr3V0aVn2eib+Pqbz2PdtTlD1E9TZ4nGJ1/xSULWzCePHyFD1MD 5+Q4cf8fkinmXmBghuDm3l/YpA/k9nzR+XYwMzvFUcuhq3JHmJalbwr7MReMddn5ObxigobdclkVE iSlw30PzZlK9TJ9jsO3P7NqO76xG4MlUU/ILqrNoeLZd11o6feCSs1UTq1aRkZL9WNKmqyATHNdpp dHX8eSqEzRMt6UB5mO5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT156-00000000TFQ-1sTV; Thu, 25 Jan 2024 14:51:52 +0000 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13m-00000000S5O-3KUB for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:32 +0000 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-50f11e3ba3aso10098680e87.1 for ; Thu, 25 Jan 2024 06:50:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194229; x=1706799029; 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=f/zPTXzuzucodd7Jc2j/c0UTTlvdcrp8MZ/snSSgH8c=; b=pO7lGC0DH7s2UY5AXHk7aeFmN2c7dKjzRiUPE8kfIiSvXhWgxThhU2P75iVX0oJVAD apQcyO35M4TgaSXZW0ujkS4/kSp7s6pll43PIAl3x0uVNzwko743UgwhUoAjOkij5fel c7ZBVa/ys1y+uYg/0S92V7q2VPA3S2WiYOFXYFq0QpZ1OyEW+hEenu2BGix18rX1c7pc J+zki/1hvMD7mMA4kOzvb3Ldfwp+9acGObdADZ5jUg145VxIYy+iMdiP5MN8KTnQTV8i yuZSjKjd8/1ev7yVBAzl/eTO9/qG+m64lXszd8liM/YxAU/ITMAdfE7RDVRCHsMcF7Rm jd6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194229; x=1706799029; 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=f/zPTXzuzucodd7Jc2j/c0UTTlvdcrp8MZ/snSSgH8c=; b=A9Q2pgm4DLfixMdlsbPqNSg3NO575Whs55xymg/5P8DV2HXGTz46l8Cg+njrO5tLs/ LqzV3HgeEMU5Qw4Qeuyqy9rtteEX/b8s2WNJEToVUeiJzJOm9JuYHDh1MqtBbIqZmMGO uwUnkVpHTfOh9pd2Pn+pVUkxD/DmY4rU7l9QZLgh5heMqktJ2GlHtbzLWJod3wvoU1Ub il0ZRIbKuPCXslSTVCNMPemW46rxRbcqs3ZkDZ2awQ2zPPWHrVfxZfX53vZEZjJ/iDpJ UpVTVlZIpsfFl5IFQkQMu8lOnOw5zhJ04fp13zNmuY5p4NLY1U3Mx4j6DI8da8wvJRaZ vo+w== X-Gm-Message-State: AOJu0Yy0bTIXTA9bX1NJFPYtBNcSZNmtkbUGIaCFkl3APPUFk+MUsxyc IIK2vVX6jrxY4vlkExInVpojW+iTdIn6BzuyxMS0VUsOnw+LoVTID6AxCJGVbKg= X-Google-Smtp-Source: AGHT+IEEJRoUMypCd5WxAINWuuyyAtoDoV7u9sVIAu6LKI6SWWX9FrZs5lQFbxcY+zk8kyfwTvqYyg== X-Received: by 2002:a19:ad4c:0:b0:510:7e4:f2be with SMTP id s12-20020a19ad4c000000b0051007e4f2bemr790436lfd.48.1706194229248; Thu, 25 Jan 2024 06:50:29 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:28 -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 21/28] spi: s3c64xx: infer fifosize from the compatible Date: Thu, 25 Jan 2024 14:49:59 +0000 Message-ID: <20240125145007.748295-22-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_065030_953038_0AE4AB5C X-CRM114-Status: GOOD ( 13.23 ) 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 Infer the FIFO size from the compatible, where all the instances of the SPI IP have the same FIFO size. This way we no longer depend on the SPI alias from the device tree to select the FIFO size, thus we remove the dependency of the driver on the SPI alias. Signed-off-by: Tudor Ambarus --- drivers/spi/spi-s3c64xx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 5a93ed4125b0..b86eb0a77b60 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1381,7 +1381,7 @@ static const struct dev_pm_ops s3c64xx_spi_pm = { }; static const struct s3c64xx_spi_port_config s3c2443_spi_port_config = { - .fifo_lvl_mask = { 0x7f }, + .fifosize = 64, .rx_lvl_offset = 13, .tx_st_done = 21, .clk_div = 2, @@ -1389,7 +1389,7 @@ static const struct s3c64xx_spi_port_config s3c2443_spi_port_config = { }; static const struct s3c64xx_spi_port_config s3c6410_spi_port_config = { - .fifo_lvl_mask = { 0x7f, 0x7F }, + .fifosize = 64, .rx_lvl_offset = 13, .tx_st_done = 21, .clk_div = 2, @@ -1435,7 +1435,7 @@ static const struct s3c64xx_spi_port_config exynos5433_spi_port_config = { }; static const struct s3c64xx_spi_port_config exynos850_spi_port_config = { - .fifo_lvl_mask = { 0x7f, 0x7f, 0x7f }, + .fifosize = 64, .rx_lvl_offset = 15, .tx_st_done = 25, .clk_div = 4, @@ -1459,7 +1459,7 @@ static const struct s3c64xx_spi_port_config exynosautov9_spi_port_config = { }; static const struct s3c64xx_spi_port_config fsd_spi_port_config = { - .fifo_lvl_mask = { 0x7f, 0x7f, 0x7f, 0x7f, 0x7f}, + .fifosize = 64, .rx_lvl_offset = 15, .tx_st_done = 25, .clk_div = 2, From patchwork Thu Jan 25 14:50:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13531002 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 B527EC47DDF for ; Thu, 25 Jan 2024 14:52:10 +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=7Z11Bh3zy0zBENe0RMAU77vosypqULINp37VA+6n9Uc=; b=giV6u6xHokBE8S byVdpBGYEEwwOeXatznueQLN8qkxyXb97Du86aEtUY+FaTg6fqYks1xbKiH3zcfbTAjrvk78QObsa 4fu2+pFq+FZmyyKlSQZjSwOTUmSwWHfsOoaWtjjklny2dQz0McoJsCTCIyGrVUy1HdOVWb25vi2Ur TmTF3rjVNCMXPGUH3n1AYPN6LTQ/e4GmT6QBljcrwi6UAouA0Ql/ARVVv3ln98wI6n+e+Iu4iRBkf O+28q/syMvmOHRLD2c2ORxMgoezaMd0RENikeZRvj4nWDVBVl1fLFjRML6fK9t3015LO/L7jsA1D/ JVBk1qZAc6NxEQw31+xg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT15A-00000000TJl-24Sr; Thu, 25 Jan 2024 14:51:56 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13n-00000000S65-1WeN for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:33 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40e913e3f03so85545735e9.3 for ; Thu, 25 Jan 2024 06:50:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194230; x=1706799030; 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=JtNtOah4q0k+JGCPgSMuID7OmymIk1nPxql5oxULauE=; b=jmOd4ZKFwpNKAaxF2h4XVLK7D7qe59cfWK1lwGT14vnsqaps91hDhpPgF6XHdDcHKe Wzo5SXXL/PCV3F/PKlUEQRSpARuwaXIsNw9RuNOPpvSD1B+j5T6wcNMDYMWZejTSs09S r6MNskEZF3Odu9n3tl62c7vhvekbxLJGfamAVqovWvBpEDN9potPzUk5i61wO+oCi0Zv +fF2swrugDsun6+VHsRnkadLEfvti8VaJKqHwUhzge9+f/yjxB6p0K/Igxv8O2Rg1ZyB +TcMHuh4qMqsHJipSUvZWZhbPsiBJvqL5PBwYUB7NTAYQ04dGg+UUhn4FbZYA4gaysGM KVng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194230; x=1706799030; 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=JtNtOah4q0k+JGCPgSMuID7OmymIk1nPxql5oxULauE=; b=PxkO0fx1TjlQLMmu6BSFpSnlrEAN6i1fMY/VJ/xApnZ5Y4suWwCXwJav/nDoxXjFUW fg+qXvJMaxFArwjOAeJl2IBPCiAsvWytONvilJWEALrgASucZxQsuycmAYJyd97YipLF O4+ITUxIjup1KE5RoUzLG2e4YfaEv/FIMAK/b0CVED+tGQxQ69mkW3j+aHHqNXSfeV98 bNXQxpBI6r4xbwv+CSH3myoX0dkGusjIV8hDS64y6Ztyr4heWPu0I8obPyBhX8oE8VaO W7sNBVY0xO9jeyvfJlDQkp2ji6uaxvcTNa4uu0Ex1QexBHy5yz+Njj5u2bENgljt9hRG WxrQ== X-Gm-Message-State: AOJu0YwiLWN8ZGHoehgAplzMpPaeKCJNm9rlGYiDoJuKH4n9bwSqVsAz 7O2QUkDesJUp3W/3VEue/2KER+ivXSBvis3/gPNJ9TnBBQN68/+KwQKDi5SosdY= X-Google-Smtp-Source: AGHT+IHbggNgNKsbigSPf6qnK9OAL7RN+AXot/5cZEw4S6FkZlNDOIGl4jCVyK8EYQh9E6qMazSeuQ== X-Received: by 2002:a05:600c:384e:b0:40e:c1a9:6829 with SMTP id s14-20020a05600c384e00b0040ec1a96829mr575554wmr.120.1706194230059; Thu, 25 Jan 2024 06:50:30 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:29 -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 22/28] spi: s3c64xx: drop dependency on of_alias where possible Date: Thu, 25 Jan 2024 14:50:00 +0000 Message-ID: <20240125145007.748295-23-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_065031_500708_13418429 X-CRM114-Status: GOOD ( 18.33 ) 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 Remove the dependency on the OF alias for SoCs that use the same FIFO size for all the instances of the SPI IP. The driver failed to probe if an SPI alias was not provided, which is obviously wrong. We now let the SPI core determine the SPI alias, either by getting the alias ID, or by allocating a dynamic bus number when the alias is absent. Signed-off-by: Tudor Ambarus --- drivers/spi/spi-s3c64xx.c | 61 ++++++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 23 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index b86eb0a77b60..7a99f6b02319 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -107,10 +107,9 @@ #define S3C64XX_SPI_FBCLK_MASK GENMASK(1, 0) -#define FIFO_LVL_MASK(i) ((i)->port_conf->fifo_lvl_mask[i->port_id]) #define S3C64XX_SPI_ST_TX_DONE(v, i) (((v) & \ (1 << (i)->port_conf->tx_st_done)) ? 1 : 0) -#define FIFO_DEPTH(i) ((FIFO_LVL_MASK(i) >> 1) + 1) +#define FIFO_DEPTH(x) (((x) >> 1) + 1) #define S3C64XX_SPI_POLLING_SIZE 32 @@ -197,7 +196,6 @@ struct s3c64xx_spi_driver_data { struct s3c64xx_spi_dma_data rx_dma; struct s3c64xx_spi_dma_data tx_dma; const struct s3c64xx_spi_port_config *port_conf; - unsigned int port_id; unsigned int fifosize; }; @@ -1110,6 +1108,37 @@ static inline const struct s3c64xx_spi_port_config *s3c64xx_spi_get_port_config( return (const struct s3c64xx_spi_port_config *)platform_get_device_id(pdev)->driver_data; } +static int s3c64xx_spi_get_fifosize(const struct platform_device *pdev, + struct s3c64xx_spi_driver_data *sdd) +{ + 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; + + if (!np) { + if (pdev->id < 0) + return dev_err_probe(&pdev->dev, -EINVAL, + "Negative platform ID is not allowed\n"); + id = pdev->id; + sdd->fifosize = FIFO_DEPTH(fifo_lvl_mask[id]); + return 0; + } + + if (port->fifosize) { + sdd->fifosize = port->fifosize; + return 0; + } + + id = of_alias_get_id(np, "spi"); + if (id < 0) + return dev_err_probe(&pdev->dev, id, + "Failed to get alias id\n"); + sdd->fifosize = FIFO_DEPTH(fifo_lvl_mask[id]); + + return 0; +} + static int s3c64xx_spi_probe(struct platform_device *pdev) { struct resource *mem_res; @@ -1142,34 +1171,20 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) sdd = spi_controller_get_devdata(host); sdd->port_conf = s3c64xx_spi_get_port_config(pdev); + ret = s3c64xx_spi_get_fifosize(pdev, sdd); + if (ret) + return ret; + sdd->host = host; sdd->cntrlr_info = sci; sdd->pdev = pdev; - if (pdev->dev.of_node) { - ret = of_alias_get_id(pdev->dev.of_node, "spi"); - if (ret < 0) - return dev_err_probe(&pdev->dev, ret, - "Failed to get alias id\n"); - sdd->port_id = ret; - } else { - if (pdev->id < 0) - return dev_err_probe(&pdev->dev, -EINVAL, - "Negative platform ID is not allowed\n"); - sdd->port_id = pdev->id; - } - - if (sdd->port_conf->fifosize) - sdd->fifosize = sdd->port_conf->fifosize; - else - sdd->fifosize = FIFO_DEPTH(sdd); - sdd->cur_bpw = 8; sdd->tx_dma.direction = DMA_MEM_TO_DEV; sdd->rx_dma.direction = DMA_DEV_TO_MEM; host->dev.of_node = pdev->dev.of_node; - host->bus_num = sdd->port_id; + host->bus_num = -1; host->setup = s3c64xx_spi_setup; host->cleanup = s3c64xx_spi_cleanup; host->prepare_transfer_hardware = s3c64xx_spi_prepare_transfer; @@ -1250,7 +1265,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) } dev_dbg(&pdev->dev, "Samsung SoC SPI Driver loaded for Bus SPI-%d with %d Targets attached\n", - sdd->port_id, host->num_chipselect); + host->bus_num, host->num_chipselect); dev_dbg(&pdev->dev, "\tIOmem=[%pR]\tFIFO %dbytes\n", mem_res, sdd->fifosize); 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, From patchwork Thu Jan 25 14:50:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13531004 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 98E5FC47DDF for ; Thu, 25 Jan 2024 14:52:16 +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=3gWo/Oe0rm7wNQZQfOgWoy8jJxOSVCtzR4uMEOQRJJs=; b=l+ZSe0052tfy/E 7pXqeGg4pw6YLuQYLIybPQbsj81YpoE3+5Cgqske0cau1DLuColHzHxFSEeYPGd6WqKzERFmZ3lrG SiFVxwwMfCaJSxEbq2wg8UMzsj3+UC3UYLwHECWUySKfGfJOaR3qrwLlCi6e4k/iG9FoIiph4JRDa wj10YapNeJH0zEuT6uYsKDGlmMjtNRj5LyHNKOzJNogm7HZsLFsf3DZe5Oax/aocOdTfaCpH6GG2u 2QznxbVh6up3cghMQh0H5iciNVYa8xSXUbxwf9UfV37KVa+4wUni9p0cm7ss3MYeGVL4Ujf5HlRkJ a/6U8ROnGrv+joZ8bIUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT15G-00000000TOm-0wjP; Thu, 25 Jan 2024 14:52:02 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13p-00000000S7p-3Y3F for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:35 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40e9101b5f9so75536515e9.3 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=1706194232; x=1706799032; 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=ApOZNfBccU6dqvedRX4iUyVPu1nTeSF4guAYCuO4Cl4=; b=lY7J23/quN0NxCgyh20iTw+Zif9TG7kFKtjrOK+3d5oFEQJi4Qyweha8h100OVX0fQ S0MvNgAaRrJ4LGAVriLQfdJgfryDUOd6noOjF+n4TR5TPg0y80tHSaROyvJv1RCWYKIm fPauUjHkL7JK3jJOy3hgyZSxVY9V1mucepibgwM/HStesfo2b26iRhrBoQr6U3D8IsC2 bssqLtvEMN9SuNEHidsSjUzmlZbNEXsBsk5KUKdrB6JTX2U4oNOgJWKNsKwKxu49DIia CNZdZvFuOst4KdK1aBSAvPCrFvm73rwl5x8wfzSezNnQ9reYnaMOZSJJgiJ7BtMjiZo6 Wf8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194232; x=1706799032; 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=ApOZNfBccU6dqvedRX4iUyVPu1nTeSF4guAYCuO4Cl4=; b=Pk/QTsp4tFYCr9mrNa9MfmoKFhH6c/9Gq974Mc8LK2kENQ+OiN8DFMQ7L6fEdRDhU3 Ul+R/O4/qEiSNAAnHczFb9ixHv+KeTKycBV64QLn6o8C1duIKmj37b4cCciEqh6LMCh+ BckNx2Nwqe0dLYls6VwMbJNBC8RN+DEuu0NeGj3/AtOuQxwSXsI1JaM8ftplNMpRHHXn F+kfS8J5cfu+kM6OykB3GIX8An3Pjb4QFv1ZGPoGF5B/Fu96Bf/xfnOIhJA4FIuq/voE CjbsSfgcIhPSyvUKMmsLPD60S+fYi/Q8SL4z7QXQ+TDGntdZG6Brte0GpiPH8yay+d54 WWoA== X-Gm-Message-State: AOJu0Yyy4pbQHFc8RkX4ivSnlCjpgZFNXE6aXHpigy4rN6/lyNTB+Xkm 8gcAlJpsW1zbhaMkBaEUPCaGFb7IaoHtREnyfEza3ae9TW21rjYYAdTLhTAPsXA= X-Google-Smtp-Source: AGHT+IGyrJbT7ENzixl1qRIV4teC3M8kK7663WjQeVwHKN5MMuO5Gp4c8gAac9UV5b3ihgXW5+2V7w== X-Received: by 2002:a05:600c:4515:b0:40e:ccf7:3618 with SMTP id t21-20020a05600c451500b0040eccf73618mr664568wmo.23.1706194232646; Thu, 25 Jan 2024 06:50:32 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:31 -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 24/28] spi: s3c64xx: mark fifo_lvl_mask as deprecated Date: Thu, 25 Jan 2024 14:50:02 +0000 Message-ID: <20240125145007.748295-25-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_065033_977146_7941219F X-CRM114-Status: GOOD ( 13.72 ) 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 The SPI of_alias was used as an index into the fifo_lvl_mask to determine the FIFO depth of the SPI node. Changing the alias ID into the device tree would make the driver choose a wrong FIFO size configuration, if not accessing past the fifo_lvl_mask array boundaries. Not specifying an SPI alias would make the driver fail to probe, which is also wrong. We now have the infrastructure to correctly determine the FIFO size. SoCs that use the same FIFO size across all the instances of the SPI IP shall infer the FIFO size from the compatible, thus by setting ``s3c64xx_spi_port_config.fifosize``. SoCs that have instances of the SPI IP with different FIFO sizes shall specify the FIFO size to each SPI device tree node by using the ``samsung,spi-fifosize`` property. Mark fifo_lvl_mask as deprecated. Signed-off-by: Tudor Ambarus --- drivers/spi/spi-s3c64xx.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 3e7797d915c5..fa70c6aab7c2 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -127,7 +127,8 @@ struct s3c64xx_spi_dma_data { /** * struct s3c64xx_spi_port_config - SPI Controller hardware info - * @fifo_lvl_mask: Bit-mask for {TX|RX}_FIFO_LVL bits in SPI_STATUS register. + * @fifo_lvl_mask: [DEPRECATED] Bit-mask for {TX|RX}_FIFO_LVL bits in + * SPI_STATUS register. * @rx_lvl_offset: Bit offset of RX_FIFO_LVL bits in SPI_STATUS regiter. * @tx_st_done: Bit offset of TX_DONE bit in SPI_STATUS regiter. * @clk_div: Internal clock divider @@ -1415,6 +1416,7 @@ static const struct s3c64xx_spi_port_config s3c6410_spi_port_config = { }; static const struct s3c64xx_spi_port_config s5pv210_spi_port_config = { + /* fifo_lvl_mask is deprecated. */ .fifo_lvl_mask = { 0x1ff, 0x7F }, .rx_lvl_offset = 15, .tx_st_done = 25, @@ -1423,6 +1425,7 @@ static const struct s3c64xx_spi_port_config s5pv210_spi_port_config = { }; static const struct s3c64xx_spi_port_config exynos4_spi_port_config = { + /* fifo_lvl_mask is deprecated. */ .fifo_lvl_mask = { 0x1ff, 0x7F, 0x7F }, .rx_lvl_offset = 15, .tx_st_done = 25, @@ -1433,6 +1436,7 @@ static const struct s3c64xx_spi_port_config exynos4_spi_port_config = { }; static const struct s3c64xx_spi_port_config exynos7_spi_port_config = { + /* fifo_lvl_mask is deprecated. */ .fifo_lvl_mask = { 0x1ff, 0x7F, 0x7F, 0x7F, 0x7F, 0x1ff}, .rx_lvl_offset = 15, .tx_st_done = 25, @@ -1443,6 +1447,7 @@ static const struct s3c64xx_spi_port_config exynos7_spi_port_config = { }; static const struct s3c64xx_spi_port_config exynos5433_spi_port_config = { + /* fifo_lvl_mask is deprecated. */ .fifo_lvl_mask = { 0x1ff, 0x7f, 0x7f, 0x7f, 0x7f, 0x1ff}, .rx_lvl_offset = 15, .tx_st_done = 25, @@ -1465,6 +1470,7 @@ static const struct s3c64xx_spi_port_config exynos850_spi_port_config = { }; static const struct s3c64xx_spi_port_config exynosautov9_spi_port_config = { + /* fifo_lvl_mask is deprecated. */ .fifo_lvl_mask = { 0x1ff, 0x1ff, 0x7f, 0x7f, 0x7f, 0x7f, 0x1ff, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f}, .rx_lvl_offset = 15, From patchwork Thu Jan 25 14:50:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13531005 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 2DB8FC47258 for ; Thu, 25 Jan 2024 14:52:19 +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=4Lxi40N1jlYIE7QhMzVAume7icxHmKyd6STPos7VcfM=; b=kvhKbsWJ2rJmYA e5agMWWnH5vtoWOhuZidSRtPu5AHPGg+EjwCMgx/+zovHV/ZrUfazoZc9LgUyGrENSWIJPsX0DhNk q98JYXVxa8eSx4xKYI0I1TIKf86NUdgjfBu5R5w5L8XpClOM9cZ+M3tz6+PHBUN4VXJPviiQUixPk 361HFrqbcGT8/F3BOA2f0arn+QzRlWjaCSeL/hPCR96qm8i2GSxsLNZBoJJahKfkaW42k66VNjfwl iqPwpCZHFvYsgdt69aI+uoE3nWYajFjRiMyIrRxMJqRl3VcxWIv7pcrm1gghjZ1S3FYUBFKFVrEbw nANYIF9i66t56SVHICGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT15L-00000000TTH-1ME7; Thu, 25 Jan 2024 14:52:07 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13r-00000000S8S-18zG for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:36 +0000 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-33921b8988fso5758811f8f.3 for ; Thu, 25 Jan 2024 06:50:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194233; x=1706799033; 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=S9fJpsc9ntkK7Gm49ODwE4XlmIeMd92uqdDuqa4hcJ8=; b=F+l3VnbI9WFI/goY9PBz/wORVHxCDWFxYX0d3brd5HVcXxkiO8iOQj0jCgPJcoiHy/ MAW+ksFH8hls6xH6q2DWzaiG2K926osA6rhqQ87ArFBwh0rd9BUfd8YGxgiK0trTEEgM G5m6+s2Cf5cjRyi4+ExYoki4CqZKfsRJxQqhX8Ot7s/9CvCtqTUf55N/AxQGjUO5cnlY EwXJs0HU+7hWiQH+AY9vFjmqeSptY8IQF1yTdiLZIjmxcPPupdfCWc/fTnjLBPgnU1wL nfSIes9zUBgV0IthsXoFwBb6lAio8yHywjtmHE+xazEM1gXSTs67TjW5ffnZpJCse5a6 vZpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194233; x=1706799033; 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=S9fJpsc9ntkK7Gm49ODwE4XlmIeMd92uqdDuqa4hcJ8=; b=htNfp8JwvImekahci7r5BoaInCpcR8PtkkUIYkoSiIj1Ik5WlEScWjr4rSA8SInfHq f9gUTN4D5/kIOUcXKbeSV6keuZSGn29LnJLr1sIQPmX4IZ2Ur5vhS8vKWBp/5E4zNSzX J/FAtnFcymMNkSx67Kao/FW5nppBzxGDEVlGS2YHzoIQFcL0heVKjI8JaB4UEN5xIEfr RxImB2fLsBNIcZLzHX6YTi9Ou30EonZ3jwDV7LchgjN2S+TMbzpPQ0+TXofyVAQmmBTq sUyEb7Dwf++5xhNOK2qajgZzBekSuzRE1gz/k6884f+nC7KVhT/e6K8ldEJKZIvAjvdn 0HxA== X-Gm-Message-State: AOJu0Yxxc8E1TH3IK1tL7bvIU4ZbgcKuBk6jhN8y33wJ06FX5X3k20BG M3KgQB9n+EqcMEO+Be8gswlOyDcY6LX2x+3mQiK1zrB61aXjaXB7+mAx78+NSY4= X-Google-Smtp-Source: AGHT+IHav9r3fWyDiEX8CdSvB/U4xaT1J9Vfk5kfMl/b6781KqaxDQ9QxWNs1mhHIC22Ki2pTVXdRg== X-Received: by 2002:a05:600c:2907:b0:40e:6fa9:345 with SMTP id i7-20020a05600c290700b0040e6fa90345mr406881wmd.66.1706194233577; Thu, 25 Jan 2024 06:50:33 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:32 -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 25/28] asm-generic/io.h: add iowrite{8,16}_32 accessors Date: Thu, 25 Jan 2024 14:50:03 +0000 Message-ID: <20240125145007.748295-26-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_065035_356823_E2310723 X-CRM114-Status: GOOD ( 11.41 ) 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 This will allow devices that require 32 bits register accesses to write data in chunks of 8 or 16 bits. One SoC that requires 32 bit register accesses is the google gs101. A typical use case is SPI, where the clients can request transfers in words of 8 bits. Signed-off-by: Tudor Ambarus --- include/asm-generic/io.h | 50 +++++++++++++++++++++++++++++++++++++ include/asm-generic/iomap.h | 2 ++ 2 files changed, 52 insertions(+) diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index bac63e874c7b..1e224d1ccc98 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -476,6 +476,21 @@ static inline void writesb(volatile void __iomem *addr, const void *buffer, } #endif +#ifndef writesb_l +#define writesb_l writesb_l +static inline void writesb_l(volatile void __iomem *addr, const void *buffer, + unsigned int count) +{ + if (count) { + const u8 *buf = buffer; + + do { + __raw_writel(*buf++, addr); + } while (--count); + } +} +#endif + #ifndef writesw #define writesw writesw static inline void writesw(volatile void __iomem *addr, const void *buffer, @@ -491,6 +506,21 @@ static inline void writesw(volatile void __iomem *addr, const void *buffer, } #endif +#ifndef writesw_l +#define writesw_l writesw_l +static inline void writesw_l(volatile void __iomem *addr, const void *buffer, + unsigned int count) +{ + if (count) { + const u16 *buf = buffer; + + do { + __raw_writel(*buf++, addr); + } while (--count); + } +} +#endif + #ifndef writesl #define writesl writesl static inline void writesl(volatile void __iomem *addr, const void *buffer, @@ -956,6 +986,16 @@ static inline void iowrite8_rep(volatile void __iomem *addr, } #endif +#ifndef iowrite8_32_rep +#define iowrite8_32_rep iowrite8_32_rep +static inline void iowrite8_32_rep(volatile void __iomem *addr, + const void *buffer, + unsigned int count) +{ + writesb_l(addr, buffer, count); +} +#endif + #ifndef iowrite16_rep #define iowrite16_rep iowrite16_rep static inline void iowrite16_rep(volatile void __iomem *addr, @@ -966,6 +1006,16 @@ static inline void iowrite16_rep(volatile void __iomem *addr, } #endif +#ifndef iowrite16_32_rep +#define iowrite16_32_rep iowrite16_32_rep +static inline void iowrite16_32_rep(volatile void __iomem *addr, + const void *buffer, + unsigned int count) +{ + writesw_l(addr, buffer, count); +} +#endif + #ifndef iowrite32_rep #define iowrite32_rep iowrite32_rep static inline void iowrite32_rep(volatile void __iomem *addr, diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h index 196087a8126e..9d63f9adf2db 100644 --- a/include/asm-generic/iomap.h +++ b/include/asm-generic/iomap.h @@ -84,7 +84,9 @@ extern void ioread16_rep(const void __iomem *port, void *buf, unsigned long coun extern void ioread32_rep(const void __iomem *port, void *buf, unsigned long count); extern void iowrite8_rep(void __iomem *port, const void *buf, unsigned long count); +extern void iowrite8_32_rep(void __iomem *port, const void *buf, unsigned long count); extern void iowrite16_rep(void __iomem *port, const void *buf, unsigned long count); +extern void iowrite16_32_rep(void __iomem *port, const void *buf, unsigned long count); extern void iowrite32_rep(void __iomem *port, const void *buf, unsigned long count); #ifdef CONFIG_HAS_IOPORT_MAP From patchwork Thu Jan 25 14:50:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13531006 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 080C0C47258 for ; Thu, 25 Jan 2024 14:52:27 +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=BY8l2IfBRMEfmdf8JusVM3oRCrPbPWWs5XjsgwvIDh0=; b=LxS3RFChTvGuk3 Ub8xXDzzps88Tfsnr/6qQMgQqslzi7OTH8j9tJBvzB8g+8Y44LDuSzP8Sb6Pk6l7xJnt6qH9o3bu+ c0FjNpG+OUI1gcrd49+33+557vJf31XyvPV5uvcZSF7sCulPz692PiS0kO5D8Lu0St6NbwBVcreCL +IJlO2p+86PDSAIbryje+iipRaNdOM5/wS8JXDeDD3JTBexm1BpYb2x31F0eGeL9mChgqaaJ6Yl2M Ln60BPBqaKBdc030TdNW3awAAvnV1hQkz9ob3r8Oj8dJ9SnNSRp0cMEx/LI5+qNHi3s8LCfqVJRws ymNTAkKbCT54fBPihIcQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT15Q-00000000TY8-21In; Thu, 25 Jan 2024 14:52:12 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13r-00000000S8l-2L3X for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:36 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40eb2f392f0so37935315e9.1 for ; Thu, 25 Jan 2024 06:50:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194234; x=1706799034; 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=ILSaztB6FcGB0AGX6yBD5eg2sH+uIPmbRLL9DGHOYeE=; b=UslhAwDknqXLNPUdyyX4tZMN3SQYWyBD1Iv5p1l9pv4Y3eJV0GEq4HC5GHLRLVqV2M LMgRO8HwgwUqO9/3entwoksdVaIF69PkLEbFCoqnzk5NVqfn8I3Og5xJblgSmogNedi6 oPFrvJJ42hZcsEMj1UmulG0r0GFLd0CoHSF2Djj6TR/Sn0mnGfr6t3hhQz26//n8NPWE CORv8euANSaia2pqkcHBVuxChsK07BRjQeuPr6PRQBBQKjQRioRM2PmxjX1wIz0krk7X WFagYstApRae3GrhW9RPCDj/RgQTryk9nT6PqNeA/sd/pUsMMJQ5jnA8CgpXfk/t/ocU ft9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194234; x=1706799034; 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=ILSaztB6FcGB0AGX6yBD5eg2sH+uIPmbRLL9DGHOYeE=; b=FEHCozo1suaBaQWQQvTv5ViksAuR1OeNPPqvFt5oMKniMuMCJDz5rh343kWEv3qy0e LYCZ9R38l9/5aXbg4wLnwDvVEmc1qcIuMxjoD213y7NuL253nyqZxGAuzq/E/B1eUICJ n8qqm/8ZhjG672By1cPCYEAyWL+xXAHWJjS5EQBC+C8zTZ5cGziCRxEpKmsvPp2iPqBo bPAkZSfL8FDSTLIdlp3JcbwvWAdDuGPRJhG397szMDoR7OULR7Ac9Cu+MCaAZlwAVFdm b+zYcIBEW4A9AmUU90nI3AXAYQauzfUFNFD18kCCRDRjzbq/5dgajwOshuQaB7TIyRP5 YypQ== X-Gm-Message-State: AOJu0Yyb1MyP53oDwU1ORUbNNsR14yh47b3q6pFbDZT5JVbkzL4e0eyb x7pEQ2Q6qMMk+gSTjLuXmrBKfXO8f5NOZmOnBOs8aQJp6BmoC8flGYOhC9zdYmY= X-Google-Smtp-Source: AGHT+IEEFjYXZBt80LZEizQKLMuDRZIJ0xb27lsGtHr9gw6xNivRFK3y+AivGuvHVv+xDYMvvMwlMw== X-Received: by 2002:a05:600c:3d09:b0:40d:3b2d:99a0 with SMTP id bh9-20020a05600c3d0900b0040d3b2d99a0mr632998wmb.81.1706194234358; Thu, 25 Jan 2024 06:50:34 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:33 -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 26/28] spi: s3c64xx: add iowrite{8,16}_32_rep accessors Date: Thu, 25 Jan 2024 14:50:04 +0000 Message-ID: <20240125145007.748295-27-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_065035_661658_A698EBFC X-CRM114-Status: GOOD ( 14.26 ) 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 There are SoCs that allow just 32 bit register accesses otherwise they throw a SError interrupt if accessing the bus with 8 or 16 bits widths. Such an SoC is the google gs101. Allow such SoCs to use the iowrite{8,16}_32_rep accessors. Signed-off-by: Tudor Ambarus --- drivers/spi/spi-s3c64xx.c | 46 +++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index fa70c6aab7c2..35a2d5554dfd 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -139,6 +139,7 @@ struct s3c64xx_spi_dma_data { * prescaler unit. * @clk_ioclk: True if clock is present on this device * @has_loopback: True if loopback mode can be supported + * @use_32bit_io: True if the SoC allows just 32-bit register accesses. * * The Samsung s3c64xx SPI controller are used on various Samsung SoC's but * differ in some aspects such as the size of the fifo and spi bus clock @@ -156,6 +157,7 @@ struct s3c64xx_spi_port_config { bool clk_from_cmu; bool clk_ioclk; bool has_loopback; + bool use_32bit_io; }; /** @@ -412,6 +414,35 @@ static bool s3c64xx_spi_can_dma(struct spi_controller *host, return false; } +static void s3c64xx_iowrite_rep(const struct s3c64xx_spi_driver_data *sdd, + struct spi_transfer *xfer) +{ + void __iomem *regs = sdd->regs; + + switch (sdd->cur_bpw) { + case 32: + iowrite32_rep(regs + S3C64XX_SPI_TX_DATA, + xfer->tx_buf, xfer->len / 4); + break; + case 16: + if (sdd->port_conf->use_32bit_io) + iowrite16_32_rep(regs + S3C64XX_SPI_TX_DATA, + xfer->tx_buf, xfer->len / 2); + else + iowrite16_rep(regs + S3C64XX_SPI_TX_DATA, + xfer->tx_buf, xfer->len / 2); + break; + default: + if (sdd->port_conf->use_32bit_io) + iowrite8_32_rep(regs + S3C64XX_SPI_TX_DATA, + xfer->tx_buf, xfer->len); + else + iowrite8_rep(regs + S3C64XX_SPI_TX_DATA, + xfer->tx_buf, xfer->len); + break; + } +} + static int s3c64xx_enable_datapath(struct s3c64xx_spi_driver_data *sdd, struct spi_transfer *xfer, int dma_mode) { @@ -445,20 +476,7 @@ static int s3c64xx_enable_datapath(struct s3c64xx_spi_driver_data *sdd, modecfg |= S3C64XX_SPI_MODE_TXDMA_ON; ret = s3c64xx_prepare_dma(&sdd->tx_dma, &xfer->tx_sg); } else { - switch (sdd->cur_bpw) { - case 32: - iowrite32_rep(regs + S3C64XX_SPI_TX_DATA, - xfer->tx_buf, xfer->len / 4); - break; - case 16: - iowrite16_rep(regs + S3C64XX_SPI_TX_DATA, - xfer->tx_buf, xfer->len / 2); - break; - default: - iowrite8_rep(regs + S3C64XX_SPI_TX_DATA, - xfer->tx_buf, xfer->len); - break; - } + s3c64xx_iowrite_rep(sdd, xfer); } } From patchwork Thu Jan 25 14:50:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13531007 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 0381EC48260 for ; Thu, 25 Jan 2024 14:52:28 +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=I14DjYvdI8xpLb1TadLxuyL116UazXxfFNgyA+2mOH8=; b=abFR5fJzhw6yUL 8Z+o4Fzya81w5ayaa3fkJs81O9yXWuKj0ojc78Blrs47oqBK3ZFgJqzfQEOe83vfQdRkZxSn9IUs3 08xaFEQ1UZUBr+7OFKuoxsLr1vfjZ5QN4Ypy1wwHnyPgwSRq9uWVv0btrorQ7dfl3eNCmCoP+fdnC cjWhOo1/gl8ZOlzdBNWF3viYKlIa6nD3aQqVLJpgptm65EFmioEsmp9dqozEkRzh9UOwCwQLHSPFr zL+AQO9PAC5cslsk5kk4833PTJXrxJm9psCySPuJjc9uUy8WedmKM6qs8LjW+xCuc2B0cb2i/V+Ap H0v3qQbiZNvaljnhpmMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT15U-00000000Taz-1iCH; Thu, 25 Jan 2024 14:52:16 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13s-00000000S9A-3bJU for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:38 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40e80046264so85759615e9.0 for ; Thu, 25 Jan 2024 06:50:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194235; x=1706799035; 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=19XNc7jIAxEmcrcFqH2bLQ+8jlId4AXQd1JRVfuNpBo=; b=YaYnzvsWQUyW6zq/hlx8wrzSkG+38q8PMm6eJKtnNwTiw3kEpWdJvjz+m6+avITym8 n0fOrGyw0Sz2Q/PzfOnK8vEdN2Y+Zncc5cVHWLQ0bL5ap1nL8GADYV58YOMzT8KPMqS6 U9XnFNrLbWRiAyZaHOFqHXKVdcOTw+RSxFLETSkimGr1RS29GEhBS29CJM63YADzXs4x XB5EhlE8v13k237txFC961cRKs3xDbeXcMpf8RMD5QUPJSyRMCwsQ2inEFznfYyQPsww vr6RCYLwPwkufDjU6P996yn+kxhWp8m5QLi8Wp2w1tOPj4KGdYW6AWB8SV2Ai7P6ZdVV 532w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194235; x=1706799035; 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=19XNc7jIAxEmcrcFqH2bLQ+8jlId4AXQd1JRVfuNpBo=; b=k6AcxJIsxGJLz1HyY3RgI9U94tdNUrH5udtLF+hSQDygZN3G9+4JpTuGRkPQoi453V YFvREKMgOWMjSq1XYTWPMnkQkHaGl7JMcw3FCDKv3fP+RmpPYtgmbwfFqgZpZMVRMkfH mjpcPMaB96HVDCzXwYamJalaYzF4ksi8XEZVhFdvi9okkW2/u9zjVDtXa227pI4g3n/W WZKA6UfrHb1OZQ23CJxY6dxYh7KUkGyzxnwB+MGjyeBkaVJ/kSjl8E03jNsqE6b9Xss2 QMxW4MuFobRddCqJpRWKdZYMq3DjzY0TR6St4lodqGY8FnX7UL9rLJJRSr+V0ELQiYR0 5pmA== X-Gm-Message-State: AOJu0YzJh9e7aJuCD26pSm5kwzBCFYlA2vHhXZysIB4FGNjSaZ3KBpil I7AyXOlRMZyPs6obN0mbqQql2yTY2jPDJ/VHe/u647wRTK+ImbT4U60MaWPvFfo= X-Google-Smtp-Source: AGHT+IEFr/987GA7O5P+jHyDvY1MNzaWPBQnTT94NwSUHH8TDDZpjDbDCXcvpcmOYFXkXrFx2sxc0A== X-Received: by 2002:a05:600c:5293:b0:40b:5e59:ccdb with SMTP id hj19-20020a05600c529300b0040b5e59ccdbmr659803wmb.188.1706194235159; Thu, 25 Jan 2024 06:50:35 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:34 -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 27/28] spi: s3c64xx: add support for google,gs101-spi Date: Thu, 25 Jan 2024 14:50:05 +0000 Message-ID: <20240125145007.748295-28-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_065036_954481_26D7CAF7 X-CRM114-Status: GOOD ( 11.18 ) 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 Add support for GS101 SPI. All the SPI nodes on GS101 have 64 bytes FIFOs, infer the FIFO size from the compatible. GS101 allows just 32bit register accesses, otherwise a Serror Interrupt is raised. Do the write reg accesses in 32 bits. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/spi/spi-s3c64xx.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 35a2d5554dfd..e887be6955a0 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1501,6 +1501,18 @@ static const struct s3c64xx_spi_port_config exynosautov9_spi_port_config = { .quirks = S3C64XX_SPI_QUIRK_CS_AUTO, }; +static const struct s3c64xx_spi_port_config gs101_spi_port_config = { + .fifosize = 64, + .rx_lvl_offset = 15, + .tx_st_done = 25, + .clk_div = 4, + .high_speed = true, + .clk_from_cmu = true, + .has_loopback = true, + .use_32bit_io = true, + .quirks = S3C64XX_SPI_QUIRK_CS_AUTO, +}; + static const struct s3c64xx_spi_port_config fsd_spi_port_config = { .fifosize = 64, .rx_lvl_offset = 15, @@ -1556,6 +1568,10 @@ static const struct of_device_id s3c64xx_spi_dt_match[] = { .compatible = "samsung,exynosautov9-spi", .data = &exynosautov9_spi_port_config, }, + { + .compatible = "google,gs101-spi", + .data = &gs101_spi_port_config, + }, { .compatible = "tesla,fsd-spi", .data = &fsd_spi_port_config, From patchwork Thu Jan 25 14:50:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13531008 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 17B74C47258 for ; Thu, 25 Jan 2024 14:52:34 +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=ddW0DByjBkT1Wiz+b9y68g+U4dbgwicna1puEjpX4Rg=; b=M3aW0gXAUhQyQU FWyQJbO8Fdvwim5hzwV+b1OvtbO6WeDwZufbTAgmwtUUsoNn53Bawm3fDswa9Hc9yG3r7qNpHnjp0 yOznul9OTzOvs25MUPKkvLM2/gpI8Dc+ADvd98mMjfuo6ifJ0za22Z0kjne/eVeDw9A3Vd2ga+r5M zCBiCvmCo2ydJNvuy6A/PEAKwUyBcwW4oxIIsk3EmIdqZBowDUhOCGutJZi8zDBgJY5B5FSv68h7H pMdWob6gel2wZyo/L6/4bRCgEi5vxMo0IipNj7TcpPHNDbcNqlLehhucN+d4jfRKxc9RB8C9oX9aG Mbc4CAgmse/oqWwL1Nfw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT15X-00000000Tdr-3W94; Thu, 25 Jan 2024 14:52:19 +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 1rT13t-00000000S9R-13z2 for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:38 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40e60e137aaso74624765e9.0 for ; Thu, 25 Jan 2024 06:50:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194236; x=1706799036; 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=G4aDiYMz53oQSBvKn2Ur1bqI8j5m6Uz7Sia7O2YMwFw=; b=jD2xwmjoUvXlFSjtjl2s7G5kEfVBgAejBnnKIqnEtHKZFSvDjpSXCsSe9c4grbYYH7 WiKws+fuFT4vI+YYs6OIt/tdtymE2gPhnTULTw9DU1I2AnvJV2cpIAB/vM3vQIMxlMvs 4oUvD/2My4A2EuWgRd/gTGxcI5fFLUwT4erUyPkcrO8Rg6w9+fbP+iVw2ox86tnWdSu9 vwSeRcsGsr1Fjfo6xHNUF7dbNuSirpB4ic+pzMUVGvAls+luCjODA/WloR7YHKaFuL6M bz+yIAiaw1THsjZr6WftWw7MvVbAb6M34W7/ZtfHBXsH33VxILfllyPrCV+ssZcH1AE5 S1dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194236; x=1706799036; 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=G4aDiYMz53oQSBvKn2Ur1bqI8j5m6Uz7Sia7O2YMwFw=; b=NM+BmrQbM9iTYoP/sowD9pQGUv3AQFpQWhBCvPhnEUXDO/NzHFue4+Vzk3B6QIPTcY RwEGHvWX4HvQEbql4aiEiB4stAqNPUBip8LSj0ZNUr9q9rFHjki3v7+Ej+FToS11/FWd stysblTahLBDLWxCQuE2UfX9X+TwkB1bsTi+8SzeQKIFz3I8squ7JsGaTifLapUpVRtW m9JDvI921zDusjCZJUg0KEPoC1owJbssDBo4q63FeuQ2/MTn5U+7XD8zMl6BEfTKdeFU HnQFke5vqrvZW49cSfIEWvDxrGTZuG4sf1iCTf1Dvxp6PjMXoZqmTdGv1j95vEckD33y Y3lA== X-Gm-Message-State: AOJu0YxTE4zZ7upWEyTv0RFxDALnYgaz/HSgQN6Ftww/AIM0PPLeuqAA NUf3DZr+4aF+zq95hyeUVCVVUzkCevlUe/FI167Ycug26zE3iafDOwLuQEJTdQk= X-Google-Smtp-Source: AGHT+IE7/zbpGORnJLRqmbZzk50i5Tn1H9FBZ7QHo75PUDu0GzJbbvQE4kU1u7rK+rLs/4lIcENVtw== X-Received: by 2002:a05:600c:a45:b0:40e:c309:55d1 with SMTP id c5-20020a05600c0a4500b0040ec30955d1mr383831wmq.91.1706194236022; Thu, 25 Jan 2024 06:50:36 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:35 -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 28/28] MAINTAINERS: add Tudor Ambarus as R for the samsung SPI driver Date: Thu, 25 Jan 2024 14:50:06 +0000 Message-ID: <20240125145007.748295-29-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_065037_381294_ED619078 X-CRM114-Status: GOOD ( 10.11 ) 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 I'm working with the samsung SPI driver and I'd like to review further patches on this driver. Add myself as reviewer. Reviewed-by: Sam Protsenko Signed-off-by: Tudor Ambarus --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 8d1052fa6a69..b9cde7ed8489 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -19404,6 +19404,7 @@ F: include/linux/clk/samsung.h SAMSUNG SPI DRIVERS M: Andi Shyti +R: Tudor Ambarus L: linux-spi@vger.kernel.org L: linux-samsung-soc@vger.kernel.org S: Maintained