static int es705_uart_probe_thread(void *ptr)
{
    int rc = 0;
    struct device *dev = (struct device *) ptr;

    rc = es705_uart_open(&es705_priv);
    if (rc) {
        dev_err(dev, "%s(): es705_uart_open() failed %d\n",
                __func__, rc);
        return rc;
    }

    /* set es705 function pointers */
    es705_priv.dev_read = es705_uart_read;
    es705_priv.dev_write = es705_uart_write;
    es705_priv.cmd = es705_uart_cmd;
    es705_priv.boot_setup = es705_uart_boot_setup;
    es705_priv.boot_finish = es705_uart_boot_finish;

    es705_priv.streamdev = uart_streamdev;

    rc = es705_core_probe(dev);
    if (rc) {
        dev_err(dev, "%s(): es705_core_probe() failed %d\n",
                __func__, rc);
        goto bootup_error;
    }

    rc = es705_bootup(&es705_priv);

    if (rc) {
        dev_err(dev, "%s(): es705_bootup failed %d\n",
                __func__, rc);
        goto bootup_error;
    }

    rc = snd_soc_register_codec(dev, &soc_codec_dev_es705,
                                es705_dai, ES705_NUM_CODEC_DAIS);
    dev_dbg(dev, "%s(): rc = snd_soc_regsiter_codec() = %d\n",
            __func__, rc);

    /* init es705 character device here, now that the UART is discovered */
    rc = es705_init_cdev(&es705_priv);
    if (rc) {
        dev_err(dev, "%s(): failed to initialize char device = %d\n",
                __func__, rc);
        goto cdev_init_error;
    }

    return rc;

bootup_error:
    /* close filp */
    es705_uart_close(&es705_priv);
cdev_init_error:
    dev_dbg(es705_priv.dev, "%s(): exit with error\n", __func__);
    return rc;
}
static int es705_slim_probe(struct slim_device *sbdev)
{
	int rc;

#if defined(SLIMBUS_VER_1)
	struct task_struct *thread = NULL;
#endif

	dev_info(&sbdev->dev, "%s(): sbdev->name = %s\n", __func__, sbdev->name);

#ifdef CONFIG_SND_SOC_ES704_TEMP
	if (!strcmp(sbdev->name, "es704-codec-gen0")) {
		dev_info(&sbdev->dev, "%s() ES704 device, wait some time\n", __func__);
		msleep(10);
		if (dev_selected) {
			dev_info(&sbdev->dev, "%s(): dev_selected is True, return\n", __func__);
			return -1;
		}
	}
#endif

	if (sbdev->dev.of_node) {
		rc = es705_slim_probe_dts(sbdev);
		if (rc)
			goto es705_core_probe_error;
	} else {
		es705_slim_probe_nodts(sbdev);
	}

	if (es705_priv.intf_client == NULL ||
	    es705_priv.gen0_client == NULL) {
		dev_dbg(&sbdev->dev, "%s(): incomplete initialization\n",
			__func__);
		return 0;
	}

	slim_set_clientdata(sbdev, &es705_priv);

	es705_priv.intf = ES705_SLIM_INTF;
	es705_priv.dev_read = es705_slim_read;
	es705_priv.dev_write = es705_slim_write;
	es705_priv.dev_write_then_read = es705_slim_write_then_read;
	es705_priv.vs_streaming = es705_slim_vs_streaming;

	es705_priv.streamdev = uart_streamdev;
	es705_priv.boot_setup = es705_slim_boot_setup;
	es705_priv.boot_finish = es705_slim_boot_finish;
	es705_priv.wakeup_bus = es705_slim_wakeup_bus;

	es705_priv.cmd = es705_slim_cmd;
	es705_priv.dev = &es705_priv.gen0_client->dev;
	rc = es705_core_probe(&es705_priv.gen0_client->dev);
	if (rc) {
		dev_err(&sbdev->dev, "%s(): es705_core_probe() failed %d\n",
			__func__, rc);
		goto es705_core_probe_error;
	}

#if defined(SLIMBUS_VER_1)
	thread = kthread_run(es705_fw_thread, &es705_priv, "audience thread");
	if (IS_ERR(thread)) {
		dev_err(&sbdev->dev, "%s(): can't create es705 firmware thread = %p\n",
			__func__, thread);
		return -1;
	}
#endif

	return 0;

es705_core_probe_error:
	dev_dbg(&sbdev->dev, "%s(): exit with error\n", __func__);
	return rc;
}