All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jens Renner (EFE)" <renner-Xf229rFC5gsb1SvskN2V4Q@public.gmane.org>
To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [PATCH] spi: spi-xilinx: Use DT information for bits_per_word value
Date: Mon, 11 Feb 2013 17:28:01 +0100	[thread overview]
Message-ID: <51191C11.9070607@efe-gmbh.de> (raw)

From: Jens Renner <renner-Xf229rFC5gsb1SvskN2V4Q@public.gmane.org>

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-Xf229rFC5gsb1SvskN2V4Q@public.gmane.org>
---
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

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb

             reply	other threads:[~2013-02-11 16:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-11 16:28 Jens Renner (EFE) [this message]
     [not found] ` <51191C11.9070607-Xf229rFC5gsb1SvskN2V4Q@public.gmane.org>
2013-03-02 21:22   ` [PATCH] spi: spi-xilinx: Use DT information for bits_per_word value Grant Likely
  -- strict thread matches above, loose matches on Subject: below --
2013-02-11 14:55 Jens Renner (EFE)

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=51191C11.9070607@efe-gmbh.de \
    --to=renner-xf229rfc5gsb1svskn2v4q@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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 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.