153966124SFrançois Tigeot /*
2*1dedbd3bSFrançois Tigeot  * Copyright (c) 2018-2019 François Tigeot <ftigeot@wolfpond.org>
353966124SFrançois Tigeot  * All rights reserved.
453966124SFrançois Tigeot  *
553966124SFrançois Tigeot  * Redistribution and use in source and binary forms, with or without
653966124SFrançois Tigeot  * modification, are permitted provided that the following conditions
753966124SFrançois Tigeot  * are met:
853966124SFrançois Tigeot  * 1. Redistributions of source code must retain the above copyright
953966124SFrançois Tigeot  *    notice unmodified, this list of conditions, and the following
1053966124SFrançois Tigeot  *    disclaimer.
1153966124SFrançois Tigeot  * 2. Redistributions in binary form must reproduce the above copyright
1253966124SFrançois Tigeot  *    notice, this list of conditions and the following disclaimer in the
1353966124SFrançois Tigeot  *    documentation and/or other materials provided with the distribution.
1453966124SFrançois Tigeot  *
1553966124SFrançois Tigeot  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1653966124SFrançois Tigeot  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1753966124SFrançois Tigeot  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1853966124SFrançois Tigeot  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1953966124SFrançois Tigeot  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2053966124SFrançois Tigeot  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2153966124SFrançois Tigeot  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2253966124SFrançois Tigeot  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2353966124SFrançois Tigeot  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2453966124SFrançois Tigeot  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2553966124SFrançois Tigeot  */
2653966124SFrançois Tigeot 
2753966124SFrançois Tigeot #ifndef _LINUX_POWER_SUPPLY_H_
2853966124SFrançois Tigeot #define _LINUX_POWER_SUPPLY_H_
2953966124SFrançois Tigeot 
3053966124SFrançois Tigeot #include <linux/workqueue.h>
3153966124SFrançois Tigeot #include <linux/leds.h>
3253966124SFrançois Tigeot #include <linux/spinlock.h>
3353966124SFrançois Tigeot #include <linux/notifier.h>
3453966124SFrançois Tigeot 
3553966124SFrançois Tigeot #include <sys/power.h>
3653966124SFrançois Tigeot 
3753966124SFrançois Tigeot static inline int
power_supply_is_system_supplied(void)3853966124SFrançois Tigeot power_supply_is_system_supplied(void)
3953966124SFrançois Tigeot {
4053966124SFrançois Tigeot 	return (power_profile_get_state() == POWER_PROFILE_PERFORMANCE);
4153966124SFrançois Tigeot }
4253966124SFrançois Tigeot 
43*1dedbd3bSFrançois Tigeot struct device_node;
44*1dedbd3bSFrançois Tigeot 
4553966124SFrançois Tigeot #endif	/* _LINUX_POWER_SUPPLY_H_ */
46