30 #include <linux/types.h>
31 #include <linux/kernel.h>
32 #include <linux/module.h>
36 #include <linux/pci.h>
37 #include <linux/i2c.h>
39 #include <linux/videodev2.h>
41 #include <linux/sem.h>
44 #include <linux/ctype.h>
45 #include <linux/poll.h>
54 struct procfs_params_zr36067 {
61 static const struct procfs_params_zr36067 zr67[] = {
62 {
"HSPol", 0x000, 1, 30},
63 {
"HStart", 0x000, 0x3ff, 10},
64 {
"HEnd", 0x000, 0x3ff, 0},
66 {
"VSPol", 0x004, 1, 30},
67 {
"VStart", 0x004, 0x3ff, 10},
68 {
"VEnd", 0x004, 0x3ff, 0},
70 {
"ExtFl", 0x008, 1, 26},
71 {
"TopField", 0x008, 1, 25},
72 {
"VCLKPol", 0x008, 1, 24},
73 {
"DupFld", 0x008, 1, 20},
74 {
"LittleEndian", 0x008, 1, 0},
76 {
"HsyncStart", 0x10c, 0xffff, 16},
77 {
"LineTot", 0x10c, 0xffff, 0},
79 {
"NAX", 0x110, 0xffff, 16},
80 {
"PAX", 0x110, 0xffff, 0},
82 {
"NAY", 0x114, 0xffff, 16},
83 {
"PAY", 0x114, 0xffff, 0},
91 setparam (
struct zoran *zr,
97 while (zr67[i].name !=
NULL) {
100 reg &= ~(zr67[
i].mask << zr67[
i].bit);
104 if ((val & ~zr67[i].
mask))
106 reg |= (val & zr67[
i].mask) << zr67[i].
bit;
109 "%s: setparam: setting ZR36067 register 0x%03x: 0x%08x=>0x%08x %s=%d\n",
119 static int zoran_show(
struct seq_file *
p,
void *
v)
125 for (i = 0; i < 0x130; i += 16)
126 seq_printf(p,
"%03X %08X %08X %08X %08X \n", i,
138 size_t count, loff_t *ppos)
140 struct zoran *zr = PDE(file->
f_path.dentry->d_inode)->data;
142 char *
line, *ldelim, *varname, *svar, *tdelim;
147 string = sp =
vmalloc(count + 1);
151 "%s: write_proc: can not allocate memory\n",
172 setparam(zr, varname, svar);
186 .write = zoran_write,
195 #ifdef CONFIG_PROC_FS
203 "%s: procfs entry /proc/%s allocated. data=%p\n",
217 #ifdef CONFIG_PROC_FS