static int es705_slim_vs_streaming(struct es705_priv *es705) { int rc; #ifdef VS_BUFFER_VIA_UART /* rc = gpio_direction_input(es705->pdata->wakeup_gpio); if (rc < 0) { dev_err(es705_priv.dev, "%s(): set GPIO for UART failed", __func__); goto es705_vs_streaming_error; } */ rc = es705_uart_open(es705); if (rc) { dev_err(es705->dev, "%s(): uart open error\n", __func__); goto es705_vs_streaming_error; } /* set speed to bootloader baud */ es705_configure_tty(es705_priv.uart_dev.tty, UART_TTY_BAUD_RATE_BOOTLOADER, UART_TTY_STOP_BITS); /* wait until all data will be read by App */ /* rc = es705_uart_write(es705, data, sz); if (rc != sz) { dev_err(es705->dev, "%s(): uart write fail\n", __func__); rc = -EIO; goto es705_vs_streaming_error; } msleep(20000); */ rc = es705_uart_close(es705); if (rc) { dev_err(es705->dev, "%s(): uart close error\n", __func__); goto es705_vs_streaming_error; } /* rc = gpio_direction_output(es705->pdata->wakeup_gpio, 0); if (rc < 0) dev_err(es705_priv.dev, "%s(): set UART direction failed", __func__); } */ #else /* * VS BUFFER via SLIMBus * end point is * 156 - 0x9c for pass through 1 chan mode * 156 - 0x9c and 157 - 0x9d for pass through 2 channels mode */ u32 vs_stream_end_point = 0x8028809C; u32 rspn = vs_stream_end_point; int match = 1; u32 vs_stream_cmd = 0x90250202 | ES705_STREAM_ENABLE; /* select streaming pathID */ dev_dbg(es705->dev, "%s(): Set VS Streaming PathID\n", __func__); rc = es705_slim_write_then_read(es705, &vs_stream_end_point, sizeof(vs_stream_end_point), &rspn, match); if (rc) { dev_err(es705->dev, "%s(): Select VS stream Path ID Fail\n", __func__); goto es705_vs_streaming_error; } /* enable streaming */ dev_dbg(es705->dev, "%s(): Enable VS Streaming\n", __func__); rc = es705_slim_write(es705, &vs_stream_cmd, 4); if (rc) { dev_err(es705->dev, "%s(): Enable VS streaming Fail\n", __func__); goto es705_vs_streaming_error; } /* TODO wait end of streaming and disable */ /* vs_stream = 0x90250200 | ES705_STREAM_DISABLE; rc = es705_slim_write(es705, &vs_stream_cmd, 4); if (rc) dev_err(es705->dev, "%s(): Disable VS streaming Fail\n", __func__); */ #endif es705_vs_streaming_error: return rc; }
void es705_set_tty_baud_rate(int index) { /* set baudrate to FW baud (common case) */ es705_configure_tty(es705_priv.uart_dev.tty, host_uart_baud_rate[index], UART_TTY_STOP_BITS); }