1 /* OLPC machine specific definitions */
8 struct olpc_platform_t
{
14 #define OLPC_F_PRESENT 0x01
15 #define OLPC_F_DCON 0x02
16 #define OLPC_F_VSA 0x04
31 OLPC_REV_UNKNOWN
/* this should always come last */
36 static inline int machine_is_olpc(void) { return 0; }
37 static inline int olpc_has_dcon(void) { return 0; }
38 static inline int olpc_has_vsa(void) { return 0; }
39 static inline int olpc_get_rev(void) { return OLPC_REV_UNKNOWN
; }
43 extern struct olpc_platform_t olpc_platform_info
;
48 return (olpc_platform_info
.flags
& OLPC_F_PRESENT
) ? 1 : 0;
54 return (olpc_platform_info
.flags
& OLPC_F_DCON
) ? 1 : 0;
60 return (olpc_platform_info
.flags
& OLPC_F_VSA
) ? 1 : 0;
66 return olpc_platform_info
.boardrev
;
70 olpc_rev_after(int rev
)
72 return olpc_platform_info
.boardrev
> rev
&&
73 olpc_platform_info
.boardrev
!= OLPC_REV_UNKNOWN
;
77 olpc_rev_before(int rev
)
79 return olpc_platform_info
.boardrev
< rev
||
80 olpc_platform_info
.boardrev
== OLPC_REV_UNKNOWN
;
87 int olpc_ec_cmd(unsigned char cmd
, unsigned char *inbuf
, size_t inlen
,
88 unsigned char *outbuf
, size_t outlen
);
90 void olpc_register_battery_callback(void (*f
)(unsigned long));
91 void olpc_deregister_battery_callback(void);
93 /* EC commands and responses */
95 /* SCI source values */
97 #define EC_SCI_SRC_EMPTY 0x00
98 #define EC_SCI_SRC_GAME 0x01
99 #define EC_SCI_SRC_BATTERY 0x02
100 #define EC_SCI_SRC_BATSOC 0x04
101 #define EC_SCI_SRC_BATERR 0x08
102 #define EC_SCI_SRC_EBOOK 0x10
103 #define EC_SCI_SRC_WLAN 0x20
104 #define EC_SCI_SRC_ACPWR 0x40
106 /* GPIO assignments */
108 #define OLPC_GPIO_MIC_AC 1
109 #define OLPC_GPIO_DCON_IRQ 7
110 #define OLPC_GPIO_THRM_ALRM 10
111 #define OLPC_GPIO_WORKAUX 24
112 #define OLPC_GPIO_LID 26
113 #define OLPC_GPIO_ECSCI 27