summaryrefslogtreecommitdiffstats
path: root/drivers/staging/fbtft
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2017-03-02 22:19:00 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-09 17:33:18 +0100
commite70065fdc11d86fac671c9e4103d69ac099f46c9 (patch)
treeb523a43213e21125c08295539895e1fac4e50b9f /drivers/staging/fbtft
parent60da70204ead415ce43f6865ae237cb073f3a5a0 (diff)
downloadblackbird-op-linux-e70065fdc11d86fac671c9e4103d69ac099f46c9.tar.gz
blackbird-op-linux-e70065fdc11d86fac671c9e4103d69ac099f46c9.zip
staging: fbtft: use helper fbtft_write_buf_dc in fbtft-bus.c
Make use of new helper fbtft_write_buf_dc. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/fbtft')
-rw-r--r--drivers/staging/fbtft/fbtft-bus.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/drivers/staging/fbtft/fbtft-bus.c b/drivers/staging/fbtft/fbtft-bus.c
index ec45043c0830..3475b1b8081f 100644
--- a/drivers/staging/fbtft/fbtft-bus.c
+++ b/drivers/staging/fbtft/fbtft-bus.c
@@ -36,14 +36,9 @@ void func(struct fbtft_par *par, int len, ...) \
} \
\
*buf = modifier((type)va_arg(args, unsigned int)); \
- if (par->gpio.dc != -1) \
- gpio_set_value(par->gpio.dc, 0); \
- ret = par->fbtftops.write(par, par->buf, sizeof(type) + offset); \
- if (ret < 0) { \
- va_end(args); \
- dev_err(par->info->device, "%s: write() failed and returned %d\n", __func__, ret); \
- return; \
- } \
+ ret = fbtft_write_buf_dc(par, par->buf, sizeof(type) + offset, 0); \
+ if (ret < 0) \
+ goto out; \
len--; \
\
if (par->startbyte) \
@@ -51,19 +46,12 @@ void func(struct fbtft_par *par, int len, ...) \
\
if (len) { \
i = len; \
- while (i--) { \
+ while (i--) \
*buf++ = modifier((type)va_arg(args, unsigned int)); \
- } \
- if (par->gpio.dc != -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; \
- } \
+ fbtft_write_buf_dc(par, par->buf, \
+ len * (sizeof(type) + offset), 1); \
} \
+out: \
va_end(args); \
} \
EXPORT_SYMBOL(func);
@@ -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);
- if (par->gpio.dc != -1)
- gpio_set_value(par->gpio.dc, 1);
-
/* 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);
OpenPOWER on IntegriCloud