From patchwork Fri Feb 16 07:05:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13559618 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 3D665C48260 for ; Fri, 16 Feb 2024 07:06:39 +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=LiPzN8VtDPN3KrVy2oGqB3cSWUtoBpITPJRzyeOmYKg=; b=UDXS8oxBEt9ux4 hEQ/uE4XQ6VPYF8tjr+y4+kX4wOxN7aLU5IXSCm/x91v6rp9NrkQHXg8Oa+09+Uhyb3HQT+3ez4F3 f5kVkIUQaOL+D+N1wpk5Z2qQezNV2o7XQOWWQ2Bs9fS2KM+KeET3Lk5k1dgrwIpYcpWj/54D/nEwp jXJbR1S+u5aZWNt2LG1OlyI3lvHygDO4pXfByQz1ts1KThQ5qy/mdfQAmJAywrON22J21MjH8wiAb r2u9tgE6TWuZRcy3vnN7THcR7X2v+aCnuKd0r8569z4XjjmTaWjsO2PffpzW06z+sPLo0vho9PWcg lX3I+LU5Lnl09oHfOK5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rasIe-00000001JGX-0AD5; Fri, 16 Feb 2024 07:06:20 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rasIN-00000001J8M-12A5 for linux-arm-kernel@lists.infradead.org; Fri, 16 Feb 2024 07:06:07 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-411f165ef9bso14039395e9.0 for ; Thu, 15 Feb 2024 23:06:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708067161; x=1708671961; 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=B4fweEbO97J5QIjA941SE8yy8/h6DEGER6dvQE2i+PI=; b=ARbhpEbA3k2I/tkRwtzhF/H5k6tk7Hn9RHc6xHLuZTW7k8YwIJlj6TETRIyCHg5IzW kx+mhnqq/mcWi1cpC55kWjIE+LKQEWEcLvqth1pDdqRE0HFuPaoE7wM+tVDM/ZFjhXS6 i1s2amVm60OusZ5lzwfH54dqtuZ59EjGdOCNw4epjDDbj4YLDKYWC6QncsBR/A7JRZcF RRcBhkI4IPHl1Bs/SOmvMwqwV6am+D0/MW78fctpKrnDeoFsDXyIF09tOU1dzW2GzGHb TX1S8FVDkyoE3MYtk0xFtiJ79lSz9zuxTVxNLwjNQ8pmc0xzo1gGUI0XxDG9I7YCgl9t i0KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708067161; x=1708671961; 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=B4fweEbO97J5QIjA941SE8yy8/h6DEGER6dvQE2i+PI=; b=i0cuLmMNinovz+IdSxi8KvC8lM801f6vx3yZKb1UvTyaXvd1+62/xrER+MySU5eEv5 2HEJ6+6kjjmujJQvDrZHJjGrU+wB1e91E34TYuSusAOxrGtGRrb8cTF3ZlGn7nVZd/Q9 if61yZGDlMlOIZF0fWjMfkUaga6lMRS9fgForpogVC4eAvJD4fruXL3bYX6nXoLgxKpr /5Z6Aadi6F1ct1WoKNlgc+gZnYmeT3SkKl8HU++EZvtFdFqXBt+ds0XE3wtIjMImR8Ww LyOzHtlMcjw5wwnOECr4s3Zts3H4WgL5vgzv6skZnZJ0dhfAy2rrquejuYO5pwK2Ynni S80g== X-Forwarded-Encrypted: i=1; AJvYcCWMZr7AdVbcyOeNJIC13IWRtyIZxD4M3u+Dw82IsfZBEWleJNuxDy/TRvGxsukPe5H/9Xn2MB3opJ/TtCn7wjohM8ydOi8u5KdCRE1igSUdHqmSLsM= X-Gm-Message-State: AOJu0YzOOaszOCPw2NKojLY7ElOIVhjY5iYC1Td7E0IBlcDL3JMuKe9z lYg9ysML1tlSrqLmuOqsKYHq8tFg7KB5/n8wvbpczG9pW8Gvp4x+GNAZqikkRJA= X-Google-Smtp-Source: AGHT+IGNTDNcX3yLe4cA7IBsE2D0ybjAgGYV+Vet+w3kDi3fkoc8XRRHeXTdsbbg8juxa8VlLjF5Fw== X-Received: by 2002:adf:fe86:0:b0:33c:f638:ed0b with SMTP id l6-20020adffe86000000b0033cf638ed0bmr3032323wrr.8.1708067161478; Thu, 15 Feb 2024 23:06:01 -0800 (PST) Received: from ta2.c.googlers.com.com (105.168.195.35.bc.googleusercontent.com. [35.195.168.105]) by smtp.gmail.com with ESMTPSA id k18-20020a5d66d2000000b0033940016d6esm1298839wrw.93.2024.02.15.23.06.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 23:06:00 -0800 (PST) From: Tudor Ambarus To: broonie@kernel.org, robh@kernel.org, andi.shyti@kernel.org, krzysztof.kozlowski@linaro.org, semen.protsenko@linaro.org, conor+dt@kernel.org Cc: alim.akhtar@samsung.com, linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, devicetree@vger.kernel.org, Tudor Ambarus Subject: [PATCH v3 02/12] spi: s3c64xx: define a magic value Date: Fri, 16 Feb 2024 07:05:45 +0000 Message-ID: <20240216070555.2483977-3-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog In-Reply-To: <20240216070555.2483977-1-tudor.ambarus@linaro.org> References: <20240216070555.2483977-1-tudor.ambarus@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240215_230603_303578_50290E4E X-CRM114-Status: GOOD ( 11.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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)