From patchwork Mon Feb 12 14:03:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 199830 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp2449875dyd; Mon, 12 Feb 2024 06:09:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IFADLJuvVz0UEuri17OZXW2LU6T6zJJuoo3bKnSEWmvQR4xTZs1n1M6Ebzayz91rNoZAE5w X-Received: by 2002:a05:6214:1bc6:b0:68c:9d40:d1c with SMTP id m6-20020a0562141bc600b0068c9d400d1cmr10105172qvc.0.1707746966118; Mon, 12 Feb 2024 06:09:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707746966; cv=pass; d=google.com; s=arc-20160816; b=UrZ4xbLAqa79n2nfbsJU3lD1jNdpr1ZzwJGas+Qj3zag46uQA+42B2EFM1SxaidAEZ NTzSmVeUMP11qhe9bk6KV8ucae1C3iKQb79AXMaT8+/ULVFlo6NDamVo5QNfRK29+LoL NfmNyJceKQ+xtFNzoPzpi2QKkcqAj8ADPSV03iGMFc7yrSNq38/eJfBvkcoaAQh1cFEL 6Pnxb6m/Cu+2Jwwb8OkiQZnL69kAdBNcBfCXWIfM/o4Wmdrk2BW1zN3tZch2meS0CBsT QFDS4AXPSq+5kK1k0EnJGvQCRyEmRcQkwkoenPT/CKI5aCN+quepvxuFr2Ln8kmBR9a4 jPCQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=/YEBZ5QgPmZi1uvEzjonJi8xfKR7wdfW/zkTSEaERIc=; fh=Q20M++GIxQnFux1h4Lu77MXY42Eccyse8dJjKkFM5lA=; b=1DFSpMLvwAgZrh3FZvJRdlWh+3z8BmElFqA8ywycRAWQqgfpBeNBQgC/XKIGn43t4q bIiF6s9J/8sge+2FvKpCtEjCH+v8Aodp9tljgMUOIRkn2iPaDgrd7DH3HnnLCmyuhsx0 1kA7GYVAJhPxMDWugsfg5Yj09CASwXCk1cEHsQDE94YCszO+1gJpeH9YzJDyHzfG3zwx Jq0h+rtlQtEOADzPe+0GVpRqG3YdD+3qZiPwrh44OtWdDdtokFpdBFwSJYhj6l4yMEec 203RD6uUkum1HinJpf7pE61h31QASQHYQJQNgXLHQ4m44+XUEK8CujqSUswxcMG02smf 5V5g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qhMfyoMh; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-61788-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61788-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCXiE34bj7hR0VGNP+FcF8wt7WDKJIdI3OH9rsqUV4ijyK5s/90tlag/ngnr77JtsG6MOYgCdQLjtvr2Ts3TDsuvroR0vA== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id kd3-20020a056214400300b0068cbf72c904si431465qvb.391.2024.02.12.06.09.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 06:09:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61788-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qhMfyoMh; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-61788-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61788-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D389E1C23869 for ; Mon, 12 Feb 2024 14:09:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC1B13D972; Mon, 12 Feb 2024 14:03:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="qhMfyoMh" Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 207123D3B9 for ; Mon, 12 Feb 2024 14:03:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707746629; cv=none; b=PJbrWeTW1HK5mDo4GBh1cop0hcAGP96H+EFHE4qlQzcxiXPX9BsVuT3LxBbyi1DJN0WYDLNNQ9gg8bwSgXayw0c6mQL3j+3YOeKXeIvXBdlnpX+Ml43jEmwsPVupsGIqJhIntcnqqj4zV3Ehh8xDr8fuYzShHxQv6Ji+MCHIv1Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707746629; c=relaxed/simple; bh=1ZMGRL2bdDrzE8jpO2TRP5Gv5JmPakVuDy7jd5uzp9g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=owqOMQ7xcjiC9YBoAXCC3cbDhYsZzC7/Mz4Mtj6S+viu2LmR90hxh3pA/1FIqPWTTaNuCjCf7zIxA3n50JeALhOqlBWMzWNAkwaR3tV26HA90oIdgicDo9521qiAifQ7thEVMNyqEwQyg9AAWEVAYyEHQfGzdWjSnXS5f+Fg4Ns= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=qhMfyoMh; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-33b29b5ea96so1511023f8f.0 for ; Mon, 12 Feb 2024 06:03:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707746626; x=1708351426; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/YEBZ5QgPmZi1uvEzjonJi8xfKR7wdfW/zkTSEaERIc=; b=qhMfyoMhv6kO3y6XvrZHzeQ3EtdSZdIiVNO44hMWpr0tpH/1oLtV4sE69FOE+eCgEi q0HPP+X3I2fOy7G11ATwX1zt9QwfZ6UqtUQi8L3Ks57tIPTklpy0SO8QXXR7iL77T1Fa G6tecTfAJF27E+bIIO3YBvqzZ6M1kwqU1+kC/jwSY0yPrMlo0NN3hYElPssf9p+hmx6c xm59ixdVwA5GqrrRSUTREShuFti9aWfHZ3diwMrsTVL50OjKmlPkQFIc1ubs9T/+r3SB +ssEbNMaMJ0rIX6BRi6tK0rBDagtJqanE9PFI9s2GyAPVBEupeAJdaJB1zVnzs2p8h+S wlUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707746626; x=1708351426; 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=/YEBZ5QgPmZi1uvEzjonJi8xfKR7wdfW/zkTSEaERIc=; b=wYqH+wPKoJDAVTOgFBj/wrUZmkTM3+sU2yPeumYFxJumA44emVjMX6w/mqJIToTspx qVZDMf0glo1OQ/waeHMTDXV3o+vofzVOuIaGG5yQCHF5k+JWmw7H0gxHSYr2nhC9alzY DRxTm8jstfoxNH3eURCyrQP7y9SBxEuZXK7VjlN83Uw81qlvu8O6hWTTwvI8JpZzrNri B9+18UJADPlA5HJj5XJspsynVs66nBvrfLGLWPohXwL68aVZnUC5zK1IulHaBbfAacwz /PJnGKLMw2pMsO4MwkcAPwEU7KZl2taxiAkIh0Wow4I/2zF+C3Nyo8T8ut+GqKCs+cZh 2uuw== X-Gm-Message-State: AOJu0YychWw/3NJCO5DYGCsW4i9rpujopG7i9o3J8PWQ2lRDRuoqmC0S Oe0x/x3MOQAZv6UnHkHltCLp34rtoP4FAtJHq9JyvrdZZcdFJVP9/PeSsUjcoFY= X-Received: by 2002:a5d:6388:0:b0:33b:8604:5068 with SMTP id p8-20020a5d6388000000b0033b86045068mr1747857wru.14.1707746625898; Mon, 12 Feb 2024 06:03:45 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCU+avd8wL8iuEOUD3YPGF+15CK03P0cMjdZum0FGwAAFhBEXXM8bcsjtPURQ+6z2liFzq4eodzK1auoo5Q3JYv/PdEKLDtyJzaOjX5EZOUxC3hUcXyz5J6AJBEeVbrRKek2MaBBETDKc0GPmJSG3fdAUpvmsSIgmOlIBpComLX4JWaCLaNU3GIhjR2nmPqwY6hp3wpaiotOLOQFA7ymTcaZtYpqt5wfnJDkhhnjsPYgNDgo6ebbf0VThnJs+83vsKZBe1gIyB9bzhivHNCUFQKotEI/rqlAZrhyHeJPL1NVNoIdgJ17Cyd+jj7SHtE7VBU6x7VPFkAruymYIKUVoUlgax0uWFtAFFVtD5Q5AgwVfcMkR/IRpujPBRn27Xkd8Abb61qxvfZOfe+wxHciX9o9MxXHM6cgGAFQ+A6OdUFhWGLbt9n0cLXZ2aLW2xzn60WEBJznrlbSY96JSrm0s7pGz2xLqAlcLRQDBQHufKZWANCRNcbw5+MsxpWsrKcLIGyrPCmmv0+F187ecNSQeOhLD1e+frqyOzQH1q084u+IKoy2fNRUL/cF8VXbPr4KRr2F3S4nBraBQGjgbOpMJHx0RRGQjrYnj/jZU6CVt6eaSe/BVxE= Received: from ta2.c.googlers.com.com (105.168.195.35.bc.googleusercontent.com. [35.195.168.105]) by smtp.gmail.com with ESMTPSA id v9-20020a5d4b09000000b0033b843786e1sm2135356wrq.51.2024.02.12.06.03.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 06:03:43 -0800 (PST) From: Tudor Ambarus To: broonie@kernel.org, robh@kernel.org, andi.shyti@kernel.org, krzysztof.kozlowski@linaro.org, semen.protsenko@linaro.org, conor+dt@kernel.org Cc: alim.akhtar@samsung.com, linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, devicetree@vger.kernel.org, arnd@arndb.de, Tudor Ambarus Subject: [PATCH v2 02/12] spi: s3c64xx: define a magic value Date: Mon, 12 Feb 2024 14:03:21 +0000 Message-ID: <20240212140331.915498-3-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.687.g38aa6559b0-goog In-Reply-To: <20240212140331.915498-1-tudor.ambarus@linaro.org> References: <20240212140331.915498-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790702482731117709 X-GMAIL-MSGID: 1790702482731117709 Define a magic value, it will be used in the next patch as well. 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 6f29dca68491..6ff3b25b6feb 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -78,6 +78,7 @@ #define S3C64XX_SPI_INT_RX_FIFORDY_EN (1<<1) #define S3C64XX_SPI_INT_TX_FIFORDY_EN (1<<0) +#define S3C64XX_SPI_ST_TX_FIFO_LVL_SHIFT 6 #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) @@ -108,7 +109,8 @@ #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 TX_FIFO_LVL(v, i) (((v) >> S3C64XX_SPI_ST_TX_FIFO_LVL_SHIFT) & \ + 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)