Revert "input: touch: maxim_sti: boot fusion from init"
Bo Kim [Mon, 14 Oct 2013 06:03:25 +0000 (15:03 +0900)]
This reverts commit 06eef70f3568f781da609570d0dfb39c3a869439.

Change-Id: I13caedd3d9e0519af496d83a81785ccd28117b10
Signed-off-by: Bo Kim <bok@nvidia.com>
Reviewed-on: http://git-master/r/298853
(cherry picked from commit c835182402f2b3cd2345a4c9b193b08d18639fde)
Reviewed-on: http://git-master/r/327438
Reviewed-by: Harry Hong <hhong@nvidia.com>
Tested-by: Harry Hong <hhong@nvidia.com>

drivers/input/touchscreen/maxim_sti.c

index bc7af34..abae474 100644 (file)
@@ -66,6 +66,7 @@ struct dev_data {
        u32                          nl_seq;
        u8                           nl_mc_group_count;
        bool                         nl_enabled;
+       bool                         start_fusion;
        bool                         suspend_in_progress;
        bool                         resume_in_progress;
        bool                         expect_resume_ack;
@@ -1565,6 +1566,9 @@ static int processing_thread(void *arg)
        struct dev_data         *dd = arg;
        struct maxim_sti_pdata  *pdata = dd->spi->dev.platform_data;
        struct sk_buff          *skb;
+       char                    *argv[] = { pdata->touch_fusion, "daemon",
+                                           pdata->nl_family,
+                                           pdata->config_file, NULL };
        int                     ret, ret2;
        bool                    fusion_dead;
 
@@ -1585,11 +1589,21 @@ static int processing_thread(void *arg)
                                        find_get_pid(dd->fusion_process),
                                        PIDTYPE_PID) == NULL) {
                        stop_scan_canned(dd);
+                       dd->start_fusion = true;
                        dd->fusion_process = (pid_t)0;
 #if INPUT_ENABLE_DISABLE
                        dd->input_no_deconfig = true;
 #endif
                }
+               if (dd->start_fusion) {
+                       do {
+                               ret = call_usermodehelper(argv[0], argv, NULL,
+                                                         UMH_WAIT_EXEC);
+                               if (ret != 0)
+                                       msleep(100);
+                       } while (ret != 0 && !kthread_should_stop());
+                       dd->start_fusion = false;
+               }
                if (kthread_should_stop())
                        break;
 
@@ -1811,6 +1825,7 @@ static int probe(struct spi_device *spi)
 #endif
 
        /* start up Touch Fusion */
+       dd->start_fusion = true;
        wake_up_process(dd->thread);
        INFO("driver loaded; version %s; release date %s", DRIVER_VERSION,
             DRIVER_RELEASE);