Skip to content
Snippets Groups Projects
Commit ea934fbc authored by Vladimir Karpovich's avatar Vladimir Karpovich Committed by Vineeta Srivastava
Browse files

asoc: fsa8500: Disable UART if console is off.


Fairchild FSA8500 does not detect some TTY boxes correctly
if UART detection enabled.Enable UART detection only if
debug console is configured in bootloader.

Bug: 17725106

Change-Id: Id2f6308eb8f9fddac5ddf8e6dbf44e713f946544
Signed-off-by: default avatarVladimir Karpovich <vkarpovich@motorola.com>
parent 98eb87de
No related branches found
No related tags found
No related merge requests found
......@@ -61,6 +61,9 @@
/* Reset bits */
#define FSA8500_RESET 0x03
/* Disable UART detection bit */
#define FSA8500_UART_OFF 0x08
/* amp states */
#define FSA8500_AMP_DISABLED 0
#define FSA8500_AMP_ENABLED 1
......
......@@ -36,6 +36,7 @@
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/uaccess.h>
#include <linux/console.h>
#include <linux/fsa8500.h>
#include <sound/soc.h>
#include <sound/jack.h>
......@@ -187,6 +188,15 @@ error:
return retval;
}
static int fsa8500_check_console(void)
{
struct console *con;
for_each_console(con)
if (!strncmp(con->name, "tty", 3))
return 1;
return 0;
}
static void fsa8500_initialize(struct fsa8500_platform_data *pdata,
struct fsa8500_data *fsa8500)
{
......@@ -203,7 +213,15 @@ static void fsa8500_initialize(struct fsa8500_platform_data *pdata,
if (retval != 0)
goto error;
}
/* Disable UART detection if console is not configured
to help with TTY detection */
if (!fsa8500_check_console()) {
pr_debug("%s: Console isn't set. Disable UART detection.\n",
__func__);
fsa8500_reg_write(fsa8500, FSA8500_CONTROL2,
FSA8500_UART_OFF, FSA8500_UART_OFF);
}
pr_info("fsa8500_initialize success\n");
error:
return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment