diff options
author | David Engraf <david.engraf@sysgo.com> | 2011-01-21 02:05:17 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-01-21 02:11:56 -0500 |
commit | 48c27016e18f8608c12b7516515ad773093198d8 (patch) | |
tree | 18d46f8b955f5f83248dbb4de449feb559f9b103 /drivers/input/serio/serport.c | |
parent | b0f05aadf1516c166ba301b7a535bc9429ce1961 (diff) |
Input: serio - allow registered drivers to get status flag
Parse and pass the status byte information to the registered serio
drivers as well as the data bytes.
Signed-off-by: David Engraf<david.engraf@sysgo.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/serio/serport.c')
-rw-r--r-- | drivers/input/serio/serport.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/input/serio/serport.c b/drivers/input/serio/serport.c index 6e362de3f412..8755f5f3ad37 100644 --- a/drivers/input/serio/serport.c +++ b/drivers/input/serio/serport.c | |||
@@ -116,14 +116,15 @@ static void serport_ldisc_close(struct tty_struct *tty) | |||
116 | 116 | ||
117 | /* | 117 | /* |
118 | * serport_ldisc_receive() is called by the low level tty driver when characters | 118 | * serport_ldisc_receive() is called by the low level tty driver when characters |
119 | * are ready for us. We forward the characters, one by one to the 'interrupt' | 119 | * are ready for us. We forward the characters and flags, one by one to the |
120 | * routine. | 120 | * 'interrupt' routine. |
121 | */ | 121 | */ |
122 | 122 | ||
123 | static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *cp, char *fp, int count) | 123 | static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *cp, char *fp, int count) |
124 | { | 124 | { |
125 | struct serport *serport = (struct serport*) tty->disc_data; | 125 | struct serport *serport = (struct serport*) tty->disc_data; |
126 | unsigned long flags; | 126 | unsigned long flags; |
127 | unsigned int ch_flags; | ||
127 | int i; | 128 | int i; |
128 | 129 | ||
129 | spin_lock_irqsave(&serport->lock, flags); | 130 | spin_lock_irqsave(&serport->lock, flags); |
@@ -131,8 +132,23 @@ static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *c | |||
131 | if (!test_bit(SERPORT_ACTIVE, &serport->flags)) | 132 | if (!test_bit(SERPORT_ACTIVE, &serport->flags)) |
132 | goto out; | 133 | goto out; |
133 | 134 | ||
134 | for (i = 0; i < count; i++) | 135 | for (i = 0; i < count; i++) { |
135 | serio_interrupt(serport->serio, cp[i], 0); | 136 | switch (fp[i]) { |
137 | case TTY_FRAME: | ||
138 | ch_flags = SERIO_FRAME; | ||
139 | break; | ||
140 | |||
141 | case TTY_PARITY: | ||
142 | ch_flags = SERIO_PARITY; | ||
143 | break; | ||
144 | |||
145 | default: | ||
146 | ch_flags = 0; | ||
147 | break; | ||
148 | } | ||
149 | |||
150 | serio_interrupt(serport->serio, cp[i], ch_flags); | ||
151 | } | ||
136 | 152 | ||
137 | out: | 153 | out: |
138 | spin_unlock_irqrestore(&serport->lock, flags); | 154 | spin_unlock_irqrestore(&serport->lock, flags); |