From: "Jens Renner (EFE)" <renner@efe-gmbh.de>
To: spi-devel-general@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] spi: spi-xilinx: Use DT information for bits_per_word value
Date: Mon, 11 Feb 2013 15:55:39 +0100 [thread overview]
Message-ID: <5119066B.2050103@efe-gmbh.de> (raw)
From: Jens Renner <renner@efe-gmbh.de>
This patch overrides the default value of bits_per_word with the actual value of "xlnx,num-transfer-bits" from the DTS file to allow for 16 and 32 bit word lengths.
Signed-off-by: Jens Renner <renner@efe-gmbh.de>
---
diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c
index e1d7696..03abdfa 100644
--- a/drivers/spi/spi-xilinx.c
+++ b/drivers/spi/spi-xilinx.c
@@ -487,6 +487,12 @@ static int xilinx_spi_probe(struct platform_device *dev)
&len);
if (prop && len >= sizeof(*prop))
num_cs = __be32_to_cpup(prop);
+
+ /* override default number of bits per word */
+ prop = of_get_property(dev->dev.of_node,
+ "xlnx,num-transfer-bits", &len);
+ if (prop && len >= sizeof(*prop))
+ bits_per_word = __be32_to_cpup(prop);
}
#endif
next reply other threads:[~2013-02-11 14:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-11 14:55 Jens Renner (EFE) [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-02-11 16:28 [PATCH] spi: spi-xilinx: Use DT information for bits_per_word value Jens Renner (EFE)
[not found] ` <51191C11.9070607-Xf229rFC5gsb1SvskN2V4Q@public.gmane.org>
2013-03-02 21:22 ` Grant Likely
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=5119066B.2050103@efe-gmbh.de \
--to=renner@efe-gmbh.de \
--cc=linux-kernel@vger.kernel.org \
--cc=spi-devel-general@lists.sourceforge.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.