Commit e0f682e0 authored by Alan's avatar Alan Committed by Greg Kroah-Hartman

goldfish: clean up tty 64bit support

Use the helper we now have available.
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f6279717
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/goldfish.h>
enum { enum {
GOLDFISH_TTY_PUT_CHAR = 0x00, GOLDFISH_TTY_PUT_CHAR = 0x00,
...@@ -29,9 +30,7 @@ enum { ...@@ -29,9 +30,7 @@ enum {
GOLDFISH_TTY_DATA_PTR = 0x10, GOLDFISH_TTY_DATA_PTR = 0x10,
GOLDFISH_TTY_DATA_LEN = 0x14, GOLDFISH_TTY_DATA_LEN = 0x14,
#ifdef CONFIG_64BIT
GOLDFISH_TTY_DATA_PTR_HIGH = 0x18, GOLDFISH_TTY_DATA_PTR_HIGH = 0x18,
#endif
GOLDFISH_TTY_CMD_INT_DISABLE = 0, GOLDFISH_TTY_CMD_INT_DISABLE = 0,
GOLDFISH_TTY_CMD_INT_ENABLE = 1, GOLDFISH_TTY_CMD_INT_ENABLE = 1,
...@@ -60,10 +59,8 @@ static void goldfish_tty_do_write(int line, const char *buf, unsigned count) ...@@ -60,10 +59,8 @@ static void goldfish_tty_do_write(int line, const char *buf, unsigned count)
struct goldfish_tty *qtty = &goldfish_ttys[line]; struct goldfish_tty *qtty = &goldfish_ttys[line];
void __iomem *base = qtty->base; void __iomem *base = qtty->base;
spin_lock_irqsave(&qtty->lock, irq_flags); spin_lock_irqsave(&qtty->lock, irq_flags);
writel((u32)buf, base + GOLDFISH_TTY_DATA_PTR); gf_write64((u64)buf, base + GOLDFISH_TTY_DATA_PTR,
#ifdef CONFIG_64BIT base + GOLDFISH_TTY_DATA_PTR_HIGH);
writel((u32)((u64)buf >> 32), base + GOLDFISH_TTY_DATA_PTR_HIGH);
#endif
writel(count, base + GOLDFISH_TTY_DATA_LEN); writel(count, base + GOLDFISH_TTY_DATA_LEN);
writel(GOLDFISH_TTY_CMD_WRITE_BUFFER, base + GOLDFISH_TTY_CMD); writel(GOLDFISH_TTY_CMD_WRITE_BUFFER, base + GOLDFISH_TTY_CMD);
spin_unlock_irqrestore(&qtty->lock, irq_flags); spin_unlock_irqrestore(&qtty->lock, irq_flags);
...@@ -84,10 +81,8 @@ static irqreturn_t goldfish_tty_interrupt(int irq, void *dev_id) ...@@ -84,10 +81,8 @@ static irqreturn_t goldfish_tty_interrupt(int irq, void *dev_id)
count = tty_prepare_flip_string(&qtty->port, &buf, count); count = tty_prepare_flip_string(&qtty->port, &buf, count);
spin_lock_irqsave(&qtty->lock, irq_flags); spin_lock_irqsave(&qtty->lock, irq_flags);
writel((u32)buf, base + GOLDFISH_TTY_DATA_PTR); gf_write64((u64)buf, base + GOLDFISH_TTY_DATA_PTR,
#ifdef CONFIG_64BIT base + GOLDFISH_TTY_DATA_PTR_HIGH);
writel((u32)((u64)buf >> 32), base + GOLDFISH_TTY_DATA_PTR_HIGH);
#endif
writel(count, base + GOLDFISH_TTY_DATA_LEN); writel(count, base + GOLDFISH_TTY_DATA_LEN);
writel(GOLDFISH_TTY_CMD_READ_BUFFER, base + GOLDFISH_TTY_CMD); writel(GOLDFISH_TTY_CMD_READ_BUFFER, base + GOLDFISH_TTY_CMD);
spin_unlock_irqrestore(&qtty->lock, irq_flags); spin_unlock_irqrestore(&qtty->lock, irq_flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment