Skip to content

Commit

Permalink
ARM: SAMSUNG: Save/restore only selected uart's registers
Browse files Browse the repository at this point in the history
Basically this code gets executed only during debugging i.e when
DEBUG_LL & SAMSUNG_PM_DEBUG is on, so required only for UART used
for debugging. Since we are removing static iodesc entries for UARTs,
so now only the selected (CONFIG_DEBUG_S3C_UART) UART will be
ioremapped by the debug_ll_io_init() for DEBUG_LL, so save/restore
uart registers only for selected uart.

Signed-off-by: Yadwinder Singh Brar <[email protected]>
Signed-off-by: Kukjin Kim <[email protected]>
  • Loading branch information
Yadwinder Singh Brar authored and kgene committed Jul 24, 2013
1 parent 8969301 commit 7bdc84f
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions arch/arm/plat-samsung/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ unsigned char pm_uart_udivslot;

#ifdef CONFIG_SAMSUNG_PM_DEBUG

static struct pm_uart_save uart_save[CONFIG_SERIAL_SAMSUNG_UARTS];
static struct pm_uart_save uart_save;

static void s3c_pm_save_uart(unsigned int uart, struct pm_uart_save *save)
{
Expand All @@ -101,11 +101,7 @@ static void s3c_pm_save_uart(unsigned int uart, struct pm_uart_save *save)

static void s3c_pm_save_uarts(void)
{
struct pm_uart_save *save = uart_save;
unsigned int uart;

for (uart = 0; uart < CONFIG_SERIAL_SAMSUNG_UARTS; uart++, save++)
s3c_pm_save_uart(uart, save);
s3c_pm_save_uart(CONFIG_DEBUG_S3C_UART, &uart_save);
}

static void s3c_pm_restore_uart(unsigned int uart, struct pm_uart_save *save)
Expand All @@ -126,11 +122,7 @@ static void s3c_pm_restore_uart(unsigned int uart, struct pm_uart_save *save)

static void s3c_pm_restore_uarts(void)
{
struct pm_uart_save *save = uart_save;
unsigned int uart;

for (uart = 0; uart < CONFIG_SERIAL_SAMSUNG_UARTS; uart++, save++)
s3c_pm_restore_uart(uart, save);
s3c_pm_restore_uart(CONFIG_DEBUG_S3C_UART, &uart_save);
}
#else
static void s3c_pm_save_uarts(void) { }
Expand Down

0 comments on commit 7bdc84f

Please sign in to comment.