Skip to content

Commit

Permalink
media: ipu-cio2: Remove unnecessary runtime PM power state setting
Browse files Browse the repository at this point in the history
ipu-cio2 uses generic power management, and pci_pm_runtime_suspend() and
pci_pm_runtime_resume() already take care of setting the PCI device power
state, so the driver doesn't need to do it explicitly.

Remove explicit setting to D3hot or D0 during runtime suspend and resume.

Remove #defines that are no longer used.

Signed-off-by: Bjorn Helgaas <[email protected]>
Cc: Hyungwoo Yang <[email protected]>
Cc: Rajmohan Mani <[email protected]>
Cc: Vijaykumar Ramya <[email protected]>
Cc: Samu Onkalo <[email protected]>
Cc: Jouni Högander <[email protected]>
Cc: Jouni Ukkonen <[email protected]>
Cc: Antti Laakso <[email protected]>
[Sakari Ailus: Remove now-redundant local variables.]
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
  • Loading branch information
bjorn-helgaas authored and Hans Verkuil committed Apr 10, 2024
1 parent f55aa90 commit ca7329c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
11 changes: 0 additions & 11 deletions drivers/media/pci/intel/ipu3/ipu3-cio2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1807,16 +1807,10 @@ static int __maybe_unused cio2_runtime_suspend(struct device *dev)
struct pci_dev *pci_dev = to_pci_dev(dev);
struct cio2_device *cio2 = pci_get_drvdata(pci_dev);
void __iomem *const base = cio2->base;
u16 pm;

writel(CIO2_D0I3C_I3, base + CIO2_REG_D0I3C);
dev_dbg(dev, "cio2 runtime suspend.\n");

pci_read_config_word(pci_dev, pci_dev->pm_cap + CIO2_PMCSR_OFFSET, &pm);
pm = (pm >> CIO2_PMCSR_D0D3_SHIFT) << CIO2_PMCSR_D0D3_SHIFT;
pm |= CIO2_PMCSR_D3;
pci_write_config_word(pci_dev, pci_dev->pm_cap + CIO2_PMCSR_OFFSET, pm);

return 0;
}

Expand All @@ -1825,15 +1819,10 @@ static int __maybe_unused cio2_runtime_resume(struct device *dev)
struct pci_dev *pci_dev = to_pci_dev(dev);
struct cio2_device *cio2 = pci_get_drvdata(pci_dev);
void __iomem *const base = cio2->base;
u16 pm;

writel(CIO2_D0I3C_RR, base + CIO2_REG_D0I3C);
dev_dbg(dev, "cio2 runtime resume.\n");

pci_read_config_word(pci_dev, pci_dev->pm_cap + CIO2_PMCSR_OFFSET, &pm);
pm = (pm >> CIO2_PMCSR_D0D3_SHIFT) << CIO2_PMCSR_D0D3_SHIFT;
pci_write_config_word(pci_dev, pci_dev->pm_cap + CIO2_PMCSR_OFFSET, pm);

return 0;
}

Expand Down
4 changes: 0 additions & 4 deletions drivers/media/pci/intel/ipu3/ipu3-cio2.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,6 @@ struct pci_dev;
#define CIO2_CSIRX_DLY_CNT_TERMEN_DEFAULT 0x4
#define CIO2_CSIRX_DLY_CNT_SETTLE_DEFAULT 0x570

#define CIO2_PMCSR_OFFSET 4U
#define CIO2_PMCSR_D0D3_SHIFT 2U
#define CIO2_PMCSR_D3 0x3

struct cio2_csi2_timing {
s32 clk_termen;
s32 clk_settle;
Expand Down

0 comments on commit ca7329c

Please sign in to comment.