diff options
Diffstat (limited to 'drivers/misc/mei/mei_dev.h')
-rw-r--r-- | drivers/misc/mei/mei_dev.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h index ca7581ce0722..bec6adef68bd 100644 --- a/drivers/misc/mei/mei_dev.h +++ b/drivers/misc/mei/mei_dev.h | |||
@@ -220,6 +220,7 @@ struct mei_cl { | |||
220 | * @hw_start - start hw after reset | 220 | * @hw_start - start hw after reset |
221 | * @hw_config - configure hw | 221 | * @hw_config - configure hw |
222 | 222 | ||
223 | * @pg_state - power gating state of the device | ||
223 | * @pg_is_enabled - is power gating enabled | 224 | * @pg_is_enabled - is power gating enabled |
224 | 225 | ||
225 | * @intr_clear - clear pending interrupts | 226 | * @intr_clear - clear pending interrupts |
@@ -246,6 +247,7 @@ struct mei_hw_ops { | |||
246 | int (*hw_start)(struct mei_device *dev); | 247 | int (*hw_start)(struct mei_device *dev); |
247 | void (*hw_config)(struct mei_device *dev); | 248 | void (*hw_config)(struct mei_device *dev); |
248 | 249 | ||
250 | enum mei_pg_state (*pg_state)(struct mei_device *dev); | ||
249 | bool (*pg_is_enabled)(struct mei_device *dev); | 251 | bool (*pg_is_enabled)(struct mei_device *dev); |
250 | 252 | ||
251 | void (*intr_clear)(struct mei_device *dev); | 253 | void (*intr_clear)(struct mei_device *dev); |
@@ -335,11 +337,37 @@ struct mei_cl_device { | |||
335 | void *priv_data; | 337 | void *priv_data; |
336 | }; | 338 | }; |
337 | 339 | ||
340 | |||
341 | /** | ||
342 | * enum mei_pg_event - power gating transition events | ||
343 | * | ||
344 | * @MEI_PG_EVENT_IDLE: the driver is not in power gating transition | ||
345 | * @MEI_PG_EVENT_WAIT: the driver is waiting for a pg event to complete | ||
346 | * @MEI_PG_EVENT_RECEIVED: the driver received pg event | ||
347 | */ | ||
348 | enum mei_pg_event { | ||
349 | MEI_PG_EVENT_IDLE, | ||
350 | MEI_PG_EVENT_WAIT, | ||
351 | MEI_PG_EVENT_RECEIVED, | ||
352 | }; | ||
353 | |||
354 | /** | ||
355 | * enum mei_pg_state - device internal power gating state | ||
356 | * | ||
357 | * @MEI_PG_OFF: device is not power gated - it is active | ||
358 | * @MEI_PG_ON: device is power gated - it is in lower power state | ||
359 | */ | ||
360 | enum mei_pg_state { | ||
361 | MEI_PG_OFF = 0, | ||
362 | MEI_PG_ON = 1, | ||
363 | }; | ||
364 | |||
338 | /** | 365 | /** |
339 | * struct mei_device - MEI private device struct | 366 | * struct mei_device - MEI private device struct |
340 | 367 | ||
341 | * @reset_count - limits the number of consecutive resets | 368 | * @reset_count - limits the number of consecutive resets |
342 | * @hbm_state - state of host bus message protocol | 369 | * @hbm_state - state of host bus message protocol |
370 | * @pg_event - power gating event | ||
343 | * @mem_addr - mem mapped base register address | 371 | * @mem_addr - mem mapped base register address |
344 | 372 | ||
345 | * @hbuf_depth - depth of hardware host/write buffer is slots | 373 | * @hbuf_depth - depth of hardware host/write buffer is slots |
@@ -387,6 +415,11 @@ struct mei_device { | |||
387 | enum mei_hbm_state hbm_state; | 415 | enum mei_hbm_state hbm_state; |
388 | u16 init_clients_timer; | 416 | u16 init_clients_timer; |
389 | 417 | ||
418 | /* | ||
419 | * Power Gating support | ||
420 | */ | ||
421 | enum mei_pg_event pg_event; | ||
422 | |||
390 | unsigned char rd_msg_buf[MEI_RD_MSG_BUF_SIZE]; /* control messages */ | 423 | unsigned char rd_msg_buf[MEI_RD_MSG_BUF_SIZE]; /* control messages */ |
391 | u32 rd_msg_hdr; | 424 | u32 rd_msg_hdr; |
392 | 425 | ||
@@ -563,6 +596,11 @@ static inline void mei_hw_config(struct mei_device *dev) | |||
563 | dev->ops->hw_config(dev); | 596 | dev->ops->hw_config(dev); |
564 | } | 597 | } |
565 | 598 | ||
599 | static inline enum mei_pg_state mei_pg_state(struct mei_device *dev) | ||
600 | { | ||
601 | return dev->ops->pg_state(dev); | ||
602 | } | ||
603 | |||
566 | static inline bool mei_pg_is_enabled(struct mei_device *dev) | 604 | static inline bool mei_pg_is_enabled(struct mei_device *dev) |
567 | { | 605 | { |
568 | return dev->ops->pg_is_enabled(dev); | 606 | return dev->ops->pg_is_enabled(dev); |