14 #include <linux/types.h>
19 #define SMSC_FDC37M81X_CONFIG_INDEX 0x00
20 #define SMSC_FDC37M81X_CONFIG_DATA 0x01
21 #define SMSC_FDC37M81X_CONF 0x02
22 #define SMSC_FDC37M81X_INDEX 0x03
23 #define SMSC_FDC37M81X_DNUM 0x07
24 #define SMSC_FDC37M81X_DID 0x20
25 #define SMSC_FDC37M81X_DREV 0x21
26 #define SMSC_FDC37M81X_PCNT 0x22
27 #define SMSC_FDC37M81X_PMGT 0x23
28 #define SMSC_FDC37M81X_OSC 0x24
29 #define SMSC_FDC37M81X_CONFPA0 0x26
30 #define SMSC_FDC37M81X_CONFPA1 0x27
31 #define SMSC_FDC37M81X_TEST4 0x2B
32 #define SMSC_FDC37M81X_TEST5 0x2C
33 #define SMSC_FDC37M81X_TEST1 0x2D
34 #define SMSC_FDC37M81X_TEST2 0x2E
35 #define SMSC_FDC37M81X_TEST3 0x2F
38 #define SMSC_FDC37M81X_FDD 0x00
39 #define SMSC_FDC37M81X_SERIAL1 0x04
40 #define SMSC_FDC37M81X_SERIAL2 0x05
41 #define SMSC_FDC37M81X_KBD 0x07
44 #define SMSC_FDC37M81X_ACTIVE 0x30
45 #define SMSC_FDC37M81X_BASEADDR0 0x60
46 #define SMSC_FDC37M81X_BASEADDR1 0x61
47 #define SMSC_FDC37M81X_INT 0x70
48 #define SMSC_FDC37M81X_INT2 0x72
49 #define SMSC_FDC37M81X_MODE 0xF0
52 #define SMSC_FDC37M81X_CONFIG_ENTER 0x55
53 #define SMSC_FDC37M81X_CONFIG_EXIT 0xaa
54 #define SMSC_FDC37M81X_CHIP_ID 0x4d
56 static unsigned long g_smsc_fdc37m81x_base;
58 static inline unsigned char smsc_fdc37m81x_rd(
unsigned char index)
65 static inline void smsc_dc37m81x_wr(
unsigned char index,
unsigned char data)
73 if (g_smsc_fdc37m81x_base) {
81 if (g_smsc_fdc37m81x_base)
90 if (g_smsc_fdc37m81x_base)
91 val = smsc_fdc37m81x_rd(reg);
98 if (g_smsc_fdc37m81x_base)
99 smsc_dc37m81x_wr(reg, val);
104 const int field =
sizeof(
unsigned long) * 2;
107 if (g_smsc_fdc37m81x_base)
110 field, g_smsc_fdc37m81x_base);
112 g_smsc_fdc37m81x_base =
port;
122 g_smsc_fdc37m81x_base = 0;
125 return g_smsc_fdc37m81x_base;
129 static void smsc_fdc37m81x_config_dump_one(
const char *
key,
u8 dev,
u8 reg)
133 smsc_fdc37m81x_rd(reg));
136 void smsc_fdc37m81x_config_dump(
void)
139 const char *
fname = __func__;