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;
}
Exemple #2
0
static int es705_uart_probe_thread(void *ptr)
{
	int rc = 0;
	struct device *dev = (struct device *)ptr;

	if (variant_aif_required == NO_AIF)
		return rc;

	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;
	es705_priv.datablockdev = uart_datablockdev;

	rc = es705_core_init(dev);
	if (rc) {
		dev_err(dev, "%s(): es705_core_init() 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;
	}

	/* 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_spi_probe(struct spi_device *spi)
{
	int rc;

	es705_priv.spi_client = spi;
	es705_priv.intf = ES705_SPI_INTF;
	es705_priv.dev_read = es705_spi_read;
	es705_priv.dev_write = es705_spi_write;
	es705_priv.dev_write_then_read = es705_spi_write_then_read;
	es705_priv.boot_setup = es705_spi_boot_setup;
	es705_priv.boot_finish = es705_spi_boot_finish;
	es705_priv.cmd = es705_spi_cmd;

	dev_info(&spi->dev, "%s()\n", __func__);

	es705_priv.streamdev = spi_streamdev;

	rc = es705_core_init(&spi->dev);
	if (rc) {
		dev_err(&spi->dev, "%s(): es705_core_init() failed %d\n",
			__func__, rc);
		goto es705_core_probe_error;
	}

	rc = es705_bootup(&es705_priv);
	if (rc) {
		dev_err(&spi->dev, "%s(): es705_bootup failed %d\n", __func__,
			rc);
		goto bootup_error;
	}
	return rc;

bootup_error:
es705_core_probe_error:
	dev_dbg(&spi->dev, "%s(): exit with error\n", __func__);

	return rc;
}