]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
MLK-9866: mfd: si476x: FM will fail to open sometimes.
authorShengjiu Wang <shengjiu.wang@freescale.com>
Tue, 18 Nov 2014 06:20:55 +0000 (14:20 +0800)
committerNitin Garg <nitin.garg@freescale.com>
Fri, 16 Jan 2015 03:18:34 +0000 (21:18 -0600)
In commit e856a0ebc23dcd2c933e3f902317652cc50f0067, we disabled
wait_event_timeout for CMD_POWER_DOWN, which will cause power down
failed sometimes, then FM will fail to reopen.
In this patch enable the wait_event_timeout for power down.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit 30aa7f1a3580d0a5bc866c624d1da441fd5502c1)

drivers/mfd/si476x-cmd.c

index 8ac23dff91a1660aa486c79c615e068d1c245a2c..6f1ef63086c9df98c56c00369c7b91b60c5320c5 100644 (file)
@@ -303,13 +303,13 @@ static int si476x_core_send_command(struct si476x_core *core,
         * possible racing conditions when working in polling mode */
        atomic_set(&core->cts, 0);
 
-       if (!(command == CMD_POWER_DOWN))
-               if (!wait_event_timeout(core->command,
-                                       atomic_read(&core->cts),
-                                       usecs_to_jiffies(usecs) + 1))
-                       dev_warn(&core->client->dev,
-                               "(%s) [CMD 0x%02x] Answer timeout.\n",
-                               __func__, command);
+       /* if (unlikely(command == CMD_POWER_DOWN) */
+       if (!wait_event_timeout(core->command,
+                               atomic_read(&core->cts),
+                               usecs_to_jiffies(usecs) + 1))
+               dev_warn(&core->client->dev,
+                        "(%s) [CMD 0x%02x] Answer timeout.\n",
+                        __func__, command);
 
        /*
          When working in polling mode, for some reason the tuner will