Thread (3 messages) flat view 3 messages, 3 authors, 2018-06-20

Re: [PATCH] spi/fsl-espi: Add missing cell-index OF property

From: York Sun <hidden>
Date: 2018-06-19 16:29:42

Joakim,=0A=
=0A=
I am not the maintainer for this driver. Adding Mark Brown.=0A=
=0A=
York=0A=
=0A=
On 06/19/2018 09:23 AM, Joakim Tjernlund wrote:=0A=
quoted hunk ↗ jump to hunk
espi does not look for a OF cell-index property which=0A=
makes the bus numbering dynamic only. This add an=0A=
optional cell-index.=0A=
=0A=
Signed-off-by: Joakim Tjernlund <redacted>=0A=
---=0A=
 drivers/spi/spi-fsl-espi.c | 8 ++++++++=0A=
 1 file changed, 8 insertions(+)=0A=
=0A=
diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c=0A=
index 1d332e23f6ed..56b71c5e2f10 100644=0A=
--- a/drivers/spi/spi-fsl-espi.c=0A=
+++ b/drivers/spi/spi-fsl-espi.c=0A=
@@ -672,6 +672,14 @@ static int fsl_espi_probe(struct device *dev, struct=
 resource *mem,=0A=
 =0A=
 	dev_set_drvdata(dev, master);=0A=
 =0A=
+	if (dev->of_node) {=0A=
+		u32 cell_index;=0A=
+=0A=
+		if (!of_property_read_u32(dev->of_node, "cell-index",=0A=
+					  &cell_index))=0A=
+			master->bus_num =3D cell_index;=0A=
+	}=0A=
+=0A=
 	master->mode_bits =3D SPI_RX_DUAL | SPI_CPOL | SPI_CPHA | SPI_CS_HIGH |=
=0A=
 			    SPI_LSB_FIRST | SPI_LOOP;=0A=
 	master->dev.of_node =3D dev->of_node;=0A=
=0A=
=0A=
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help