Commit e58f7d15 authored by Alvaro Gamez Machado's avatar Alvaro Gamez Machado Committed by Mark Brown

spi: xilinx: Add DT support for selecting transfer word width

This core supports either 8, 16 or 32 bits as word width. This value is only
settable on instantiation, and thus we need to support any of them by means
of the device tree.
Signed-off-by: default avatarAlvaro Gamez Machado <alvaro.gamez@hazent.com>
Link: https://lore.kernel.org/r/20191024110757.25820-3-alvaro.gamez@hazent.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent e3354b17
...@@ -391,7 +391,7 @@ static int xilinx_spi_probe(struct platform_device *pdev) ...@@ -391,7 +391,7 @@ static int xilinx_spi_probe(struct platform_device *pdev)
struct xilinx_spi *xspi; struct xilinx_spi *xspi;
struct xspi_platform_data *pdata; struct xspi_platform_data *pdata;
struct resource *res; struct resource *res;
int ret, num_cs = 0, bits_per_word = 8; int ret, num_cs = 0, bits_per_word;
struct spi_master *master; struct spi_master *master;
u32 tmp; u32 tmp;
u8 i; u8 i;
...@@ -403,6 +403,11 @@ static int xilinx_spi_probe(struct platform_device *pdev) ...@@ -403,6 +403,11 @@ static int xilinx_spi_probe(struct platform_device *pdev)
} else { } else {
of_property_read_u32(pdev->dev.of_node, "xlnx,num-ss-bits", of_property_read_u32(pdev->dev.of_node, "xlnx,num-ss-bits",
&num_cs); &num_cs);
ret = of_property_read_u32(pdev->dev.of_node,
"xlnx,num-transfer-bits",
&bits_per_word);
if (ret)
bits_per_word = 8;
} }
if (!num_cs) { if (!num_cs) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment