platform/x86: hp_accel: Avoid invoking _INI to speed up resume
authorKai-Heng Feng <kai.heng.feng@canonical.com>
Fri, 30 Apr 2021 06:07:35 +0000 (14:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Jun 2021 07:00:39 +0000 (09:00 +0200)
commit515181e38e9788a0fff038109dd62b8bf6819e76
tree7f624152b499adcc1dca61fc6b5376309a11a783
parent3267a061096efc91eda52c2a0c61ba76e46e4b34
platform/x86: hp_accel: Avoid invoking _INI to speed up resume

[ Upstream commit 79d341e26ebcdbc622348aaaab6f8f89b6fdb25f ]

hp_accel can take almost two seconds to resume on some HP laptops.

The bottleneck is on evaluating _INI, which is only needed to run once.

Resolve the issue by only invoking _INI when it's necessary. Namely, on
probe and on hibernation restore.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Acked-by: Éric Piel <eric.piel@trempplin-utc.net>
Link: https://lore.kernel.org/r/20210430060736.590321-1-kai.heng.feng@canonical.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/misc/lis3lv02d/lis3lv02d.h
drivers/platform/x86/hp_accel.c