Mercurial > pt1
annotate driver/pt1_i2c.h @ 146:42f838632c32
follow Disney channel and BS ANIMAX's transponder migration.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Tue, 22 May 2018 01:33:50 +0900 |
parents | 1e7718cc2556 |
children |
rev | line source |
---|---|
0 | 1 #ifndef __PT1_I2C_H__ |
2 #define __PT1_I2C_H__ | |
3 #include <linux/mutex.h> | |
4 /***************************************************************************/ | |
142
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
5 /* I2Cデータ位置定義 */ |
0 | 6 /***************************************************************************/ |
142
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
7 #define MAX_CHANNEL 4 // チャネル数 |
0 | 8 |
9 #define FALSE 0 | |
10 #define TRUE 1 | |
11 | |
12 /***************************************************************************/ | |
142
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
13 /* I2Cデータ位置定義 */ |
0 | 14 /***************************************************************************/ |
142
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
15 #define I2C_ADDRESS 10 // I2Cアドレス(10ビット) |
0 | 16 |
17 #define I2C_DATA_EN 10 | |
18 #define I2C_CLOCK 11 | |
142
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
19 #define I2C_WRIET_MODE 12 // I2C書き込み/読み込み |
0 | 20 #define I2C_BUSY 13 |
142
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
21 #define I2C_DATA 18 // I2Cデータ(18ビット) |
0 | 22 /***************************************************************************/ |
142
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
23 /* I2C定義 */ |
0 | 24 /***************************************************************************/ |
142
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
25 #define WRITE_EN 1 // 書き込み |
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
26 #define READ_EN 0 // 読み込み |
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
27 #define DATA_EN 1 // データあり |
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
28 #define DATA_DIS 0 // データなし |
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
29 #define CLOCK_EN 1 // CLOCKあり |
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
30 #define CLOCK_DIS 0 // CLOCKなし |
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
31 #define BUSY_EN 1 // BUSYあり |
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
32 #define BUSY_DIS 0 // BUSYなし |
0 | 33 |
34 /***************************************************************************/ | |
35 /* */ | |
36 /***************************************************************************/ | |
37 #define PCI_LOCKED 1 | |
38 #define RAM_LOCKED 2 | |
39 #define RAM_SHIFT 4 | |
40 /***************************************************************************/ | |
142
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
41 /* ビット */ |
0 | 42 /***************************************************************************/ |
43 #define WRITE_PCI_RESET (1 << 16) | |
44 #define WRITE_PCI_RESET_ (1 << 24) | |
45 #define WRITE_RAM_RESET (1 << 17) | |
46 #define WRITE_RAM_RESET_ (1 << 25) | |
47 #define WRITE_RAM_ENABLE (1 << 1) | |
48 | |
49 #define WRITE_PULSE (1 << 3) | |
50 #define I2C_READ_SYNC (1 << 29) | |
51 #define READ_DATA (1 << 30) | |
52 #define READ_UNLOCK (1 << 31) | |
53 | |
54 #define XC3S_PCI_CLOCK (512 / 4) | |
79 | 55 #define XC3S_PCI_CLOCK_PT2 (166) |
0 | 56 /***************************************************************************/ |
142
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
57 /* I2Cアドレス定義 */ |
0 | 58 /***************************************************************************/ |
142
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
59 #define T0_ISDB_S 0X1B // チューナ0 ISDB-S |
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
60 #define T1_ISDB_S 0X19 // チューナ1 ISDB-S |
0 | 61 |
142
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
62 #define T0_ISDB_T 0X1A // チューナ0 ISDB-T |
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
63 #define T1_ISDB_T 0X18 // チューナ1 ISDB-T |
0 | 64 |
65 /***************************************************************************/ | |
142
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
66 /* I2C書き込みデータ定義 */ |
0 | 67 /***************************************************************************/ |
68 typedef struct _WBLOCK{ | |
142
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
69 __u8 addr ; // I2Cデバイスアドレス |
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
70 __u32 count ; // 転送個数 |
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
71 __u8 value[16]; // 書き込み値 |
0 | 72 }WBLOCK; |
73 | |
74 /***************************************************************************/ | |
142
1e7718cc2556
use utf-8 instead of euc-jp
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
79
diff
changeset
|
75 /* 関数定義 */ |
0 | 76 /***************************************************************************/ |
77 //extern __u32 makei2c(void __iomem *, __u32, __u32, __u32, __u32, __u32, __u32); | |
79 | 78 extern int xc3s_init(void __iomem *, int); |
0 | 79 extern void SetStream(void __iomem *, __u32, __u32); |
80 extern void blockwrite(void __iomem *, WBLOCK *); | |
81 extern void i2c_write(void __iomem *, struct mutex *, WBLOCK *); | |
82 extern __u32 i2c_read(void __iomem *, struct mutex *, WBLOCK *, int); | |
83 | |
84 #endif |