Closed qianfan-Zhao closed 5 years ago
Resolution:
diff --git a/drivers/spi/spi-nuc970-p0.c b/drivers/spi/spi-nuc970-p0.c
index 531c8281ec6..8dbc875c376 100644
--- a/drivers/spi/spi-nuc970-p0.c
+++ b/drivers/spi/spi-nuc970-p0.c
@@ -445,6 +445,7 @@ static int nuc970_spi0_setupxfer(struct spi_device *spi,
if (ret)
return ret;
+ nuc970_set_divider(hw);
nuc970_spi0_setup_txbitlen(hw, hw->pdata->txbitlen);
nuc970_tx_edge(hw, hw->pdata->txneg);
nuc970_rx_edge(hw, hw->pdata->rxneg);
diff --git a/drivers/spi/spi-nuc970-p1.c b/drivers/spi/spi-nuc970-p1.c
index 9885dbb6c6c..47a0dfddbb7 100644
--- a/drivers/spi/spi-nuc970-p1.c
+++ b/drivers/spi/spi-nuc970-p1.c
@@ -445,6 +445,7 @@ static int nuc970_spi1_setupxfer(struct spi_device *spi,
if (ret)
return ret;
+ nuc970_set_divider(hw);
nuc970_spi1_setup_txbitlen(hw, hw->pdata->txbitlen);
nuc970_tx_edge(hw, hw->pdata->txneg);
nuc970_rx_edge(hw, hw->pdata->rxneg);
Fixed in 329f50237a85e801f39814c7392269504dd94efe, thanks.
I had connected two device on the same spi bus and they use different chipselect.
One is MODE0 and another is MODE3.
Write 1K random data from the spi bus and dump them by using logic analysis:
The datas come first is in MODE3 and speed is 9.52MHz, after that is MODE0 and speed is 9.52MHz (should be 3MHz).