History

Platform: OLPC: Move EC-specific functionality out from x86

Move the olpc-ec driver away from the X86 OLPC platform so that it could be used by the ARM based laptops too. Notably, the driver for the OLPC battery, which is also used on the ARM models, builds on this driver's interface. It is actually plaform independent: the OLPC EC commands with their argument and responses are mostly the same despite the delivery mechanism is different.

Lubomir Rintel committed 7 years ago

Commit ec9964b1 parent 2dc78635 files · +145 −137Browse files

Showing the changes to include/linux (1 of 5 files). Show all

Unified · Split

include/linux/olpc-ec.h+31−1
@@ -16,14 +16,28 @@ · 15 unmodified lines
1616 #define EC_SCI_QUERY 0x84
1717 #define EC_EXT_SCI_QUERY 0x85
1818
19+/* SCI source values */
20+#define EC_SCI_SRC_EMPTY 0x00
21+#define EC_SCI_SRC_GAME 0x01
22+#define EC_SCI_SRC_BATTERY 0x02
23+#define EC_SCI_SRC_BATSOC 0x04
24+#define EC_SCI_SRC_BATERR 0x08
25+#define EC_SCI_SRC_EBOOK 0x10 /* XO-1 only */
26+#define EC_SCI_SRC_WLAN 0x20 /* XO-1 only */
27+#define EC_SCI_SRC_ACPWR 0x40
28+#define EC_SCI_SRC_BATCRIT 0x80
29+#define EC_SCI_SRC_GPWAKE 0x100 /* XO-1.5 only */
30+#define EC_SCI_SRC_ALL 0x1FF
31+
1932 struct platform_device;
2033
2134 struct olpc_ec_driver {
22− int (*probe)(struct platform_device *);
2335 int (*suspend)(struct platform_device *);
2436 int (*resume)(struct platform_device *);
2537
2638 int (*ec_cmd)(u8, u8 *, size_t, u8 *, size_t, void *);
39+
40+ bool wakeup_available;
2741 };
2842
2943 #ifdef CONFIG_OLPC
@@ -33,11 +47,27 @@ extern void olpc_ec_driver_register(struct olpc_ec_driver *drv, void *arg); · 3 unmodified lines
3347 extern int olpc_ec_cmd(u8 cmd, u8 *inbuf, size_t inlen, u8 *outbuf,
3448 size_t outlen);
3549
50+extern void olpc_ec_wakeup_set(u16 value);
51+extern void olpc_ec_wakeup_clear(u16 value);
52+
53+extern int olpc_ec_mask_write(u16 bits);
54+extern int olpc_ec_sci_query(u16 *sci_value);
55+
56+extern bool olpc_ec_wakeup_available(void);
57+
3658 #else
3759
3860 static inline int olpc_ec_cmd(u8 cmd, u8 *inbuf, size_t inlen, u8 *outbuf,
3961 size_t outlen) { return -ENODEV; }
4062
63+static inline void olpc_ec_wakeup_set(u16 value) { }
64+static inline void olpc_ec_wakeup_clear(u16 value) { }
65+
66+static inline bool olpc_ec_wakeup_available(void)
67+{
68+ return false;
69+}
70+
4171 #endif /* CONFIG_OLPC */
4272
4373 #endif /* _LINUX_OLPC_EC_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t