162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 262306a36Sopenharmony_ci/* apc - Driver definitions for power management functions 362306a36Sopenharmony_ci * of Aurora Personality Chip (APC) on SPARCstation-4/5 and 462306a36Sopenharmony_ci * derivatives 562306a36Sopenharmony_ci * 662306a36Sopenharmony_ci * Copyright (c) 2001 Eric Brower (ebrower@usa.net) 762306a36Sopenharmony_ci * 862306a36Sopenharmony_ci */ 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci#ifndef _SPARC_APC_H 1162306a36Sopenharmony_ci#define _SPARC_APC_H 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_ci#include <linux/ioctl.h> 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_ci#define APC_IOC 'A' 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ci#define APCIOCGFANCTL _IOR(APC_IOC, 0x00, int) /* Get fan speed */ 1862306a36Sopenharmony_ci#define APCIOCSFANCTL _IOW(APC_IOC, 0x01, int) /* Set fan speed */ 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ci#define APCIOCGCPWR _IOR(APC_IOC, 0x02, int) /* Get CPOWER state */ 2162306a36Sopenharmony_ci#define APCIOCSCPWR _IOW(APC_IOC, 0x03, int) /* Set CPOWER state */ 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_ci#define APCIOCGBPORT _IOR(APC_IOC, 0x04, int) /* Get BPORT state */ 2462306a36Sopenharmony_ci#define APCIOCSBPORT _IOW(APC_IOC, 0x05, int) /* Set BPORT state */ 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_ci/* 2762306a36Sopenharmony_ci * Register offsets 2862306a36Sopenharmony_ci */ 2962306a36Sopenharmony_ci#define APC_IDLE_REG 0x00 3062306a36Sopenharmony_ci#define APC_FANCTL_REG 0x20 3162306a36Sopenharmony_ci#define APC_CPOWER_REG 0x24 3262306a36Sopenharmony_ci#define APC_BPORT_REG 0x30 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ci#define APC_REGMASK 0x01 3562306a36Sopenharmony_ci#define APC_BPMASK 0x03 3662306a36Sopenharmony_ci 3762306a36Sopenharmony_ci/* 3862306a36Sopenharmony_ci * IDLE - CPU standby values (set to initiate standby) 3962306a36Sopenharmony_ci */ 4062306a36Sopenharmony_ci#define APC_IDLE_ON 0x01 4162306a36Sopenharmony_ci 4262306a36Sopenharmony_ci/* 4362306a36Sopenharmony_ci * FANCTL - Fan speed control state values 4462306a36Sopenharmony_ci */ 4562306a36Sopenharmony_ci#define APC_FANCTL_HI 0x00 /* Fan speed high */ 4662306a36Sopenharmony_ci#define APC_FANCTL_LO 0x01 /* Fan speed low */ 4762306a36Sopenharmony_ci 4862306a36Sopenharmony_ci/* 4962306a36Sopenharmony_ci * CPWR - Convenience power outlet state values 5062306a36Sopenharmony_ci */ 5162306a36Sopenharmony_ci#define APC_CPOWER_ON 0x00 /* Conv power on */ 5262306a36Sopenharmony_ci#define APC_CPOWER_OFF 0x01 /* Conv power off */ 5362306a36Sopenharmony_ci 5462306a36Sopenharmony_ci/* 5562306a36Sopenharmony_ci * BPA/BPB - Read-Write "Bit Ports" state values (reset to 0 at power-on) 5662306a36Sopenharmony_ci * 5762306a36Sopenharmony_ci * WARNING: Internal usage of bit ports is platform dependent-- 5862306a36Sopenharmony_ci * don't modify BPORT settings unless you know what you are doing. 5962306a36Sopenharmony_ci * 6062306a36Sopenharmony_ci * On SS5 BPA seems to toggle onboard ethernet loopback... -E 6162306a36Sopenharmony_ci */ 6262306a36Sopenharmony_ci#define APC_BPORT_A 0x01 /* Bit Port A */ 6362306a36Sopenharmony_ci#define APC_BPORT_B 0x02 /* Bit Port B */ 6462306a36Sopenharmony_ci 6562306a36Sopenharmony_ci#endif /* !(_SPARC_APC_H) */ 66