scsi: qla2xxx: remove double assignment in qla2x00_update_fcport
[linux-2.6-microblaze.git] / drivers / pwm / pwm-lpss-platform.c
index 5561b9e..757230e 100644 (file)
@@ -30,6 +30,7 @@ static const struct pwm_lpss_boardinfo pwm_lpss_bsw_info = {
        .clk_rate = 19200000,
        .npwm = 1,
        .base_unit_bits = 16,
+       .other_devices_aml_touches_pwm_regs = true,
 };
 
 /* Broxton */
@@ -60,6 +61,7 @@ static int pwm_lpss_probe_platform(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, lpwm);
 
+       dev_pm_set_driver_flags(&pdev->dev, DPM_FLAG_SMART_PREPARE);
        pm_runtime_set_active(&pdev->dev);
        pm_runtime_enable(&pdev->dev);
 
@@ -74,13 +76,29 @@ static int pwm_lpss_remove_platform(struct platform_device *pdev)
        return pwm_lpss_remove(lpwm);
 }
 
-static SIMPLE_DEV_PM_OPS(pwm_lpss_platform_pm_ops,
-                        pwm_lpss_suspend,
-                        pwm_lpss_resume);
+static int pwm_lpss_prepare(struct device *dev)
+{
+       struct pwm_lpss_chip *lpwm = dev_get_drvdata(dev);
+
+       /*
+        * If other device's AML code touches the PWM regs on suspend/resume
+        * force runtime-resume the PWM controller to allow this.
+        */
+       if (lpwm->info->other_devices_aml_touches_pwm_regs)
+               return 0; /* Force runtime-resume */
+
+       return 1; /* If runtime-suspended leave as is */
+}
+
+static const struct dev_pm_ops pwm_lpss_platform_pm_ops = {
+       .prepare = pwm_lpss_prepare,
+       SET_SYSTEM_SLEEP_PM_OPS(pwm_lpss_suspend, pwm_lpss_resume)
+};
 
 static const struct acpi_device_id pwm_lpss_acpi_match[] = {
        { "80860F09", (unsigned long)&pwm_lpss_byt_info },
        { "80862288", (unsigned long)&pwm_lpss_bsw_info },
+       { "80862289", (unsigned long)&pwm_lpss_bsw_info },
        { "80865AC8", (unsigned long)&pwm_lpss_bxt_info },
        { },
 };