spi: spi-xilinx: Use DT information for bits_per_word value
Subsystems (2)
PATCH 1/1 spi: spi-xilinx: Use DT information for bits_per_word value
From: Jens Renner <[email protected]>
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 <[email protected]>
---
drivers/spi/spi-xilinx.c +0 -0
@@ -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