All pastes #1063031 Raw Edit

ARM Assembler

public text v1 · immutable
#1063031 ·published 2008-07-05 15:00 UTC
rendered paste body
commit 77bb5901aa535dcba477c2cc082f2196752382fdAuthor: Philipp Zabel <philipp.zabel@gmail.com>Date:   Tue Jun 10 08:33:59 2008 +0200    PXA: support platform hook for serial_pxa_pm        Some platforms may need to power up/down devices attached    to the serial port. Provide them hooks to be called    via serial_pxa_pm.        Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.cindex abc161d..da3889c 100644--- a/arch/arm/mach-pxa/devices.c+++ b/arch/arm/mach-pxa/devices.c@@ -16,6 +16,7 @@ #include <asm/arch/pxa2xx_spi.h> #include <asm/arch/camera.h> #include <asm/arch/audio.h>+#include <asm/arch/serial.h>  #include "devices.h" #include "generic.h"@@ -229,6 +230,26 @@ struct platform_device pxa_device_hwuart = { 	.num_resources	= ARRAY_SIZE(pxa_resource_hwuart), }; +void __init pxa_set_ffuart_info(struct pxa_serial_platform_data *info)+{+	pxa_device_ffuart.dev.platform_data = info;+}++void __init pxa_set_btuart_info(struct pxa_serial_platform_data *info)+{+	pxa_device_btuart.dev.platform_data = info;+}++void __init pxa_set_stuart_info(struct pxa_serial_platform_data *info)+{+	pxa_device_stuart.dev.platform_data = info;+}++void __init pxa_set_hwuart_info(struct pxa_serial_platform_data *info)+{+	pxa_device_hwuart.dev.platform_data = info;+}+ static struct resource pxai2c_resources[] = { 	{ 		.start	= 0x40301680,diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.cindex b4f7ffb..49323ec 100644--- a/drivers/serial/pxa.c+++ b/drivers/serial/pxa.c@@ -48,7 +48,7 @@ #include <asm/hardware.h> #include <asm/irq.h> #include <asm/arch/pxa-regs.h>-+#include <asm/arch/serial.h>  struct uart_pxa_port { 	struct uart_port        port;@@ -549,11 +549,15 @@ serial_pxa_pm(struct uart_port *port, unsigned int state, 	      unsigned int oldstate) { 	struct uart_pxa_port *up = (struct uart_pxa_port *)port;+	struct pxa_serial_platform_data *info = port->dev->platform_data;  	if (!state) 		clk_enable(up->clk); 	else 		clk_disable(up->clk);++	if (info && info->pm)+		info->pm(to_platform_device(port->dev), oldstate, state); }  static void serial_pxa_release_port(struct uart_port *port)diff --git a/include/asm-arm/arch-pxa/serial.h b/include/asm-arm/arch-pxa/serial.hnew file mode 100644index 0000000..1cae3e9--- /dev/null+++ b/include/asm-arm/arch-pxa/serial.h@@ -0,0 +1,23 @@+#ifndef PXA_SERIAL_H+#define PXA_SERIAL_H+/*+ * Copyright (C) 2008 Dmitry Baryshkov+ *+ * This program is free software; you can redistribute it and/or modify+ * it under the terms of the GNU General Public License as published by+ * the Free Software Foundation; either version 2 of the License, or+ * (at your option) any later version.+ */++struct pxa_serial_platform_data {+	void (*pm)(struct platform_device *dev, unsigned int oldstate,+			unsigned int state);+};++extern void pxa_set_ffuart_info(struct pxa_serial_platform_data *info);+extern void pxa_set_btuart_info(struct pxa_serial_platform_data *info);+extern void pxa_set_stuart_info(struct pxa_serial_platform_data *info);+extern void pxa_set_hwuart_info(struct pxa_serial_platform_data *info);++#endif+