Commit 60da7020 authored by Heiner Kallweit's avatar Heiner Kallweit Committed by Greg Kroah-Hartman

staging: fbtft: add helper fbtft_write_buf_dc

Factor out setting DC GPIO and writing buffer content to helper
fbtft_write_buf_dc.
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 82472b86
...@@ -43,6 +43,21 @@ static unsigned long debug; ...@@ -43,6 +43,21 @@ static unsigned long debug;
module_param(debug, ulong, 0000); module_param(debug, ulong, 0000);
MODULE_PARM_DESC(debug, "override device debug level"); MODULE_PARM_DESC(debug, "override device debug level");
int fbtft_write_buf_dc(struct fbtft_par *par, void *buf, size_t len, int dc)
{
int ret;
if (gpio_is_valid(par->gpio.dc))
gpio_set_value(par->gpio.dc, dc);
ret = par->fbtftops.write(par, buf, len);
if (ret < 0)
dev_err(par->info->device,
"write() failed and returned %d\n", ret);
return ret;
}
EXPORT_SYMBOL(fbtft_write_buf_dc);
void fbtft_dbg_hex(const struct device *dev, int groupsize, void fbtft_dbg_hex(const struct device *dev, int groupsize,
void *buf, size_t len, const char *fmt, ...) void *buf, size_t len, const char *fmt, ...)
{ {
......
...@@ -248,6 +248,7 @@ struct fbtft_par { ...@@ -248,6 +248,7 @@ struct fbtft_par {
par->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__) par->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__)
/* fbtft-core.c */ /* fbtft-core.c */
int fbtft_write_buf_dc(struct fbtft_par *par, void *buf, size_t len, int dc);
void fbtft_dbg_hex(const struct device *dev, int groupsize, void fbtft_dbg_hex(const struct device *dev, int groupsize,
void *buf, size_t len, const char *fmt, ...); void *buf, size_t len, const char *fmt, ...);
struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display, struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,
......
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