openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Joel Stanley <joel@jms.id.au>
Cc: linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org,
	devicetree@vger.kernel.org, Andrew Jeffery <andrew@aj.id.au>,
	linux-kernel@vger.kernel.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: [PATCH 02/14] fsi: Move code around to avoid forward declaration
Date: Wed, 27 Jun 2018 09:25:53 +1000	[thread overview]
Message-ID: <20180626232605.13420-3-benh@kernel.crashing.org> (raw)
In-Reply-To: <20180626232605.13420-1-benh@kernel.crashing.org>

Move fsi_slave_set_smode() and its helpers to before it's
first user and remove the corresponding forward declaration.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 drivers/fsi/fsi-core.c | 94 +++++++++++++++++++++---------------------
 1 file changed, 46 insertions(+), 48 deletions(-)

diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
index 565218872635..2f6f9b8c75e4 100644
--- a/drivers/fsi/fsi-core.c
+++ b/drivers/fsi/fsi-core.c
@@ -215,7 +215,52 @@ static int fsi_slave_report_and_clear_errors(struct fsi_slave *slave)
 			&irq, sizeof(irq));
 }
 
-static int fsi_slave_set_smode(struct fsi_master *master, int link, int id);
+/* Encode slave local bus echo delay */
+static inline uint32_t fsi_smode_echodly(int x)
+{
+	return (x & FSI_SMODE_ED_MASK) << FSI_SMODE_ED_SHIFT;
+}
+
+/* Encode slave local bus send delay */
+static inline uint32_t fsi_smode_senddly(int x)
+{
+	return (x & FSI_SMODE_SD_MASK) << FSI_SMODE_SD_SHIFT;
+}
+
+/* Encode slave local bus clock rate ratio */
+static inline uint32_t fsi_smode_lbcrr(int x)
+{
+	return (x & FSI_SMODE_LBCRR_MASK) << FSI_SMODE_LBCRR_SHIFT;
+}
+
+/* Encode slave ID */
+static inline uint32_t fsi_smode_sid(int x)
+{
+	return (x & FSI_SMODE_SID_MASK) << FSI_SMODE_SID_SHIFT;
+}
+
+static uint32_t fsi_slave_smode(int id)
+{
+	return FSI_SMODE_WSC | FSI_SMODE_ECRC
+		| fsi_smode_sid(id)
+		| fsi_smode_echodly(0xf) | fsi_smode_senddly(0xf)
+		| fsi_smode_lbcrr(0x8);
+}
+
+static int fsi_slave_set_smode(struct fsi_master *master, int link, int id)
+{
+	uint32_t smode;
+	__be32 data;
+
+	/* set our smode register with the slave ID field to 0; this enables
+	 * extended slave addressing
+	 */
+	smode = fsi_slave_smode(id);
+	data = cpu_to_be32(smode);
+
+	return fsi_master_write(master, link, id, FSI_SLAVE_BASE + FSI_SMODE,
+			&data, sizeof(data));
+}
 
 static int fsi_slave_handle_error(struct fsi_slave *slave, bool write,
 				  uint32_t addr, size_t size)
@@ -569,53 +614,6 @@ static const struct bin_attribute fsi_slave_term_attr = {
 	.write = fsi_slave_sysfs_term_write,
 };
 
-/* Encode slave local bus echo delay */
-static inline uint32_t fsi_smode_echodly(int x)
-{
-	return (x & FSI_SMODE_ED_MASK) << FSI_SMODE_ED_SHIFT;
-}
-
-/* Encode slave local bus send delay */
-static inline uint32_t fsi_smode_senddly(int x)
-{
-	return (x & FSI_SMODE_SD_MASK) << FSI_SMODE_SD_SHIFT;
-}
-
-/* Encode slave local bus clock rate ratio */
-static inline uint32_t fsi_smode_lbcrr(int x)
-{
-	return (x & FSI_SMODE_LBCRR_MASK) << FSI_SMODE_LBCRR_SHIFT;
-}
-
-/* Encode slave ID */
-static inline uint32_t fsi_smode_sid(int x)
-{
-	return (x & FSI_SMODE_SID_MASK) << FSI_SMODE_SID_SHIFT;
-}
-
-static uint32_t fsi_slave_smode(int id)
-{
-	return FSI_SMODE_WSC | FSI_SMODE_ECRC
-		| fsi_smode_sid(id)
-		| fsi_smode_echodly(0xf) | fsi_smode_senddly(0xf)
-		| fsi_smode_lbcrr(0x8);
-}
-
-static int fsi_slave_set_smode(struct fsi_master *master, int link, int id)
-{
-	uint32_t smode;
-	__be32 data;
-
-	/* set our smode register with the slave ID field to 0; this enables
-	 * extended slave addressing
-	 */
-	smode = fsi_slave_smode(id);
-	data = cpu_to_be32(smode);
-
-	return fsi_master_write(master, link, id, FSI_SLAVE_BASE + FSI_SMODE,
-			&data, sizeof(data));
-}
-
 static void fsi_slave_release(struct device *dev)
 {
 	struct fsi_slave *slave = to_fsi_slave(dev);
-- 
2.17.1

  parent reply	other threads:[~2018-06-26 23:27 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-26 23:25 [PATCH 00/14] fsi: Fixes and Coldfire coprocessor offload Benjamin Herrenschmidt
2018-06-26 23:25 ` [PATCH 01/14] devres: Add devm_of_iomap() Benjamin Herrenschmidt
2018-06-26 23:25 ` Benjamin Herrenschmidt [this message]
2018-06-26 23:25 ` [PATCH 03/14] fsi: Add mechanism to set the tSendDelay and tEchoDelay values Benjamin Herrenschmidt
2018-06-28  4:10   ` Joel Stanley
2018-06-26 23:25 ` [PATCH 04/14] fsi: master-gpio: Rename and adjust send delay Benjamin Herrenschmidt
2018-06-26 23:25 ` [PATCH 05/14] fsi: master-gpio: Add support for link_config Benjamin Herrenschmidt
2018-06-28  4:11   ` Joel Stanley
2018-06-26 23:25 ` [PATCH 06/14] fsi: master-gpio: Add more tracepoints Benjamin Herrenschmidt
2018-06-28  4:11   ` Joel Stanley
2018-07-12  2:01     ` Benjamin Herrenschmidt
2018-06-26 23:25 ` [PATCH 07/14] fsi: master-gpio: Remove unused definitions Benjamin Herrenschmidt
2018-06-28  4:11   ` Joel Stanley
2018-06-26 23:25 ` [PATCH 08/14] fsi: master-gpio: Remove "GPIO" prefix on some definitions Benjamin Herrenschmidt
2018-06-28  4:11   ` Joel Stanley
2018-06-26 23:26 ` [PATCH 09/14] fsi: master-gpio: Add missing release function Benjamin Herrenschmidt
2018-06-28  4:12   ` Joel Stanley
2018-06-26 23:26 ` [PATCH 10/14] fsi: Move various master definitions to a common header Benjamin Herrenschmidt
2018-06-28  4:12   ` Joel Stanley
2018-06-26 23:26 ` [PATCH 11/14] dt-bindings: fsi: Document binding for the fsi-master-ast-cf "device" Benjamin Herrenschmidt
2018-06-28  4:12   ` Joel Stanley
2018-07-03 22:30   ` Rob Herring
2018-07-04  1:16     ` Benjamin Herrenschmidt
2018-07-05 16:08       ` Rob Herring
2018-07-07  1:50         ` Benjamin Herrenschmidt
2018-06-26 23:26 ` [PATCH 12/14] fsi: master-ast-cf: Add new FSI master using Aspeed ColdFire Benjamin Herrenschmidt
2018-06-28  5:03   ` Joel Stanley
2018-06-26 23:26 ` [PATCH 13/14] arm: dts: OpenPower Romulus system can use coprocessor for FSI Benjamin Herrenschmidt
2018-06-28  4:12   ` Joel Stanley
2018-06-26 23:26 ` [PATCH 14/14] arm: dts: OpenPower Palmetto " Benjamin Herrenschmidt
2018-06-28  4:13   ` Joel Stanley
  -- strict thread matches above, loose matches on Subject: below --
2018-06-26 23:23 [PATCH 00/14] fsi: Fixes and Coldfire coprocessor offload Benjamin Herrenschmidt
2018-06-26 23:23 ` [PATCH 02/14] fsi: Move code around to avoid forward declaration Benjamin Herrenschmidt
2018-06-28  4:10   ` Joel Stanley
2018-06-26 23:20 [PATCH 00/14] fsi: Fixes and Coldfire coprocessor offload Benjamin Herrenschmidt
2018-06-26 23:20 ` [PATCH 02/14] fsi: Move code around to avoid forward declaration Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180626232605.13420-3-benh@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=andrew@aj.id.au \
    --cc=devicetree@vger.kernel.org \
    --cc=joel@jms.id.au \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openbmc@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).