Lines Matching refs:ix
86 static void _drx_release_fw(struct drx397xD_state *s, enum fw_ix ix)
88 memset(&fw[ix].data[0], 0, sizeof(fw[0].data));
89 if (fw[ix].file)
90 release_firmware(fw[ix].file);
95 enum fw_ix ix = s->chip_rev;
99 write_lock(&fw[ix].lock);
100 if (fw[ix].refcnt) {
101 fw[ix].refcnt--;
102 if (fw[ix].refcnt == 0)
103 _drx_release_fw(s, ix);
105 write_unlock(&fw[ix].lock);
108 static int drx_load_fw(struct drx397xD_state *s, enum fw_ix ix)
116 if (ix < 0 || ix >= ARRAY_SIZE(fw))
118 s->chip_rev = ix;
120 write_lock(&fw[ix].lock);
121 if (fw[ix].file) {
125 memset(&fw[ix].data[0], 0, sizeof(fw[0].data));
127 rc = request_firmware(&fw[ix].file, fw[ix].name, s->i2c->dev.parent);
130 mod_name, fw[ix].name);
134 if (!fw[ix].file->data || fw[ix].file->size < 10)
137 data = fw[ix].file->data;
138 size = fw[ix].file->size;
161 fw[ix].data[j] = &data[i + len + 1];
180 _drx_release_fw(s, ix);
181 fw[ix].refcnt--;
183 fw[ix].refcnt++;
184 write_unlock(&fw[ix].lock);
190 static int write_fw(struct drx397xD_state *s, enum blob_ix ix)
199 if (ix < 0 || ix >= ARRAY_SIZE(blob_name)) {
203 pr_debug("%s %s\n", __func__, blob_name[ix]);
206 data = fw[s->chip_rev].data[ix];