mirror of
https://github.com/torvalds/linux.git
synced 2024-11-18 10:01:43 +00:00
serial: omap: Switch wake-up interrupt to generic wakeirq
We can now use generic wakeirq handling and remove the custom handling for the wake-up interrupts. Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Tony Lindgren <tony@atomide.com>
This commit is contained in:
parent
00fda1682e
commit
ee83bd3b64
@ -38,6 +38,7 @@
|
|||||||
#include <linux/serial_core.h>
|
#include <linux/serial_core.h>
|
||||||
#include <linux/irq.h>
|
#include <linux/irq.h>
|
||||||
#include <linux/pm_runtime.h>
|
#include <linux/pm_runtime.h>
|
||||||
|
#include <linux/pm_wakeirq.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
#include <linux/of_irq.h>
|
#include <linux/of_irq.h>
|
||||||
#include <linux/gpio.h>
|
#include <linux/gpio.h>
|
||||||
@ -160,7 +161,6 @@ struct uart_omap_port {
|
|||||||
unsigned long port_activity;
|
unsigned long port_activity;
|
||||||
int context_loss_cnt;
|
int context_loss_cnt;
|
||||||
u32 errata;
|
u32 errata;
|
||||||
u8 wakeups_enabled;
|
|
||||||
u32 features;
|
u32 features;
|
||||||
|
|
||||||
int rts_gpio;
|
int rts_gpio;
|
||||||
@ -209,28 +209,11 @@ static int serial_omap_get_context_loss_count(struct uart_omap_port *up)
|
|||||||
return pdata->get_context_loss_count(up->dev);
|
return pdata->get_context_loss_count(up->dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void serial_omap_enable_wakeirq(struct uart_omap_port *up,
|
/* REVISIT: Remove this when omap3 boots in device tree only mode */
|
||||||
bool enable)
|
|
||||||
{
|
|
||||||
if (!up->wakeirq)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (enable)
|
|
||||||
enable_irq(up->wakeirq);
|
|
||||||
else
|
|
||||||
disable_irq_nosync(up->wakeirq);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void serial_omap_enable_wakeup(struct uart_omap_port *up, bool enable)
|
static void serial_omap_enable_wakeup(struct uart_omap_port *up, bool enable)
|
||||||
{
|
{
|
||||||
struct omap_uart_port_info *pdata = dev_get_platdata(up->dev);
|
struct omap_uart_port_info *pdata = dev_get_platdata(up->dev);
|
||||||
|
|
||||||
if (enable == up->wakeups_enabled)
|
|
||||||
return;
|
|
||||||
|
|
||||||
serial_omap_enable_wakeirq(up, enable);
|
|
||||||
up->wakeups_enabled = enable;
|
|
||||||
|
|
||||||
if (!pdata || !pdata->enable_wakeup)
|
if (!pdata || !pdata->enable_wakeup)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -750,13 +733,11 @@ static int serial_omap_startup(struct uart_port *port)
|
|||||||
|
|
||||||
/* Optional wake-up IRQ */
|
/* Optional wake-up IRQ */
|
||||||
if (up->wakeirq) {
|
if (up->wakeirq) {
|
||||||
retval = request_irq(up->wakeirq, serial_omap_irq,
|
retval = dev_pm_set_dedicated_wake_irq(up->dev, up->wakeirq);
|
||||||
up->port.irqflags, up->name, up);
|
|
||||||
if (retval) {
|
if (retval) {
|
||||||
free_irq(up->port.irq, up);
|
free_irq(up->port.irq, up);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
disable_irq(up->wakeirq);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dev_dbg(up->port.dev, "serial_omap_startup+%d\n", up->port.line);
|
dev_dbg(up->port.dev, "serial_omap_startup+%d\n", up->port.line);
|
||||||
@ -845,8 +826,7 @@ static void serial_omap_shutdown(struct uart_port *port)
|
|||||||
pm_runtime_mark_last_busy(up->dev);
|
pm_runtime_mark_last_busy(up->dev);
|
||||||
pm_runtime_put_autosuspend(up->dev);
|
pm_runtime_put_autosuspend(up->dev);
|
||||||
free_irq(up->port.irq, up);
|
free_irq(up->port.irq, up);
|
||||||
if (up->wakeirq)
|
dev_pm_clear_wake_irq(up->dev);
|
||||||
free_irq(up->wakeirq, up);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void serial_omap_uart_qos_work(struct work_struct *work)
|
static void serial_omap_uart_qos_work(struct work_struct *work)
|
||||||
@ -1139,13 +1119,6 @@ serial_omap_pm(struct uart_port *port, unsigned int state,
|
|||||||
serial_out(up, UART_EFR, efr);
|
serial_out(up, UART_EFR, efr);
|
||||||
serial_out(up, UART_LCR, 0);
|
serial_out(up, UART_LCR, 0);
|
||||||
|
|
||||||
if (!device_may_wakeup(up->dev)) {
|
|
||||||
if (!state)
|
|
||||||
pm_runtime_forbid(up->dev);
|
|
||||||
else
|
|
||||||
pm_runtime_allow(up->dev);
|
|
||||||
}
|
|
||||||
|
|
||||||
pm_runtime_mark_last_busy(up->dev);
|
pm_runtime_mark_last_busy(up->dev);
|
||||||
pm_runtime_put_autosuspend(up->dev);
|
pm_runtime_put_autosuspend(up->dev);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user