From patchwork Tue Jan 23 15:34: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: 13527625 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 68FAAC47DDB for ; Tue, 23 Jan 2024 15:35:00 +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=hQX0I7bJs/UVbTvEDvXQffPtPXEd/vovETSEt/TW7gM=; b=Rfd0AUXWaA2AGo GrgItpcaA68KoSooqftkmrwsf1RXtTtK5L1DW5AxsS9McJ/YLHtgwHUENNk9VKXPAZFxEu1K/BjGE Zjsz1YKd7EiCuvM1NBW+29l0LaekYEEQTkcwm9B9wycl7PSAFxg+IiQU0JdkHpWsEF1kh81Zf/4T7 Dyv9FL1s+N5UvWUCkPXEvC1VFEvbxMZlda+IBCSmO1rnFdl8TKNfcMhlwR580yfAUbcySOUYksdbR 4BM1JKP8mh7jaBnaooPsAXlS2iYa52XC5C5QJe2cjlQXt+63UHxahDKA2p1bPBaIWUV4wEmg8k2l0 oGzlB6qgdjt1Xe25IJcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSInM-00H3OE-0W; Tue, 23 Jan 2024 15:34:36 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSInG-00H3KF-11 for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 15:34:31 +0000 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40eb0836f8dso17922835e9.2 for ; Tue, 23 Jan 2024 07:34:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024066; x=1706628866; 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=VjipWcrbNy/QID8T6cAOMZwyasQD1NXUWSbF3OJYF5I=; b=IO3HaSzsRQIUWJfHvDzCGI9Vlhw3HMnD7on+XUKBXRtFKGOPV2liS6LjEQcCXCTq57 idUSSe7jGrUwsWlpHcM7GRqc79yRYYrif9opSp8WPvVSBRv3Spu1BIfYcEzId1gDTope JVZD2unIrEJpdtZmCYOE6cp1NG/wdj3i6/0LJmgV7bth2dwEefKMJW2Cn7huwa5Fs4v8 M+z9kN+7Z1l5gH0S9+f0VRP3t75CavlfETdii/2UyNHHYwVFbEuJk4u0C2ZDfEYa1NRw Szbr+P2El769MPvjU+y3zKrzoa4W87aKjUAyC1wZEB7CnG2KvnFCIYAMDqU4qEoC59mL 37EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024066; x=1706628866; 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=VjipWcrbNy/QID8T6cAOMZwyasQD1NXUWSbF3OJYF5I=; b=HhGTQA6hbFy5UbCAwcr2Q+q7U3bg0d2+ltimyE76FAAd+/EgPBAzCsFmXzAJNe+ior VNeFEmz3da9By64Y6cfrMTrh9PFH3K0BKNJvwAe+3bTEOKiui3w6wpaogAuAy4Snw4fY YFNVrCEJXwJ6jeDTLMVitKxdBvlvi02JLOV5JCLwcJR06L9Q/P8e+wo6gD9olE6S+Ne5 6JrALuGVkbSU7PKA64Z+zNEz28v2d3XfGQt+dGHgbmXRZTNoeA4K0PsEBy7X//pS2cME ZC3yJldp+MVs86rvLGJg7kHQIUpWCulutaLLKdLPriqGW5c2KI8czvCXL+fb2aJ2SfqR ZN8g== X-Gm-Message-State: AOJu0YxJ0AZyxTjJ6vgVNAZLmpNcZUXehvXk5rugEW34E6MJ3vVOUPkm bospmO7kYtnFQ1lzgS6buPuWFkdmWKDmOGe2yoBxMnFNTIP1QZ7feN1K+Knp/Tk= X-Google-Smtp-Source: AGHT+IHosPR7aXkGESXR19H32liyG2yCDhVCsytyJRVKkzbH8iGrmrZbLr9K8ewIBbwBtT6UmR9VcQ== X-Received: by 2002:a05:600c:9a2:b0:40e:4694:38a6 with SMTP id w34-20020a05600c09a200b0040e469438a6mr248582wmp.157.1706024066574; Tue, 23 Jan 2024 07:34: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 p21-20020a05600c359500b0040e3488f16dsm42457536wmq.12.2024.01.23.07.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:34: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 01/21] spi: dt-bindings: samsung: add google,gs101-spi compatible Date: Tue, 23 Jan 2024 15:34:00 +0000 Message-ID: <20240123153421.715951-2-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240123153421.715951-1-tudor.ambarus@linaro.org> References: <20240123153421.715951-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-20240123_073430_355512_C8D05CE5 X-CRM114-Status: UNSURE ( 8.64 ) 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. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Acked-by: Andi Shyti --- 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 79da99ca0e53..386ea8b23993 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 Tue Jan 23 15:34: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: 13527628 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 254D4C47DDF for ; Tue, 23 Jan 2024 15:35:06 +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=1tOQJbvZoauM3IHtBcO2UJBozhdi1OoquWm1pmdTeHE=; b=FHfkMRT08NJT2o XTkOqn7+JqEBBO3Qm4rI6RFPfXoRbxObAdhTeJkJJd3gsGflUJMPeG68QTO0IV5Ip3LepwPceX5zg LHSfzG6Zg1hxP3NzYkkFWz2rwdGX6KXBkfWbhsMpKe80GojyTKDmjgOhFVnUyshV5/KzVD9mNvl/P YV4eCWe7odE6barTIHDTQeYDX/hpF4gfBpfgUtJjODPoS3Cdb+mQIPLNDzvQpsEm/DZ3Qa8KtxUFF AvZeWLZdg6Pl6haNbmGUDf+Pm5/0/sqKwJAhqpOivqK0EZioNiU5vhB6nXIrmm47+Xbu9erjWWz5j ubGqwA1qfnpusqPwGUxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSInM-00H3Of-2Q; Tue, 23 Jan 2024 15:34:36 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSInH-00H3KU-05 for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 15:34:32 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40eacb6067dso27103925e9.1 for ; Tue, 23 Jan 2024 07:34:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024067; x=1706628867; 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=XigujyuTekxObecLRQT69LgHjYiW1lnxBRIg9BTFsN8=; b=Drktp5WIbPftsLPnIVKyKOZl4mRb/y0KRfe4Pshf/ew5g6pAv0E7/35gBnUk2+sGXo c9R44aDjF+ZIOE8jZw9DUjsgdpJF9rIuJQS1RzfQ65KXp/r2p22rO9liQ/krDWQHYrof RcYijrRk6NS8sChF+jAGPVr1Zu/baSHUpaEm7W0rHt0Y68pWtlgHuL3MWAev+zVrZfgg jnlfe+j3t5/9umxsmx7ahtXDjReRoLkMFyMLjFmykSD4Ht27R0zq5U2cDjZnknveD2H/ tMufXKQaiS4bidBnaRJiaZyIfJ8M2zVt1mcX39GNQVxRQTjLVkkEXuj9/RzRiV2DlLMN xHQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024067; x=1706628867; 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=XigujyuTekxObecLRQT69LgHjYiW1lnxBRIg9BTFsN8=; b=J99bKGcQTiDm5qcG2p+h0XKa2S9EI0X4y/pNv4ny7TYC7Q5KZc9UY+mfgc5zd5yaU6 ZAgVjenCaMlYhCkzzJZD0OMupp+92DqP/gav8PZ9jkujVank8EVOp+zEQ7PSIyNynS/O jTN9vlvZ6Z76g9RUudllynjlPVph+i8WhRBWHIE6CUDewuDi+UXQDbbpbp3OX4Kk5mim PRzpQBof8ocG1T3yfM7hWTkWIoOBybUy+GlfvnAHSOiM+vRnA5VrA8NHiilJCow41X3v AgbKe1B/PEhVsF8BXSb6zGnC5TaWTqg5m9ZnRzQLqfBOSbSwnbx6M02Ak274noMqcXKg xP7g== X-Gm-Message-State: AOJu0YzfkZvAXD3I+nUuCZ5T6rbkwc85+U60ailFmF7DrF6/Ge3QWHTD y7V/anDYdRg3FhSg8bjTcIIeNHeEpkXgOdIxP1Zt9+efbz7x2V3x6cOUBLlUQyU= X-Google-Smtp-Source: AGHT+IF1ROX3DbhMGiVBd3XC1sBuhtQqNpsdEmdhphsiT0Bhxh5GRHz0uW02UEB/+wKq7d65pkfsCQ== X-Received: by 2002:a05:600c:3ba2:b0:40e:a328:25ff with SMTP id n34-20020a05600c3ba200b0040ea32825ffmr344127wms.93.1706024067183; Tue, 23 Jan 2024 07:34: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 p21-20020a05600c359500b0040e3488f16dsm42457536wmq.12.2024.01.23.07.34.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:34: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 02/21] spi: s3c64xx: sort headers alphabetically Date: Tue, 23 Jan 2024 15:34:01 +0000 Message-ID: <20240123153421.715951-3-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240123153421.715951-1-tudor.ambarus@linaro.org> References: <20240123153421.715951-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-20240123_073431_064340_68CF944E X-CRM114-Status: GOOD ( 10.53 ) 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. Signed-off-by: Tudor Ambarus Reviewed-by: Andi Shyti --- drivers/spi/spi-s3c64xx.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 432ec60d3568..187b617e3e14 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -3,19 +3,19 @@ // Copyright (c) 2009 Samsung Electronics Co., Ltd. // Jaswinder Singh -#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 Tue Jan 23 15:34: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: 13527629 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 CC18AC47258 for ; Tue, 23 Jan 2024 15:35: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=MroH9i/Zk6Z+9zXVzQRT1LywEj241S6gE+NRuNHdjVI=; b=lESenbuc7U5NKp wAVJ/JSP6u55Hj06Am060cWTWGU2JqN5U/DP3t4od2d7dABkZ1BDvmK+YVQxNCJJwDgVzAcIEmgsz 8WDQzFp/Lf4rXk+UcxTmv+DSfpSQMn9/erfqy2u53d+AeLtAxCoV88K4gpdeF6d4fp2Qf6QB4LN2T xXDwrQn8A43jOL6g36KU2bjVROCOltDeb18AJhJV8gerxcufJ0uqeeJLFaVMWLQ1BxNZ7ZHJqEcWN ZplXH+DcuAakQJb/Zqos9jqNifJeRjzk9ZkfaISZNUs799+PWe+Nqw4OrKihb2HFEg+bJdO/Wd/Z9 fZ3/F1dHE9T6KmHxqs6A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSInO-00H3Pb-18; Tue, 23 Jan 2024 15:34:38 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSInH-00H3KY-2G for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 15:34:33 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40e913e3f03so56390225e9.3 for ; Tue, 23 Jan 2024 07:34:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024068; x=1706628868; 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=TlhyzNjFt8B4egY8fYl+NmfB3SAkzLPxUZ0BvmIG80I=; b=PKRCr/pHqWnchr5+s47nq/0xDFxbyRR49jUPe/lhTlqQMnemHf3U5CwK6reRUAVPB0 0cyoQ5fiS7u/zC/0w6PEyYvg/qKejV6zwtih8f17xz9slOP+ER98FKPq7U3vxUtskN0Z 1PS/KtbdQQaSYvMHUVL8je5GaigsuDcgQNQ3ldkI/snF8F/SR0WRym1HIm61wU1xQV+Q WO724XnSbZW39kB4hCrhYi+c/0VFFe5dw26Uj26almuzGvtxCL4uTIt5qqDf6FvsVxb0 pUQ4PiDXorvyn+E3/TNwFf452lK25tXykNMUSGY2slalnLE62J7Msz+29wcChi8SrRTd 3pYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024068; x=1706628868; 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=TlhyzNjFt8B4egY8fYl+NmfB3SAkzLPxUZ0BvmIG80I=; b=aP28RA+5xsB+NCoip6hPskawyghA+qY2mypVsNYp1X0+L2WEq341g78xxEX4Jg/bge 10PIudAtx7vNJI91hmfy9RJeXw3H4rVkJlJFFP+F8GKYpCmYyDYVmqnsza27n3dxrXni Gn1dXpbiTKQv0EEVBnaTOGIk4gZaIRCYn0BIDC0ELY5wuyhKFEPSrG2FSaAMY2a4ipMA iFl0MRlX5ZY/zvUIxagGP/izIOALT+4p95Da8mT2C294ihdpXhWR4jOiJfmmdlqEcDuV tRmi/vjpkHEtB+nKWbAZY/H9vYv+/vUYIUPrE/sGMVXphPEL0wuuJ5jZFQ5E/5Uw/ldC Phiw== X-Gm-Message-State: AOJu0YxDwmnBK6KgwcZkmMhytWSfHEt2t03zjfwEP4J145udeo6T3Fi1 8GKFWb1zntiaGjWZ2UID34bGwr7TO3F38EuK6ZXw0ryscekgvjCc7HdoHmEJk+8= X-Google-Smtp-Source: AGHT+IFZYGuih+06B7G1t7JNngFPHTbZIv3BFvbVmmj7HCjRI+QxjvRyDu/w8RFd1+v88GBtB6rn1w== X-Received: by 2002:a05:600c:1f81:b0:40e:a7f0:a0f8 with SMTP id je1-20020a05600c1f8100b0040ea7f0a0f8mr286487wmb.33.1706024067797; Tue, 23 Jan 2024 07:34: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 p21-20020a05600c359500b0040e3488f16dsm42457536wmq.12.2024.01.23.07.34.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:34: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 03/21] spi: s3c64xx: remove extra blank line Date: Tue, 23 Jan 2024 15:34:02 +0000 Message-ID: <20240123153421.715951-4-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240123153421.715951-1-tudor.ambarus@linaro.org> References: <20240123153421.715951-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-20240123_073431_984033_283F737E X-CRM114-Status: UNSURE ( 9.65 ) 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 Remove extra blank line. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko Reviewed-by: Andi Shyti --- drivers/spi/spi-s3c64xx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 187b617e3e14..26d389d95af9 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -16,7 +16,6 @@ #include #include - #define MAX_SPI_PORTS 12 #define S3C64XX_SPI_QUIRK_CS_AUTO (1 << 1) #define AUTOSUSPEND_TIMEOUT 2000 From patchwork Tue Jan 23 15:34: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: 13527626 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 62BFAC47258 for ; Tue, 23 Jan 2024 15:35: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=gnvcWxIU+rARYoVarbFm34b4jNo3J2Rbx+KVoErLZtk=; b=LLtHC0nQ2zPlzN Yfheavfl+VZHTtGk1VYFDRVLkxIXc3pB7UiNc/0phDCgrZNACRe5z93DHSSg6tzDRPQUQD7h5PTMK UcWrrDygmHbGlK6eUV08inpX/vN/N0+3kwzsElZVooT4EU7N9RYNxhe3sdzxEEobUUJUzNYTlJTkB +KBF3zMtQnnPHbnnAG5HaS4xMiY2V94eOYXZn15QXSmS3BETxWIfDW7BQjXsz8G4rxN+Jlljl2xgP 5wQCxPFv1yDuSERfANqLSUy+TbTRQuob8F2kYV1kFBu4TRZxlBVkt7rRum6j60OgEao33Mpx6yqZ3 g2C09aQJdXswuJZ+Xotw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSInN-00H3PI-2J; Tue, 23 Jan 2024 15:34:37 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSInH-00H3Kb-1c for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 15:34:32 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40e5afc18f5so48814255e9.3 for ; Tue, 23 Jan 2024 07:34:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024068; x=1706628868; 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=GYolP7qSHiJsNw4Rdgmh202yjvtbAUk4vGAE3cDed4M=; b=HIV/LlEuJk4IEgmB3bNeCR/my2UZ/BrkvXqPAe2aFa2P7XET4qz7erP286nPaoZ0IH LVrNeotkvFxTm47JrhzeLrFhxxMeqqFtzGZOAFPfJwPsyQsw4uNaf5lgcuNmnsBUyk0h fBk1R8odx0DoM13TAeicTHeHWmH2A9YpmQPgLBvV1qWWvWEpMGSUzLcOxbBTtpJP47wO bOz55IerW6JyJxsi2JhJ8b2TgDm9eUVL9usRJhRG5gB+IMV04fGL9ORaGFwU/fuXR3iR +RIMrn8bAGrbL+cAUh66ywXMP437Yo2bvhKpnhpIhvA7B0ldr9rs1zv+/bj8/y/zPY6v f0tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024068; x=1706628868; 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=GYolP7qSHiJsNw4Rdgmh202yjvtbAUk4vGAE3cDed4M=; b=KHirGeWemmF1oiyN+1A8HlwpkUVcoBt4StqRCNVF/nYbLn4GQbkaLuvIxd9vceV8d/ TJ7o8S+HBPZ4aAC5NJgdQr1zxRdx4S7xk/UtYhY8/gKnzOStGp4AA/xcG30y/DEdF2g+ UgNDR0xx6p2sVrn7rGNK6WeYKF2wwzSJqC/Zj5ocP4RI2lYIoegff2uR1Z9/jHZhWoX2 hgXGiFps1Q4A+wS6ljFSy3v0XXseGjFBC0SOQhz1yK1ZLXb8IxJISQnUOCFZq2oqbula /SVVhn9Ff1Vy1gxemQF15pw8SXrQHEGG+ksZM67EKRDtx6MVc1jCCFKUc38Ve9p6+QG1 VJLw== X-Gm-Message-State: AOJu0YycGkQtofxCdb4INtESoI1kAteDIGieH6uFd3ft34Gta1+c4bf8 sE0ulQHg8sHI297sFZgEQI3gJ9fBSshWorkPBN3WRS3BebEX6rTugUqTJdKLsU8= X-Google-Smtp-Source: AGHT+IHWuxpxzMg8g8EGj2cXNPfD+1g/XO+XPmUi/g8fAIxbN4ApYg+KOHjM4WPsFejLGkzpu2Gcog== X-Received: by 2002:a05:600c:2d16:b0:40e:5571:2c6f with SMTP id x22-20020a05600c2d1600b0040e55712c6fmr254080wmf.67.1706024068416; Tue, 23 Jan 2024 07:34: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 p21-20020a05600c359500b0040e3488f16dsm42457536wmq.12.2024.01.23.07.34.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:34: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 04/21] spi: s3c64xx: remove unneeded (void *) casts in of_match_table Date: Tue, 23 Jan 2024 15:34:03 +0000 Message-ID: <20240123153421.715951-5-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240123153421.715951-1-tudor.ambarus@linaro.org> References: <20240123153421.715951-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-20240123_073431_579284_3B0B01F8 X-CRM114-Status: GOOD ( 10.60 ) 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. Signed-off-by: Tudor Ambarus Reviewed-by: Andi Shyti --- drivers/spi/spi-s3c64xx.c | 40 +++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 26d389d95af9..b350e70fd179 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1495,29 +1495,37 @@ 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,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 Tue Jan 23 15:34: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: 13527627 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 A3E54C47258 for ; Tue, 23 Jan 2024 15:35:05 +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=hsercxkJuKted+08NdMQPeSBwcqfcVBp8VbAApBafB0=; b=sRTdzd0W3h09td YprsqHJz81eN0n1UAUryrfBLvUSi93PxxEqjXtV7ashww0PnZRVUGpJY4VtyigpUUTsXSq1wSfSVL RQ17ABTzjzqHEBD+/K00KkA8KyjFoQoJEtDzdR9DJwWxMA/UC1oWyidEtEYxX+sCvMzb3Z9AO7V4v CS3HxZdZTC9cq0B8AnVp4nka88IoSNUVt1rel/uY+IYroI9+mq1MoSWGHruO3Q4PNdsRy0Phaonqc 7DgD5GKQO7ksgw5nZck6tCB/lSr8eCmMi41dt3aToeQDqJBvcD7Wx1xHel6mHD2q41aISt6LUuJrO NOyVZu8x1lc62T2Z7upQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSInP-00H3QQ-0Y; Tue, 23 Jan 2024 15:34:39 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSInJ-00H3Kk-09 for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 15:34:34 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40ebfc5fb19so6462285e9.2 for ; Tue, 23 Jan 2024 07:34:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024069; x=1706628869; 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=9OHi5EgWCeJpCVpQQS24DPa9E+cj9YStk/+6+6uJiCg=; b=izfCDxlHrzpjKPO7CUUl+wCx2I4ZcqabCkqXpbMpvUuoS9o8+OPWE0Ex46QpH7qXQp tJ9tjyup1e+7o2XJazC5eTJ9fYsoeywO4WWrgayZWgwOoEfK6iQm5LFzOtMsYNMrU580 bJKmL92aNr43VI51niBbrS2fpgKtSrNFIV2CJeMYxb6wHh2wH8Jd/Krng9s/nLZUCUHq cszBC/HSHNeXKcDNodg5llIp4BZanXsCPcOeTd9Ers4R1nA+HawuZspBRQsJ425LNxw5 rhZ5h2Cfr2MzzPZ0aWpsTRMVMb40ZDAwaJj+ueXy3VbXLNtMRiT857xcSqCRuBWuo1RX 1LRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024069; x=1706628869; 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=9OHi5EgWCeJpCVpQQS24DPa9E+cj9YStk/+6+6uJiCg=; b=vDXGcJYxhP7kXZ0Gi1btpARZL3IzRfcKMobvJpoW7GIHAzgD7COFjxYt8nN6ganWaa qPXxEJlojpcM/J1R31zpkI/8v4GB4sRh9nLCx8x3kCllOLyyRVzNvYqDgrGECiF044KZ Adptuida5hwF+7we2rz/cvlWkcVLx8sSO1pgvqQY5jmtx5A+ZHDKctkxTEWrc/DSZSf8 0CWoftj7cE5txPKihAGBVoJVxeHr0ilThtcHolWBzFdYODcuXbUk+b4zwmb7MuAoCSHZ M1o801pJhMtZgljgNHDCNiJA4nRXgeKnE+TQU3hcxHHzF6kvwJy1hdIAkMPw4hfHmwxp GrJQ== X-Gm-Message-State: AOJu0YxAMQ/UazkRLedd354spCNqJsxvXh6y4TjGBUcD1Lh/XGYE/Npg Ny3uTIiaKYPKLcAxFlAOP1HHTtwgvmKtIivWmmxhTAf3mdL1bIbegexO2srfogw= X-Google-Smtp-Source: AGHT+IEW8wM8jKrmBHWu9oFzJXlcGywLUYOu5woE/V+wgfwbWwJGW6Xexs4KhMhkqwE1PVcIdJYUoQ== X-Received: by 2002:a05:600c:2053:b0:40d:3afc:9263 with SMTP id p19-20020a05600c205300b0040d3afc9263mr175292wmg.104.1706024069457; Tue, 23 Jan 2024 07:34: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 p21-20020a05600c359500b0040e3488f16dsm42457536wmq.12.2024.01.23.07.34.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:34: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 05/21] spi: s3c64xx: explicitly include Date: Tue, 23 Jan 2024 15:34:04 +0000 Message-ID: <20240123153421.715951-6-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240123153421.715951-1-tudor.ambarus@linaro.org> References: <20240123153421.715951-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-20240123_073433_084365_BC704C41 X-CRM114-Status: UNSURE ( 9.28 ) 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 . Include the missing header, we shall aim to have the drivers self contained. 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 b350e70fd179..9ce56aa792ed 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 Tue Jan 23 15:34: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: 13527631 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 89BC3C47DDF for ; Tue, 23 Jan 2024 15:35:38 +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=tUcD6YQXYAO9wwCkDZGgvJsFZgAAAJYAeetXpT0mpwk=; b=HrJ51U812YR8ty buB4T12fUhwcQqEvCPW+BL2mxrAotS7C4yc4pAXL5tuEca+gQESXB6tMeefYO4GvpEgTFjEKVy8vk WpyhLZcJ0m6xx1Z8des6UCe+3fof2daNpc6d4SDVjPwoZhKb9Zb9mgjeu+97sTZcH1so9jsL05pEJ iuqXuuR8UDdH0qqNm6zbBJtWxVyVHOrQ4fc7aaDmU260WPvhCzFO7ErjOtQMTB9r+NFF8fxYhmBKE z84znWXW8ze0Pxmmy10q/pRXDVHAIZzMreng3u/6zt7WyvbSRiV1cA+HbRHQc83wcFsZfS9uzRl5a VH4lZtw97yvgF1te//ZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSInt-00H3o7-2c; Tue, 23 Jan 2024 15:35:09 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSInK-00H3L2-0i for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 15:34:35 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40ec3535225so1664215e9.2 for ; Tue, 23 Jan 2024 07:34:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024070; x=1706628870; 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=RUhqsvib/uXsB8/ZG1ztFE4b7a6LgsyBrst5iQF/X8M=; b=JvveZfNWtzWVm3fMoruW3FB0E/4veNl1084VjqdfK5r/i4ITqTos9F4cX8GX9St2qD k8TPsS5jKmzE91TMpXCBxdF9NGSDhbM19mwuJ5lT73h7a8/1kwMoNZz8nKiXcY0+X2Bq LxZcRFhNU4zaT4maH0rJvipZiV6dwstIjBawvXMimJPe4zgZnVk3uoJbjbDum6nsoOnO BY27Q7Jhxb5BQmiMnSamg005lfAmsYGgS6APulbUTQzCSh/d/slKCOs9+8oauJtKJJ45 Re9d5qLC7KWFu9+I1BrFheHIl9RSmu8CyYuS5O4Rwh4eTKxHNBKlZgc1EIo/vwcVvRyK htsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024070; x=1706628870; 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=RUhqsvib/uXsB8/ZG1ztFE4b7a6LgsyBrst5iQF/X8M=; b=YIlXULGaXA3iT7f1f8perlRUaDfYrss9TEqa4f8xl3lcOHiFJ1Hdzk/Pqw1vpinSw8 tvfo3xDnuROo6Xa3sj2V6fSxeBnE6Pq6LeGigQrc8XXOoZnmBrU8VR+q5VKcO6QwUmMf MlD+eOSCUT3klkLswsO5k6TFUbLga6wownx72fPdq+y6W4aCQSZ/Nt8N3B+oXG2FF2PK 0JAfLM0YHXxoI3qDhubAKeOMqzQKlYB5asecLpNwCThPARebNTfTkL/jSNQW9z6vZHKe lNfZ8y5t7uF4HzRRaeNoJLxLlO0shg8g+nygBGJ7nzSXEzW0MxWT71/xeC8chIWiEzOD odWw== X-Gm-Message-State: AOJu0YzYR6d0NvcOB3djby83XJC+9pMk29d/7o0AJFiVXbdpkq8y/Em+ A5Tp8XV8Aq1ONosddkll1WsRIDANPnkyXwH0Vm8ucSeFCPpYR/Ifx9SKeSzVtEo= X-Google-Smtp-Source: AGHT+IEUQRFIekgMzpx0cR8sCCVG3w5xgk2OePoUsW4Y1C3evA/H4sd/SqXvBEWXjsocAfm8duQg6A== X-Received: by 2002:a05:600c:1f8e:b0:40e:50c6:3b88 with SMTP id je14-20020a05600c1f8e00b0040e50c63b88mr370700wmb.142.1706024070623; Tue, 23 Jan 2024 07:34: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 p21-20020a05600c359500b0040e3488f16dsm42457536wmq.12.2024.01.23.07.34.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:34: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 06/21] spi: s3c64xx: remove else after return Date: Tue, 23 Jan 2024 15:34:05 +0000 Message-ID: <20240123153421.715951-7-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240123153421.715951-1-tudor.ambarus@linaro.org> References: <20240123153421.715951-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-20240123_073434_259888_526AAFFF X-CRM114-Status: GOOD ( 10.51 ) 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. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko Reviewed-by: Andi Shyti --- 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 9ce56aa792ed..db1e1d6ee732 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -406,12 +406,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 Tue Jan 23 15:34: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: 13527632 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 6D856C47258 for ; Tue, 23 Jan 2024 15:35:38 +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=g4mQ9RrlJROQufbJHkXO2Oc45Uod/FqAApaYmdSv39M=; b=d9DTnzyVwtd+sj 3Dus9ZZnfDj4sv4p21NQsyP3xjHA0Js9DZVFXVSkTOclueH+p4Ds0OqSoZybSJ9eAncTZA73BM9t3 uvGxGiC8v/La7/u3jzW0wW7Zs9KenHXgfj3DreITge58CGUkC2zLu4NLxk3ZOdRD4bTyW0FwPougb G3/wSQFvoVMoS0na8oe4/LtIRcJY9BYj+6sPpZbXNIsv1yURU/r1aGqWTCbyAie3WFy9Yo6Yxa3d5 2T6rN0nNoYkDYe5KOLl+tSKZOQFq3dUa039rvGVWFOgboFKsQjPJjKVJU5kVcNspM8Xr2d890l25f OEGgGq1nXf7x5/ae+Lpw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSInu-00H3ob-1o; Tue, 23 Jan 2024 15:35:10 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSInK-00H3Lv-1U for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 15:34:36 +0000 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-337d5480a6aso4278570f8f.1 for ; Tue, 23 Jan 2024 07:34:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024071; x=1706628871; 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=TOeaP+uQvqY+z2mWaYRhy1CLD5dZOaOwjcdl9nFCka0=; b=gcRpr5TzXpas3dydfgrPdrucZU9XK5pOUx4A5oLh+a2JXyyy1NxfjtWvq8171oStIf AuVYB84CcFdaB+ir8K4rEqxEqRj23uIhnj8EaOM0E6SdRSRP7n1p8PjFhNMs/WFDF9nK rvavvl9SA4/tmD/bBUvUXKO9R52pduxDnE/9jjn+/hJGVYYDq47z7nAaBdO7Wo0cgza1 sPEtgAOik+Uxde/Lf1TQV96biMC9F8fh5YZL3FKz/4Jf/cfmxw5v1UV/kgqKEf14Jo0h VacLhx6dZh8NHUKoAOtFuGRYY9KIELZm91QAOqC9pwxtiofMsrz2d6UJFyK8AANe/JMS YadA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024071; x=1706628871; 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=TOeaP+uQvqY+z2mWaYRhy1CLD5dZOaOwjcdl9nFCka0=; b=XuSjF9lMkS/JRyUorcAa/JRcJLcKT07P4DVECeelgof8Bw+cyme/a8VeHlWwJoJ6gi rBTD2VPConBDVDDJ6AcGD1YBKH46wVIbPjFy5wf+1nDK6GpAC3TVDibh44T2Ovsf6F3C v9zCgFaTczeMqwNCCUsXXZwuWTXqeErpVtDFWRNl6j+qfj+e9mKQa/e1DhyljyvTNODr 75k3CyI4mipR4amT3GVtYJJlYAnZhJVmCW9edwh/BfvwDTH1rP0RneVlnrV4UiVgV0tD 4cUbw2hvtshN2NFaCs4qbGjasVFg/Bu5LJDMK33BScsBtk3UJd/1YJ0+ZjX9XqJE1/it bF9g== X-Gm-Message-State: AOJu0YxZaBLE7nLZ8fbfOQRBpdf8WGbOQbsv72Ay8Hec52QaQZXhJMl5 VgYopiuIezYhHlLUM13h+NdPEWm4Mw6i9kQH3IH/DLVYuh+OkxuXq4EaxJMADCs= X-Google-Smtp-Source: AGHT+IGkWbV55/MmrTK57oh/po/OTjbqpTK3Dx13U0dgMMaMNXEqC0k6UPb8hTivxpsDPwAhpDNUeQ== X-Received: by 2002:a05:600c:538e:b0:40e:6d7a:f9dd with SMTP id hg14-20020a05600c538e00b0040e6d7af9ddmr275420wmb.47.1706024071685; Tue, 23 Jan 2024 07:34: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 p21-20020a05600c359500b0040e3488f16dsm42457536wmq.12.2024.01.23.07.34.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:34: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 07/21] spi: s3c64xx: use bitfield access macros Date: Tue, 23 Jan 2024 15:34:06 +0000 Message-ID: <20240123153421.715951-8-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240123153421.715951-1-tudor.ambarus@linaro.org> References: <20240123153421.715951-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-20240123_073434_505990_1753461B X-CRM114-Status: GOOD ( 14.66 ) 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 db1e1d6ee732..16eea56892a2 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -4,6 +4,7 @@ // Jaswinder Singh #include +#include #include #include #include @@ -17,91 +18,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) & \ @@ -111,18 +112,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; @@ -341,8 +337,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 { @@ -665,16 +662,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; } @@ -800,7 +803,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 */ @@ -1073,8 +1076,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); @@ -1090,8 +1093,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 Tue Jan 23 15:34:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13527630 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 EF1B5C48260 for ; Tue, 23 Jan 2024 15:35:09 +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=RgzuTZE6oYz9lh1tsaKoQCS0YKAD4xyzSB3jrlSLh0Q=; b=Vnz4kW9Dz4bRl3 wYb78P3N9SCSGCWy+jnjs4cuWjoPP+40sLJ1+0IbGuc2c8oLRR/AKT1Ey/gFVmVh5Jv3fpVWiVrcY i9ho9rahx0k9zAqpjQ8E3DSsSTBfdATgHykOmShCE+AinW9OTGmOeAzEo7FQ0QUkyr51Xwyg4bu6G c0ANFBIaEwtin+CO4lrBxoK1/3hz8dYnK4el0fRba4RWNRQGN8DIOXo4BvRm1u39xbgci5b+TjzAq oWY25vtVbEGtebpRnN/s3x8R/uMbumHzLDo5aQ6Xnsb784jwedrAKq3+GauwD2JnYa6iaSEJElGFI weGWqWX0pH/KAu5edUyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSInQ-00H3RW-0L; Tue, 23 Jan 2024 15:34:40 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSInJ-00H3M4-1t for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 15:34:34 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40e76109cdeso49929955e9.0 for ; Tue, 23 Jan 2024 07:34:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024072; x=1706628872; 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=AHAMCRAZbqujp5tmnqVlu3xbp4r52puiDbaaPDxhoS4=; b=UkPmYfq5K6T2TmL0d5zgHAKaptHsS9nlzvUV30i5MZ0lQfDMLUQrtf5FKjiOIK94P2 A1oyZcWQ7EGYEjnHNcRFXLPn4fIPOFpCmjEWTO1XkGrIIijtDXJ7FXRB5bHESZmXzJGu pp1p2QnbQ8yWt/KQrigNuNPLAX8Jp8e+Y0qj/YG76W4fz0Ibcac/vHzyr1AfNeE2ylb/ 0xdXRpF22BFEPCfTGlllUcelK9DptzBE1sarGyWcb9xhOMqfd0kWJbi6Fj/bdwksMQJF bLLXCTPwo47ktDNAdRn/gOQTXtEegEGUfdnEhHtlGHgv4UQhUOjfOwEy14BkMBukVOug yHMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024072; x=1706628872; 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=AHAMCRAZbqujp5tmnqVlu3xbp4r52puiDbaaPDxhoS4=; b=oSR4Z1yg1fr44Mq7smzV2y6YcSbjv9UO73enGgLWYYgXj2x0y2ekz/TeuMMqu24Lhc 50xA+067updf2Lrr+ngp4wZ7nD1hxcxqywQI9hXAwhtcHtG5fjmQHjzHKkJT6I/qmmOP yFbfPljiEMgS1E98alGX10sEmMdGNTzvnkcb9/BhFcWRooEYA4hxOyMPUYFFMcboMnhv 5niN49bkI/bw78UMsJnCmPIM2Qhf6yLzKr7Qu+R8Vx/7140P8P1CDG0sVFONiFv0dvJz TzEBEdxHfL9Tb5+HB5kAj5fZONZSyCTpprudu6oqzxS2uU8adhWYK8lSisSSVI8KbsKH PakQ== X-Gm-Message-State: AOJu0YxbQYA1eLD99xtzfb2jrAltUBx9IiY/6w0sv3Hds3283niyPS7l RSuGcCnUxdGKzO7kNvl7Q2qtvopAkVZLwewjGdxGw2uXx+nL/Uxc2xIhOx+vH8Q= X-Google-Smtp-Source: AGHT+IEawZ2QUjKQsybqiQMynrw5FMreS9VpG6oekTM7Bcb7Eww/T8JFnJKSGqnlZXecULPsUM+uMQ== X-Received: by 2002:a05:600c:21d7:b0:40e:53f7:a254 with SMTP id x23-20020a05600c21d700b0040e53f7a254mr255145wmj.73.1706024072434; Tue, 23 Jan 2024 07:34: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 p21-20020a05600c359500b0040e3488f16dsm42457536wmq.12.2024.01.23.07.34.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:34: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 08/21] spi: s3c64xx: move error check up to avoid rechecking Date: Tue, 23 Jan 2024 15:34:07 +0000 Message-ID: <20240123153421.715951-9-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240123153421.715951-1-tudor.ambarus@linaro.org> References: <20240123153421.715951-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-20240123_073433_625034_BED2EE9C X-CRM114-Status: GOOD ( 13.77 ) 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 value of wait_for_completion_timeout() immediately after the call so that we avoid checking the return value twice. Signed-off-by: Tudor Ambarus --- drivers/spi/spi-s3c64xx.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 16eea56892a2..128c3b8211ce 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -519,17 +519,17 @@ static int s3c64xx_wait_for_dma(struct s3c64xx_spi_driver_data *sdd, val = msecs_to_jiffies(ms) + 10; val = wait_for_completion_timeout(&sdd->xfer_completion, val); - + if (!val) + return -EIO; /* - * If the previous xfer was completed within timeout, then - * proceed further else return -EIO. + * If the previous xfer was completed within timeout proceed further. * 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 * needs bus transmission to finish, so we don't worry if * Xfer involved Rx(with or without Tx). */ - if (val && !xfer->rx_buf) { + if (!xfer->rx_buf) { val = msecs_to_loops(10); status = readl(regs + S3C64XX_SPI_STATUS); while ((TX_FIFO_LVL(status, sdd) @@ -538,13 +538,8 @@ static int s3c64xx_wait_for_dma(struct s3c64xx_spi_driver_data *sdd, cpu_relax(); status = readl(regs + S3C64XX_SPI_STATUS); } - } - /* If timed out while checking rx/tx status return error */ - if (!val) - return -EIO; - return 0; } From patchwork Tue Jan 23 15:34:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13527634 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 ABA7BC47DDB for ; Tue, 23 Jan 2024 15:35: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=M1Myeg6MZNR6EDIzGhuus9cGBpBFRmIsqNHZaKP6iJo=; b=28x3s9X2jybq0w wJg8SoxvLTGfV+HQntRGfz310vAwsNH+vavI8IrG69uZc8YKJ4PkfdfJ406YDHIca66oLW++BQdJ2 XUJgjDPNFWORWzW0fiBDQscNX39VdIIx6aiP6hidNK+esMorRRMCMuSPTx/lW81DNzqbY5/xSkV1L w07t+JRY3Rae22luYT2AlRNSbkXobs3e2hzSRLGGHrIio/AwLNlc/Q9xK4idtUefBhRkFtZrAwjWO Xmi2NxK4BJJoVS3gZAB+lx8yNuCGuqinQeSCG8qMzBc2aQ+YmYWT+JqVultZ20z0sDDLq7IJ9Vp7k BF0Gm/2tjukRyHIrmYcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSInw-00H3qy-33; Tue, 23 Jan 2024 15:35:12 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSInM-00H3NB-34 for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 15:34:38 +0000 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-337d5480a6aso4278594f8f.1 for ; Tue, 23 Jan 2024 07:34:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024073; x=1706628873; 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=1vqPNM01RVbT6WZVcBqWSaQXCmIfHRqWLTf3/DbElPA=; b=fCa/FmOxXjYR97zgmor8S3fxn4dW2LjIwdn6iZnFnD1e8hjO9j1gK7wzFwobcbKY2A w0r9GZL8/eNNagBhFSJO/9uPFinXdufE4/nRwl5B+qX/5p8bNBkHfChmviLfu5NKgiZn NSOYz9Pz5tLfyUonIpJRX9Wwei5RrBtcELKyl4ZT9V6TK7Pbotpc9YrcmsX5CfGQEggr AvTuFif3k0c8iP6yn9B8xOAgrh1rInX/kqivV11Y4Db+w1yWDIhDqucqvm+1x310Kloz xF2mppmkzJOnohCfdBx41Ls3zlFU5hQUNp/tuS+FAMJu242m7WD7t7eNitNJyPqus71Q nJfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024073; x=1706628873; 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=1vqPNM01RVbT6WZVcBqWSaQXCmIfHRqWLTf3/DbElPA=; b=g3am9WjIIUO/du00VcNUxZIV1TgaPFWdtQPF5ODUrZegfvVY6ctE4ZG7yS7GmYr+LS AsKAXVgLeMEKZiQ2ZsHKeKYY4y0ny0q7aiPteb/YfYsSfOlMEpC00bJVNktXXvNQ/9aH L6UdSUZtKwRuQEmIR+PTml6734ct0nNdwNxWVVkbHJ56NTzej92KJ3pC29DZSM71EjAl nq2ld2LJhrD/L4owmsC6CPwnCBTjKKXgs2j7Ju2fSUxiw9ytuBRNllNor9G1hDVPf264 pkrnwYsYrvIA5qbDiMy049nvoAIeSU7wStYlv2sJgRvToGStj8x7O5SNfg6A/ZMiGiyv kXQQ== X-Gm-Message-State: AOJu0YxJgqqQ70DA1y6Q+jzAcQl4YWWQ9eFOxB97XfgP1SAvfGDXYipU yVLHwPfHsrIeuYUX3t/jIbjXUWe5YU5ME2QELCKpzYm0pPii+f+hsN2HKnvkjE0= X-Google-Smtp-Source: AGHT+IEJSsm0JwEG/PJT9w/zaoV5lSJHX44wrK9tJed6SVlw4AsZr/9ynIHMW3t3RqWwTYCplqwvhg== X-Received: by 2002:a05:600c:4f95:b0:40e:bf94:be7a with SMTP id n21-20020a05600c4f9500b0040ebf94be7amr248043wmq.92.1706024073235; Tue, 23 Jan 2024 07:34: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 p21-20020a05600c359500b0040e3488f16dsm42457536wmq.12.2024.01.23.07.34.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:34: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 09/21] spi: s3c64xx: use full mask for {RX, TX}_FIFO_LVL Date: Tue, 23 Jan 2024 15:34:08 +0000 Message-ID: <20240123153421.715951-10-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240123153421.715951-1-tudor.ambarus@linaro.org> References: <20240123153421.715951-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-20240123_073437_046044_7A3B51AB X-CRM114-Status: GOOD ( 16.29 ) 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 128c3b8211ce..a06b83b952c6 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -77,6 +77,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) @@ -107,9 +109,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 @@ -218,7 +217,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"); @@ -227,7 +226,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; @@ -498,10 +497,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, @@ -532,7 +532,7 @@ static int s3c64xx_wait_for_dma(struct s3c64xx_spi_driver_data *sdd, if (!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(); @@ -562,7 +562,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) { @@ -574,7 +574,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 Tue Jan 23 15:34:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13527633 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 44B05C47DDB for ; Tue, 23 Jan 2024 15:35: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=E/eTQvzPSDmzT0qZdtbWS26DMZnW+i8ittl0R1Ar3b8=; b=t+ZT3xLyDmZFD9 wMs4ZqApCpj+rOp14dDG24/gH9+1QKts3OP/p9kG/1Lfd/G1OUrSPQG3jRY3KYCizS9AyuBFdAhM4 CuV8NhMU8hecaoxKGjVP15dmEJk7Be8k71Y90g7YeLCK4PcCSHVuufz2Yk4zJVhsMxWvqoTz+WRib /ru7FyanmCdp+lPumVKLCCg1S9qqkOVfDxzWnGmZHfB8XL3oNZ8U8jH0MI/DP2ZLnQN8yKbqF7AG+ gYv96r2WHNmK71SwW0dZpbd4OHCsj5ZUYtrkt4OitttSez6SmFvOx6jyJbzAsO8An+rOGmGqNrvzm IC1gi/3Z7H5nCGCEXIOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSInv-00H3pK-2q; Tue, 23 Jan 2024 15:35:11 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSInL-00H3Np-2P for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 15:34:37 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40e80046246so27054695e9.1 for ; Tue, 23 Jan 2024 07:34:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024074; x=1706628874; 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=iCR0lpI4fVpLmP3DQ9mG8C0OncX2u+kTHiicR+nRZek=; b=tG6B71nSp6mlX9N9RnL5/hIlm746z9CR0XuCjcUAZPVcjKFIfqYlt68UPl66kfaV2C ebOz2WLw1ymCxGqfPv84N3WbVIVlmxtZH8hAmCEebxNcn9CoUyOgWGjmvu7aHukGdmpE C+Zt6Jamr5VCUHB/Tdno2FNLhQWGv5P923x7CNLCTdREK6JWihmT9xSMrObddNTdgi2s BeQuN83vwOqZP7aK74eeA8BtZlxU2wbefnTldL2sjsKBiwKAxhrpWohilCWjclzp9QHg Nx5PfAtv5e/ep65YWzeRXd4k7PdslFWNKqNUMQi9VJ+5OtQ5AtgeSnbiFlmc6kkpjUxC 416g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024074; x=1706628874; 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=iCR0lpI4fVpLmP3DQ9mG8C0OncX2u+kTHiicR+nRZek=; b=HTJekD9Xk5ryPODS/y3YVq1dc8FzDPG6ec1KRFGKej5eutO0EBmOEFDH2rZCu7uqj0 N8ayEel38k8YjaRkBPcDlFOdRTL2TXdrqmsdVlMJ0ig2B98B+u5G+W3Jt2dHwHyMfutx bC18EU4nc7ENT0XWhmM3RreNOiMzYTHdJfsCmXlI5RO97wKI+tybCsCdkjze0dilshga oExOqjmNKEsPo9N5xFK+cs0zFYt4MV8X9yfC12EKEGSmYkKx1R4kc95uWbz1NpgE8OtQ iTEI7WRShzkLTvZF2Mm5i+MchCR0tph5zS3DP0MYfqsXWZWHIqbUbFghiEf4LGyHU6BA HUgQ== X-Gm-Message-State: AOJu0YyK4DA2KHj7qpbbeGoQmirFnKKb8/mUPO508m2FHqMnV/OXl7Bh Cwopq/Jfg2nD1t+E0s0RD8aTkhCQi+ESWoEMDKszfT07hqvC7pKmoxvmIJbVaPM= X-Google-Smtp-Source: AGHT+IG9ffmjdMTbmPgzKsGlfFXptU3Y/H2kV8L9oXd6VmUQvvbkly+26/+kAPCJ0iTtA2RQs4aNqw== X-Received: by 2002:a05:600c:3784:b0:40e:a366:e718 with SMTP id o4-20020a05600c378400b0040ea366e718mr247710wmr.42.1706024074578; Tue, 23 Jan 2024 07:34: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 p21-20020a05600c359500b0040e3488f16dsm42457536wmq.12.2024.01.23.07.34.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:34: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 10/21] spi: s3c64xx: move common code outside if else Date: Tue, 23 Jan 2024 15:34:09 +0000 Message-ID: <20240123153421.715951-11-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240123153421.715951-1-tudor.ambarus@linaro.org> References: <20240123153421.715951-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-20240123_073435_781958_B31F362F X-CRM114-Status: GOOD ( 10.27 ) 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 --- 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 a06b83b952c6..4b13252da8b8 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -285,20 +285,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 Tue Jan 23 15:34:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13527635 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 B67F6C47DDB for ; Tue, 23 Jan 2024 15:35:49 +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=6X0zTijgwtuaxhDxXU9G1hg8dysADdEA8h3WcsbppNA=; b=kzSvAPbYmfUcnq CxYqcGXlVEfU/BjD4onU1cYbg25mXYFc3IrhcbKG93qqJLFhxF/lN1BFBfvYjiVxHMJmMIb5ZrOaZ +JBITW7wBcn5wSZoA3eUKbqI2Jbu3pyoKgs+90B2PeNjztkyhO3CsqVEE8zy4X0R1rRShVuTi7Sa7 40PRT/iECRJzIQBaL+FDLjdhnel3f5dxjy9GI2i9WrMacqJOp2UV5LJbnpqMhXJ7ymoI3ogJlaFFv WL13ISiAQ0vb7NNvHbJE8BxnPvfp1+B2nto9s9stCyJL3BilJTuejZnnSJB3nGOcYwyk2UPrJFExO VlK2OehZ9bf66NJDuQvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSInz-00H3sP-0J; Tue, 23 Jan 2024 15:35:15 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSInP-00H3OD-0t for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 15:34:42 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40eacb4bfa0so24558715e9.1 for ; Tue, 23 Jan 2024 07:34:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024075; x=1706628875; 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=BB2Xa0B54slaxQ4TFzJZkt9rUGgpa6L4k5N0BA4Wago=; b=tPpwYt2CnPBE7H9lPC8ptm9iB0PmDKK2ApnxJBeiT/bbdd+YVCOCgg6hkIl2Qel7nD yxi8ElXhhAvO0gvZ8B5PzZ6lJdcbQSU+Ng2K7BaTYWhcYITf9f5Rdqc62R/U6z8WpWd2 QQ62FiGPa2XmYCsVQ3ErTCnRB4q02LOwnovZrZbIg/SSzmv12BTGfLqjCj7ZnAX4OAPe arkeEb4nQ/hy0R9lkk4GBtPcI/L1p6pGam9aEGbtwJ4OzcpJYCI2d+iUyth3lU6ceIIo rsW7EP8J50lRKO77LbadNRaFu8JtIwyq2TthUgWomRRDLg1HJtWaF7sNsHkEKvJIFEKM EPsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024075; x=1706628875; 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=BB2Xa0B54slaxQ4TFzJZkt9rUGgpa6L4k5N0BA4Wago=; b=PSt984XMkSEE6rZRyK/uhtngWMkzA87UKM4WQ/xqh+DnyinXVdNaVc0JMBXEtvdr7M is0z6ykezXUDrUJ+DEH0+Y9x+RiCa6Fttjo09xs164Ufsq//oGN4Jt59novhVs0Z5UjG ij8zGpmxn6QB0pwCjRonRfl8hxu5RLrBxSG8SY9UQ266oYcOyR5QKpbRxYBW+EmvvgWd +kF8CdYXXHtXJGRS21l9M/58URK8Y6aX5y5oXUgj9CEL2XEp83ZAJ4s0gJFEzRVL74aM O3+b36DA3JtHSnVjCSRNAGSk3vbbh1dUMhZVemxbU9OBPC/Q8CGjTGBgKG3dwUMq/Nb+ F3qA== X-Gm-Message-State: AOJu0Yxu88GNo6W2wwebVlrpaYo+ekPrBw3L+6ab693WQFonyXr1TkMc D84UosxahGeY1NAaGrMbkRVEDC2ZWYTt2yXjorcaTn+tb9jnQxs+EqA3NgwYwP4ywced5ZiRnMN kR+k= X-Google-Smtp-Source: AGHT+IEp2Ri4s9MSjNV1VlE0RaiDM1zebT1VTZlSVw5LZqKCz7pZak2vpPPA7KZ21bzUs72y5miHDg== X-Received: by 2002:a05:600c:2108:b0:40e:62c9:9e6f with SMTP id u8-20020a05600c210800b0040e62c99e6fmr241876wml.184.1706024075595; Tue, 23 Jan 2024 07:34: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 p21-20020a05600c359500b0040e3488f16dsm42457536wmq.12.2024.01.23.07.34.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:34: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 11/21] spi: s3c64xx: check return code of dmaengine_slave_config() Date: Tue, 23 Jan 2024 15:34:10 +0000 Message-ID: <20240123153421.715951-12-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240123153421.715951-1-tudor.ambarus@linaro.org> References: <20240123153421.715951-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-20240123_073439_316931_1B44A746 X-CRM114-Status: GOOD ( 11.40 ) 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 --- 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 4b13252da8b8..cc33647eab14 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -296,7 +296,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 Tue Jan 23 15:34:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13527637 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 E1193C48260 for ; Tue, 23 Jan 2024 15:35:51 +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=ZEkajcP51e6Vmv4BVMRqMGrScwbJTHraQxxiGBkPsoQ=; b=HSqZjj8qaqIxRF KBvZXozMVEs1A24La4vOIsdN2wTja1/rdJQYvIv1GVEe5mBOyEtYJdYbKbks40K/6k0hvIGMV6ffQ Q2pBtTRdT18mw4bZhULk6EnSJ0E+JMXK9Bs3BBnS+Ri5xNnIXFux2pwVN62NT9cUUXtDgFoCWPPjN 1N0FzFqOzbr5FMbfmZlN+Ihk+fSiZpjJgTqTkVBB9gMecpx9KedWePFIYoiVJevJoF+aL/Gptr9X0 GzV9UUeZoH3kq6VJu52tfmTYvUoF9ByeqdGmlcWKDEIo7pI5OcxA36DVJoKjLg/ZaDSDmhG67afVf 6TKDY50AWtuuYgu5YQsg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSIo0-00H3tE-25; Tue, 23 Jan 2024 15:35:16 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSInQ-00H3Oj-0M for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 15:34:42 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40e913e3f03so56392345e9.3 for ; Tue, 23 Jan 2024 07:34:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024076; x=1706628876; 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=e+YMzDyGNc/zXRSdUvNiD+W2fMYH+c8kFJSxO3iDixs=; b=EoDIhh/uTUH6qwjhzAZNGFKp8l3hJ0h2JnPHBrsrdVHaB3tKpguwsn7PgZxS85cI36 KE9jom964Q71rYo2djmJXTnIztJIXF/OWwt1serZsemJiDvcCcAnMR1WttP/KRZc53FH NYi1E42hIQo0mt/wdDnz4VqYP2lM6lE7fMoKyhB9mgdfC35VQag6lkANb+e4ouj2C2xJ kAB3D0c+iwaVpdVqTZt5y8X6lA8JsPtoQ5mKtapsv4lviZ8QEXm3JrE34nQf0UKoGh3z s2R3O7e2WfmPRhejfYP3aTerttsiPRoJEGO9kkEjVhzi6O5tx1wtCHdTmUbMflYmEm8n 1tpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024076; x=1706628876; 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=e+YMzDyGNc/zXRSdUvNiD+W2fMYH+c8kFJSxO3iDixs=; b=b3KSafkx3Twymkdu5r6ercXdHUhw3nOoYmzgQpkvxt+uHfugeXctd2iLJD56E2Oo3z NAbOcnUoFHI17I+9SQ/IbDVPBigC4+8OwnyEdCcB3V/kc2XR/yr3XZljusYysZi5PKed FubZUIe7mEal6xEa+dDqQgv3I6FXXk+CtsPA0ct/kIoRftS7S8uLwoQ7+/ZAaeqpGAS3 CxtXSmUP6TcVtl2HTatCG5NeApW+HgwnV52MbsgfQNYax0WFoQPc447zXEdUEyiAG4bN 2g53FTHXRlRTk1GVeYwWsFGpIa0YtxPFcp9hmfCi0hY8QQpQVQ/DBdo1Gp04ATkuJnLt cRDw== X-Gm-Message-State: AOJu0YyR4Ml6tHfekb7m4BbFbgC+sG0hlT0NMIGMIwyyzmyKA+9Zb0qO NOAgxQgAnFlMK5jTZV2EDMq9mhqA44qn3zeuVtzaxad6ktDLrxmHRqLeRETCRoU= X-Google-Smtp-Source: AGHT+IHzfN1qnVR4UVsM9mJTMqExDKUWTqRX/JTb9E8bTyCwoGow8h3nokE07jWiTAJ313YlGKAHHw== X-Received: by 2002:a05:600c:12cb:b0:40e:4179:d060 with SMTP id v11-20020a05600c12cb00b0040e4179d060mr280263wmd.65.1706024076431; Tue, 23 Jan 2024 07:34: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 p21-20020a05600c359500b0040e3488f16dsm42457536wmq.12.2024.01.23.07.34.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:34: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 12/21] spi: s3c64xx: propagate the dma_submit_error() error code Date: Tue, 23 Jan 2024 15:34:11 +0000 Message-ID: <20240123153421.715951-13-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240123153421.715951-1-tudor.ambarus@linaro.org> References: <20240123153421.715951-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-20240123_073440_158256_7EEE019D X-CRM114-Status: GOOD ( 11.45 ) 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 cc33647eab14..2b088a190ab9 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -315,7 +315,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 Tue Jan 23 15:34:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13527639 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 A217BC48277 for ; Tue, 23 Jan 2024 15:35: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=9koSoYO7lBm0itUr34XHpz5TQ3rHTHgZARGJuN4qRZk=; b=Tbj0P4L42jImd0 MMOB84z5fT+CvPpYmxn3MJzZrDSq5MtjMjZ/DvOTsxb+lMgUIkaUkXOxP61jThzAAMg5MZUB/ll/4 oGIaSKJDMzRMiBJm2ALpNiqIhf2p5q6xaanGoH00f3kqy4nnsmXgRohfMPLhEwbjEMguFavzDBd4b aj9pz6QaiEBKt7+k1+WnMqyKdpnD1Y/nOxr3HYSJceJHmuiCCj0v43qfqDRYfdxPKMVhG4pNoJHtl mH48xCFH/m5Xba1GREZTP4zFR1DrL4jOqF2dzTJpB0HZJ0TTmwf4eQa+ZYWFAetaud7T2lHKEl5j9 XC8bb7P6ZSabNWOferkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSInx-00H3ro-2s; Tue, 23 Jan 2024 15:35:13 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSInO-00H3PO-23 for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 15:34:40 +0000 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40ec2594544so4095675e9.0 for ; Tue, 23 Jan 2024 07:34:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024077; x=1706628877; 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=Kxj/GKivy8KHz8wlyYVu9rRfrbEmnmhas4Q7ujviZXU=; b=BySKkaCLqa3108Bo+u8AGz0zqJZfcGDBNf8nb/JMK3anQUr1jWZBr5RWLyYcx21iV1 haaBn5LIu5Mneq+DA0lRtY5t8x5pUMrj320ilpOB/gnNWUC61IWH9fTLbv8oA02FcuQm Y3nbUeTBu69t+xXs4eBw3aDEizmeChLmLyqbRwHVl1O/AwAJqkRDJ2lW9AyiozFSIxvG npbA2Fy8DG2pm1iY8nQc+lJlBIr3AhUCPtP2HUSBPu/Xpl6I813VwiNdDMHTjqicZKpy kZbEpeilaE6snxltj4SGfiAxKtgnL5R1lvIlp52usOO8DIrtzEeF5uuHdtgcVkpDqq+b Ct8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024077; x=1706628877; 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=Kxj/GKivy8KHz8wlyYVu9rRfrbEmnmhas4Q7ujviZXU=; b=xFjm5D5XOhHikyqk+7vjqjzDBsBsc1FGTnx+JxNWHO6zFrLu7/jtmM7fQvxITWkB+z osmKSA0wqlxo/NCA9Hshf9QDiiG+JA/TKuJpHn1u5Yo+/hblf1hPcHujcmJ/MctZxdTD c61QqaAZ4H/kgr1YifuC14jQ7l9lHbctnE6tz0YgpvQhiC96bxvG+Uf1DzbL8h/scNaK v0k8wpDSE5+UZgmyJKcoGsC1lKugay+sug0lXhRL72CqKsvYcD+pCilSvSLS1Ad6dCPf snYfUW3xvPruahZZFU0QbQkdh8gwajWXNko6edL7Ew9uiuwHWjEq2d4aVex7eRw8kBA3 sTJA== X-Gm-Message-State: AOJu0Yy4MO5ze765i3OcH+X04Ifu56hPtPGtblvqI5o4bc6lluJHFWKi YKvZ4LfqUfG1L+JYzwGlbvCjv4APpCtNtkIXujqi4B3/+AYx+gDWVNk+MxCPfa4= X-Google-Smtp-Source: AGHT+IFcab2zDsD9I27H2KBoICJD/fGV5rpgJVASWI6Q+u5HNWTcCrDWfrf1zCUTug9AMM0BIJrhgw== X-Received: by 2002:a7b:cd8f:0:b0:40e:b505:5581 with SMTP id y15-20020a7bcd8f000000b0040eb5055581mr265504wmj.60.1706024077455; Tue, 23 Jan 2024 07:34:37 -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 p21-20020a05600c359500b0040e3488f16dsm42457536wmq.12.2024.01.23.07.34.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:34:36 -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 13/21] spi: s3c64xx: rename prepare_dma() to s3c64xx_prepare_dma() Date: Tue, 23 Jan 2024 15:34:12 +0000 Message-ID: <20240123153421.715951-14-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240123153421.715951-1-tudor.ambarus@linaro.org> References: <20240123153421.715951-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-20240123_073438_695664_58095924 X-CRM114-Status: GOOD ( 11.91 ) 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 --- 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 2b088a190ab9..8897b5895cde 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -272,8 +272,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; @@ -439,7 +439,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: @@ -471,7 +471,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 Tue Jan 23 15:34:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13527636 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 B811AC47258 for ; Tue, 23 Jan 2024 15:35:50 +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=uTGWAXTTnyqjjsk9wU7Z7pLm06Io9Vo3LzQi92aD48Q=; b=QzLf1gRuQFBF7m srDTckayAd3Zo3zLCyxVI1mjo7AJ9ROR/oaXgXWnyftWVfQWHkSqlMGuC+9zQJuwiYYOFuEBrr8kp 62fXIskJv/AlqhXSY5RAp8vUUrsMDYgLvcOkN8ZsDcwjNAHLRxyi1PGr2cZyTv4KcjqgwiJalm455 PbNYs9WQyaffj2vflI/5tXR3N2Z3DCN4H0Ni1uFk2F/cGhfDIry8Obq/EMCDtDALGlQmJT62M7ZNf puODTQcgO17NMzcY1TQl/1JpVCk3EVc3iHOzkqbFXOICyOIIx+SUGY7V5h4KOOsziUcl04q0n3SJj 6ud2aX8qLz3FEx/nB5Nw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSIo2-00H3uK-01; Tue, 23 Jan 2024 15:35:18 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSInR-00H3Q1-2y for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 15:34:43 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40ea5653f6bso41148335e9.3 for ; Tue, 23 Jan 2024 07:34:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024078; x=1706628878; 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=BDcK5S8n/PLxtzPm44TTZV7bPj0wDFTndTNX2CSFLe8=; b=X0qYqQrq0TVPzpefol3hbY8YsCj2M1hhFJVKrkipVNSZur/wh3VH3MoI0GIwMhGcPU 17KRAaCQDq43EtTJ/axpFQHP5MjG8oF27O6RJBi4o9tWFhriIB5YRWglyX2rLOUmIOuK QFUhTpxCFIoSDajCcwslAzZ9i+3CJrVF2T1iABZexF+hLAa7175i8zH3LPvZlbIPFIDm //7mvmTb5bXL5S89giq8Vb+GHYkQDC0J92CKdqsiBB+/K9DLi/mRy6EfUT65pfOTaSPK BtRZqA8WU00ykfJy2PxRewbIKXKAieEzSpf9sGQQdWd7lUwS4aM/6iUJv31rB6fxEHcH OQlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024078; x=1706628878; 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=BDcK5S8n/PLxtzPm44TTZV7bPj0wDFTndTNX2CSFLe8=; b=e9XhwglclZsbFf1HmFdkUjo6u+9o/Le7qWFRxxrdHFw812f5OvejKHu3m4oflT+PCQ OMwaRQOzOMK6t1IOm4p+7VOusrtmY74h7iQp1T5CB5RIGIlwIHsIMNJbGdbhEKjFJNd0 Z2FeNapqcgyueqzc4RvVYxUlzJYO9wom1BaCrs7if/8WlrvEANjJaY3jN4x0BrtjpAdO ivV6OoloBiQItKoqvzJmWHOx/g/CYQyfIYF5j/TAxLWrHW3NERzhUEP593RoI20Z6uvE XspB4vzh/b/i5LuLABhLYi9VIbweULk3ZpdUyE+zeZtOw3BjigOOxDOxMf90K2OCsgOo Sqaw== X-Gm-Message-State: AOJu0YyS4wPpqyKgKmh9UPxCXJRLxlMmt1CPunxSzAZ3JROPgo/Mx9kc T1S3GMg5Jz+JtLUrPkJGecigufZqApBLtTfj8Cv2ceUpXKngdJuZ1v7ZTgjFGFg= X-Google-Smtp-Source: AGHT+IEaPKuKYQ2O6yA2vkn4qNMcqnTA/hNm86+45dMXVIcjSmoweGA6oIQ5FlKxetXppti+/C/LhA== X-Received: by 2002:a05:600c:3ca9:b0:40e:88d7:3dd1 with SMTP id bg41-20020a05600c3ca900b0040e88d73dd1mr250569wmb.37.1706024078284; Tue, 23 Jan 2024 07:34:38 -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 p21-20020a05600c359500b0040e3488f16dsm42457536wmq.12.2024.01.23.07.34.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:34:37 -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 14/21] spi: s3c64xx: return ETIMEDOUT for wait_for_completion_timeout() Date: Tue, 23 Jan 2024 15:34:13 +0000 Message-ID: <20240123153421.715951-15-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240123153421.715951-1-tudor.ambarus@linaro.org> References: <20240123153421.715951-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-20240123_073441_973701_124179BD X-CRM114-Status: GOOD ( 12.06 ) 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 --- 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 8897b5895cde..fd0e62ff8968 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -520,7 +520,7 @@ static int s3c64xx_wait_for_dma(struct s3c64xx_spi_driver_data *sdd, val = msecs_to_jiffies(ms) + 10; val = wait_for_completion_timeout(&sdd->xfer_completion, val); if (!val) - return -EIO; + return -ETIMEDOUT; /* * If the previous xfer was completed within timeout proceed further. * DmaTx returns after simply writing data in the FIFO, @@ -568,7 +568,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 Tue Jan 23 15:34:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13527640 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 DCA38C47258 for ; Tue, 23 Jan 2024 15:35: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=uW5viRuS5YN3yjqUS5+LlEHBN5fDt2ueEc/Z0KyJtRo=; b=buF0tFh2cFtryd RmkKZ6OlLhgLKO1ly3a/uimdaaNwQNxHWxV++IbiU8tog0ljUO3W5ULLj4zYq1kSChDH7abVM41id bh1KMvIeXDox+nqOGRcBRaOV6OECgtO+hkv763GOi7D1rVyxLBlN/Zr8dye7LI2aMan5Q3SouxSla bbk05dQ62MJDY01DZsutiDroLxyAbGSJoHcdJNfpLbHTMrdJssIUekg04Mw8VdVSS/+5MIuTsFThb YqEX3neU9RPSAMwnq1UDfoMZScH34WvUhncAEilHa9OOYj/GeqUVAwHLOUruAEER+n6uxkkxdJjDd vGax2VqzZiqC97YdjclQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSIo3-00H3vU-23; Tue, 23 Jan 2024 15:35:19 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSInS-00H3R8-2t for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 15:34:44 +0000 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3368abe1093so3781705f8f.2 for ; Tue, 23 Jan 2024 07:34:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024079; x=1706628879; 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=2fDM9KTVN+TskU9fbko0BxYR8hTUuEx0IDlypoaNnK8=; b=uO9s5b/yh86kuJWz6HGFhN5WkqLPfFYQQHVAhARKv7TIAK9TqL1wyj/2ZfpDcBxfmG 7KApOzeWPxYlqaNa2uqN4XCZncu8wt5Rh/mpWXDmwtPPiY2UdzoNKtYyFXS+NiufJqsK FDQn31lmnjE2wnkQreyVAFTovUhSdmyxRF4yj0lj/tKtnYfBCgtmfFRcAK8913ekzZlg 2WC+Bv0uGYxeoerLsDLgC7mGvTEnuC5bMRgv8ENl7YOZBsCLWahwhaXCusUNmUC0SDIY 61UW6Zo70M1l1E57ydlCNhv/nclVmTuKUd1YYROQzbbwKgZBkUyu43kg30yVCT1yBDDx UnPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024079; x=1706628879; 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=2fDM9KTVN+TskU9fbko0BxYR8hTUuEx0IDlypoaNnK8=; b=cKLfRQuU+KYl++d+T22pEJOpf22/7pZCHc2lAE4aIs89BF6+8xsW7RxvnrjNzAVGzE lEaTCcAO5Qj1Zigx8LMEUzTvyGnVwQkh145UPY8ThSFnvPJdGlGkCdIiMhKsJJM06gmP C5wbXefK4YBLVdCtWVQ7w3m0BB10d5URER9HlOOomxeBU5i1jBYBa8dYho6NbHctvdYl yHdz8KFV3YEAxCvjcvXdNCFrDzeuQoUMJlex5r7GjEn81l4UPm9r7S20SH03+7naNo1l 5TLqf+kSX+jnYhs5zRr34Pl79do/qylH+crcofomf/rD1mFeKU87R1NMop6DDphwbawk yEOg== X-Gm-Message-State: AOJu0YwvQZXzLFCiteJN4nTyHYLoYGFsy7DpwRDPAyeLe9zNrHBh1FIn G1wggnL35c/LheSPDzD/rBgC7xNaBDgghiUVhI1X9CeDkR9RRbbm8GVpW7KJAt4= X-Google-Smtp-Source: AGHT+IG7MEG80tjOklkuIf4WBsSG8lL2BEyEh1zV2JV31IyAf2q0kQ4mEQdrihuSIxu+3aeBuTvWIQ== X-Received: by 2002:a05:600c:4e87:b0:40e:c23f:8784 with SMTP id f7-20020a05600c4e8700b0040ec23f8784mr262957wmq.111.1706024079161; Tue, 23 Jan 2024 07:34:39 -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 p21-20020a05600c359500b0040e3488f16dsm42457536wmq.12.2024.01.23.07.34.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:34:38 -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 15/21] spi: s3c64xx: simplify s3c64xx_wait_for_pio() Date: Tue, 23 Jan 2024 15:34:14 +0000 Message-ID: <20240123153421.715951-16-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240123153421.715951-1-tudor.ambarus@linaro.org> References: <20240123153421.715951-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-20240123_073442_953284_0278BB78 X-CRM114-Status: GOOD ( 16.54 ) 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. Clean s3c64xx_wait_for_pio() and emphasize that it works with lengths smaller than the fifo size. 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 fd0e62ff8968..f5474f3b3920 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -484,26 +484,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) { @@ -547,13 +527,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; @@ -576,48 +554,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 Tue Jan 23 15:34:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13527638 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 0FC8AC47DDB for ; Tue, 23 Jan 2024 15:35: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=igyTxaRyPmKhBINgdpjRYPitsx41q8DvS/0mWX7Pa5Q=; b=wXJaFlFA7ojict 2z5obRGCPIHfd4ZD2QZfi22YBnSfSXQxbFRC3W6fXfzpVsavWg0xmSTWBakFBUZ5aj2Uf59LYxJgq AzcDuCKTSzZghHVpvBd1OfqtcQ7TIjdQXPTO6LjfEhT1s9LvdIZEiNy0vw3Wibtv2SFtC9KkAOxgU YdgPdUTU7+FHF1gHSVuH253tWHjNHBDzGHoUbV40oAACaJzECnKRBOxfWjJoKdYdMUeffvWKIfl2d i5w/gpFeVKbXNbN6L4GO7VXEGTKiNy0fmOC7U28FPjko5wuIke4uwTxNFcDQRgSGQk9KQjAPTJnm/ 8p9bLNNWjPLe8M61OXzQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSIo5-00H3x2-1H; Tue, 23 Jan 2024 15:35:21 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSInT-00H3S9-33 for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 15:34:45 +0000 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-40e8fec0968so57577575e9.1 for ; Tue, 23 Jan 2024 07:34:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024080; x=1706628880; 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=2ut/OStyJerEIXwncXZj/mTgjprtvHDvTLoi9wIIiA8=; b=wpxxoFbwAoYa15eeb+LPFQ5wrCD2XHu+5a9not5qvcjdKozmRyN65/oBzjGYj1ohmo +NI3kgUnabYXDJfNWq3vIENHKHTiG9i+DBQRPYnh5GeAQXVdE6W5vAudH8p4IDZDH8qe dO8Zs5dAT3RJPqcRyL0UDWf+3Cq1GhO5oPr/7WHbFuBWMU8plebu0hMTgSIQa1SUFcSs bDGILopCwtNTrlYdc3LUEzMdq/eKvJx94NEx+kja+OzlrmIGGiaKCnY3HnprbwKPtDXr AXOeIy4ISKgo3nSc04ZJrhJkZi0eyHgna4uzZ+cWWZt4DT6plcRy70q4JVjZApO5Xn1K OgGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024080; x=1706628880; 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=2ut/OStyJerEIXwncXZj/mTgjprtvHDvTLoi9wIIiA8=; b=bUzoMXLkD5tYDfJ4Szm8sIbE4wXTUfCbeoLvHMGcl4uQASY9kfEWJk2uot4PiHJaiL U1ga2DAoNwqpFO2rP1IcILTJEWv8bnskWzBUkcs4EZhr51BZJhWu5e1TCMauFLiwHFQr 83A0QRPRSAj711CTU9P0cn0QxB9RnvTZrrpujOHUF0BC9ExtKzYOjk48FJ9mqIDpE64D cqEy4RJcjNdvMQPtG3dWfim7dYjd5hFMJfadwAq8SBPvbVFDUBrhGtSYWHy3xmJvaYMj MI/VABW7QhKfvPiLLuXaGu0LkZoNLpckq5Ov3di6lRNrLHrZj1IkLP1K7U9R7DzknAeM Y4MQ== X-Gm-Message-State: AOJu0Yy8aOxPff+Q/xA77CmWE8r3/yI6Zy7X+ye2SqubBgrn5Z4JnmXh 5KFGLYtvl3AoH5OqlwK9lVjxXyFZT4j3JP+2SE93jTzDrcTbVe8MzoyuhViFteE= X-Google-Smtp-Source: AGHT+IFy5hVqPrTc2wq6yQNAZyI/n9eio2xmFflp5WDTVB2OCH4vhagDSKA9/oRlBzXDGVqen8YdpQ== X-Received: by 2002:a05:600c:3f97:b0:40e:5263:28a3 with SMTP id fs23-20020a05600c3f9700b0040e526328a3mr258912wmb.52.1706024080218; Tue, 23 Jan 2024 07:34:40 -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 p21-20020a05600c359500b0040e3488f16dsm42457536wmq.12.2024.01.23.07.34.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:34:39 -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 16/21] spi: s3c64xx: add missing blank line after declaration Date: Tue, 23 Jan 2024 15:34:15 +0000 Message-ID: <20240123153421.715951-17-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240123153421.715951-1-tudor.ambarus@linaro.org> References: <20240123153421.715951-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-20240123_073444_001602_FB587EDA X-CRM114-Status: GOOD ( 11.48 ) 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 missing blank line after declaration. Move initialization in the body of the function. 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 f5474f3b3920..2abf5994080a 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1273,8 +1273,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 Tue Jan 23 15:34:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13527642 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 4DFAAC47DDF for ; Tue, 23 Jan 2024 15:35:57 +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=WPp4HbsmgPNnyZLILH0w5dDJnwBlvlpfY6K8kT9Cots=; b=fKAym5Zd8TfZ/Q aMln7KY9mtFnAgQ5rNzciV9bHIWBzlc2gGKgvkyTYGiG4qbbSlKYHX5QgG5T8poS+hOqo6RK4v7fE SjUN8sH6NpMAgluj1kMKTnKwtm11pZbPZ1N9I4nHmsfSfxMxMDuswqVKziSbQiyThN0TVckEi+/8G pOnYZTJScic7lgHMQCJGp43ISWdrYcttk9SeM9OYhccLhav6YJQQ63zDdbbTlGBUB3xcDw7je2eDt f0boNeumTrkcdagXQl92T14oqdRBycN0sEzOCP57EbALZGzK98BQeV/trfCV+sXSVHlb30FZoQz7I 2PzroEVhIrquE1FFwGvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSIo6-00H3yd-2u; Tue, 23 Jan 2024 15:35:22 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSInU-00H3Sd-2b for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 15:34:46 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40e86a9fc4bso57491065e9.2 for ; Tue, 23 Jan 2024 07:34:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024081; x=1706628881; 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=/irE8ZyZqV8JPqhFZspW4QvYBkIBZkdLqpFIYT3Nu0M=; b=CnkVu6FX1hflQN9MxVs9zpm9bTWiiU6YcuWYYZ2qQyL0xLOVW48r3MOu0eWojEHTGH psZyXxTqstnAozjA3XgGoJgBsNJ3cAq3BXOEav1uJVeUghye0JRT6Pqv9Rmi4QJXEaIy L+KKWd+jktGDUFWyMqn0+8wBHO0oBFGpTSOSncyIeAyxKlLsFCNCRP3Ssiqf1+xV6q9K NkeO5zOtx7uwVeDuHUpQ4R5Quwv/ocREECZIqGcnBZhhItqBiWcF1pUzQipsnx1055Fm jArkWWcaqS6gcWUl0kjUavrY2IujaqEDvjoRXBvjOpp6ZFxArwe7nojWXYeFnTrHkh6t 8jZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024081; x=1706628881; 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=/irE8ZyZqV8JPqhFZspW4QvYBkIBZkdLqpFIYT3Nu0M=; b=mjoCa/5HjgqfYIBqOTm4YF1d3DVpGnS0LDBjsYDta/QvehnF7S5Ua40q5582aNhf68 8Ns24x76Fia7F53oagi/7zNDYtqz+2vGXFrrJzAtj8fT0zHF3cLNNLW7uD6qKS4buV3w peaWtuLqK7wubdEu0Pn5Lzfk1dLIR3aruRKeKguUuCxgxym0hoAGUhzJJXfDt6+lO9Op pTQ11E2lPe3pwz2axFLqljgERkM4pUDvzDt8H6qFXcuKz2qGsGyzUucZfCDFE8UbImcL A4MbqIO3O1MmB/lhuoUwa49NlVA8bGfZ5ti4w0lTgfaQXEhO9jTdlj8G/QNaDi4oJh6e 7cTg== X-Gm-Message-State: AOJu0YwQQnNDf5e+JXROSsasW2FDS5cyHleAJPs4MjjKfVXKu72QpVoE AhQBmyB6K9MqRIaz1PLoeVyIkGic7HuJ2VkNx7Q/g7SA6FUBks0Yq8CVeG+1oOY= X-Google-Smtp-Source: AGHT+IFnQUAOFj2XlDJpBxTuWZdr7PkB/FRu7Br6988kcrenHLZAgS6ZvP6iNS1JTyl+7ezr01rrMA== X-Received: by 2002:a05:600c:46ce:b0:40e:b036:d92e with SMTP id q14-20020a05600c46ce00b0040eb036d92emr249779wmo.144.1706024081101; Tue, 23 Jan 2024 07:34:41 -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 p21-20020a05600c359500b0040e3488f16dsm42457536wmq.12.2024.01.23.07.34.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:34:40 -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 17/21] spi: s3c64xx: downgrade dev_warn to dev_dbg for optional dt props Date: Tue, 23 Jan 2024 15:34:16 +0000 Message-ID: <20240123153421.715951-18-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240123153421.715951-1-tudor.ambarus@linaro.org> References: <20240123153421.715951-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-20240123_073444_883261_1C8191E0 X-CRM114-Status: GOOD ( 11.95 ) 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 --- 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 2abf5994080a..62671b2d594a 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1065,14 +1065,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 Tue Jan 23 15:34:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13527641 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 F2DD1C47DDB for ; Tue, 23 Jan 2024 15:35: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=67MBL+n9BvlDZGz2BX5QD44AvpqOTmpDiM4NnkK/xRM=; b=YsNJh84ME5Dc7C 3rQXeynrOBC7WXZs2iaeZqZqyleAcvMWsOOI2DywHaBN8EIHmz0x2bBD6vsEAvRGT14JXIo+OGncI 8Wym4Ua0eV2JrVZJ9IJh8OCuig91nFGiZx53wO1Wh6xvgmiECp65/Vpw1mBpSEDZu9AXVTn6AY0dy rnxPXuTMXAZ7KJ1/XmqhZhPnHWhRpF6QTHyd4v6w9M41QTPZH3J3i9ff8cBYxyU86/eRPrjJpYisM t0FbJizhYsDGCXwFPsBDZ9NmPgdvVhqhtblm53cAd+NMZa01O+DWElNwa/6bP6b72Q3W/ngB+u4gX CvGuE4kKUzBLbSiL8r/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSIo8-00H3zc-1Y; Tue, 23 Jan 2024 15:35:24 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSInU-00H3Tc-2b for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 15:34:46 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40ec34160baso1839635e9.1 for ; Tue, 23 Jan 2024 07:34:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024082; x=1706628882; 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=2H+4vxpbUIDd45rCzEN2Z22Mxunqggm4pG1DkoeAKqY=; b=BQ27qUdvmX/vs5XoeygqH2gNPHILvosegKM9eZDpfwpqYxtfyA7ppOHKFHSozDaGw9 2qzz+1L4L/cQgv+Mfbcm28Owlz2to7O0UN3fHeFWLWTY7UJGytEtdqZDWiMTNiRSMdRn okau+A7jWaf6yRhpbFqoKrs49Xvi0Jv2LreP9tqbwXjagxQoS1FPY2JugXAPoea34oPL OPEf87Cra/azROIWFLP/K9hFp8gm6AzP+AqgldzYWZo1ToFIEKiaLT/rBYvE1bJPqLfp 2hGTtSSJKd0UWA1bu1pwVB9pW3BEYBDk/GAxc1gakRA9JZMPRH8z4QPfJaXvY0Q9jTDe GW2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024082; x=1706628882; 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=2H+4vxpbUIDd45rCzEN2Z22Mxunqggm4pG1DkoeAKqY=; b=lyYgIQeYP6C0pdCxhp2p9vfhmFjWuDc0wJ7Lbrl01TKk50nxKJOYfWzBEXPDPZpk+R OvDIRJB8hb2Qrqc2lQhU54a90v6BmTFB3iWfqCPWU+ci4CTgxPunkbA5ZTCvDGkK/QrF m87aI6mpWMKM6GXPbXEn0VvMfY1MWSLu0DAzdOAyRf0X0LY7giuvFtCdMaQ6pTx9dnji HMpAqaKYs8fK2eNc0kLP9NupHDLxOLNfyKbUwpreyAJ6/M2HhCKxoYXKP3BVD2zIAKgR be2t+XKobOd+7SstWMm/ynhVqmO90tKvRi8ACHtIwlTMfWcVnrXyr5b8q7YZfItupNfp E6dQ== X-Gm-Message-State: AOJu0YxswFQ3dj1+KNKAw3bM9WT5fcuf85/0Z1DTp0CPELpIDGUmv6uM lePLx89lkfQNTaMnb82gs8eFXpHbpgG7/NnvHxmgBVob/sCMeodBkD2UpRw8xpE= X-Google-Smtp-Source: AGHT+IEdhulGHnMoRApGote5ScptZ0DoCltZHEA7gddglwiHhXxlIDhI6CN7Ov1Zuk+CJc7AAijQ6g== X-Received: by 2002:a05:600c:4448:b0:40e:937f:16dc with SMTP id v8-20020a05600c444800b0040e937f16dcmr707423wmn.17.1706024082130; Tue, 23 Jan 2024 07:34:42 -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 p21-20020a05600c359500b0040e3488f16dsm42457536wmq.12.2024.01.23.07.34.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:34:41 -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 18/21] asm-generic/io.h: add iowrite{8,16}_32 accessors Date: Tue, 23 Jan 2024 15:34:17 +0000 Message-ID: <20240123153421.715951-19-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240123153421.715951-1-tudor.ambarus@linaro.org> References: <20240123153421.715951-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-20240123_073444_855252_F9382238 X-CRM114-Status: GOOD ( 10.14 ) 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 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 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, From patchwork Tue Jan 23 15:34:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13527643 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 E9EDEC48260 for ; Tue, 23 Jan 2024 15:35:57 +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=kar1bdnQzd0qEgt4aQOszS06LAzFpmd7+DX8RaJLyYw=; b=xVw/wukqKD1Wtb Gd6iTvh/iawodehzV/VJE8A+87VdcMdhkd9w8OcY5ade0qM0I0tIXn5dEjk6ZhGmVk1D9z5g1S2Mh jH44eGZav34vE+QPcKGns5GFDM3jobcOQ2UgqLyIdgpATXfzBWk14Geb/2+NnQKd7mgbyOIYk7rZk blQWM+BfK8mjB7AAeV9184muS+Jc0f9BqSynWKu+F8vwhkLPe+LHPfFv6tQZ3uht2aUqzE6cHXTSf jfUyRk6mqF0AyDWvPzRY0dTPPwQofJ5At1rRgZrWWhsy/MWV5J2al7qaNPYb7u2C0a70yT2MosIxQ VsRUMp2KCv9eo/WoXUaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSIo9-00H41P-2n; Tue, 23 Jan 2024 15:35:25 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSInV-00H3VJ-0q for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 15:34:46 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40e9d4ab5f3so48240545e9.2 for ; Tue, 23 Jan 2024 07:34:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024084; x=1706628884; 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=spZW8S0GVeUeUaVNEXaPIDC8+SPXAmAjIvuVT5xHfKI=; b=PXP+R8DZhtd4R25HQiQAMciWPv+ttYbjpI3Itw6er3uIBbosxx+c7W27RslB+qGxZf M5vIwM+sSKkAJmAdH7pygWx2bBLMRmrSTqoE4JKnfEVTofjyOamDJ+QWUlXztVuyV3Ci H5QDW7FWflN5fQ9mxpHsrlv2X4Fgz585YuuykadesotUx2O1kt3W5lmo6OMUKyV/T8CY Ta3a0FnW25lLeLBDE/ghLKJVLns5U76VyHrRL++k4UIHqhocf//EVrGloePAHgwuIuYF p1N0rso4Qau6x0XvOWY2pTn2Oo7o5I2mnlrmmICTJuWsqq+8xqo6ljVNgnN7b8vReZoE /usw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024084; x=1706628884; 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=spZW8S0GVeUeUaVNEXaPIDC8+SPXAmAjIvuVT5xHfKI=; b=nez2xhCboe6tC8LJnTeA/IED4oQ34bNLcagTZ+aYcSgX3Y3eRx9MUj5xb1TMuOzhT5 gsjNbrjTWa1Y2t1FIOINrwXSxHEJuldZwZuHB0Fzwg1m+zUGUPGHLf5RHaklvV3y9E6R AaBKAcNb0nEU6SRMxT2BX+U8yQflnXtxvO671axz7Nq7aRkr/bsvnUbPjVWMQW6PstE/ 607QNzHDyaDSmrui01coIEWIlYYb+M4BZAnp+jlUHxHvL48YUZ8l1VbKHgpCu8IdCiBw qnXs0H96SX1bd4LY13bl2RUs42UzRY9yhk5qU+8vyJolY35qWsmI5jEEtAonWlhVy324 oyhA== X-Gm-Message-State: AOJu0Yw7EbStSQ/t1yvmeBDeISk2tJ4z8WUOo1/sUQZW4gJREufJJoWo 3+CW1vQclGIg2hN/VVh7xFHipndWYS61ut9ZLrpE+5g0LtywkGq/HZwCBT9IT/s= X-Google-Smtp-Source: AGHT+IEwGHIZco2gJ7iHs+3ejOlkItskw5CNIOEGW9+nHZyAIdrwcgrVKi17dDetE+hV66X5PLQAKA== X-Received: by 2002:a05:600c:a46:b0:40e:5598:a6f3 with SMTP id c6-20020a05600c0a4600b0040e5598a6f3mr258341wmq.124.1706024084020; Tue, 23 Jan 2024 07:34:44 -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 p21-20020a05600c359500b0040e3488f16dsm42457536wmq.12.2024.01.23.07.34.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:34:42 -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 19/21] spi: s3c64xx: add support for google,gs101-spi Date: Tue, 23 Jan 2024 15:34:18 +0000 Message-ID: <20240123153421.715951-20-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240123153421.715951-1-tudor.ambarus@linaro.org> References: <20240123153421.715951-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-20240123_073445_330426_3A474976 X-CRM114-Status: GOOD ( 17.61 ) 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 --- drivers/spi/spi-s3c64xx.c | 50 +++++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 62671b2d594a..c4ddd2859ba4 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -20,6 +20,7 @@ #define MAX_SPI_PORTS 12 #define S3C64XX_SPI_QUIRK_CS_AUTO BIT(1) +#define S3C64XX_SPI_GS1O1_32BIT_REG_IO_WIDTH BIT(2) #define AUTOSUSPEND_TIMEOUT 2000 /* Registers and bit-fields */ @@ -131,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 @@ -149,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; @@ -175,6 +178,7 @@ struct s3c64xx_spi_port_config { * @tx_dma: Local transmit DMA data (e.g. chan and direction) * @port_conf: Local SPI port configuartion data * @port_id: Port identification number + * @fifosize: size of the FIFO for this port */ struct s3c64xx_spi_driver_data { void __iomem *regs; @@ -194,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) @@ -403,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; } @@ -447,12 +452,22 @@ static int s3c64xx_enable_datapath(struct s3c64xx_spi_driver_data *sdd, xfer->tx_buf, xfer->len / 4); break; case 16: - iowrite16_rep(regs + S3C64XX_SPI_TX_DATA, - xfer->tx_buf, xfer->len / 2); + if (sdd->port_conf->quirks & + S3C64XX_SPI_GS1O1_32BIT_REG_IO_WIDTH) + 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: - iowrite8_rep(regs + S3C64XX_SPI_TX_DATA, - xfer->tx_buf, xfer->len); + if (sdd->port_conf->quirks & + S3C64XX_SPI_GS1O1_32BIT_REG_IO_WIDTH) + 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; } } @@ -696,7 +711,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; @@ -1145,6 +1160,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; @@ -1234,7 +1254,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); @@ -1362,6 +1382,18 @@ static const struct dev_pm_ops s3c64xx_spi_pm = { s3c64xx_spi_runtime_resume, NULL) }; +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, + .quirks = S3C64XX_SPI_QUIRK_CS_AUTO | + S3C64XX_SPI_GS1O1_32BIT_REG_IO_WIDTH, +}; + static const struct s3c64xx_spi_port_config s3c2443_spi_port_config = { .fifo_lvl_mask = { 0x7f }, .rx_lvl_offset = 13, @@ -1452,6 +1484,10 @@ static const struct platform_device_id s3c64xx_spi_driver_ids[] = { }; static const struct of_device_id s3c64xx_spi_dt_match[] = { + { + .compatible = "google,gs101-spi", + .data = &gs101_spi_port_config, + }, { .compatible = "samsung,s3c2443-spi", .data = &s3c2443_spi_port_config, From patchwork Tue Jan 23 15:34:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13527644 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 09BEDC47258 for ; Tue, 23 Jan 2024 15:36:02 +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=ZAecyff6ijjOXMLkFNJaTOpKVhW7RnGG2RItOb8+c88=; b=wS4767VeXWNkNu eQVMF+eqZNqv1b8VoDLtkhVsMvtrmspWrbVg9KGKx7+aqxt2CrFSq8z8R2BNGnEOg0HPevvm0CJyh 12R9qS0iF/IY9+LbpbEjzNK2q6yc54jM3BmjBakLC3qKsd9yx+s4y04h5snZsPI794Rp9KuEUyukw pINct1vt/cmTOfGtPYxvMCDlciwKL68OFfMdb2ZAT3suSxn/om2xLBQxMs4pO1WcLRL3YVU2eXPx8 ZE5FmCjYzSdw7jS3po/jOA+f8yVOlVWnS10JJc8K+qZkMdXiIWHKqWNx6kDjj/ayGwVlTVyzo1y+N y/2zGGCGc31laZpqS3oA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSIoB-00H42a-0K; Tue, 23 Jan 2024 15:35:27 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSInW-00H3Wb-13 for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 15:34:48 +0000 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-40ec048e0c1so4722185e9.2 for ; Tue, 23 Jan 2024 07:34:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024085; x=1706628885; 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=6MwC7JrWaaByRi9Bmg46WpEIcb48Uk9F6chaPlqeYW4=; b=TB2EMK/fmvrAA1tQWC4ZeZRyAVA7CQrAyhTwU5rqcq3ekXX5rF1dQ7p79VxVzT9FIn qaRPdqC3Ze/bjnJ52iefsle6AwD3KAhBLdq4YMj/3ayYlN2iuF7a0YtGd64+jcYuMrkO EaiQ7Gf+9Se/t3DGfB1ZXuio3Dmz9R19AEzxaG+ORUlFVXX/f8FGm/ttbv/byHEgB5TV U9UDR4sQ5HM5RNQqlRoNAPfqvznLozpEVAgCiZlRjxBSs0coWrpMHWnvDVKeyPG78kJF kUOJ0bwCnSUEZF7o1Ic+Shvn8hWX3ylKCoYk27kYXizL5ECrja7NvcBkzEoCd3Pw60YP R3MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024085; x=1706628885; 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=6MwC7JrWaaByRi9Bmg46WpEIcb48Uk9F6chaPlqeYW4=; b=i9L60wElaU7vOwUZw/DX4oPNmW4UviwtD7J+XLGh1FT6gZXYQd9FNncnL0KrS/+3ub AAxBX3M23xTyXrsnIydLTBMyjNq+Yww1IeDl8NSUrVI3NH3lLPqVpyUzfD1Tb3Q/iXcp 3zCHnjcwh4Z9vRy7LvyXdaHJP4nqwUF5ZR0Fkde3Y8G9DOU3TwRtyGFr2EwamgcFufno sVke1wOyc8pevCRT7tVMBwhWm5I3zrlcZ98bH+T8hgJHIw3oNffOxg/9JRc9xndjUPoI eUtJ4sOqj4y4XO1f4ueeHXsiqidq3mTpCGYvx8o/7KzxCYdY4/kyn4hoTUCDB1OxRFvQ ZmhA== X-Gm-Message-State: AOJu0YwU9OAnq1J7N8UVkSkb6hTaiJtaJzr2eAZZGwwtWvN0BcRco/CV Yo6DB5zUy2Affs7+HFf5WrEfnCJU4vLeKRY0raDR7E3eiQ5Nd6OLFA0UHYxhr7I= X-Google-Smtp-Source: AGHT+IH5mkP1CJQ0rWDrIEEhD7IVzjwMWQ7d2wNt7PJY7Y6iegwnmTYm0CFXzpgTor0e3wG3s2U6YA== X-Received: by 2002:a05:600c:35ca:b0:40e:6163:55f2 with SMTP id r10-20020a05600c35ca00b0040e616355f2mr643207wmq.84.1706024085095; Tue, 23 Jan 2024 07:34:45 -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 p21-20020a05600c359500b0040e3488f16dsm42457536wmq.12.2024.01.23.07.34.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:34:44 -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 20/21] spi: s3c64xx: make the SPI alias optional for newer SoCs Date: Tue, 23 Jan 2024 15:34:19 +0000 Message-ID: <20240123153421.715951-21-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240123153421.715951-1-tudor.ambarus@linaro.org> References: <20240123153421.715951-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-20240123_073446_387053_04CB4501 X-CRM114-Status: GOOD ( 15.83 ) 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 alias was used to initialize the port_id, which unfortunately is used for older SoCs to determine the FIFO size from ``s3c64xx_spi_port_config.fifo_lvl_mask``. This is wrong all the way as we shouldn't make a driver dependable of an alias, or the order of probe. If multiple FIFO sizes are supported across the SPI IPs, one shall instead introduce a fifosize device tree property. Make the SPI alias optional for the newer SoCs and mark the ``port_id`` and ``fifo_lvl_mask`` as deprecated. Signed-off-by: Tudor Ambarus --- drivers/spi/spi-s3c64xx.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index c4ddd2859ba4..9cd64fd3058a 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -128,7 +128,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 @@ -177,7 +178,7 @@ struct s3c64xx_spi_port_config { * @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_id: Port identification number + * @port_id: [DEPRECATED] Port identification number * @fifosize: size of the FIFO for this port */ struct s3c64xx_spi_driver_data { @@ -1152,7 +1153,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) sdd->pdev = pdev; if (pdev->dev.of_node) { ret = of_alias_get_id(pdev->dev.of_node, "spi"); - if (ret < 0) + if (ret < 0 && !sdd->port_conf->fifosize) return dev_err_probe(&pdev->dev, ret, "Failed to get alias id\n"); sdd->port_id = ret; @@ -1171,7 +1172,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) 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; @@ -1252,7 +1253,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 Tue Jan 23 15:34:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13527645 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 93031C47DDF for ; Tue, 23 Jan 2024 15:36:02 +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=uuY96OP07XddmQPJeF4Pwjb8fqi45XnsXma9ykQ/vAA=; b=zPb3zIJoDh6l5k OUu9sB+vqd5VvjgC/l5NVZSRoVKkTGsGaz6lS1tfO/8FbDxRIdpyicoDBC8z8bQYOIACpWHWpDj+m pJRSu2gKxf1c7m+dsS7hJNBIAeNiB2D3K1nAyO5lV7TA5i0b7t+wCzsR8uYTr/yPsJhoZxK299hcF E+fNUxy9tf8XOxVVxe/0gPUZ9a3LkXwjk8BL2CRFFPoQFy/SyU+zg2ALsO1S3HsAyCZdWmbKAcfqE dgwY0Kzzdts5MOLNFcvjYYIwOFuqi3hJUqJuoXuDub6Nb2NaDB/VfudsgLjezF+Lqr830jN0FjlG6 E+YERObncbVCuAMJB7mQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSIoC-00H43r-2T; Tue, 23 Jan 2024 15:35:28 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSIna-00H3Y0-0e for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 15:34:51 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40eacb6067dso27108085e9.1 for ; Tue, 23 Jan 2024 07:34:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024086; x=1706628886; 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=Pkm1sDmd91/8Icdqt+yhAM2zfTrJG1x4ZL3+cJTuru4=; b=DwSrpkCttaVw8hBlgHTpQPB9UczzPBpsAB1mf31llcO19aYqoxwwvSQgmn4T1hDzmX KSB7L3wID5yUiENOQ6DhWGW9o4b2O+2IWYbLpQYvR1pWO4LRZILvkcpbSwhTHfQ7M2+4 t2+ZMwMzM1yb+GO5OEeq/FPEqt+P7yk3qPeg0CIf40f31PIrPhU9DQUVr0lC0udAM92U 3zL3yuvY34+5cXSDEOp+DpOTSkSuSTCsmuIJBfMugSruvN9yG+UtwB/Sd80kefFC8LJR q4iEBT3CWwza2ehr6UnfXV9Uz/4BH4XMkw+VBmFdmHb+rUTKtusSnPLVaXbyYp/+iN6m rUHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024086; x=1706628886; 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=Pkm1sDmd91/8Icdqt+yhAM2zfTrJG1x4ZL3+cJTuru4=; b=dNsLwFbG+zWNtXa5aOBqinRBMZ2czJl++KEVxIcO7m+p6HJ6elMSBmcuzTfRBdeW/z VssjtZwiyIod4usyFkuJRAyBJzQKJiPsh9rwYd8apv3ndaosjhCYxuWJVTHyM8JV0rKp 0dS0csL7mcFJsZeLYl9AeFGR0tIX06JBXjXo8FzSs57b2aedcpOahcWqny/JbqDWubJd yGm4kPJTgUiO//eru+NlhRGz6LBXwIfzr2XWhbH5ZLrfTRE3ZESdN6ZeHGkPm1zaVt4/ FOwPjss7J5PiSgWUGugYWGGkrvembNyMzmHjcYbVr8U9+FJDxHfXmUMyfTGIWj0ue+bE UcYw== X-Gm-Message-State: AOJu0YweWYfB0mjvHrJlm+U/s63uPSlX8klEDUBRfI3QdSjsYAqa/5cf Yrhlg0mo5E8vrfuJ3iRwEWgljCW+j53I9w84xKqaHN9Rb1XUf/wLNQ1bMJhisIM= X-Google-Smtp-Source: AGHT+IE4mLdB3TlfxdLmU2ph7jFqikJUsLFTael0hg9zuHgIorXMxGlhO+GRg4XyNJMUtoeWepFXyg== X-Received: by 2002:a05:600c:3b90:b0:40e:bed2:7bcd with SMTP id n16-20020a05600c3b9000b0040ebed27bcdmr319089wms.140.1706024086420; Tue, 23 Jan 2024 07:34:46 -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 p21-20020a05600c359500b0040e3488f16dsm42457536wmq.12.2024.01.23.07.34.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:34:45 -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 21/21] MAINTAINERS: add Tudor Ambarus as R for the samsung SPI driver Date: Tue, 23 Jan 2024 15:34:20 +0000 Message-ID: <20240123153421.715951-22-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240123153421.715951-1-tudor.ambarus@linaro.org> References: <20240123153421.715951-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-20240123_073450_280878_87F533F0 X-CRM114-Status: GOOD ( 10.34 ) 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. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- 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