HID: intel_ish-hid: HBM: Use connected standby state bit during suspend/resume
The individual sensor drivers implemented in the ISH firmware needs capability to take special actions when there is a change in the system standby state. The ISH core firmware passes this notification to individual sensor drivers in response to the OS request via connected standby bit in the SYSTEM_STATE_STATUS command. This change sets CONNECTED_STANDBY_STATE_BIT bit to 1 during suspend callback and clears during resume callback. Signed-off-by: Ye Xiang <xiang.ye@intel.com> [srinivas.pandruvada@linux.intel.com: changelog rewrite] Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
e71da1fd0e
commit
94cad2ddb2
@ -914,7 +914,7 @@ static inline void fix_cl_hdr(struct ishtp_msg_hdr *hdr, size_t length,
|
||||
/*** Suspend and resume notification ***/
|
||||
|
||||
static uint32_t current_state;
|
||||
static uint32_t supported_states = 0 | SUSPEND_STATE_BIT;
|
||||
static uint32_t supported_states = SUSPEND_STATE_BIT | CONNECTED_STANDBY_STATE_BIT;
|
||||
|
||||
/**
|
||||
* ishtp_send_suspend() - Send suspend message to FW
|
||||
@ -933,7 +933,7 @@ void ishtp_send_suspend(struct ishtp_device *dev)
|
||||
memset(&state_status_msg, 0, len);
|
||||
state_status_msg.hdr.cmd = SYSTEM_STATE_STATUS;
|
||||
state_status_msg.supported_states = supported_states;
|
||||
current_state |= SUSPEND_STATE_BIT;
|
||||
current_state |= (SUSPEND_STATE_BIT | CONNECTED_STANDBY_STATE_BIT);
|
||||
dev->print_log(dev, "%s() sends SUSPEND notification\n", __func__);
|
||||
state_status_msg.states_status = current_state;
|
||||
|
||||
@ -959,7 +959,7 @@ void ishtp_send_resume(struct ishtp_device *dev)
|
||||
memset(&state_status_msg, 0, len);
|
||||
state_status_msg.hdr.cmd = SYSTEM_STATE_STATUS;
|
||||
state_status_msg.supported_states = supported_states;
|
||||
current_state &= ~SUSPEND_STATE_BIT;
|
||||
current_state &= ~(CONNECTED_STANDBY_STATE_BIT | SUSPEND_STATE_BIT);
|
||||
dev->print_log(dev, "%s() sends RESUME notification\n", __func__);
|
||||
state_status_msg.states_status = current_state;
|
||||
|
||||
|
@ -235,6 +235,7 @@ struct dma_xfer_hbm {
|
||||
#define SYSTEM_STATE_QUERY_SUBSCRIBERS 0x3
|
||||
#define SYSTEM_STATE_STATE_CHANGE_REQ 0x4
|
||||
/*indicates suspend and resume states*/
|
||||
#define CONNECTED_STANDBY_STATE_BIT (1<<0)
|
||||
#define SUSPEND_STATE_BIT (1<<1)
|
||||
|
||||
struct ish_system_states_header {
|
||||
|
Loading…
Reference in New Issue
Block a user