fpga-manager: altera-ps-spi: preserve nCONFIG state
PATCH 1/1 fpga-manager: altera-ps-spi: preserve nCONFIG state
If the driver module is loaded when FPGA is configured, the FPGA is reset because nconfig is pulled low (low-active gpio inited with GPIOD_OUT_HIGH activates the signal which means setting its value to low). Init nconfig with GPIOD_OUT_LOW to prevent this.
--- drivers/fpga/altera-ps-spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fpga/altera-ps-spi.c +1 -1
@@ -258,7 +258,7 @@ static int altera_ps_probe(struct spi_device *spi) } conf->spi = spi; - conf->config =devm_gpiod_get (&spi->dev,"nconfig" ,GPIOD_OUT_HIGH ); + conf->config =devm_gpiod_get (&spi->dev,"nconfig" ,GPIOD_OUT_LOW );if (IS_ERR (conf->config)) {dev_err (&spi->dev,"Failed to get config gpio: %ld\n" ,PTR_ERR (conf->config));
Signature · 1 line
2.11.0
On Thu, Feb 1, 2018 at 4:20 PM, Anatolij Gustschin <[email protected]> wrote:
Hi Anatolij,
Quoted 4 lines
If the driver module is loaded when FPGA is configured, the FPGA is reset because nconfig is pulled low (low-active gpio inited with
GPIOD_OUT_HIGHactivates the signal which means setting its value to low). Init nconfig withGPIOD_OUT_LOWto prevent this.
Yes, makes sense.
Quoted 2 lines
Signed-off-by Anatolij Gustschin <[email protected]>
Thanks,
Alan
Quoted 24 lines
--- drivers/fpga/altera-ps-spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/fpga/altera-ps-spi.c +1
-2@@ -258,7 +258,7 @@ static int altera_ps_probe(struct spi_device *spi) } conf->spi = spi; - conf->config =devm_gpiod_get (&spi->dev,"nconfig" ,GPIOD_OUT_HIGH ); + conf->config =devm_gpiod_get (&spi->dev,"nconfig" ,GPIOD_OUT_LOW );if (IS_ERR (conf->config)) {dev_err (&spi->dev,"Failed to get config gpio: %ld\n" ,PTR_ERR (conf->config)); --2.11.0
--
To unsubscribe from this list: send the line "unsubscribe linux-fpga" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Anatolij,
Quoted 6 lines · Anatolij Gustschin
If the driver module is loaded when FPGA is configured, the FPGA is reset because nconfig is pulled low (low-active gpio inited with
GPIOD_OUT_HIGHactivates the signal which means setting its value to low). Init nconfig withGPIOD_OUT_LOWto prevent this.Signed-off-by Anatolij Gustschin <[email protected]>
Quoted 20 lines
--- drivers/fpga/altera-ps-spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/fpga/altera-ps-spi.c +1
-1@@ -258,7 +258,7 @@ static int altera_ps_probe(struct spi_device *spi) } conf->spi = spi; - conf->config =devm_gpiod_get (&spi->dev,"nconfig" ,GPIOD_OUT_HIGH ); + conf->config =devm_gpiod_get (&spi->dev,"nconfig" ,GPIOD_OUT_LOW );if (IS_ERR (conf->config)) {dev_err (&spi->dev,"Failed to get config gpio: %ld\n" ,PTR_ERR (conf->config));Signature · 1 line
2.11.0
Thanks for your patch,
Moritz