Lines Matching +full:serial +full:- +full:midi
1 // SPDX-License-Identifier: GPL-2.0
20 //#undef SPDIF /* if you want MIDI uncomment this line */
25 #define FIRMWARE_FW "emi62/midi.fw"
28 #define EMI62_VENDOR_ID 0x086a /* Emagic Soft-und Hardware GmBH */
35 #define CPUCS_REG 0x7F92 /* EZ-USB Control and Status Register. Bit 0 controls 8051 reset */
46 /* thanks to drivers/usb/serial/keyspan_pda.c code */
55 dev_err(&dev->dev, "kmalloc(%d) failed.\n", length); in emi62_writememory()
56 return -ENOMEM; in emi62_writememory()
65 /* thanks to drivers/usb/serial/keyspan_pda.c code */
69 dev_info(&dev->dev, "%s - %d\n", __func__, reset_bit); in emi62_set_reset()
73 dev_err(&dev->dev, "set_reset (%d) failed\n", reset_bit); in emi62_set_reset()
85 int err = -ENOMEM; in emi62_load_firmware()
90 dev_dbg(&dev->dev, "load_firmware\n"); in emi62_load_firmware()
95 err = request_ihex_firmware(&loader_fw, "emi62/loader.fw", &dev->dev); in emi62_load_firmware()
100 &dev->dev); in emi62_load_firmware()
104 err = request_ihex_firmware(&firmware_fw, FIRMWARE_FW, &dev->dev); in emi62_load_firmware()
115 rec = (const struct ihex_binrec *)loader_fw->data; in emi62_load_firmware()
117 /* 1. We need to put the loader for the FPGA into the EZ-USB */ in emi62_load_firmware()
119 err = emi62_writememory(dev, be32_to_cpu(rec->addr), in emi62_load_firmware()
120 rec->data, be16_to_cpu(rec->len), in emi62_load_firmware()
127 /* De-assert reset (let the CPU run) */ in emi62_load_firmware()
136 rec = (const struct ihex_binrec *)bitstream_fw->data; in emi62_load_firmware()
139 addr = be32_to_cpu(rec->addr); in emi62_load_firmware()
142 while (rec && (i + be16_to_cpu(rec->len) < FW_LOAD_SIZE)) { in emi62_load_firmware()
143 memcpy(buf + i, rec->data, be16_to_cpu(rec->len)); in emi62_load_firmware()
144 i += be16_to_cpu(rec->len); in emi62_load_firmware()
157 /* 3. We need to put the loader for the firmware into the EZ-USB (again...) */ in emi62_load_firmware()
158 for (rec = (const struct ihex_binrec *)loader_fw->data; in emi62_load_firmware()
160 err = emi62_writememory(dev, be32_to_cpu(rec->addr), in emi62_load_firmware()
161 rec->data, be16_to_cpu(rec->len), in emi62_load_firmware()
167 /* De-assert reset (let the CPU run) */ in emi62_load_firmware()
173 /* 4. We put the part of the firmware that lies in the external RAM into the EZ-USB */ in emi62_load_firmware()
175 for (rec = (const struct ihex_binrec *)firmware_fw->data; in emi62_load_firmware()
177 if (!INTERNAL_RAM(be32_to_cpu(rec->addr))) { in emi62_load_firmware()
178 err = emi62_writememory(dev, be32_to_cpu(rec->addr), in emi62_load_firmware()
179 rec->data, be16_to_cpu(rec->len), in emi62_load_firmware()
191 for (rec = (const struct ihex_binrec *)firmware_fw->data; in emi62_load_firmware()
193 if (INTERNAL_RAM(be32_to_cpu(rec->addr))) { in emi62_load_firmware()
194 err = emi62_writememory(dev, be32_to_cpu(rec->addr), in emi62_load_firmware()
195 rec->data, be16_to_cpu(rec->len), in emi62_load_firmware()
202 /* De-assert reset (let the CPU run) */ in emi62_load_firmware()
220 dev_err(&dev->dev,"%s - error loading firmware: error = %d\n", in emi62_load_firmware()
227 dev_err(&dev->dev, "Error\n"); in emi62_load_firmware()
241 dev_dbg(&intf->dev, "emi62_probe\n"); in emi62_probe()
243 dev_info(&intf->dev, "%s start\n", __func__); in emi62_probe()
248 return -EIO; in emi62_probe()
256 .name = "emi62 - firmware loader",