linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Young <sean@mess.org>
To: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>,
	linux-media@vger.kernel.org
Subject: [PATCH 2/5] auxdisplay: charlcd: add flush function
Date: Mon, 15 Jan 2018 09:58:21 +0000	[thread overview]
Message-ID: <cdfa0d36f2f2d306e0824205b4fca0b685991ee9.1516008708.git.sean@mess.org> (raw)
In-Reply-To: <cover.1516008708.git.sean@mess.org>
In-Reply-To: <cover.1516008708.git.sean@mess.org>

The Sasem Remote Controller has an LCD, which is connnected via usb.
Multiple write reg or write data commands can be combined into one usb
packet.

The latency of usb is such that if we send commands one by one, we get
very obvious tearing on the LCD.

By adding a flush function, we can buffer all commands until either
the usb packet is full or the lcd changes are complete.

Signed-off-by: Sean Young <sean@mess.org>
---
 drivers/auxdisplay/charlcd.c | 6 ++++++
 include/misc/charlcd.h       | 1 +
 2 files changed, 7 insertions(+)

diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c
index 45ec5ce697c4..a16c72779722 100644
--- a/drivers/auxdisplay/charlcd.c
+++ b/drivers/auxdisplay/charlcd.c
@@ -642,6 +642,9 @@ static ssize_t charlcd_write(struct file *file, const char __user *buf,
 		charlcd_write_char(the_charlcd, c);
 	}
 
+	if (the_charlcd->ops->flush)
+		the_charlcd->ops->flush(the_charlcd);
+
 	return tmp - buf;
 }
 
@@ -703,6 +706,9 @@ static void charlcd_puts(struct charlcd *lcd, const char *s)
 
 		charlcd_write_char(lcd, *tmp);
 	}
+
+	if (lcd->ops->flush)
+		lcd->ops->flush(lcd);
 }
 
 /* initialize the LCD driver */
diff --git a/include/misc/charlcd.h b/include/misc/charlcd.h
index 23f61850f363..ff8fd456018e 100644
--- a/include/misc/charlcd.h
+++ b/include/misc/charlcd.h
@@ -32,6 +32,7 @@ struct charlcd_ops {
 	void (*write_cmd_raw4)(struct charlcd *lcd, int cmd);	/* 4-bit only */
 	void (*clear_fast)(struct charlcd *lcd);
 	void (*backlight)(struct charlcd *lcd, int on);
+	void (*flush)(struct charlcd *lcd);
 };
 
 struct charlcd *charlcd_alloc(unsigned int drvdata_size);
-- 
2.14.3

  parent reply	other threads:[~2018-01-15  9:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-15  9:58 [PATCH 0/5] new driver for Ahanix D.Vine 5 IR/VFD Sean Young
2018-01-15  9:58 ` [PATCH 1/5] auxdisplay: charlcd: no need to call charlcd_gotoxy() if nothing changes Sean Young
2018-02-12 13:42   ` Miguel Ojeda
2018-02-12 13:59     ` Geert Uytterhoeven
2018-02-12 17:30       ` Miguel Ojeda
2018-01-15  9:58 ` Sean Young [this message]
2018-02-12 20:44   ` [PATCH 2/5] auxdisplay: charlcd: add flush function Miguel Ojeda
2018-02-13 13:47     ` Andy Shevchenko
2018-01-15  9:58 ` [PATCH 3/5] auxdisplay: charlcd: add escape sequence for brightness on NEC µPD16314 Sean Young
2018-02-12 11:56   ` Miguel Ojeda
2018-02-13 17:34     ` Sean Young
2018-01-15  9:58 ` [PATCH 4/5] media: rc: add keymap for Dign Remote Sean Young
2018-01-15  9:58 ` [PATCH 5/5] media: rc: new driver for Sasem Remote Controller VFD/IR Sean Young

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cdfa0d36f2f2d306e0824205b4fca0b685991ee9.1516008708.git.sean@mess.org \
    --to=sean@mess.org \
    --cc=linux-media@vger.kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).