Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 259165
b: refs/heads/master
c: 762e77a
h: refs/heads/master
i:
  259163: edb8eb9
v: v3
  • Loading branch information
Anton Blanchard authored and Benjamin Herrenschmidt committed Jul 19, 2011
1 parent 6ea9202 commit a4ec20a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 19df9abdd30a0448e5940c6aa3527096bb69aca7
refs/heads/master: 762e77ae7dd055d0b77e0ad34d87db7416df109e
39 changes: 39 additions & 0 deletions trunk/drivers/tty/hvc/hvc_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <linux/delay.h>
#include <linux/freezer.h>
#include <linux/slab.h>
#include <linux/serial_core.h>

#include <asm/uaccess.h>

Expand Down Expand Up @@ -766,6 +767,39 @@ static int hvc_tiocmset(struct tty_struct *tty,
return hp->ops->tiocmset(hp, set, clear);
}

#ifdef CONFIG_CONSOLE_POLL
int hvc_poll_init(struct tty_driver *driver, int line, char *options)
{
return 0;
}

static int hvc_poll_get_char(struct tty_driver *driver, int line)
{
struct tty_struct *tty = driver->ttys[0];
struct hvc_struct *hp = tty->driver_data;
int n;
char ch;

n = hp->ops->get_chars(hp->vtermno, &ch, 1);

if (n == 0)
return NO_POLL_CHAR;

return ch;
}

static void hvc_poll_put_char(struct tty_driver *driver, int line, char ch)
{
struct tty_struct *tty = driver->ttys[0];
struct hvc_struct *hp = tty->driver_data;
int n;

do {
n = hp->ops->put_chars(hp->vtermno, &ch, 1);
} while (n <= 0);
}
#endif

static const struct tty_operations hvc_ops = {
.open = hvc_open,
.close = hvc_close,
Expand All @@ -776,6 +810,11 @@ static const struct tty_operations hvc_ops = {
.chars_in_buffer = hvc_chars_in_buffer,
.tiocmget = hvc_tiocmget,
.tiocmset = hvc_tiocmset,
#ifdef CONFIG_CONSOLE_POLL
.poll_init = hvc_poll_init,
.poll_get_char = hvc_poll_get_char,
.poll_put_char = hvc_poll_put_char,
#endif
};

struct hvc_struct *hvc_alloc(uint32_t vtermno, int data,
Expand Down

0 comments on commit a4ec20a

Please sign in to comment.