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

staging: fbtft: use helper fbtft_write_buf_dc in fbtft-bus.c

Make use of new 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 60da7020
...@@ -36,14 +36,9 @@ void func(struct fbtft_par *par, int len, ...) \ ...@@ -36,14 +36,9 @@ void func(struct fbtft_par *par, int len, ...) \
} \ } \
\ \
*buf = modifier((type)va_arg(args, unsigned int)); \ *buf = modifier((type)va_arg(args, unsigned int)); \
if (par->gpio.dc != -1) \ ret = fbtft_write_buf_dc(par, par->buf, sizeof(type) + offset, 0); \
gpio_set_value(par->gpio.dc, 0); \ if (ret < 0) \
ret = par->fbtftops.write(par, par->buf, sizeof(type) + offset); \ goto out; \
if (ret < 0) { \
va_end(args); \
dev_err(par->info->device, "%s: write() failed and returned %d\n", __func__, ret); \
return; \
} \
len--; \ len--; \
\ \
if (par->startbyte) \ if (par->startbyte) \
...@@ -51,19 +46,12 @@ void func(struct fbtft_par *par, int len, ...) \ ...@@ -51,19 +46,12 @@ void func(struct fbtft_par *par, int len, ...) \
\ \
if (len) { \ if (len) { \
i = len; \ i = len; \
while (i--) { \ while (i--) \
*buf++ = modifier((type)va_arg(args, unsigned int)); \ *buf++ = modifier((type)va_arg(args, unsigned int)); \
} \ fbtft_write_buf_dc(par, par->buf, \
if (par->gpio.dc != -1) \ len * (sizeof(type) + offset), 1); \
gpio_set_value(par->gpio.dc, 1); \
ret = par->fbtftops.write(par, par->buf, \
len * (sizeof(type) + offset)); \
if (ret < 0) { \
va_end(args); \
dev_err(par->info->device, "%s: write() failed and returned %d\n", __func__, ret); \
return; \
} \
} \ } \
out: \
va_end(args); \ va_end(args); \
} \ } \
EXPORT_SYMBOL(func); EXPORT_SYMBOL(func);
...@@ -243,10 +231,7 @@ int fbtft_write_vmem16_bus16(struct fbtft_par *par, size_t offset, size_t len) ...@@ -243,10 +231,7 @@ int fbtft_write_vmem16_bus16(struct fbtft_par *par, size_t offset, size_t len)
vmem16 = (u16 *)(par->info->screen_buffer + offset); vmem16 = (u16 *)(par->info->screen_buffer + offset);
if (par->gpio.dc != -1)
gpio_set_value(par->gpio.dc, 1);
/* no need for buffered write with 16-bit bus */ /* no need for buffered write with 16-bit bus */
return par->fbtftops.write(par, vmem16, len); return fbtft_write_buf_dc(par, vmem16, len, 1);
} }
EXPORT_SYMBOL(fbtft_write_vmem16_bus16); EXPORT_SYMBOL(fbtft_write_vmem16_bus16);
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