lkml.org 
[lkml]   [2019]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/3] spi: lpspi: add multi SS support in PIO mode
Date
Add "fsl,spi-num-chipselects" check to support multi SS function in PIO
mode.

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
---
drivers/spi/spi-fsl-lpspi.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c
index 19040b5ef349..a8e83cb96f61 100644
--- a/drivers/spi/spi-fsl-lpspi.c
+++ b/drivers/spi/spi-fsl-lpspi.c
@@ -841,7 +841,7 @@ static int fsl_lpspi_probe(struct platform_device *pdev)
struct spi_imx_master *lpspi_platform_info =
dev_get_platdata(&pdev->dev);
struct resource *res;
- int i, ret, irq;
+ int i, ret, irq, num_cs;
u32 temp;
bool is_slave;

@@ -863,6 +863,16 @@ static int fsl_lpspi_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, controller);

+ ret = of_property_read_u32(np, "fsl,spi-num-chipselects", &num_cs);
+ if (ret < 0) {
+ if (lpspi_platform_info) {
+ num_cs = lpspi_platform_info->num_chipselect;
+ controller->num_chipselect = num_cs;
+ }
+ } else {
+ controller->num_chipselect = num_cs;
+ }
+
fsl_lpspi = spi_controller_get_devdata(controller);
fsl_lpspi->dev = &pdev->dev;
fsl_lpspi->is_slave = is_slave;
--
2.17.1
\
 
 \ /
  Last update: 2019-04-23 12:47    [W:0.082 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site