GNU Linux-libre 4.14.290-gnu1
[releases.git] / drivers / media / usb / au0828 / au0828-reg.h
1 /*
2  *  Driver for the Auvitek USB bridge
3  *
4  *  Copyright (c) 2008 Steven Toth <stoth@linuxtv.org>
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *
15  *  GNU General Public License for more details.
16  */
17
18 /* We'll start to rename these registers once we have a better
19  * understanding of their meaning.
20  */
21 #define REG_000 0x000
22 #define REG_001 0x001
23 #define REG_002 0x002
24 #define REG_003 0x003
25
26 #define AU0828_SENSORCTRL_100 0x100
27 #define AU0828_SENSORCTRL_VBI_103 0x103
28
29 /* I2C registers */
30 #define AU0828_I2C_TRIGGER_200          0x200
31 #define AU0828_I2C_STATUS_201           0x201
32 #define AU0828_I2C_CLK_DIVIDER_202      0x202
33 #define AU0828_I2C_DEST_ADDR_203        0x203
34 #define AU0828_I2C_WRITE_FIFO_205       0x205
35 #define AU0828_I2C_READ_FIFO_209        0x209
36 #define AU0828_I2C_MULTIBYTE_MODE_2FF   0x2ff
37
38 /* Audio registers */
39 #define AU0828_AUDIOCTRL_50C 0x50C
40
41 #define REG_600 0x600
42
43 /*********************************************************************/
44 /* Here are constants for values associated with the above registers */
45
46 /* I2C Trigger (Reg 0x200) */
47 #define AU0828_I2C_TRIGGER_WRITE        0x01
48 #define AU0828_I2C_TRIGGER_READ         0x20
49 #define AU0828_I2C_TRIGGER_HOLD         0x40
50
51 /* I2C Status (Reg 0x201) */
52 #define AU0828_I2C_STATUS_READ_DONE     0x01
53 #define AU0828_I2C_STATUS_NO_READ_ACK   0x02
54 #define AU0828_I2C_STATUS_WRITE_DONE    0x04
55 #define AU0828_I2C_STATUS_NO_WRITE_ACK  0x08
56 #define AU0828_I2C_STATUS_BUSY          0x10
57
58 /* I2C Clock Divider (Reg 0x202) */
59 #define AU0828_I2C_CLK_250KHZ 0x07
60 #define AU0828_I2C_CLK_100KHZ 0x14
61 #define AU0828_I2C_CLK_30KHZ  0x40
62 #define AU0828_I2C_CLK_20KHZ  0x60