OSDN Git Service

HID: intel-ish-hid: ipc: set NO_D3 flag only when needed
authorZhang Lixu <lixu.zhang@intel.com>
Thu, 8 Aug 2019 10:21:11 +0000 (18:21 +0800)
committerJiri Kosina <jkosina@suse.cz>
Mon, 19 Aug 2019 12:01:50 +0000 (14:01 +0200)
commitc1ca58f6982bb815c27a4a75f0f430f87b624f66
tree429ac78c1fd02d93c24042c1b3df305bf97962f6
parentf4eb1423e43376bec578c5696635b074c8bd2035
HID: intel-ish-hid: ipc: set NO_D3 flag only when needed

Currently, the NO_D3 flag is set in ish_probe(), and cleared in
ish_remove(). So even if the system goes into S3, ISH is still
in D0i3 state. It makes more sense that put ISH into D3 as system
goes into S3 and put ISH into D0i3 as system goes into suspend-to-idle.
I remove the NO_D3 setting in ish_probe(), so that ISH can enter
D3 state when system enters S3. Only set N0_D3 flag when system
enters the suspend-to-idle or platform specified, and clear it
when system resume.

When the ISH enters D3, the FW will check the DMA bit status.
If the DMA bit is set, the FW will reset automatically. So the
DMA bit need be clear before putting ISH into D3 state.

Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/intel-ish-hid/ipc/hw-ish.h
drivers/hid/intel-ish-hid/ipc/ipc.c
drivers/hid/intel-ish-hid/ipc/pci-ish.c