Lines Matching refs:spi
67 struct spi_device *spi = (struct spi_device *)context; in firmware_load() local
68 struct fpga_data *data = spi_get_drvdata(spi); in firmware_load()
78 dev_err(&spi->dev, "Cannot load firmware, aborting\n"); in firmware_load()
83 dev_err(&spi->dev, "Error: Firmware size is 0!\n"); in firmware_load()
94 spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len); in firmware_load()
96 dev_dbg(&spi->dev, "FPGA JTAG ID=%08x\n", jedec_id); in firmware_load()
103 dev_err(&spi->dev, in firmware_load()
109 dev_info(&spi->dev, "FPGA %s detected\n", ecp3_dev[i].name); in firmware_load()
112 spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len); in firmware_load()
114 dev_dbg(&spi->dev, "FPGA Status=%08x\n", status); in firmware_load()
118 dev_err(&spi->dev, "Error: Can't allocate memory!\n"); in firmware_load()
132 spi_write(spi, txbuf, 4); in firmware_load()
135 spi_write(spi, txbuf, 4); in firmware_load()
138 spi_write(spi, txbuf, 4); in firmware_load()
145 spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len); in firmware_load()
154 dev_err(&spi->dev, in firmware_load()
161 dev_info(&spi->dev, "Configuring the FPGA...\n"); in firmware_load()
162 spi_write(spi, buffer, fw->size + 8); in firmware_load()
165 spi_write(spi, txbuf, 4); in firmware_load()
168 spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len); in firmware_load()
170 dev_dbg(&spi->dev, "FPGA Status=%08x\n", status); in firmware_load()
174 dev_info(&spi->dev, "FPGA successfully configured!\n"); in firmware_load()
176 dev_info(&spi->dev, "FPGA not configured (DONE not set)\n"); in firmware_load()
188 static int lattice_ecp3_probe(struct spi_device *spi) in lattice_ecp3_probe() argument
193 data = devm_kzalloc(&spi->dev, sizeof(*data), GFP_KERNEL); in lattice_ecp3_probe()
195 dev_err(&spi->dev, "Memory allocation for fpga_data failed\n"); in lattice_ecp3_probe()
198 spi_set_drvdata(spi, data); in lattice_ecp3_probe()
202 FIRMWARE_NAME, &spi->dev, in lattice_ecp3_probe()
203 GFP_KERNEL, spi, firmware_load); in lattice_ecp3_probe()
205 dev_err(&spi->dev, "Firmware loading failed with %d!\n", err); in lattice_ecp3_probe()
209 dev_info(&spi->dev, "FPGA bitstream configuration driver registered\n"); in lattice_ecp3_probe()
214 static void lattice_ecp3_remove(struct spi_device *spi) in lattice_ecp3_remove() argument
216 struct fpga_data *data = spi_get_drvdata(spi); in lattice_ecp3_remove()
226 MODULE_DEVICE_TABLE(spi, lattice_ecp3_id);