Lines Matching refs:ptr
74 zr36016_read (struct zr36016 *ptr, in zr36016_read() argument
80 if (ptr->codec->master_data->readreg) in zr36016_read()
82 (ptr->codec->master_data-> in zr36016_read()
83 readreg(ptr->codec, reg)) & 0xFF; in zr36016_read()
87 ptr->name); in zr36016_read()
89 dprintk(4, "%s: reading from 0x%04x: %02x\n", ptr->name, reg, in zr36016_read()
96 zr36016_write (struct zr36016 *ptr, in zr36016_write() argument
100 dprintk(4, "%s: writing 0x%02x to 0x%04x\n", ptr->name, value, in zr36016_write()
104 if (ptr->codec->master_data->writereg) { in zr36016_write()
105 ptr->codec->master_data->writereg(ptr->codec, reg, value); in zr36016_write()
110 ptr->name); in zr36016_write()
117 zr36016_readi (struct zr36016 *ptr, in zr36016_readi() argument
123 if ((ptr->codec->master_data->writereg) && in zr36016_readi()
124 (ptr->codec->master_data->readreg)) { in zr36016_readi()
125 ptr->codec->master_data->writereg(ptr->codec, ZR016_IADDR, reg & 0x0F); // ADDR in zr36016_readi()
126 value = (ptr->codec->master_data->readreg(ptr->codec, ZR016_IDATA)) & 0xFF; // DATA in zr36016_readi()
131 ptr->name); in zr36016_readi()
133 dprintk(4, "%s: reading indirect from 0x%04x: %02x\n", ptr->name, in zr36016_readi()
139 zr36016_writei (struct zr36016 *ptr, in zr36016_writei() argument
143 dprintk(4, "%s: writing indirect 0x%02x to 0x%04x\n", ptr->name, in zr36016_writei()
147 if (ptr->codec->master_data->writereg) { in zr36016_writei()
148 ptr->codec->master_data->writereg(ptr->codec, ZR016_IADDR, reg & 0x0F); // ADDR in zr36016_writei()
149 ptr->codec->master_data->writereg(ptr->codec, ZR016_IDATA, value & 0x0FF); // DATA in zr36016_writei()
154 ptr->name); in zr36016_writei()
165 zr36016_read_version (struct zr36016 *ptr) in zr36016_read_version() argument
167 ptr->version = zr36016_read(ptr, 0) >> 4; in zr36016_read_version()
168 return ptr->version; in zr36016_read_version()
178 zr36016_basic_test (struct zr36016 *ptr) in zr36016_basic_test() argument
182 zr36016_writei(ptr, ZR016I_PAX_LO, 0x55); in zr36016_basic_test()
183 dprintk(1, KERN_INFO "%s: registers: ", ptr->name); in zr36016_basic_test()
185 dprintk(1, "%02x ", zr36016_readi(ptr, i)); in zr36016_basic_test()
190 zr36016_writei(ptr, ZR016I_PAX_LO, 0x00); in zr36016_basic_test()
191 if (zr36016_readi(ptr, ZR016I_PAX_LO) != 0x0) { in zr36016_basic_test()
195 ptr->name); in zr36016_basic_test()
198 zr36016_writei(ptr, ZR016I_PAX_LO, 0x0d0); in zr36016_basic_test()
199 if (zr36016_readi(ptr, ZR016I_PAX_LO) != 0x0d0) { in zr36016_basic_test()
203 ptr->name); in zr36016_basic_test()
207 zr36016_read_version(ptr); in zr36016_basic_test()
208 if (ptr->version & 0x0c) { in zr36016_basic_test()
212 ptr->name, ptr->version); in zr36016_basic_test()
226 static int zr36016_pushit (struct zr36016 *ptr,
234 ptr->name, startreg,len);
236 zr36016_writei(ptr, startreg++, data[i++]);
250 zr36016_init (struct zr36016 *ptr) in zr36016_init() argument
253 zr36016_write(ptr, ZR016_GOSTOP, 0); in zr36016_init()
256 zr36016_write(ptr, ZR016_MODE, in zr36016_init()
258 (ptr->mode == CODEC_DO_COMPRESSION ? in zr36016_init()
262 zr36016_writei(ptr, ZR016I_SETUP1, in zr36016_init()
263 (ptr->xdec ? (ZR016_HRFL | ZR016_HORZ) : 0) | in zr36016_init()
264 (ptr->ydec ? ZR016_VERT : 0) | ZR016_CNTI); in zr36016_init()
265 zr36016_writei(ptr, ZR016I_SETUP2, ZR016_CCIR); in zr36016_init()
269 zr36016_writei(ptr, ZR016I_PAX_HI, ptr->width >> 8); in zr36016_init()
270 zr36016_writei(ptr, ZR016I_PAX_LO, ptr->width & 0xFF); in zr36016_init()
271 zr36016_writei(ptr, ZR016I_PAY_HI, ptr->height >> 8); in zr36016_init()
272 zr36016_writei(ptr, ZR016I_PAY_LO, ptr->height & 0xFF); in zr36016_init()
273 zr36016_writei(ptr, ZR016I_NAX_HI, ptr->xoff >> 8); in zr36016_init()
274 zr36016_writei(ptr, ZR016I_NAX_LO, ptr->xoff & 0xFF); in zr36016_init()
275 zr36016_writei(ptr, ZR016I_NAY_HI, ptr->yoff >> 8); in zr36016_init()
276 zr36016_writei(ptr, ZR016I_NAY_LO, ptr->yoff & 0xFF); in zr36016_init()
279 zr36016_write(ptr, ZR016_GOSTOP, 1); in zr36016_init()
294 struct zr36016 *ptr = (struct zr36016 *) codec->data; in zr36016_set_mode() local
296 dprintk(2, "%s: set_mode %d call\n", ptr->name, mode); in zr36016_set_mode()
301 ptr->mode = mode; in zr36016_set_mode()
302 zr36016_init(ptr); in zr36016_set_mode()
314 struct zr36016 *ptr = (struct zr36016 *) codec->data; in zr36016_set_video() local
317 ptr->name, norm->HStart, norm->VStart, in zr36016_set_video()
324 ptr->width = cap->width; in zr36016_set_video()
325 ptr->height = cap->height; in zr36016_set_video()
332 ptr->xoff = (norm->HStart ? norm->HStart : 1) + cap->x; in zr36016_set_video()
337 ptr->yoff = norm->VStart + cap->y; in zr36016_set_video()
339 ptr->xdec = ((cap->decimation & 0xff) == 1) ? 0 : 1; in zr36016_set_video()
340 ptr->ydec = (((cap->decimation >> 8) & 0xff) == 1) ? 0 : 1; in zr36016_set_video()
352 struct zr36016 *ptr = (struct zr36016 *) codec->data; in zr36016_control() local
355 dprintk(2, "%s: control %d call with %d byte\n", ptr->name, type, in zr36016_control()
403 struct zr36016 *ptr = codec->data; in zr36016_unset() local
405 if (ptr) { in zr36016_unset()
408 dprintk(1, "%s: finished codec #%d\n", ptr->name, in zr36016_unset()
409 ptr->num); in zr36016_unset()
410 kfree(ptr); in zr36016_unset()
432 struct zr36016 *ptr; in zr36016_setup() local
444 codec->data = ptr = kzalloc(sizeof(struct zr36016), GFP_KERNEL); in zr36016_setup()
445 if (NULL == ptr) { in zr36016_setup()
450 snprintf(ptr->name, sizeof(ptr->name), "zr36016[%d]", in zr36016_setup()
452 ptr->num = zr36016_codecs++; in zr36016_setup()
453 ptr->codec = codec; in zr36016_setup()
456 res = zr36016_basic_test(ptr); in zr36016_setup()
462 ptr->mode = CODEC_DO_COMPRESSION; in zr36016_setup()
463 ptr->width = 768; in zr36016_setup()
464 ptr->height = 288; in zr36016_setup()
465 ptr->xdec = 1; in zr36016_setup()
466 ptr->ydec = 0; in zr36016_setup()
467 zr36016_init(ptr); in zr36016_setup()
470 ptr->name, ptr->version); in zr36016_setup()