예제 #1
0
static int s3c_serial_suspend(struct platform_device *dev, pm_message_t state)
{
	struct uart_port *port = s3c_dev_to_port(&dev->dev);

	unsigned int gpadata = 0;
	unsigned int gpaconslp = 0;

	if(port->line == 0) {
		gpadata = __raw_readl(S3C64XX_GPADAT);
		gpadata |= (1<<3);
		__raw_writel(gpadata, S3C64XX_GPADAT);
	} else if(port->line == 1) {
		s3c_gpio_cfgpin(S3C64XX_GPA(7), S3C_GPIO_SFN(1));

		gpaconslp = __raw_readl(S3C64XX_GPACONSLP);
		gpaconslp |= (1 << 14);
		gpaconslp &= ~(1 << 15);
		__raw_writel(gpaconslp, S3C64XX_GPACONSLP);

		gpadata = __raw_readl(S3C64XX_GPADAT);
		gpadata |= (1 << 7);
		__raw_writel(gpadata, S3C64XX_GPADAT);
		
		s3c_gpio_setpull(S3C64XX_GPA(7), S3C_GPIO_PULL_NONE);
	}

	s3c6410_pm_do_save(uart_save + port->line * SAVE_UART_PORT, SAVE_UART_PORT);

	if (port)
		uart_suspend_port(&s3c_uart_drv, port);

	return 0;
}
예제 #2
0
static ssize_t s3c_serial_show_clksrc(struct device *dev,
					  struct device_attribute *attr,
					  char *buf)
{
	struct uart_port *port = s3c_dev_to_port(dev);
	struct s3c_uart_port *ourport = to_ourport(port);

	return snprintf(buf, PAGE_SIZE, "* %s\n", ourport->clksrc->name);
}
예제 #3
0
static int s3c_serial_suspend(struct platform_device *dev, pm_message_t state)
{
	struct uart_port *port = s3c_dev_to_port(&dev->dev);

	if (port)
		uart_suspend_port(&s3c_uart_drv, port);

	return 0;
}
예제 #4
0
static int s3c_serial_remove(struct platform_device *dev)
{
	struct uart_port *port = s3c_dev_to_port(&dev->dev);

	if (port)
		uart_remove_one_port(&s3c_uart_drv, port);

	return 0;
}
예제 #5
0
int s3c_serial_remove(struct platform_device *dev)
{
	struct uart_port *port = s3c_dev_to_port(&dev->dev);

	if (port) {
		s3c_serial_cpufreq_deregister(to_ourport(port));
		device_remove_file(&dev->dev, &dev_attr_clock_source);
		uart_remove_one_port(&s3c_uart_drv, port);
	}

	return 0;
}
예제 #6
0
static int s3c_serial_resume(struct platform_device *dev)
{
	struct uart_port *port = s3c_dev_to_port(&dev->dev);
	struct s3c_uart_port *ourport = to_ourport(port);

	if (port) {
		clk_enable(ourport->clk);
		s3c_serial_resetport(port, s3c_port_to_cfg(port));
		clk_disable(ourport->clk);

		uart_resume_port(&s3c_uart_drv, port);
	}

	return 0;
}
예제 #7
0
static int s3c_serial_resume(struct platform_device *dev)
{
	struct uart_port *port = s3c_dev_to_port(&dev->dev);
	struct s3c_uart_port *ourport = to_ourport(port);

	unsigned int gpadata = 0;

	if (port) {
		clk_enable(ourport->clk);
		
		s3c_serial_resetport(port, s3c_port_to_cfg(port));
		clk_disable(ourport->clk);

		s3c6410_pm_do_restore(uart_save + port->line * SAVE_UART_PORT, SAVE_UART_PORT);

		uart_resume_port(&s3c_uart_drv, port);
	}

	if (port->line == 0) {
		gpadata = __raw_readl(S3C64XX_GPADAT);
		gpadata &= ~(1<<3);
		__raw_writel(gpadata, S3C64XX_GPADAT);
	} else if(port->line == 1) {
		s3c_gpio_cfgpin(S3C64XX_GPA(7), S3C_GPIO_SFN(1));

		gpadata = __raw_readl(S3C64XX_GPADAT);
		gpadata &= ~(1<<7);
		__raw_writel(gpadata, S3C64XX_GPADAT);
		
		s3c_gpio_setpull(S3C64XX_GPA(7), S3C_GPIO_PULL_NONE);

		s3c_gpio_cfgpin(S3C64XX_GPA(7), S3C_GPIO_SFN(2));
	}

	return 0;
}