~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/olpc-ec.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _LINUX_OLPC_EC_H
  3 #define _LINUX_OLPC_EC_H
  4 
  5 #include <linux/bits.h>
  6 
  7 /* XO-1 EC commands */
  8 #define EC_FIRMWARE_REV                 0x08
  9 #define EC_WRITE_SCI_MASK               0x1b
 10 #define EC_WAKE_UP_WLAN                 0x24
 11 #define EC_WLAN_LEAVE_RESET             0x25
 12 #define EC_DCON_POWER_MODE              0x26
 13 #define EC_READ_EB_MODE                 0x2a
 14 #define EC_SET_SCI_INHIBIT              0x32
 15 #define EC_SET_SCI_INHIBIT_RELEASE      0x34
 16 #define EC_WLAN_ENTER_RESET             0x35
 17 #define EC_WRITE_EXT_SCI_MASK           0x38
 18 #define EC_SCI_QUERY                    0x84
 19 #define EC_EXT_SCI_QUERY                0x85
 20 
 21 /* SCI source values */
 22 #define EC_SCI_SRC_GAME         BIT(0)
 23 #define EC_SCI_SRC_BATTERY      BIT(1)
 24 #define EC_SCI_SRC_BATSOC       BIT(2)
 25 #define EC_SCI_SRC_BATERR       BIT(3)
 26 #define EC_SCI_SRC_EBOOK        BIT(4)    /* XO-1 only */
 27 #define EC_SCI_SRC_WLAN         BIT(5)    /* XO-1 only */
 28 #define EC_SCI_SRC_ACPWR        BIT(6)
 29 #define EC_SCI_SRC_BATCRIT      BIT(7)
 30 #define EC_SCI_SRC_GPWAKE       BIT(8)   /* XO-1.5 only */
 31 #define EC_SCI_SRC_ALL          GENMASK(8, 0)
 32 
 33 struct platform_device;
 34 
 35 struct olpc_ec_driver {
 36         int (*suspend)(struct platform_device *);
 37         int (*resume)(struct platform_device *);
 38 
 39         int (*ec_cmd)(u8, u8 *, size_t, u8 *, size_t, void *);
 40 
 41         bool wakeup_available;
 42 };
 43 
 44 #ifdef CONFIG_OLPC_EC
 45 
 46 extern void olpc_ec_driver_register(struct olpc_ec_driver *drv, void *arg);
 47 
 48 extern int olpc_ec_cmd(u8 cmd, u8 *inbuf, size_t inlen, u8 *outbuf,
 49                 size_t outlen);
 50 
 51 extern void olpc_ec_wakeup_set(u16 value);
 52 extern void olpc_ec_wakeup_clear(u16 value);
 53 
 54 extern int olpc_ec_mask_write(u16 bits);
 55 extern int olpc_ec_sci_query(u16 *sci_value);
 56 
 57 extern bool olpc_ec_wakeup_available(void);
 58 
 59 asmlinkage int xo1_do_sleep(u8 sleep_state);
 60 
 61 #else
 62 
 63 static inline int olpc_ec_cmd(u8 cmd, u8 *inbuf, size_t inlen, u8 *outbuf,
 64                 size_t outlen) { return -ENODEV; }
 65 
 66 static inline void olpc_ec_wakeup_set(u16 value) { }
 67 static inline void olpc_ec_wakeup_clear(u16 value) { }
 68 
 69 static inline bool olpc_ec_wakeup_available(void)
 70 {
 71         return false;
 72 }
 73 
 74 #endif /* CONFIG_OLPC_EC */
 75 
 76 #endif /* _LINUX_OLPC_EC_H */
 77 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php