apc.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /* apc - Driver definitions for power management functions
  3. * of Aurora Personality Chip (APC) on SPARCstation-4/5 and
  4. * derivatives
  5. *
  6. * Copyright (c) 2001 Eric Brower ([email protected])
  7. *
  8. */
  9. #ifndef _SPARC_APC_H
  10. #define _SPARC_APC_H
  11. #include <linux/ioctl.h>
  12. #define APC_IOC 'A'
  13. #define APCIOCGFANCTL _IOR(APC_IOC, 0x00, int) /* Get fan speed */
  14. #define APCIOCSFANCTL _IOW(APC_IOC, 0x01, int) /* Set fan speed */
  15. #define APCIOCGCPWR _IOR(APC_IOC, 0x02, int) /* Get CPOWER state */
  16. #define APCIOCSCPWR _IOW(APC_IOC, 0x03, int) /* Set CPOWER state */
  17. #define APCIOCGBPORT _IOR(APC_IOC, 0x04, int) /* Get BPORT state */
  18. #define APCIOCSBPORT _IOW(APC_IOC, 0x05, int) /* Set BPORT state */
  19. /*
  20. * Register offsets
  21. */
  22. #define APC_IDLE_REG 0x00
  23. #define APC_FANCTL_REG 0x20
  24. #define APC_CPOWER_REG 0x24
  25. #define APC_BPORT_REG 0x30
  26. #define APC_REGMASK 0x01
  27. #define APC_BPMASK 0x03
  28. /*
  29. * IDLE - CPU standby values (set to initiate standby)
  30. */
  31. #define APC_IDLE_ON 0x01
  32. /*
  33. * FANCTL - Fan speed control state values
  34. */
  35. #define APC_FANCTL_HI 0x00 /* Fan speed high */
  36. #define APC_FANCTL_LO 0x01 /* Fan speed low */
  37. /*
  38. * CPWR - Convenience power outlet state values
  39. */
  40. #define APC_CPOWER_ON 0x00 /* Conv power on */
  41. #define APC_CPOWER_OFF 0x01 /* Conv power off */
  42. /*
  43. * BPA/BPB - Read-Write "Bit Ports" state values (reset to 0 at power-on)
  44. *
  45. * WARNING: Internal usage of bit ports is platform dependent--
  46. * don't modify BPORT settings unless you know what you are doing.
  47. *
  48. * On SS5 BPA seems to toggle onboard ethernet loopback... -E
  49. */
  50. #define APC_BPORT_A 0x01 /* Bit Port A */
  51. #define APC_BPORT_B 0x02 /* Bit Port B */
  52. #endif /* !(_SPARC_APC_H) */