2 * PROJECT: ReactOS Boot Loader
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: boot/armllb/hw/omap3-zoom2/hwsynkpd.c
5 * PURPOSE: LLB Synpatics Keypad Support for OMAP3 ZOOM 2
6 * PROGRAMMERS: ReactOS Portable Systems Group
11 /* FUNCTIONS ******************************************************************/
15 LlbHwOmap3TwlRead1(IN UCHAR ChipAddress
,
16 IN UCHAR RegisterAddress
)
18 volatile int i
= 1000;
20 /* Select the register */
21 LlbHwOmap3TwlWrite(ChipAddress
, RegisterAddress
, 0, NULL
);
24 WRITE_REGISTER_USHORT(0x48070024, 0x8401);
25 for (i
= 1000; i
> 0; i
--);
26 return READ_REGISTER_USHORT(0x4807001c);
31 LlbHwOmap3TwlWrite(IN UCHAR ChipAddress
,
32 IN UCHAR RegisterAddress
,
36 volatile int i
= 1000;
39 /* Select chip address */
40 WRITE_REGISTER_USHORT(0x4807002c, ChipAddress
);
41 WRITE_REGISTER_USHORT(0x48070018, Length
+ 1);
43 /* Enable master transmit mode */
44 WRITE_REGISTER_USHORT(0x48070024, 0x8601);
45 WRITE_REGISTER_USHORT(0x4807001c, RegisterAddress
);
48 for (j
= 0; j
< Length
; j
++)
51 WRITE_REGISTER_USHORT(0x4807001c, Values
[j
]);
54 /* Issue stop command */
55 WRITE_REGISTER_USHORT(0x48070024, 0x8602);
56 for (i
= 1000; i
> 0; i
--);
61 LlbHwOmap3TwlWrite1(IN UCHAR ChipAddress
,
62 IN UCHAR RegisterAddress
,
65 /* Do the actual write */
66 LlbHwOmap3TwlWrite(ChipAddress
, RegisterAddress
, 1, &Value
);