18 #include <linux/module.h>
19 #include <linux/i2c.h>
37 #define FWDEV(x) &((x)->dev)
64 #define CX2388x_FIRMWARE "v4l-cx23885-avcore-01.fw"
65 #define CX231xx_FIRMWARE "v4l-cx231xx-avcore-01.fw"
66 #define CX25840_FIRMWARE "v4l-cx25840.fw"
74 if (is_cx2388x(state))
76 if (is_cx231xx(state))
88 v4l_err(client,
"firmware %s load failed\n",
93 v4l_info(client,
"loaded %s firmware (%d bytes)\n",
94 get_fw_name(client), size);
101 v4l_err(client,
"firmware load i2c failure\n");
114 const char *fwname = get_fw_name(client);
117 u32 gpio_oe = 0, gpio_da = 0;
119 if (is_cx2388x(state)) {
125 if (is_cx231xx(state) && MAX_BUF_SIZE > 16) {
126 v4l_err(client,
" Firmware download size changed to 16 bytes max length\n");
131 v4l_err(client,
"unable to open firmware %s\n", fwname);
135 start_fw_load(client);
143 int len =
min(MAX_BUF_SIZE - 2, size);
145 memcpy(buffer + 2, ptr, len);
147 retval = fw_write(client, buffer, len + 2);
163 if (is_cx2388x(state)) {
169 return check_fw_load(client, size);