18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci/* apc - Driver definitions for power management functions
38c2ecf20Sopenharmony_ci * of Aurora Personality Chip (APC) on SPARCstation-4/5 and
48c2ecf20Sopenharmony_ci * derivatives
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Copyright (c) 2001 Eric Brower (ebrower@usa.net)
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#ifndef _SPARC_APC_H
118c2ecf20Sopenharmony_ci#define _SPARC_APC_H
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#include <linux/ioctl.h>
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#define APC_IOC	'A'
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#define APCIOCGFANCTL _IOR(APC_IOC, 0x00, int)	/* Get fan speed	*/
188c2ecf20Sopenharmony_ci#define APCIOCSFANCTL _IOW(APC_IOC, 0x01, int)	/* Set fan speed	*/
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci#define APCIOCGCPWR   _IOR(APC_IOC, 0x02, int)	/* Get CPOWER state	*/
218c2ecf20Sopenharmony_ci#define APCIOCSCPWR   _IOW(APC_IOC, 0x03, int)	/* Set CPOWER state	*/
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci#define APCIOCGBPORT   _IOR(APC_IOC, 0x04, int)	/* Get BPORT state 	*/
248c2ecf20Sopenharmony_ci#define APCIOCSBPORT   _IOW(APC_IOC, 0x05, int)	/* Set BPORT state	*/
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci/*
278c2ecf20Sopenharmony_ci * Register offsets
288c2ecf20Sopenharmony_ci */
298c2ecf20Sopenharmony_ci#define APC_IDLE_REG	0x00
308c2ecf20Sopenharmony_ci#define APC_FANCTL_REG	0x20
318c2ecf20Sopenharmony_ci#define APC_CPOWER_REG	0x24
328c2ecf20Sopenharmony_ci#define APC_BPORT_REG	0x30
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#define APC_REGMASK		0x01
358c2ecf20Sopenharmony_ci#define APC_BPMASK		0x03
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci/*
388c2ecf20Sopenharmony_ci * IDLE - CPU standby values (set to initiate standby)
398c2ecf20Sopenharmony_ci */
408c2ecf20Sopenharmony_ci#define APC_IDLE_ON		0x01
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci/*
438c2ecf20Sopenharmony_ci * FANCTL - Fan speed control state values
448c2ecf20Sopenharmony_ci */
458c2ecf20Sopenharmony_ci#define APC_FANCTL_HI	0x00	/* Fan speed high	*/
468c2ecf20Sopenharmony_ci#define APC_FANCTL_LO	0x01	/* Fan speed low	*/
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci/*
498c2ecf20Sopenharmony_ci * CPWR - Convenience power outlet state values
508c2ecf20Sopenharmony_ci */
518c2ecf20Sopenharmony_ci#define APC_CPOWER_ON	0x00	/* Conv power on	*/
528c2ecf20Sopenharmony_ci#define APC_CPOWER_OFF	0x01	/* Conv power off	*/
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci/*
558c2ecf20Sopenharmony_ci * BPA/BPB - Read-Write "Bit Ports" state values (reset to 0 at power-on)
568c2ecf20Sopenharmony_ci *
578c2ecf20Sopenharmony_ci * WARNING: Internal usage of bit ports is platform dependent--
588c2ecf20Sopenharmony_ci * don't modify BPORT settings unless you know what you are doing.
598c2ecf20Sopenharmony_ci *
608c2ecf20Sopenharmony_ci * On SS5 BPA seems to toggle onboard ethernet loopback... -E
618c2ecf20Sopenharmony_ci */
628c2ecf20Sopenharmony_ci#define APC_BPORT_A		0x01	/* Bit Port A		*/
638c2ecf20Sopenharmony_ci#define APC_BPORT_B		0x02	/* Bit Port B		*/
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci#endif /* !(_SPARC_APC_H) */
66