treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / powerpc / include / asm / pmi.h
blob478f0a2fe7f4f188554fe7707a8af4a09396ecc4
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 #ifndef _POWERPC_PMI_H
3 #define _POWERPC_PMI_H
5 /*
6 * Definitions for talking with PMI device on PowerPC
8 * PMI (Platform Management Interrupt) is a way to communicate
9 * with the BMC (Baseboard Management Controller) via interrupts.
10 * Unlike IPMI it is bidirectional and has a low latency.
12 * (C) Copyright IBM Deutschland Entwicklung GmbH 2005
14 * Author: Christian Krafft <krafft@de.ibm.com>
17 #ifdef __KERNEL__
19 #define PMI_TYPE_FREQ_CHANGE 0x01
20 #define PMI_TYPE_POWER_BUTTON 0x02
21 #define PMI_READ_TYPE 0
22 #define PMI_READ_DATA0 1
23 #define PMI_READ_DATA1 2
24 #define PMI_READ_DATA2 3
25 #define PMI_WRITE_TYPE 4
26 #define PMI_WRITE_DATA0 5
27 #define PMI_WRITE_DATA1 6
28 #define PMI_WRITE_DATA2 7
30 #define PMI_ACK 0x80
32 #define PMI_TIMEOUT 100
34 typedef struct {
35 u8 type;
36 u8 data0;
37 u8 data1;
38 u8 data2;
39 } pmi_message_t;
41 struct pmi_handler {
42 struct list_head node;
43 u8 type;
44 void (*handle_pmi_message) (pmi_message_t);
47 int pmi_register_handler(struct pmi_handler *);
48 void pmi_unregister_handler(struct pmi_handler *);
50 int pmi_send_message(pmi_message_t);
52 #endif /* __KERNEL__ */
53 #endif /* _POWERPC_PMI_H */