+ ps-2-serio-driver-for-avr32-devices-fix.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     ps-2-serio-driver-for-avr32-devices-fix
has been added to the -mm tree.  Its filename is
     ps-2-serio-driver-for-avr32-devices-fix.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: ps-2-serio-driver-for-avr32-devices-fix
From: Hans-Christian Egtvedt <hcegtvedt@xxxxxxxxx>

Cc: Dmitry Torokhov <dtor@xxxxxxx>
Cc: Haavard Skinnemoen <hskinnemoen@xxxxxxxxx>
Cc: Hans-Christian Egtvedt <hcegtvedt@xxxxxxxxx>
Cc: Jiri Kosina <jikos@xxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/input/serio/at32psif.c |   24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff -puN drivers/input/serio/at32psif.c~ps-2-serio-driver-for-avr32-devices-fix drivers/input/serio/at32psif.c
--- a/drivers/input/serio/at32psif.c~ps-2-serio-driver-for-avr32-devices-fix
+++ a/drivers/input/serio/at32psif.c
@@ -23,10 +23,6 @@
 
 #define PSIF_BUF_SIZE		16
 
-#define ring_is_empty(_psif)	(_psif->head == _psif->tail)
-#define ring_next_head(_psif)	((_psif->head + 1) & (PSIF_BUF_SIZE - 1))
-#define ring_next_tail(_psif)	((_psif->tail + 1) & (PSIF_BUF_SIZE - 1))
-
 struct psif {
 	struct platform_device	*pdev;
 	struct clk		*pclk;
@@ -42,6 +38,21 @@ struct psif {
 	unsigned char		buffer[PSIF_BUF_SIZE];
 };
 
+static int ring_is_empty(struct psif *psif)
+{
+	return (psif->head == psif->tail);
+}
+
+static unsigned int ring_next_head(struct psif *psif)
+{
+	return ((psif->head + 1) & (PSIF_BUF_SIZE - 1));
+}
+
+static unsigned int ring_next_tail(struct psif *psif)
+{
+	return ((psif->tail + 1) & (PSIF_BUF_SIZE - 1));
+}
+
 static irqreturn_t psif_interrupt(int irq, void *_ptr)
 {
 	struct psif *psif = _ptr;
@@ -151,6 +162,11 @@ static void psif_close(struct serio *io)
 	psif_writel(psif, IDR, ~0UL);
 	psif_writel(psif, CR, PSIF_BIT(CR_TXDIS) | PSIF_BIT(CR_RXDIS));
 
+	del_timer_sync(&psif->tx_timer);
+
+	/* Reset circular buffer. */
+	psif->tail = psif->head;
+
 	clk_disable(psif->pclk);
 }
 
_

Patches currently in -mm which might be from hcegtvedt@xxxxxxxxx are

git-alsa.patch
git-avr32.patch
input-core-driver-for-wm97xx-touchscreens-update.patch
input-core-driver-for-wm97xx-touchscreens-update-fix-typo.patch
input-driver-for-wm97xx-touchscreens-in-streaming-mode-on-mainstone-update.patch
ps-2-serio-driver-for-avr32-devices.patch
ps-2-serio-driver-for-avr32-devices-fix.patch
at73c213-fix-error-checking-for-clk-api.patch
at73c213-monaural-support.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux