Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5d12c56f authored by Colin Cross's avatar Colin Cross Committed by Amit Pundir
Browse files

ANDROID: ARM: fiq_debugger: add debug_putc



Convert all the calls to state->pdata->uart_putc to a debug_putc
helper.

Change-Id: Idc007bd170ff1b51d0325e238105ae0c86d23777
Signed-off-by: default avatarColin Cross <ccross@android.com>
parent 14dbf867
Loading
Loading
Loading
Loading
+16 −11
Original line number Original line Diff line number Diff line
@@ -175,13 +175,18 @@ static void debug_uart_flush(struct fiq_debugger_state *state)
		state->pdata->uart_flush(state->pdev);
		state->pdata->uart_flush(state->pdev);
}
}


static void debug_putc(struct fiq_debugger_state *state, char c)
{
	state->pdata->uart_putc(state->pdev, c);
}

static void debug_puts(struct fiq_debugger_state *state, char *s)
static void debug_puts(struct fiq_debugger_state *state, char *s)
{
{
	unsigned c;
	unsigned c;
	while ((c = *s++)) {
	while ((c = *s++)) {
		if (c == '\n')
		if (c == '\n')
			state->pdata->uart_putc(state->pdev, '\r');
			debug_putc(state, '\r');
		state->pdata->uart_putc(state->pdev, c);
		debug_putc(state, c);
	}
	}
}
}


@@ -758,19 +763,19 @@ static bool debug_handle_uart_interrupt(struct fiq_debugger_state *state,
		} else if ((c >= ' ') && (c < 127)) {
		} else if ((c >= ' ') && (c < 127)) {
			if (state->debug_count < (DEBUG_MAX - 1)) {
			if (state->debug_count < (DEBUG_MAX - 1)) {
				state->debug_buf[state->debug_count++] = c;
				state->debug_buf[state->debug_count++] = c;
				state->pdata->uart_putc(state->pdev, c);
				debug_putc(state, c);
			}
			}
		} else if ((c == 8) || (c == 127)) {
		} else if ((c == 8) || (c == 127)) {
			if (state->debug_count > 0) {
			if (state->debug_count > 0) {
				state->debug_count--;
				state->debug_count--;
				state->pdata->uart_putc(state->pdev, 8);
				debug_putc(state, 8);
				state->pdata->uart_putc(state->pdev, ' ');
				debug_putc(state, ' ');
				state->pdata->uart_putc(state->pdev, 8);
				debug_putc(state, 8);
			}
			}
		} else if ((c == 13) || (c == 10)) {
		} else if ((c == 13) || (c == 10)) {
			if (c == '\r' || (c == '\n' && last_c != '\r')) {
			if (c == '\r' || (c == '\n' && last_c != '\r')) {
				state->pdata->uart_putc(state->pdev, '\r');
				debug_putc(state, '\r');
				state->pdata->uart_putc(state->pdev, '\n');
				debug_putc(state, '\n');
			}
			}
			if (state->debug_count) {
			if (state->debug_count) {
				state->debug_buf[state->debug_count] = 0;
				state->debug_buf[state->debug_count] = 0;
@@ -879,8 +884,8 @@ static void debug_console_write(struct console *co,
	debug_uart_enable(state);
	debug_uart_enable(state);
	while (count--) {
	while (count--) {
		if (*s == '\n')
		if (*s == '\n')
			state->pdata->uart_putc(state->pdev, '\r');
			debug_putc(state, '\r');
		state->pdata->uart_putc(state->pdev, *s++);
		debug_putc(state, *s++);
	}
	}
	debug_uart_flush(state);
	debug_uart_flush(state);
	debug_uart_disable(state);
	debug_uart_disable(state);
@@ -922,7 +927,7 @@ int fiq_tty_write(struct tty_struct *tty, const unsigned char *buf, int count)


	debug_uart_enable(state);
	debug_uart_enable(state);
	for (i = 0; i < count; i++)
	for (i = 0; i < count; i++)
		state->pdata->uart_putc(state->pdev, *buf++);
		debug_putc(state, *buf++);
	debug_uart_disable(state);
	debug_uart_disable(state);


	return count;
	return count;