Lines Matching refs:mgr

30 static int get_done_gpio(struct fpga_manager *mgr)  in get_done_gpio()  argument
32 struct xilinx_spi_conf *conf = mgr->priv; in get_done_gpio()
38 dev_err(&mgr->dev, "Error reading DONE (%d)\n", ret); in get_done_gpio()
43 static enum fpga_mgr_states xilinx_spi_state(struct fpga_manager *mgr) in xilinx_spi_state() argument
45 if (!get_done_gpio(mgr)) in xilinx_spi_state()
63 static int wait_for_init_b(struct fpga_manager *mgr, int value, in wait_for_init_b() argument
66 struct xilinx_spi_conf *conf = mgr->priv; in wait_for_init_b()
77 dev_err(&mgr->dev, "Error reading INIT_B (%d)\n", ret); in wait_for_init_b()
84 dev_err(&mgr->dev, "Timeout waiting for INIT_B to %s\n", in wait_for_init_b()
94 static int xilinx_spi_write_init(struct fpga_manager *mgr, in xilinx_spi_write_init() argument
98 struct xilinx_spi_conf *conf = mgr->priv; in xilinx_spi_write_init()
102 dev_err(&mgr->dev, "Partial reconfiguration not supported\n"); in xilinx_spi_write_init()
108 err = wait_for_init_b(mgr, 1, 1); /* min is 500 ns */ in xilinx_spi_write_init()
116 err = wait_for_init_b(mgr, 0, 0); in xilinx_spi_write_init()
120 if (get_done_gpio(mgr)) { in xilinx_spi_write_init()
121 dev_err(&mgr->dev, "Unexpected DONE pin state...\n"); in xilinx_spi_write_init()
130 static int xilinx_spi_write(struct fpga_manager *mgr, const char *buf, in xilinx_spi_write() argument
133 struct xilinx_spi_conf *conf = mgr->priv; in xilinx_spi_write()
146 dev_err(&mgr->dev, "SPI error in firmware write: %d\n", in xilinx_spi_write()
169 static int xilinx_spi_write_complete(struct fpga_manager *mgr, in xilinx_spi_write_complete() argument
172 struct xilinx_spi_conf *conf = mgr->priv; in xilinx_spi_write_complete()
186 done = get_done_gpio(mgr); in xilinx_spi_write_complete()
202 dev_err(&mgr->dev, "Error reading INIT_B (%d)\n", ret); in xilinx_spi_write_complete()
206 dev_err(&mgr->dev, in xilinx_spi_write_complete()
210 dev_err(&mgr->dev, "Timeout after config data transfer\n"); in xilinx_spi_write_complete()
226 struct fpga_manager *mgr; in xilinx_spi_probe() local
250 mgr = devm_fpga_mgr_register(&spi->dev, in xilinx_spi_probe()
253 return PTR_ERR_OR_ZERO(mgr); in xilinx_spi_probe()