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

TOMOYO Linux Cross Reference
Linux/include/linux/pmu.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 /*
  3  * Definitions for talking to the PMU.  The PMU is a microcontroller
  4  * which controls battery charging and system power on PowerBook 3400
  5  * and 2400 models as well as the RTC and various other things.
  6  *
  7  * Copyright (C) 1998 Paul Mackerras.
  8  */
  9 #ifndef _LINUX_PMU_H
 10 #define _LINUX_PMU_H
 11 
 12 #include <linux/rtc.h>
 13 #include <uapi/linux/pmu.h>
 14 
 15 
 16 extern int __init find_via_pmu(void);
 17 
 18 extern int pmu_request(struct adb_request *req,
 19                 void (*done)(struct adb_request *), int nbytes, ...);
 20 extern int pmu_queue_request(struct adb_request *req);
 21 extern void pmu_poll(void);
 22 extern void pmu_poll_adb(void); /* For use by xmon */
 23 extern void pmu_wait_complete(struct adb_request *req);
 24 
 25 /* For use before switching interrupts off for a long time;
 26  * warning: not stackable
 27  */
 28 #if defined(CONFIG_ADB_PMU)
 29 extern void pmu_suspend(void);
 30 extern void pmu_resume(void);
 31 #else
 32 static inline void pmu_suspend(void)
 33 {}
 34 static inline void pmu_resume(void)
 35 {}
 36 #endif
 37 
 38 extern void pmu_enable_irled(int on);
 39 
 40 extern time64_t pmu_get_time(void);
 41 extern int pmu_set_rtc_time(struct rtc_time *tm);
 42 
 43 extern void pmu_restart(void);
 44 extern void pmu_shutdown(void);
 45 extern void pmu_unlock(void);
 46 
 47 extern int pmu_present(void);
 48 extern int pmu_get_model(void);
 49 
 50 extern void pmu_backlight_set_sleep(int sleep);
 51 
 52 #define PMU_MAX_BATTERIES       2
 53 
 54 /* values for pmu_power_flags */
 55 #define PMU_PWR_AC_PRESENT      0x00000001
 56 
 57 /* values for pmu_battery_info.flags */
 58 #define PMU_BATT_PRESENT        0x00000001
 59 #define PMU_BATT_CHARGING       0x00000002
 60 #define PMU_BATT_TYPE_MASK      0x000000f0
 61 #define PMU_BATT_TYPE_SMART     0x00000010 /* Smart battery */
 62 #define PMU_BATT_TYPE_HOOPER    0x00000020 /* 3400/3500 */
 63 #define PMU_BATT_TYPE_COMET     0x00000030 /* 2400 */
 64 
 65 struct pmu_battery_info
 66 {
 67         unsigned int    flags;
 68         unsigned int    charge;         /* current charge */
 69         unsigned int    max_charge;     /* maximum charge */
 70         signed int      amperage;       /* current, positive if charging */
 71         unsigned int    voltage;        /* voltage */
 72         unsigned int    time_remaining; /* remaining time */
 73 };
 74 
 75 extern int pmu_battery_count;
 76 extern struct pmu_battery_info pmu_batteries[PMU_MAX_BATTERIES];
 77 extern unsigned int pmu_power_flags;
 78 
 79 /* Backlight */
 80 extern void pmu_backlight_init(void);
 81 
 82 /* some code needs to know if the PMU was suspended for hibernation */
 83 #if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
 84 extern int pmu_sys_suspended;
 85 #else
 86 /* if power management is not configured it can't be suspended */
 87 #define pmu_sys_suspended       0
 88 #endif
 89 
 90 #endif /* _LINUX_PMU_H */
 91 

~ [ 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