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; }
static int msm_serial_suspend(struct platform_device *pdev, pm_message_t state) { struct uart_port *port; #if defined(CONFIG_KERNEL_MOTOROLA) struct vreg *vreg; #endif /* defined(CONFIG_KERNEL_MOTOROLA) */ port = get_port_from_line(pdev->id); if (port) { uart_suspend_port(&msm_uart_driver, port); if (is_console(port)) msm_deinit_clock(port); #if defined(CONFIG_KERNEL_MOTOROLA) /* Calgary uses VREG_USIM (RUIM1) for the UART3 block */ if (pdev->id == 2) { vreg = vreg_get(0, "ruim"); if (IS_ERR(vreg)) printk(KERN_ERR "%s: vreg get failed for VREG_RUIM\n", __func__); else if (vreg_disable(vreg)) printk(KERN_ERR "%s: vreg disable failed for VREG_RUIM\n", __func__); else printk(KERN_INFO "%s: VREG_RUIM disabled for RS232\n", __func__); } #endif /* defined(CONFIG_KERNEL_MOTOROLA) */ } return 0; }
static int tegra_uart_suspend(struct platform_device *pdev, pm_message_t state) { struct tegra_uart_port *t = platform_get_drvdata(pdev); struct uart_port *u; printk("[seyoung] tegra_hs_uart_suspend \n"); if (pdev->id < 0 || pdev->id > tegra_uart_driver.nr) pr_err("Invalid Uart instance (%d)\n", pdev->id); u = &t->uport; dev_dbg(t->uport.dev, "tegra_uart_suspend called\n"); /* enable clock before calling suspend so that controller register can be accessible */ if (t->uart_state == TEGRA_UART_CLOCK_OFF) { clk_enable(t->clk); t->uart_state = TEGRA_UART_OPENED; } uart_suspend_port(&tegra_uart_driver, u); t->uart_state = TEGRA_UART_SUSPEND; return 0; }
/** * xuartps_suspend - suspend event * @device: Pointer to the device structure * * Returns 0 */ static int xuartps_suspend(struct device *device) { struct uart_port *port = dev_get_drvdata(device); struct tty_struct *tty; struct device *tty_dev; int may_wake = 0; /* Get the tty which could be NULL so don't assume it's valid */ tty = tty_port_tty_get(&port->state->port); if (tty) { tty_dev = tty->dev; may_wake = device_may_wakeup(tty_dev); tty_kref_put(tty); } /* * Call the API provided in serial_core.c file which handles * the suspend. */ uart_suspend_port(&xuartps_uart_driver, port); if (console_suspend_enabled && !may_wake) { struct xuartps *xuartps = port->private_data; clk_disable(xuartps->devclk); clk_disable(xuartps->aperclk); } return 0; }
static int msm_serial_suspend(struct device *dev) { struct uart_port *port; struct platform_device *pdev = to_platform_device(dev); port = get_port_from_line(pdev->id); // BEGIN 0010274: [email protected] 2010-10-27 // Fixed a problem that system don't go to sleep mode. #if defined(CONFIG_MACH_LGE_BRYCE) struct msm_port *msm_port; if(uart_det_flag){ msm_port = UART_TO_MSM(port); clk_disable(msm_port->clk); } #endif // END 0010274: [email protected] 2010-10-27 if (port) { uart_suspend_port(&msm_uart_driver, port); if (is_console(port)) msm_deinit_clock(port); } return 0; }
static int tegra_uart_suspend(struct device *dev) { struct tegra_uart_port *tup = dev_get_drvdata(dev); struct uart_port *u = &tup->uport; return uart_suspend_port(&tegra_uart_driver, u); }
static int msm_serial_hsl_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct msm_hsl_port *msm_cir_port = htc_cir_port; struct uart_port *port; port = get_port_from_line(pdev->id); D("%s ():port->line %d, cir_enable_flg = %d\n", __func__, port->line, cir_enable_flg); if (port) { D("%s ():is_console:port->line %d, ir\n", __func__, port->line); if (is_console(port)) msm_hsl_deinit_clock(port); uart_suspend_port(&msm_hsl_uart_driver, port); if (device_may_wakeup(dev)) enable_irq_wake(port->irq); if (msm_cir_port->cir_set_path) msm_cir_port->cir_set_path(PATH_NONE); } if (msm_cir_port->cir_power) msm_cir_port->cir_power(0); return 0; }
static int tegra_uart_suspend(struct platform_device *pdev, pm_message_t state) { struct tegra_uart_port *t = platform_get_drvdata(pdev); struct uart_port *u; if (pdev->id < 0 || pdev->id > tegra_uart_driver.nr) pr_err("Invalid Uart instance (%d)\n", pdev->id); u = &t->uport; dev_dbg(t->uport.dev, "tegra_uart_suspend called\n"); if (device_may_wakeup(u->dev)) enable_irq_wake(u->irq); /* enable clock before calling suspend so that controller register can be accessible */ if (t->uart_state == TEGRA_UART_CLOCK_OFF) { pm_runtime_get_sync(u->dev); clk_prepare_enable(t->clk); t->uart_state = TEGRA_UART_OPENED; } uart_suspend_port(&tegra_uart_driver, u); t->uart_state = TEGRA_UART_SUSPEND; return 0; }
static int sprd_suspend(struct device *dev) { struct sprd_uart_port *sup = dev_get_drvdata(dev); uart_suspend_port(&sprd_uart_driver, &sup->port); return 0; }
/** * xuartps_suspend - suspend event * @pdev: Pointer to the platform device structure * @state: State of the device * * Returns 0 **/ static int xuartps_suspend(struct platform_device *pdev, pm_message_t state) { /* Call the API provided in serial_core.c file which handles * the suspend. */ uart_suspend_port(&xuartps_uart_driver, &xuartps_port[pdev->id]); return 0; }
static int sirfsoc_uart_suspend(struct platform_device *pdev, pm_message_t state) { struct sirfsoc_uart_port *sirfport = platform_get_drvdata(pdev); struct uart_port *port = &sirfport->port; uart_suspend_port(&sirfsoc_uart_drv, port); return 0; }
static int serial_omap_suspend(struct platform_device *pdev, pm_message_t state) { struct uart_omap_port *up = platform_get_drvdata(pdev); struct omap_uart_port_info *omap_up_info = pdev->dev.platform_data; static unsigned int fifo_suspendbrks; u8 lcr, efr; /* Reset the uart wakeup event */ omap_up_info->uart_wakeup_event = 0; /* Disable interrupts from this port */ serial_out(up, UART_IER, 0); /* If we're using auto-rts then disable it. */ lcr = serial_in(up, UART_LCR); serial_out(up, UART_LCR, 0xbf); efr = serial_in(up, UART_EFR); serial_out(up, UART_LCR, lcr); if (efr & UART_EFR_RTS) { serial_omap_set_autorts(up, 0); up->restore_autorts = 1; /* * Force RTS output to inactive (high) after disable autorts * mode. This RTS bit might not be restored when enable autorts * next time, since the RTS output controlled by hardware * flow control. */ serial_omap_set_mctrl(&up->port, (up->port.mctrl & ~TIOCM_RTS)); } /* * There seems to be a window here where * data could still be on the way to the * fifo. This delay is ~1 byte time @ 115.2k */ udelay(80); if (omap_uart_active(up->port.line, 0)) { fifo_suspendbrks++; printk(KERN_WARNING "UART%d FIFO break suspend %d\n", up->port.line, fifo_suspendbrks); if (up->restore_autorts) { up->restore_autorts = 0; serial_omap_set_autorts(up, 1); } serial_out(up, UART_IER, up->ier); return -EBUSY; } serial_out(up, UART_IER, up->ier); if (up) uart_suspend_port(&serial_omap_reg, &up->port); return 0; }
int s3c24xx_serial_suspend(struct device *dev, u32 state, u32 level) { struct uart_port *port = s3c24xx_dev_to_port(dev); if (port && level == SUSPEND_DISABLE) uart_suspend_port(&s3c24xx_uart_drv, port); return 0; }
static int serial_netx_suspend(struct platform_device *pdev, pm_message_t state) { struct netx_port *sport = platform_get_drvdata(pdev); if (sport) uart_suspend_port(&netx_reg, &sport->port); return 0; }
static int imapx200_serial_suspend(struct platform_device *dev, pm_message_t state) { struct uart_port *port = imapx200_dev_to_port(&dev->dev); if (port) uart_suspend_port(&imapx200_uart_drv, port); return 0; }
static int ip3106_serial_suspend(struct device *_dev, u32 state, u32 level) { struct ip3106_port *sport = dev_get_drvdata(_dev); if (sport && level == SUSPEND_DISABLE) uart_suspend_port(&ip3106_reg, &sport->port); return 0; }
static int serial_m3110_suspend(struct spi_device *spi, pm_message_t state) { struct uart_max3110 *max = spi_get_drvdata(spi); disable_irq(max->irq); uart_suspend_port(&serial_m3110_reg, &max->port); max3110_out(max, max->cur_conf | WC_SW_SHDI); return 0; }
static int serial_pxa_suspend(struct device *_dev, pm_message_t state, u32 level) { struct uart_pxa_port *sport = dev_get_drvdata(_dev); if (sport && level == SUSPEND_DISABLE) uart_suspend_port(&serial_pxa_reg, &sport->port); return 0; }
static int serial_pxa_suspend(struct device *dev) { struct uart_pxa_port *sport = dev_get_drvdata(dev); if (sport) uart_suspend_port(&serial_pxa_reg, &sport->port); return 0; }
static int s3c24xx_serial_suspend(struct device *dev) { struct uart_port *port = s3c24xx_dev_to_port(dev); if (port) uart_suspend_port(&s3c24xx_uart_drv, port); return 0; }
static int serial_omap_suspend(struct device *dev) { struct uart_omap_port *up = dev_get_drvdata(dev); uart_suspend_port(&serial_omap_reg, &up->port); flush_work(&up->qos_work); return 0; }
static int pl010_suspend(struct amba_device *dev, pm_message_t state) { struct uart_amba_port *uap = amba_get_drvdata(dev); if (uap) uart_suspend_port(&amba_reg, &uap->port); return 0; }
static int sa1100_serial_suspend(struct platform_device *dev, pm_message_t state) { struct sa1100_port *sport = platform_get_drvdata(dev); if (sport) uart_suspend_port(&sa1100_reg, &sport->port); return 0; }
static int serial_omap_suspend(struct platform_device *pdev, pm_message_t state) { struct uart_omap_port *up = platform_get_drvdata(pdev); if (up) uart_suspend_port(&serial_omap_reg, &up->port); flush_work(&up->qos_work); }
static int s3c24xx_serial_suspend(struct platform_device *dev, pm_message_t state) { struct uart_port *port = s3c24xx_dev_to_port(&dev->dev); if (port) uart_suspend_port(&s3c24xx_uart_drv, port); return 0; }
static int parrot5_serial_suspend(struct platform_device *dev, pm_message_t state) { struct uart_parrot5_port *up = platform_get_drvdata(dev); if (up) { uart_suspend_port(&parrot5_reg, &up->port); } return 0; }
static int serial_m3110_suspend(struct device *dev) { struct spi_device *spi = to_spi_device(dev); struct uart_max3110 *max = spi_get_drvdata(spi); if (max->irq > 0) disable_irq(max->irq); uart_suspend_port(&serial_m3110_reg, &max->port); max3110_out(max, max->cur_conf | WC_SW_SHDI); return 0; }
static int __maybe_unused max310x_suspend(struct device *dev) { struct max310x_port *s = dev_get_drvdata(dev); int i; for (i = 0; i < s->uart.nr; i++) { uart_suspend_port(&s->uart, &s->p[i].port); s->devtype->power(&s->p[i].port, 0); } return 0; }
static int bfin_serial_suspend(struct platform_device *dev, pm_message_t state) { int i; for (i = 0; i < nr_active_ports; i++) { if (bfin_serial_ports[i].port.dev != &dev->dev) continue; uart_suspend_port(&bfin_serial_reg, &bfin_serial_ports[i].port); } return 0; }
static int msm_serial_suspend(struct platform_device *pdev, pm_message_t state) { struct uart_port *port; port = get_port_from_line(pdev->id); if (port) { uart_suspend_port(&msm_uart_driver, port); if (is_console(port)) msm_deinit_clock(port); } return 0; }