Re: [PATCH v3 3/3] soc: loongson2_pm: add power management support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





在 2023/6/15 下午6:00, Huacai Chen 写道:

+static void loongson2_pm_status_clear(void)
+{
+       u16 value;
+
+       value = loongson2_pm_readw(LOONGSON2_PM1_STS_REG);
+       value |= (LOONGSON2_PM1_PWRBTN_STS | LOONGSON2_PM1_PCIEXP_WAKE_STS |
+                 LOONGSON2_PM1_WAKE_STS);
+       loongson2_pm_writew(value, LOONGSON2_PM1_STS_REG);
+       loongson2_pm_writel(loongson2_pm_readl(LOONGSON2_GPE0_STS_REG),
+                           LOONGSON2_GPE0_STS_REG);
Long-line warnings is removed in latest kernel, so you don't need to split here.


okay, I got it.


+}
+
+static void loongson2_power_button_irq_enable(void)

Using loongson2_pm_irq_enable is a little better.


Indeed, this looks better!  I will use it.

...

+static int loongson2_suspend_valid_state(suspend_state_t state)
+{
+       if (state == PM_SUSPEND_MEM)
+               return 1;
+
+       return 0;
"return (state == PM_SUSPEND_MEM)" is enough.


okay, I got it.


Thanks,
Yinbo




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux