Merge tag 'iwlwifi-next-for-kalle-2014-12-30' of https://git.kernel.org/pub/scm/linux...
[cascardo/linux.git] / arch / powerpc / include / asm / opal.h
index 5cd8d2f..eb95b67 100644 (file)
@@ -56,6 +56,14 @@ struct opal_sg_list {
 #define OPAL_HARDWARE_FROZEN   -13
 #define OPAL_WRONG_STATE       -14
 #define OPAL_ASYNC_COMPLETION  -15
+#define OPAL_I2C_TIMEOUT       -17
+#define OPAL_I2C_INVALID_CMD   -18
+#define OPAL_I2C_LBUS_PARITY   -19
+#define OPAL_I2C_BKEND_OVERRUN -20
+#define OPAL_I2C_BKEND_ACCESS  -21
+#define OPAL_I2C_ARBT_LOST     -22
+#define OPAL_I2C_NACK_RCVD     -23
+#define OPAL_I2C_STOP_ERR      -24
 
 /* API Tokens (in r0) */
 #define OPAL_INVALID_CALL                      -1
@@ -152,12 +160,25 @@ struct opal_sg_list {
 #define OPAL_PCI_ERR_INJECT                    96
 #define OPAL_PCI_EEH_FREEZE_SET                        97
 #define OPAL_HANDLE_HMI                                98
+#define OPAL_CONFIG_CPU_IDLE_STATE             99
+#define OPAL_SLW_SET_REG                       100
 #define OPAL_REGISTER_DUMP_REGION              101
 #define OPAL_UNREGISTER_DUMP_REGION            102
 #define OPAL_WRITE_TPO                         103
 #define OPAL_READ_TPO                          104
 #define OPAL_IPMI_SEND                         107
 #define OPAL_IPMI_RECV                         108
+#define OPAL_I2C_REQUEST                       109
+
+/* Device tree flags */
+
+/* Flags set in power-mgmt nodes in device tree if
+ * respective idle states are supported in the platform.
+ */
+#define OPAL_PM_NAP_ENABLED    0x00010000
+#define OPAL_PM_SLEEP_ENABLED  0x00020000
+#define OPAL_PM_WINKLE_ENABLED 0x00040000
+#define OPAL_PM_SLEEP_ENABLED_ER1      0x00080000
 
 #ifndef __ASSEMBLY__
 
@@ -712,6 +733,24 @@ typedef struct oppanel_line {
        uint64_t        line_len;
 } oppanel_line_t;
 
+/* OPAL I2C request */
+struct opal_i2c_request {
+       uint8_t type;
+#define OPAL_I2C_RAW_READ      0
+#define OPAL_I2C_RAW_WRITE     1
+#define OPAL_I2C_SM_READ       2
+#define OPAL_I2C_SM_WRITE      3
+       uint8_t flags;
+#define OPAL_I2C_ADDR_10       0x01    /* Not supported yet */
+       uint8_t subaddr_sz;             /* Max 4 */
+       uint8_t reserved;
+       __be16 addr;                    /* 7 or 10 bit address */
+       __be16 reserved2;
+       __be32 subaddr;         /* Sub-address if any */
+       __be32 size;                    /* Data size */
+       __be64 buffer_ra;               /* Buffer real address */
+};
+
 /* /sys/firmware/opal */
 extern struct kobject *opal_kobj;
 
@@ -876,11 +915,14 @@ int64_t opal_sensor_read(uint32_t sensor_hndl, int token, __be32 *sensor_data);
 int64_t opal_handle_hmi(void);
 int64_t opal_register_dump_region(uint32_t id, uint64_t start, uint64_t end);
 int64_t opal_unregister_dump_region(uint32_t id);
+int64_t opal_slw_set_reg(uint64_t cpu_pir, uint64_t sprn, uint64_t val);
 int64_t opal_pci_set_phb_cxl_mode(uint64_t phb_id, uint64_t mode, uint64_t pe_number);
 int64_t opal_ipmi_send(uint64_t interface, struct opal_ipmi_msg *msg,
                uint64_t msg_len);
 int64_t opal_ipmi_recv(uint64_t interface, struct opal_ipmi_msg *msg,
                uint64_t *msg_len);
+int64_t opal_i2c_request(uint64_t async_token, uint32_t bus_id,
+                        struct opal_i2c_request *oreq);
 
 /* Internal functions */
 extern int early_init_dt_scan_opal(unsigned long node, const char *uname,