xref: /linux/drivers/media/pci/zoran/zoran_device.h (revision 29583dfcd2dd72c766422bd05c16f06c6b1fb356)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Zoran zr36057/zr36067 PCI controller driver, for the
4  * Pinnacle/Miro DC10/DC10+/DC30/DC30+, Iomega Buz, Linux
5  * Media Labs LML33/LML33R10.
6  *
7  * This part handles card-specific data and detection
8  *
9  * Copyright (C) 2000 Serguei Miridonov <mirsev@cicese.mx>
10  */
11 
12 #ifndef __ZORAN_DEVICE_H__
13 #define __ZORAN_DEVICE_H__
14 
15 /* general purpose I/O */
16 void GPIO(struct zoran *zr, int bit, unsigned int value);
17 
18 /* codec (or actually: guest bus) access */
19 int post_office_wait(struct zoran *zr);
20 int post_office_write(struct zoran *zr, unsigned int guest, unsigned int reg,
21 		      unsigned int value);
22 int post_office_read(struct zoran *zr, unsigned int guest, unsigned int reg);
23 
24 void jpeg_codec_sleep(struct zoran *zr, int sleep);
25 int jpeg_codec_reset(struct zoran *zr);
26 
27 /* zr360x7 access to raw capture */
28 void zr36057_overlay(struct zoran *zr, int on);
29 void write_overlay_mask(struct zoran_fh *fh, struct v4l2_clip *vp, int count);
30 void zr36057_set_memgrab(struct zoran *zr, int mode);
31 int wait_grab_pending(struct zoran *zr);
32 
33 /* interrupts */
34 void print_interrupts(struct zoran *zr);
35 void clear_interrupt_counters(struct zoran *zr);
36 irqreturn_t zoran_irq(int irq, void *dev_id);
37 
38 /* JPEG codec access */
39 void jpeg_start(struct zoran *zr);
40 void zr36057_enable_jpg(struct zoran *zr, enum zoran_codec_mode mode);
41 void zoran_feed_stat_com(struct zoran *zr);
42 
43 /* general */
44 void zoran_set_pci_master(struct zoran *zr, int set_master);
45 void zoran_init_hardware(struct zoran *zr);
46 void zr36057_restart(struct zoran *zr);
47 
48 extern const struct zoran_format zoran_formats[];
49 
50 extern int v4l_bufsize;
51 extern int jpg_bufsize;
52 extern int pass_through;
53 
54 /* i2c */
55 #define decoder_call(zr, o, f, args...) \
56 	v4l2_subdev_call((zr)->decoder, o, f, ##args)
57 #define encoder_call(zr, o, f, args...) \
58 	v4l2_subdev_call((zr)->encoder, o, f, ##args)
59 
60 #endif				/* __ZORAN_DEVICE_H__ */
61