media: atomisp: Move power-management over to a custom pm-domain
authorHans de Goede <hdegoede@redhat.com>
Sat, 26 Nov 2022 22:02:49 +0000 (23:02 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Wed, 8 Feb 2023 06:58:10 +0000 (07:58 +0100)
commit553a64b7e7cef7690203bb07bd0280dd142c1015
treed4786efeb91f1c549a653ffc49bd4e64c9b75370
parent21b86873711be1aa019ee8991c293efd09c022fd
media: atomisp: Move power-management over to a custom pm-domain

The atomisp does not use standard PCI power-management through the
PCI config space. Instead this driver directly tells the P-Unit to
disable the ISP over the IOSF. The standard PCI subsystem pm_ops will
try to access the config space before (resume) / after (suspend) this
driver has turned the ISP on / off, resulting in the following errors:

 Unable to change power state from D0 to D3hot, device inaccessible
 Unable to change power state from D3cold to D0, device inaccessible

Getting logged into dmesg a whole bunch of time during boot as well as
every time the camera is used.

To avoid these errors use a custom pm_domain instead of standard driver
pm-callbacks so that all the PCI subsys suspend / resume handling is
skipped and call pci_save_state() / pci_restore_state() ourselves.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_internal.h
drivers/staging/media/atomisp/pci/atomisp_v4l2.c