driver: thermal: pwm_fan: tach on rising
Anshul Jain [Tue, 16 Sep 2014 22:41:17 +0000 (15:41 -0700)]
Trigger tach interrupts on rising edge as well, this will
make interrupts 4 times the RPM value. Triggering with 4 times per
rotation given better averaging and consistent results at higher RPM.

Bug 1554836

Change-Id: I21f7386f1ebbbdc63cde42ed3a0544a5c65d633b
Signed-off-by: Anshul Jain <anshulj@nvidia.com>
Reviewed-on: http://git-master/r/499507
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Raymond Poudrier <rapoudrier@nvidia.com>

drivers/thermal/pwm_fan.c

index 674785b..6402015 100644 (file)
@@ -881,7 +881,8 @@ static int pwm_fan_probe(struct platform_device *pdev)
                }
 
                err = request_irq(fan_data->tach_irq, fan_tach_isr,
-                       IRQF_TRIGGER_FALLING , "pwm-fan-tach", NULL);
+                       IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
+                       "pwm-fan-tach", NULL);
                if (err < 0)
                        goto tach_request_irq_fail;
                disable_irq_nosync(fan_data->tach_irq);