* [PATCH] FBTFT: fbtft-bus: Fix code style problems
@ 2019-03-09 21:48 ` Dante Paz
0 siblings, 0 replies; 19+ messages in thread
From: Dante Paz @ 2019-03-09 21:48 UTC (permalink / raw)
To: gregkh
Cc: devel, leobras.c, linux-fbdev, nishadkamdar, Dante Paz, dri-devel,
renatoys08
From: Dante Paz <dpaz@unc.edu.ar>
Style and coding function issues were corrected, by avoiding macro functions with a conflicting coding style.
Signed-off-by: Dante Paz <dpaz@unc.edu.ar>
---
drivers/staging/fbtft/fbtft-bus.c | 440 +++++++++++++++++-------------
1 file changed, 254 insertions(+), 186 deletions(-)
diff --git a/drivers/staging/fbtft/fbtft-bus.c b/drivers/staging/fbtft/fbtft-bus.c
index 2ea814d0dca5..6f49306cd162 100644
--- a/drivers/staging/fbtft/fbtft-bus.c
+++ b/drivers/staging/fbtft/fbtft-bus.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
#include <linux/export.h>
#include <linux/errno.h>
-#include <linux/gpio/consumer.h>
+#include <linux/gpio.h>
#include <linux/spi/spi.h>
#include "fbtft.h"
@@ -11,103 +11,171 @@
*
*****************************************************************************/
-#define define_fbtft_write_reg(func, buffer_type, data_type, modifier) \
-void func(struct fbtft_par *par, int len, ...) \
-{ \
- va_list args; \
- int i, ret; \
- int offset = 0; \
- buffer_type *buf = (buffer_type *)par->buf; \
- \
- if (unlikely(par->debug & DEBUG_WRITE_REGISTER)) { \
- va_start(args, len); \
- for (i = 0; i < len; i++) { \
- buf[i] = modifier((data_type)va_arg(args, \
- unsigned int)); \
- } \
- va_end(args); \
- fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par, \
- par->info->device, buffer_type, buf, len, \
- "%s: ", __func__); \
- } \
- \
- va_start(args, len); \
- \
- if (par->startbyte) { \
- *(u8 *)par->buf = par->startbyte; \
- buf = (buffer_type *)(par->buf + 1); \
- offset = 1; \
- } \
- \
- *buf = modifier((data_type)va_arg(args, unsigned int)); \
- ret = fbtft_write_buf_dc(par, par->buf, sizeof(data_type) + offset, \
- 0); \
- if (ret < 0) \
- goto out; \
- len--; \
- \
- if (par->startbyte) \
- *(u8 *)par->buf = par->startbyte | 0x2; \
- \
- if (len) { \
- i = len; \
- while (i--) \
- *buf++ = modifier((data_type)va_arg(args, \
- unsigned int)); \
- fbtft_write_buf_dc(par, par->buf, \
- len * (sizeof(data_type) + offset), 1); \
- } \
-out: \
- va_end(args); \
-} \
-EXPORT_SYMBOL(func);
-
-define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, )
-define_fbtft_write_reg(fbtft_write_reg16_bus8, __be16, u16, cpu_to_be16)
-define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16, )
+void fbtft_write_reg8_bus8(struct fbtft_par *par, int len, ...)
+{
+ va_list args;
+ int i, ret;
+ int offset = 0;
+
+ u8 *buf = (u8 *)par->buf;
+
+ if (unlikely(par->debug & DEBUG_WRITE_REGISTER)) {
+ va_start(args, len);
+ for (i = 0; i < len; i++)
+ buf[i] = ((u8)va_arg(args, unsigned int));
+
+ va_end(args);
+ fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par, par->info->device,
+ u8, buf, len, "%s: ", __func__);
+ }
+ va_start(args, len);
+ if (par->startbyte) {
+ *(u8 *)par->buf = par->startbyte;
+ buf = (u8 *)(par->buf + 1);
+ offset = 1;
+ }
+ *buf = ((u8)va_arg(args, unsigned int));
+ ret = fbtft_write_buf_dc(par, par->buf, sizeof(u8) + offset, 0);
+ if (ret < 0)
+ goto out;
+ len--;
+ if (par->startbyte)
+ *(u8 *)par->buf = par->startbyte | 0x2;
+ if (len) {
+ i = len;
+ while (i--)
+ *buf++ = ((u8)va_arg(args, unsigned int));
+ fbtft_write_buf_dc(par, par->buf,
+ len*(sizeof(u8) + offset), 1);
+ } out:
+ va_end(args);
+}
+EXPORT_SYMBOL(fbtft_write_reg8_bus8);
+
+void fbtft_write_reg16_bus8(struct fbtft_par *par, int len, ...)
+{
+ va_list args;
+ int i, ret;
+ int offset = 0;
+
+ __be16 *buf = (__be16 *)par->buf;
+
+ if (unlikely(par->debug & DEBUG_WRITE_REGISTER)) {
+ va_start(args, len);
+ for (i = 0; i < len; i++)
+ buf[i] = cpu_to_be16((u16)va_arg(args, unsigned int));
+
+ va_end(args);
+ fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par, par->info->device,
+ __be16, buf, len, "%s: ", __func__);
+ }
+ va_start(args, len);
+ if (par->startbyte) {
+ *(u8 *)par->buf = par->startbyte;
+ buf = (__be16 *)(par->buf + 1);
+ offset = 1;
+ }
+ *buf = cpu_to_be16((u16)va_arg(args, unsigned int));
+ ret = fbtft_write_buf_dc(par, par->buf, sizeof(u16) + offset, 0);
+ if (ret < 0)
+ goto out;
+ len--;
+ if (par->startbyte)
+ *(u8 *)par->buf = par->startbyte | 0x2;
+ if (len) {
+ i = len;
+ while (i--)
+ *buf++ = cpu_to_be16((u16)va_arg(args, unsigned int));
+ fbtft_write_buf_dc(par, par->buf,
+ len*(sizeof(u16) + offset), 1);
+ } out:
+ va_end(args);
+}
+EXPORT_SYMBOL(fbtft_write_reg16_bus8);
+
+void fbtft_write_reg16_bus16(struct fbtft_par *par, int len, ...)
+{
+ va_list args;
+ int i, ret;
+ int offset = 0;
+ u16 *buf = (u16 *)par->buf;
+
+ if (unlikely(par->debug & DEBUG_WRITE_REGISTER)) {
+ va_start(args, len);
+ for (i = 0; i < len; i++)
+ buf[i] = ((u16)va_arg(args, unsigned int));
+
+ va_end(args);
+ fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par, par->info->device,
+ u16, buf, len, "%s: ", __func__);
+ }
+ va_start(args, len);
+
+ if (par->startbyte) {
+ *(u8 *)par->buf = par->startbyte;
+ buf = (u16 *)(par->buf + 1);
+ offset = 1;
+ }
+ *buf = ((u16)va_arg(args, unsigned int));
+ ret = fbtft_write_buf_dc(par, par->buf, sizeof(u16) + offset, 0);
+ if (ret < 0)
+ goto out;
+ len--;
+ if (par->startbyte)
+ *(u8 *)par->buf = par->startbyte | 0x2;
+ if (len) {
+ i = len;
+ while (i--)
+ *buf++ = ((u16)va_arg(args, unsigned int));
+ fbtft_write_buf_dc(par, par->buf,
+ len*(sizeof(u16) + offset), 1);
+ } out:
+ va_end(args);
+}
+EXPORT_SYMBOL(fbtft_write_reg16_bus16);
void fbtft_write_reg8_bus9(struct fbtft_par *par, int len, ...)
{
- va_list args;
- int i, ret;
- int pad = 0;
- u16 *buf = (u16 *)par->buf;
-
- if (unlikely(par->debug & DEBUG_WRITE_REGISTER)) {
- va_start(args, len);
- for (i = 0; i < len; i++)
- *(((u8 *)buf) + i) = (u8)va_arg(args, unsigned int);
- va_end(args);
- fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par,
- par->info->device, u8, buf, len, "%s: ",
- __func__);
- }
- if (len <= 0)
- return;
-
- if (par->spi && (par->spi->bits_per_word = 8)) {
- /* we're emulating 9-bit, pad start of buffer with no-ops
- * (assuming here that zero is a no-op)
- */
- pad = (len % 4) ? 4 - (len % 4) : 0;
- for (i = 0; i < pad; i++)
- *buf++ = 0x000;
- }
-
- va_start(args, len);
- *buf++ = (u8)va_arg(args, unsigned int);
- i = len - 1;
- while (i--) {
- *buf = (u8)va_arg(args, unsigned int);
- *buf++ |= 0x100; /* dc=1 */
- }
- va_end(args);
- ret = par->fbtftops.write(par, par->buf, (len + pad) * sizeof(u16));
- if (ret < 0) {
- dev_err(par->info->device,
- "write() failed and returned %d\n", ret);
- return;
- }
+ va_list args;
+ int i, ret;
+ int pad = 0;
+ u16 *buf = (u16 *)par->buf;
+
+ if (unlikely(par->debug & DEBUG_WRITE_REGISTER)) {
+ va_start(args, len);
+ for (i = 0; i < len; i++)
+ *(((u8 *)buf) + i) = (u8)va_arg(args, unsigned int);
+ va_end(args);
+ fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par,
+ par->info->device, u8, buf, len, "%s: ",
+ __func__);
+ }
+ if (len <= 0)
+ return;
+
+ if (par->spi && (par->spi->bits_per_word = 8)) {
+ /* we're emulating 9-bit, pad start of buffer with no-ops
+ * (assuming here that zero is a no-op)
+ */
+ pad = (len % 4) ? 4 - (len % 4) : 0;
+ for (i = 0; i < pad; i++)
+ *buf++ = 0x000;
+ }
+
+ va_start(args, len);
+ *buf++ = (u8)va_arg(args, unsigned int);
+ i = len - 1;
+ while (i--) {
+ *buf = (u8)va_arg(args, unsigned int);
+ *buf++ |= 0x100; /* dc=1 */
+ }
+ va_end(args);
+ ret = par->fbtftops.write(par, par->buf, (len + pad) * sizeof(u16));
+ if (ret < 0) {
+ dev_err(par->info->device,
+ "write() failed and returned %d\n", ret);
+ return;
+ }
}
EXPORT_SYMBOL(fbtft_write_reg8_bus9);
@@ -120,125 +188,125 @@ EXPORT_SYMBOL(fbtft_write_reg8_bus9);
/* 16 bit pixel over 8-bit databus */
int fbtft_write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len)
{
- u16 *vmem16;
- __be16 *txbuf16 = par->txbuf.buf;
- size_t remain;
- size_t to_copy;
- size_t tx_array_size;
- int i;
- int ret = 0;
- size_t startbyte_size = 0;
-
- fbtft_par_dbg(DEBUG_WRITE_VMEM, par, "%s(offset=%zu, len=%zu)\n",
- __func__, offset, len);
-
- remain = len / 2;
- vmem16 = (u16 *)(par->info->screen_buffer + offset);
-
- if (!par->gpio.dc)
- gpiod_set_value(par->gpio.dc, 1);
-
- /* non buffered write */
- if (!par->txbuf.buf)
- return par->fbtftops.write(par, vmem16, len);
-
- /* buffered write */
- tx_array_size = par->txbuf.len / 2;
-
- if (par->startbyte) {
- txbuf16 = par->txbuf.buf + 1;
- tx_array_size -= 2;
- *(u8 *)(par->txbuf.buf) = par->startbyte | 0x2;
- startbyte_size = 1;
- }
-
- while (remain) {
- to_copy = min(tx_array_size, remain);
- dev_dbg(par->info->device, "to_copy=%zu, remain=%zu\n",
- to_copy, remain - to_copy);
-
- for (i = 0; i < to_copy; i++)
- txbuf16[i] = cpu_to_be16(vmem16[i]);
-
- vmem16 = vmem16 + to_copy;
- ret = par->fbtftops.write(par, par->txbuf.buf,
- startbyte_size + to_copy * 2);
- if (ret < 0)
- return ret;
- remain -= to_copy;
- }
-
- return ret;
+ u16 *vmem16;
+ __be16 *txbuf16 = par->txbuf.buf;
+ size_t remain;
+ size_t to_copy;
+ size_t tx_array_size;
+ int i;
+ int ret = 0;
+ size_t startbyte_size = 0;
+
+ fbtft_par_dbg(DEBUG_WRITE_VMEM, par, "%s(offset=%zu, len=%zu)\n",
+ __func__, offset, len);
+
+ remain = len / 2;
+ vmem16 = (u16 *)(par->info->screen_buffer + offset);
+
+ if (par->gpio.dc != -1)
+ gpio_set_value(par->gpio.dc, 1);
+
+ /* non buffered write */
+ if (!par->txbuf.buf)
+ return par->fbtftops.write(par, vmem16, len);
+
+ /* buffered write */
+ tx_array_size = par->txbuf.len / 2;
+
+ if (par->startbyte) {
+ txbuf16 = par->txbuf.buf + 1;
+ tx_array_size -= 2;
+ *(u8 *)(par->txbuf.buf) = par->startbyte | 0x2;
+ startbyte_size = 1;
+ }
+
+ while (remain) {
+ to_copy = min(tx_array_size, remain);
+ dev_dbg(par->info->device, "to_copy=%zu, remain=%zu\n",
+ to_copy, remain - to_copy);
+
+ for (i = 0; i < to_copy; i++)
+ txbuf16[i] = cpu_to_be16(vmem16[i]);
+
+ vmem16 = vmem16 + to_copy;
+ ret = par->fbtftops.write(par, par->txbuf.buf,
+ startbyte_size + to_copy * 2);
+ if (ret < 0)
+ return ret;
+ remain -= to_copy;
+ }
+
+ return ret;
}
EXPORT_SYMBOL(fbtft_write_vmem16_bus8);
/* 16 bit pixel over 9-bit SPI bus: dc + high byte, dc + low byte */
int fbtft_write_vmem16_bus9(struct fbtft_par *par, size_t offset, size_t len)
{
- u8 *vmem8;
- u16 *txbuf16 = par->txbuf.buf;
- size_t remain;
- size_t to_copy;
- size_t tx_array_size;
- int i;
- int ret = 0;
+ u8 *vmem8;
+ u16 *txbuf16 = par->txbuf.buf;
+ size_t remain;
+ size_t to_copy;
+ size_t tx_array_size;
+ int i;
+ int ret = 0;
- fbtft_par_dbg(DEBUG_WRITE_VMEM, par, "%s(offset=%zu, len=%zu)\n",
- __func__, offset, len);
+ fbtft_par_dbg(DEBUG_WRITE_VMEM, par, "%s(offset=%zu, len=%zu)\n",
+ __func__, offset, len);
- if (!par->txbuf.buf) {
- dev_err(par->info->device, "%s: txbuf.buf is NULL\n", __func__);
- return -1;
- }
+ if (!par->txbuf.buf) {
+ dev_err(par->info->device, "%s: txbuf.buf is NULL\n", __func__);
+ return -1;
+ }
- remain = len;
- vmem8 = par->info->screen_buffer + offset;
+ remain = len;
+ vmem8 = par->info->screen_buffer + offset;
- tx_array_size = par->txbuf.len / 2;
+ tx_array_size = par->txbuf.len / 2;
- while (remain) {
- to_copy = min(tx_array_size, remain);
- dev_dbg(par->info->device, "to_copy=%zu, remain=%zu\n",
- to_copy, remain - to_copy);
+ while (remain) {
+ to_copy = min(tx_array_size, remain);
+ dev_dbg(par->info->device, "to_copy=%zu, remain=%zu\n",
+ to_copy, remain - to_copy);
#ifdef __LITTLE_ENDIAN
- for (i = 0; i < to_copy; i += 2) {
- txbuf16[i] = 0x0100 | vmem8[i + 1];
- txbuf16[i + 1] = 0x0100 | vmem8[i];
- }
+ for (i = 0; i < to_copy; i += 2) {
+ txbuf16[i] = 0x0100 | vmem8[i + 1];
+ txbuf16[i + 1] = 0x0100 | vmem8[i];
+ }
#else
- for (i = 0; i < to_copy; i++)
- txbuf16[i] = 0x0100 | vmem8[i];
+ for (i = 0; i < to_copy; i++)
+ txbuf16[i] = 0x0100 | vmem8[i];
#endif
- vmem8 = vmem8 + to_copy;
- ret = par->fbtftops.write(par, par->txbuf.buf, to_copy * 2);
- if (ret < 0)
- return ret;
- remain -= to_copy;
- }
-
- return ret;
+ vmem8 = vmem8 + to_copy;
+ ret = par->fbtftops.write(par, par->txbuf.buf, to_copy * 2);
+ if (ret < 0)
+ return ret;
+ remain -= to_copy;
+ }
+
+ return ret;
}
EXPORT_SYMBOL(fbtft_write_vmem16_bus9);
int fbtft_write_vmem8_bus8(struct fbtft_par *par, size_t offset, size_t len)
{
- dev_err(par->info->device, "%s: function not implemented\n", __func__);
- return -1;
+ dev_err(par->info->device, "%s: function not implemented\n", __func__);
+ return -1;
}
EXPORT_SYMBOL(fbtft_write_vmem8_bus8);
/* 16 bit pixel over 16-bit databus */
int fbtft_write_vmem16_bus16(struct fbtft_par *par, size_t offset, size_t len)
{
- u16 *vmem16;
+ u16 *vmem16;
- fbtft_par_dbg(DEBUG_WRITE_VMEM, par, "%s(offset=%zu, len=%zu)\n",
- __func__, offset, len);
+ fbtft_par_dbg(DEBUG_WRITE_VMEM, par, "%s(offset=%zu, len=%zu)\n",
+ __func__, offset, len);
- vmem16 = (u16 *)(par->info->screen_buffer + offset);
+ vmem16 = (u16 *)(par->info->screen_buffer + offset);
- /* no need for buffered write with 16-bit bus */
- return fbtft_write_buf_dc(par, vmem16, len, 1);
+ /* no need for buffered write with 16-bit bus */
+ return fbtft_write_buf_dc(par, vmem16, len, 1);
}
EXPORT_SYMBOL(fbtft_write_vmem16_bus16);
--
2.17.2
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH] FBTFT: fbtft-bus: Fix code style problems @ 2019-03-09 21:48 ` Dante Paz 0 siblings, 0 replies; 19+ messages in thread From: Dante Paz @ 2019-03-09 21:48 UTC (permalink / raw) To: gregkh Cc: devel, leobras.c, linux-fbdev, nishadkamdar, Dante Paz, dri-devel, renatoys08 From: Dante Paz <dpaz@unc.edu.ar> Style and coding function issues were corrected, by avoiding macro functions with a conflicting coding style. Signed-off-by: Dante Paz <dpaz@unc.edu.ar> --- drivers/staging/fbtft/fbtft-bus.c | 440 +++++++++++++++++------------- 1 file changed, 254 insertions(+), 186 deletions(-) diff --git a/drivers/staging/fbtft/fbtft-bus.c b/drivers/staging/fbtft/fbtft-bus.c index 2ea814d0dca5..6f49306cd162 100644 --- a/drivers/staging/fbtft/fbtft-bus.c +++ b/drivers/staging/fbtft/fbtft-bus.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/export.h> #include <linux/errno.h> -#include <linux/gpio/consumer.h> +#include <linux/gpio.h> #include <linux/spi/spi.h> #include "fbtft.h" @@ -11,103 +11,171 @@ * *****************************************************************************/ -#define define_fbtft_write_reg(func, buffer_type, data_type, modifier) \ -void func(struct fbtft_par *par, int len, ...) \ -{ \ - va_list args; \ - int i, ret; \ - int offset = 0; \ - buffer_type *buf = (buffer_type *)par->buf; \ - \ - if (unlikely(par->debug & DEBUG_WRITE_REGISTER)) { \ - va_start(args, len); \ - for (i = 0; i < len; i++) { \ - buf[i] = modifier((data_type)va_arg(args, \ - unsigned int)); \ - } \ - va_end(args); \ - fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par, \ - par->info->device, buffer_type, buf, len, \ - "%s: ", __func__); \ - } \ - \ - va_start(args, len); \ - \ - if (par->startbyte) { \ - *(u8 *)par->buf = par->startbyte; \ - buf = (buffer_type *)(par->buf + 1); \ - offset = 1; \ - } \ - \ - *buf = modifier((data_type)va_arg(args, unsigned int)); \ - ret = fbtft_write_buf_dc(par, par->buf, sizeof(data_type) + offset, \ - 0); \ - if (ret < 0) \ - goto out; \ - len--; \ - \ - if (par->startbyte) \ - *(u8 *)par->buf = par->startbyte | 0x2; \ - \ - if (len) { \ - i = len; \ - while (i--) \ - *buf++ = modifier((data_type)va_arg(args, \ - unsigned int)); \ - fbtft_write_buf_dc(par, par->buf, \ - len * (sizeof(data_type) + offset), 1); \ - } \ -out: \ - va_end(args); \ -} \ -EXPORT_SYMBOL(func); - -define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, ) -define_fbtft_write_reg(fbtft_write_reg16_bus8, __be16, u16, cpu_to_be16) -define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16, ) +void fbtft_write_reg8_bus8(struct fbtft_par *par, int len, ...) +{ + va_list args; + int i, ret; + int offset = 0; + + u8 *buf = (u8 *)par->buf; + + if (unlikely(par->debug & DEBUG_WRITE_REGISTER)) { + va_start(args, len); + for (i = 0; i < len; i++) + buf[i] = ((u8)va_arg(args, unsigned int)); + + va_end(args); + fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par, par->info->device, + u8, buf, len, "%s: ", __func__); + } + va_start(args, len); + if (par->startbyte) { + *(u8 *)par->buf = par->startbyte; + buf = (u8 *)(par->buf + 1); + offset = 1; + } + *buf = ((u8)va_arg(args, unsigned int)); + ret = fbtft_write_buf_dc(par, par->buf, sizeof(u8) + offset, 0); + if (ret < 0) + goto out; + len--; + if (par->startbyte) + *(u8 *)par->buf = par->startbyte | 0x2; + if (len) { + i = len; + while (i--) + *buf++ = ((u8)va_arg(args, unsigned int)); + fbtft_write_buf_dc(par, par->buf, + len*(sizeof(u8) + offset), 1); + } out: + va_end(args); +} +EXPORT_SYMBOL(fbtft_write_reg8_bus8); + +void fbtft_write_reg16_bus8(struct fbtft_par *par, int len, ...) +{ + va_list args; + int i, ret; + int offset = 0; + + __be16 *buf = (__be16 *)par->buf; + + if (unlikely(par->debug & DEBUG_WRITE_REGISTER)) { + va_start(args, len); + for (i = 0; i < len; i++) + buf[i] = cpu_to_be16((u16)va_arg(args, unsigned int)); + + va_end(args); + fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par, par->info->device, + __be16, buf, len, "%s: ", __func__); + } + va_start(args, len); + if (par->startbyte) { + *(u8 *)par->buf = par->startbyte; + buf = (__be16 *)(par->buf + 1); + offset = 1; + } + *buf = cpu_to_be16((u16)va_arg(args, unsigned int)); + ret = fbtft_write_buf_dc(par, par->buf, sizeof(u16) + offset, 0); + if (ret < 0) + goto out; + len--; + if (par->startbyte) + *(u8 *)par->buf = par->startbyte | 0x2; + if (len) { + i = len; + while (i--) + *buf++ = cpu_to_be16((u16)va_arg(args, unsigned int)); + fbtft_write_buf_dc(par, par->buf, + len*(sizeof(u16) + offset), 1); + } out: + va_end(args); +} +EXPORT_SYMBOL(fbtft_write_reg16_bus8); + +void fbtft_write_reg16_bus16(struct fbtft_par *par, int len, ...) +{ + va_list args; + int i, ret; + int offset = 0; + u16 *buf = (u16 *)par->buf; + + if (unlikely(par->debug & DEBUG_WRITE_REGISTER)) { + va_start(args, len); + for (i = 0; i < len; i++) + buf[i] = ((u16)va_arg(args, unsigned int)); + + va_end(args); + fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par, par->info->device, + u16, buf, len, "%s: ", __func__); + } + va_start(args, len); + + if (par->startbyte) { + *(u8 *)par->buf = par->startbyte; + buf = (u16 *)(par->buf + 1); + offset = 1; + } + *buf = ((u16)va_arg(args, unsigned int)); + ret = fbtft_write_buf_dc(par, par->buf, sizeof(u16) + offset, 0); + if (ret < 0) + goto out; + len--; + if (par->startbyte) + *(u8 *)par->buf = par->startbyte | 0x2; + if (len) { + i = len; + while (i--) + *buf++ = ((u16)va_arg(args, unsigned int)); + fbtft_write_buf_dc(par, par->buf, + len*(sizeof(u16) + offset), 1); + } out: + va_end(args); +} +EXPORT_SYMBOL(fbtft_write_reg16_bus16); void fbtft_write_reg8_bus9(struct fbtft_par *par, int len, ...) { - va_list args; - int i, ret; - int pad = 0; - u16 *buf = (u16 *)par->buf; - - if (unlikely(par->debug & DEBUG_WRITE_REGISTER)) { - va_start(args, len); - for (i = 0; i < len; i++) - *(((u8 *)buf) + i) = (u8)va_arg(args, unsigned int); - va_end(args); - fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par, - par->info->device, u8, buf, len, "%s: ", - __func__); - } - if (len <= 0) - return; - - if (par->spi && (par->spi->bits_per_word == 8)) { - /* we're emulating 9-bit, pad start of buffer with no-ops - * (assuming here that zero is a no-op) - */ - pad = (len % 4) ? 4 - (len % 4) : 0; - for (i = 0; i < pad; i++) - *buf++ = 0x000; - } - - va_start(args, len); - *buf++ = (u8)va_arg(args, unsigned int); - i = len - 1; - while (i--) { - *buf = (u8)va_arg(args, unsigned int); - *buf++ |= 0x100; /* dc=1 */ - } - va_end(args); - ret = par->fbtftops.write(par, par->buf, (len + pad) * sizeof(u16)); - if (ret < 0) { - dev_err(par->info->device, - "write() failed and returned %d\n", ret); - return; - } + va_list args; + int i, ret; + int pad = 0; + u16 *buf = (u16 *)par->buf; + + if (unlikely(par->debug & DEBUG_WRITE_REGISTER)) { + va_start(args, len); + for (i = 0; i < len; i++) + *(((u8 *)buf) + i) = (u8)va_arg(args, unsigned int); + va_end(args); + fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par, + par->info->device, u8, buf, len, "%s: ", + __func__); + } + if (len <= 0) + return; + + if (par->spi && (par->spi->bits_per_word == 8)) { + /* we're emulating 9-bit, pad start of buffer with no-ops + * (assuming here that zero is a no-op) + */ + pad = (len % 4) ? 4 - (len % 4) : 0; + for (i = 0; i < pad; i++) + *buf++ = 0x000; + } + + va_start(args, len); + *buf++ = (u8)va_arg(args, unsigned int); + i = len - 1; + while (i--) { + *buf = (u8)va_arg(args, unsigned int); + *buf++ |= 0x100; /* dc=1 */ + } + va_end(args); + ret = par->fbtftops.write(par, par->buf, (len + pad) * sizeof(u16)); + if (ret < 0) { + dev_err(par->info->device, + "write() failed and returned %d\n", ret); + return; + } } EXPORT_SYMBOL(fbtft_write_reg8_bus9); @@ -120,125 +188,125 @@ EXPORT_SYMBOL(fbtft_write_reg8_bus9); /* 16 bit pixel over 8-bit databus */ int fbtft_write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len) { - u16 *vmem16; - __be16 *txbuf16 = par->txbuf.buf; - size_t remain; - size_t to_copy; - size_t tx_array_size; - int i; - int ret = 0; - size_t startbyte_size = 0; - - fbtft_par_dbg(DEBUG_WRITE_VMEM, par, "%s(offset=%zu, len=%zu)\n", - __func__, offset, len); - - remain = len / 2; - vmem16 = (u16 *)(par->info->screen_buffer + offset); - - if (!par->gpio.dc) - gpiod_set_value(par->gpio.dc, 1); - - /* non buffered write */ - if (!par->txbuf.buf) - return par->fbtftops.write(par, vmem16, len); - - /* buffered write */ - tx_array_size = par->txbuf.len / 2; - - if (par->startbyte) { - txbuf16 = par->txbuf.buf + 1; - tx_array_size -= 2; - *(u8 *)(par->txbuf.buf) = par->startbyte | 0x2; - startbyte_size = 1; - } - - while (remain) { - to_copy = min(tx_array_size, remain); - dev_dbg(par->info->device, "to_copy=%zu, remain=%zu\n", - to_copy, remain - to_copy); - - for (i = 0; i < to_copy; i++) - txbuf16[i] = cpu_to_be16(vmem16[i]); - - vmem16 = vmem16 + to_copy; - ret = par->fbtftops.write(par, par->txbuf.buf, - startbyte_size + to_copy * 2); - if (ret < 0) - return ret; - remain -= to_copy; - } - - return ret; + u16 *vmem16; + __be16 *txbuf16 = par->txbuf.buf; + size_t remain; + size_t to_copy; + size_t tx_array_size; + int i; + int ret = 0; + size_t startbyte_size = 0; + + fbtft_par_dbg(DEBUG_WRITE_VMEM, par, "%s(offset=%zu, len=%zu)\n", + __func__, offset, len); + + remain = len / 2; + vmem16 = (u16 *)(par->info->screen_buffer + offset); + + if (par->gpio.dc != -1) + gpio_set_value(par->gpio.dc, 1); + + /* non buffered write */ + if (!par->txbuf.buf) + return par->fbtftops.write(par, vmem16, len); + + /* buffered write */ + tx_array_size = par->txbuf.len / 2; + + if (par->startbyte) { + txbuf16 = par->txbuf.buf + 1; + tx_array_size -= 2; + *(u8 *)(par->txbuf.buf) = par->startbyte | 0x2; + startbyte_size = 1; + } + + while (remain) { + to_copy = min(tx_array_size, remain); + dev_dbg(par->info->device, "to_copy=%zu, remain=%zu\n", + to_copy, remain - to_copy); + + for (i = 0; i < to_copy; i++) + txbuf16[i] = cpu_to_be16(vmem16[i]); + + vmem16 = vmem16 + to_copy; + ret = par->fbtftops.write(par, par->txbuf.buf, + startbyte_size + to_copy * 2); + if (ret < 0) + return ret; + remain -= to_copy; + } + + return ret; } EXPORT_SYMBOL(fbtft_write_vmem16_bus8); /* 16 bit pixel over 9-bit SPI bus: dc + high byte, dc + low byte */ int fbtft_write_vmem16_bus9(struct fbtft_par *par, size_t offset, size_t len) { - u8 *vmem8; - u16 *txbuf16 = par->txbuf.buf; - size_t remain; - size_t to_copy; - size_t tx_array_size; - int i; - int ret = 0; + u8 *vmem8; + u16 *txbuf16 = par->txbuf.buf; + size_t remain; + size_t to_copy; + size_t tx_array_size; + int i; + int ret = 0; - fbtft_par_dbg(DEBUG_WRITE_VMEM, par, "%s(offset=%zu, len=%zu)\n", - __func__, offset, len); + fbtft_par_dbg(DEBUG_WRITE_VMEM, par, "%s(offset=%zu, len=%zu)\n", + __func__, offset, len); - if (!par->txbuf.buf) { - dev_err(par->info->device, "%s: txbuf.buf is NULL\n", __func__); - return -1; - } + if (!par->txbuf.buf) { + dev_err(par->info->device, "%s: txbuf.buf is NULL\n", __func__); + return -1; + } - remain = len; - vmem8 = par->info->screen_buffer + offset; + remain = len; + vmem8 = par->info->screen_buffer + offset; - tx_array_size = par->txbuf.len / 2; + tx_array_size = par->txbuf.len / 2; - while (remain) { - to_copy = min(tx_array_size, remain); - dev_dbg(par->info->device, "to_copy=%zu, remain=%zu\n", - to_copy, remain - to_copy); + while (remain) { + to_copy = min(tx_array_size, remain); + dev_dbg(par->info->device, "to_copy=%zu, remain=%zu\n", + to_copy, remain - to_copy); #ifdef __LITTLE_ENDIAN - for (i = 0; i < to_copy; i += 2) { - txbuf16[i] = 0x0100 | vmem8[i + 1]; - txbuf16[i + 1] = 0x0100 | vmem8[i]; - } + for (i = 0; i < to_copy; i += 2) { + txbuf16[i] = 0x0100 | vmem8[i + 1]; + txbuf16[i + 1] = 0x0100 | vmem8[i]; + } #else - for (i = 0; i < to_copy; i++) - txbuf16[i] = 0x0100 | vmem8[i]; + for (i = 0; i < to_copy; i++) + txbuf16[i] = 0x0100 | vmem8[i]; #endif - vmem8 = vmem8 + to_copy; - ret = par->fbtftops.write(par, par->txbuf.buf, to_copy * 2); - if (ret < 0) - return ret; - remain -= to_copy; - } - - return ret; + vmem8 = vmem8 + to_copy; + ret = par->fbtftops.write(par, par->txbuf.buf, to_copy * 2); + if (ret < 0) + return ret; + remain -= to_copy; + } + + return ret; } EXPORT_SYMBOL(fbtft_write_vmem16_bus9); int fbtft_write_vmem8_bus8(struct fbtft_par *par, size_t offset, size_t len) { - dev_err(par->info->device, "%s: function not implemented\n", __func__); - return -1; + dev_err(par->info->device, "%s: function not implemented\n", __func__); + return -1; } EXPORT_SYMBOL(fbtft_write_vmem8_bus8); /* 16 bit pixel over 16-bit databus */ int fbtft_write_vmem16_bus16(struct fbtft_par *par, size_t offset, size_t len) { - u16 *vmem16; + u16 *vmem16; - fbtft_par_dbg(DEBUG_WRITE_VMEM, par, "%s(offset=%zu, len=%zu)\n", - __func__, offset, len); + fbtft_par_dbg(DEBUG_WRITE_VMEM, par, "%s(offset=%zu, len=%zu)\n", + __func__, offset, len); - vmem16 = (u16 *)(par->info->screen_buffer + offset); + vmem16 = (u16 *)(par->info->screen_buffer + offset); - /* no need for buffered write with 16-bit bus */ - return fbtft_write_buf_dc(par, vmem16, len, 1); + /* no need for buffered write with 16-bit bus */ + return fbtft_write_buf_dc(par, vmem16, len, 1); } EXPORT_SYMBOL(fbtft_write_vmem16_bus16); -- 2.17.2 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH] FBTFT: fbtft-bus: Fix code style problems 2019-03-09 21:48 ` Dante Paz @ 2019-03-11 8:11 ` Dan Carpenter -1 siblings, 0 replies; 19+ messages in thread From: Dan Carpenter @ 2019-03-11 8:11 UTC (permalink / raw) To: Dante Paz Cc: devel, Dante Paz, linux-fbdev, nishadkamdar, leobras.c, gregkh, dri-devel, renatoys08 On Sat, Mar 09, 2019 at 06:48:52PM -0300, Dante Paz wrote: > From: Dante Paz <dpaz@unc.edu.ar> > > Style and coding function issues were corrected, by avoiding macro functions with a conflicting coding style. > Signed-off-by: Dante Paz <dpaz@unc.edu.ar> Line too long. No blank. Fix indenting. It's not really clear what you're trying to do actually... You need to sell your patch a bit to try convince us that it's worth applying. regards, dan carpenter ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] FBTFT: fbtft-bus: Fix code style problems @ 2019-03-11 8:11 ` Dan Carpenter 0 siblings, 0 replies; 19+ messages in thread From: Dan Carpenter @ 2019-03-11 8:11 UTC (permalink / raw) To: Dante Paz Cc: devel, Dante Paz, linux-fbdev, nishadkamdar, leobras.c, gregkh, dri-devel, renatoys08 On Sat, Mar 09, 2019 at 06:48:52PM -0300, Dante Paz wrote: > From: Dante Paz <dpaz@unc.edu.ar> > > Style and coding function issues were corrected, by avoiding macro functions with a conflicting coding style. > Signed-off-by: Dante Paz <dpaz@unc.edu.ar> Line too long. No blank. Fix indenting. It's not really clear what you're trying to do actually... You need to sell your patch a bit to try convince us that it's worth applying. regards, dan carpenter _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] FBTFT: fbtft-bus: Fix code style problems 2019-03-09 21:48 ` Dante Paz @ 2019-03-11 8:18 ` Dan Carpenter -1 siblings, 0 replies; 19+ messages in thread From: Dan Carpenter @ 2019-03-11 8:18 UTC (permalink / raw) To: Dante Paz Cc: devel, Dante Paz, linux-fbdev, nishadkamdar, leobras.c, gregkh, dri-devel, renatoys08 I feel like you need to break the patch up a bit and do the white space fixes separate from the other changes. (Probably you're going to have to redo this several times because it's hard to review when it's so mixed up with multiple changes at the same time). regards, dan carpenter ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] FBTFT: fbtft-bus: Fix code style problems @ 2019-03-11 8:18 ` Dan Carpenter 0 siblings, 0 replies; 19+ messages in thread From: Dan Carpenter @ 2019-03-11 8:18 UTC (permalink / raw) To: Dante Paz Cc: devel, Dante Paz, linux-fbdev, nishadkamdar, leobras.c, gregkh, dri-devel, renatoys08 I feel like you need to break the patch up a bit and do the white space fixes separate from the other changes. (Probably you're going to have to redo this several times because it's hard to review when it's so mixed up with multiple changes at the same time). regards, dan carpenter _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] FBTFT: fbtft-bus: Fix code style problems 2019-03-11 8:18 ` Dan Carpenter (?) @ 2019-03-11 14:06 ` DANTE JAVIER PAZ -1 siblings, 0 replies; 19+ messages in thread From: DANTE JAVIER PAZ @ 2019-03-11 14:06 UTC (permalink / raw) To: Dan Carpenter Cc: devel, leobras.c, linux-fbdev, nishadkamdar, gregkh, Dante Paz, dri-devel, renatoys08 [-- Attachment #1.1: Type: text/plain, Size: 898 bytes --] Hi Dan, Thanks a lot for your feedback, this is my first patch for the linux kernel so I'm learning a lot from your comments. I'll try to make a more clear version of the patch following your suggestions to resubmit. Best, Dante Paz El lun., 11 mar. 2019 a las 5:18, Dan Carpenter (<dan.carpenter@oracle.com>) escribió: > I feel like you need to break the patch up a bit and do the white > space fixes separate from the other changes. > > (Probably you're going to have to redo this several times because it's > hard to review when it's so mixed up with multiple changes at the same > time). > > regards, > dan carpenter > > -- -- Dr. Dante Javier Paz Instituto de Astronomía, Teórica y Experimental, IATE Observatorio Astronómico de Córdoba Tel: (54) 351-5353776 ext 75643 Web: www.iate.oac.uncor.edu Laprida 854 X5000BGR - Córdoba ARGENTINA [-- Attachment #1.2: Type: text/html, Size: 1601 bytes --] [-- Attachment #2: Type: text/plain, Size: 159 bytes --] _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] FBTFT: fbtft-bus: Fix code style problems 2019-03-09 21:48 ` Dante Paz @ 2019-03-11 16:25 ` Sam Ravnborg -1 siblings, 0 replies; 19+ messages in thread From: Sam Ravnborg @ 2019-03-11 16:25 UTC (permalink / raw) To: Dante Paz Cc: devel, Dante Paz, linux-fbdev, nishadkamdar, leobras.c, gregkh, dri-devel, renatoys08 Hi Dante Thanks for the patch. On Sat, Mar 09, 2019 at 06:48:52PM -0300, Dante Paz wrote: > From: Dante Paz <dpaz@unc.edu.ar> > > Style and coding function issues were corrected, by avoiding macro functions with a conflicting coding style. > Signed-off-by: Dante Paz <dpaz@unc.edu.ar> But it raised a few comments. The staging/fbtft is a dumping of a set of drivers that in the end will be migrated to DRM. And there is not much gained trying to do coding style changes to these drivers. So please conmsider finding a drver where this is more relevant. Furthermore that patch presented is hard to review as it contains too much changes in one go. As a rule of thumb include only one type of change per patch. This is worth to keep in mind for future submissions. It it then also good to present the trivial changes first(*), and the less trivial changes later. (*) Like whitespace to tabs, spellign errors etc. Sam ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] FBTFT: fbtft-bus: Fix code style problems @ 2019-03-11 16:25 ` Sam Ravnborg 0 siblings, 0 replies; 19+ messages in thread From: Sam Ravnborg @ 2019-03-11 16:25 UTC (permalink / raw) To: Dante Paz Cc: devel, Dante Paz, linux-fbdev, nishadkamdar, leobras.c, gregkh, dri-devel, renatoys08 Hi Dante Thanks for the patch. On Sat, Mar 09, 2019 at 06:48:52PM -0300, Dante Paz wrote: > From: Dante Paz <dpaz@unc.edu.ar> > > Style and coding function issues were corrected, by avoiding macro functions with a conflicting coding style. > Signed-off-by: Dante Paz <dpaz@unc.edu.ar> But it raised a few comments. The staging/fbtft is a dumping of a set of drivers that in the end will be migrated to DRM. And there is not much gained trying to do coding style changes to these drivers. So please conmsider finding a drver where this is more relevant. Furthermore that patch presented is hard to review as it contains too much changes in one go. As a rule of thumb include only one type of change per patch. This is worth to keep in mind for future submissions. It it then also good to present the trivial changes first(*), and the less trivial changes later. (*) Like whitespace to tabs, spellign errors etc. Sam ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] FBTFT: fbtft-bus: Fix code style problems 2019-03-11 16:25 ` Sam Ravnborg @ 2019-03-11 20:32 ` DANTE JAVIER PAZ -1 siblings, 0 replies; 19+ messages in thread From: DANTE JAVIER PAZ @ 2019-03-11 20:32 UTC (permalink / raw) To: Sam Ravnborg Cc: devel, leobras.c, linux-fbdev, nishadkamdar, gregkh, Dante Paz, dri-devel, renatoys08 Hello Sam, thank you very much for your comments, As I told Dan (my email did not reach the mailing list) this is my first attempt to contribute, So I'm learning a lot from your advice and corrections. I will look for TODO lists to see if there are more useful contributions to make, all suggestions are also welcome. Thanks again for the patience of all of you. Best, Dante El lun., 11 mar. 2019 a las 13:25, Sam Ravnborg (<sam@ravnborg.org>) escribió: > > Hi Dante > > Thanks for the patch. > On Sat, Mar 09, 2019 at 06:48:52PM -0300, Dante Paz wrote: > > From: Dante Paz <dpaz@unc.edu.ar> > > > > Style and coding function issues were corrected, by avoiding macro functions with a conflicting coding style. > > Signed-off-by: Dante Paz <dpaz@unc.edu.ar> > > But it raised a few comments. > > The staging/fbtft is a dumping of a set of drivers that > in the end will be migrated to DRM. > And there is not much gained trying to do coding style changes to these > drivers. > So please conmsider finding a drver where this is more relevant. > > Furthermore that patch presented is hard to review as it contains > too much changes in one go. > As a rule of thumb include only one type of change per patch. > This is worth to keep in mind for future submissions. > > It it then also good to present the trivial changes first(*), and the > less trivial changes later. > > (*) Like whitespace to tabs, spellign errors etc. > > Sam -- -- Dr. Dante Javier Paz Instituto de Astronomía, Teórica y Experimental, IATE Observatorio Astronómico de Córdoba Tel: (54) 351-5353776 ext 75643 Web: www.iate.oac.uncor.edu Laprida 854 X5000BGR - Córdoba ARGENTINA ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] FBTFT: fbtft-bus: Fix code style problems @ 2019-03-11 20:32 ` DANTE JAVIER PAZ 0 siblings, 0 replies; 19+ messages in thread From: DANTE JAVIER PAZ @ 2019-03-11 20:32 UTC (permalink / raw) To: Sam Ravnborg Cc: devel, leobras.c, linux-fbdev, nishadkamdar, gregkh, Dante Paz, dri-devel, renatoys08 Hello Sam, thank you very much for your comments, As I told Dan (my email did not reach the mailing list) this is my first attempt to contribute, So I'm learning a lot from your advice and corrections. I will look for TODO lists to see if there are more useful contributions to make, all suggestions are also welcome. Thanks again for the patience of all of you. Best, Dante El lun., 11 mar. 2019 a las 13:25, Sam Ravnborg (<sam@ravnborg.org>) escribió: > > Hi Dante > > Thanks for the patch. > On Sat, Mar 09, 2019 at 06:48:52PM -0300, Dante Paz wrote: > > From: Dante Paz <dpaz@unc.edu.ar> > > > > Style and coding function issues were corrected, by avoiding macro functions with a conflicting coding style. > > Signed-off-by: Dante Paz <dpaz@unc.edu.ar> > > But it raised a few comments. > > The staging/fbtft is a dumping of a set of drivers that > in the end will be migrated to DRM. > And there is not much gained trying to do coding style changes to these > drivers. > So please conmsider finding a drver where this is more relevant. > > Furthermore that patch presented is hard to review as it contains > too much changes in one go. > As a rule of thumb include only one type of change per patch. > This is worth to keep in mind for future submissions. > > It it then also good to present the trivial changes first(*), and the > less trivial changes later. > > (*) Like whitespace to tabs, spellign errors etc. > > Sam -- -- Dr. Dante Javier Paz Instituto de Astronomía, Teórica y Experimental, IATE Observatorio Astronómico de Córdoba Tel: (54) 351-5353776 ext 75643 Web: www.iate.oac.uncor.edu Laprida 854 X5000BGR - Córdoba ARGENTINA _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] FBTFT: fbtft-bus: Fix code style problems 2019-03-11 20:32 ` DANTE JAVIER PAZ @ 2019-03-11 21:15 ` Ezequiel Garcia -1 siblings, 0 replies; 19+ messages in thread From: Ezequiel Garcia @ 2019-03-11 21:15 UTC (permalink / raw) To: DANTE JAVIER PAZ Cc: devel, leobras.c, linux-fbdev, nishadkamdar, Greg KH, Dante Paz, dri-devel, renatoys08, Sam Ravnborg Hi everyone, Dante: please avoid top-posting. In other words, put your replies in-line, like I'm gonna do now. See below (and see how discussion goes on other threads). On Mon, 11 Mar 2019 at 17:34, DANTE JAVIER PAZ <dpaz@unc.edu.ar> wrote: > > Hello Sam, thank you very much for your comments, > As I told Dan (my email did not reach the mailing list) this is my > first attempt to contribute, > So I'm learning a lot from your advice and corrections. > > I will look for TODO lists to see if there are more useful > contributions to make, all suggestions are also welcome. > > Thanks again for the patience of all of you. > Best, > Dante > > > El lun., 11 mar. 2019 a las 13:25, Sam Ravnborg (<sam@ravnborg.org>) escribió: > > > > Hi Dante > > > > Thanks for the patch. > > On Sat, Mar 09, 2019 at 06:48:52PM -0300, Dante Paz wrote: > > > From: Dante Paz <dpaz@unc.edu.ar> > > > > > > Style and coding function issues were corrected, by avoiding macro functions with a conflicting coding style. > > > Signed-off-by: Dante Paz <dpaz@unc.edu.ar> > > > > But it raised a few comments. > > > > The staging/fbtft is a dumping of a set of drivers that > > in the end will be migrated to DRM. > > And there is not much gained trying to do coding style changes to these > > drivers. > > So please conmsider finding a drver where this is more relevant. > > Sam, Why is this driver still here? I thought we migrated everyhing to tinydrm already. Maybe there's a list of panels still not migrated? Thanks, Eze ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] FBTFT: fbtft-bus: Fix code style problems @ 2019-03-11 21:15 ` Ezequiel Garcia 0 siblings, 0 replies; 19+ messages in thread From: Ezequiel Garcia @ 2019-03-11 21:15 UTC (permalink / raw) To: DANTE JAVIER PAZ Cc: devel, leobras.c, linux-fbdev, nishadkamdar, Greg KH, Dante Paz, dri-devel, renatoys08, Sam Ravnborg Hi everyone, Dante: please avoid top-posting. In other words, put your replies in-line, like I'm gonna do now. See below (and see how discussion goes on other threads). On Mon, 11 Mar 2019 at 17:34, DANTE JAVIER PAZ <dpaz@unc.edu.ar> wrote: > > Hello Sam, thank you very much for your comments, > As I told Dan (my email did not reach the mailing list) this is my > first attempt to contribute, > So I'm learning a lot from your advice and corrections. > > I will look for TODO lists to see if there are more useful > contributions to make, all suggestions are also welcome. > > Thanks again for the patience of all of you. > Best, > Dante > > > El lun., 11 mar. 2019 a las 13:25, Sam Ravnborg (<sam@ravnborg.org>) escribió: > > > > Hi Dante > > > > Thanks for the patch. > > On Sat, Mar 09, 2019 at 06:48:52PM -0300, Dante Paz wrote: > > > From: Dante Paz <dpaz@unc.edu.ar> > > > > > > Style and coding function issues were corrected, by avoiding macro functions with a conflicting coding style. > > > Signed-off-by: Dante Paz <dpaz@unc.edu.ar> > > > > But it raised a few comments. > > > > The staging/fbtft is a dumping of a set of drivers that > > in the end will be migrated to DRM. > > And there is not much gained trying to do coding style changes to these > > drivers. > > So please conmsider finding a drver where this is more relevant. > > Sam, Why is this driver still here? I thought we migrated everyhing to tinydrm already. Maybe there's a list of panels still not migrated? Thanks, Eze _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] FBTFT: fbtft-bus: Fix code style problems 2019-03-11 21:15 ` Ezequiel Garcia @ 2019-03-11 21:40 ` Sam Ravnborg -1 siblings, 0 replies; 19+ messages in thread From: Sam Ravnborg @ 2019-03-11 21:40 UTC (permalink / raw) To: Ezequiel Garcia Cc: devel, DANTE JAVIER PAZ, linux-fbdev, nishadkamdar, leobras.c, Greg KH, Dante Paz, dri-devel, renatoys08 Hi Eze > > Why is this driver still here? I thought we migrated everyhing to > tinydrm already. Some have been ported, some are waiting for a user to do the port. If you looks at tinydrm you will see: ili9225.c ili9341.c And we also have under panel: panel-ilitek-ili9881c.c panel-ilitek-ili9322.c But in staging there are more panels than just these. So we have not yet ported all. And there is today no list of what is missing. Sam ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] FBTFT: fbtft-bus: Fix code style problems @ 2019-03-11 21:40 ` Sam Ravnborg 0 siblings, 0 replies; 19+ messages in thread From: Sam Ravnborg @ 2019-03-11 21:40 UTC (permalink / raw) To: Ezequiel Garcia Cc: devel, DANTE JAVIER PAZ, linux-fbdev, nishadkamdar, leobras.c, Greg KH, Dante Paz, dri-devel, renatoys08 Hi Eze > > Why is this driver still here? I thought we migrated everyhing to > tinydrm already. Some have been ported, some are waiting for a user to do the port. If you looks at tinydrm you will see: ili9225.c ili9341.c And we also have under panel: panel-ilitek-ili9881c.c panel-ilitek-ili9322.c But in staging there are more panels than just these. So we have not yet ported all. And there is today no list of what is missing. Sam _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] FBTFT: fbtft-bus: Fix code style problems 2019-03-11 21:40 ` Sam Ravnborg @ 2019-03-11 21:43 ` Ezequiel Garcia -1 siblings, 0 replies; 19+ messages in thread From: Ezequiel Garcia @ 2019-03-11 21:43 UTC (permalink / raw) To: Sam Ravnborg Cc: devel, DANTE JAVIER PAZ, linux-fbdev, nishadkamdar, leobras.c, Greg KH, Dante Paz, dri-devel, renatoys08 On Mon, 11 Mar 2019 at 18:40, Sam Ravnborg <sam@ravnborg.org> wrote: > > Hi Eze > > > > Why is this driver still here? I thought we migrated everyhing to > > tinydrm already. > Some have been ported, some are waiting for a user to do the port. > If you looks at tinydrm you will see: > ili9225.c ili9341.c > > And we also have under panel: > panel-ilitek-ili9881c.c > panel-ilitek-ili9322.c > > But in staging there are more panels than just these. > > So we have not yet ported all. > And there is today no list of what is missing. > Right. Perhaps the TODO file on fbtft should be updated stating clearly that we don't care about cleaning this one. This is important given staging is used for Outreachy and other introductory programs. We can also add some big fat warning message (in case there isn't one already) asking users of staging/fbtft to help porting/testing the port to tinydrm. Thanks, Eze ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] FBTFT: fbtft-bus: Fix code style problems @ 2019-03-11 21:43 ` Ezequiel Garcia 0 siblings, 0 replies; 19+ messages in thread From: Ezequiel Garcia @ 2019-03-11 21:43 UTC (permalink / raw) To: Sam Ravnborg Cc: devel, DANTE JAVIER PAZ, linux-fbdev, nishadkamdar, leobras.c, Greg KH, Dante Paz, dri-devel, renatoys08 On Mon, 11 Mar 2019 at 18:40, Sam Ravnborg <sam@ravnborg.org> wrote: > > Hi Eze > > > > Why is this driver still here? I thought we migrated everyhing to > > tinydrm already. > Some have been ported, some are waiting for a user to do the port. > If you looks at tinydrm you will see: > ili9225.c ili9341.c > > And we also have under panel: > panel-ilitek-ili9881c.c > panel-ilitek-ili9322.c > > But in staging there are more panels than just these. > > So we have not yet ported all. > And there is today no list of what is missing. > Right. Perhaps the TODO file on fbtft should be updated stating clearly that we don't care about cleaning this one. This is important given staging is used for Outreachy and other introductory programs. We can also add some big fat warning message (in case there isn't one already) asking users of staging/fbtft to help porting/testing the port to tinydrm. Thanks, Eze _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] FBTFT: fbtft-bus: Fix code style problems 2019-03-11 20:32 ` DANTE JAVIER PAZ @ 2019-03-11 21:42 ` Sam Ravnborg -1 siblings, 0 replies; 19+ messages in thread From: Sam Ravnborg @ 2019-03-11 21:42 UTC (permalink / raw) To: DANTE JAVIER PAZ Cc: devel, leobras.c, linux-fbdev, nishadkamdar, gregkh, Dante Paz, dri-devel, renatoys08 Hi Dante. > Hello Sam, thank you very much for your comments, > As I told Dan (my email did not reach the mailing list) this is my > first attempt to contribute, > So I'm learning a lot from your advice and corrections. > > I will look for TODO lists to see if there are more useful > contributions to make, all suggestions are also welcome. Keep the good spirit, and find some other driver to look into. You must realise than experienced developers sometimes goes through several version before a patch is ready. So expect it to be a bumpy ride the first few times. Good luck! Sam ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] FBTFT: fbtft-bus: Fix code style problems @ 2019-03-11 21:42 ` Sam Ravnborg 0 siblings, 0 replies; 19+ messages in thread From: Sam Ravnborg @ 2019-03-11 21:42 UTC (permalink / raw) To: DANTE JAVIER PAZ Cc: devel, leobras.c, linux-fbdev, nishadkamdar, gregkh, Dante Paz, dri-devel, renatoys08 Hi Dante. > Hello Sam, thank you very much for your comments, > As I told Dan (my email did not reach the mailing list) this is my > first attempt to contribute, > So I'm learning a lot from your advice and corrections. > > I will look for TODO lists to see if there are more useful > contributions to make, all suggestions are also welcome. Keep the good spirit, and find some other driver to look into. You must realise than experienced developers sometimes goes through several version before a patch is ready. So expect it to be a bumpy ride the first few times. Good luck! Sam _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2019-03-11 21:43 UTC | newest] Thread overview: 19+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-03-09 21:48 [PATCH] FBTFT: fbtft-bus: Fix code style problems Dante Paz 2019-03-09 21:48 ` Dante Paz 2019-03-11 8:11 ` Dan Carpenter 2019-03-11 8:11 ` Dan Carpenter 2019-03-11 8:18 ` Dan Carpenter 2019-03-11 8:18 ` Dan Carpenter 2019-03-11 14:06 ` DANTE JAVIER PAZ 2019-03-11 16:25 ` Sam Ravnborg 2019-03-11 16:25 ` Sam Ravnborg 2019-03-11 20:32 ` DANTE JAVIER PAZ 2019-03-11 20:32 ` DANTE JAVIER PAZ 2019-03-11 21:15 ` Ezequiel Garcia 2019-03-11 21:15 ` Ezequiel Garcia 2019-03-11 21:40 ` Sam Ravnborg 2019-03-11 21:40 ` Sam Ravnborg 2019-03-11 21:43 ` Ezequiel Garcia 2019-03-11 21:43 ` Ezequiel Garcia 2019-03-11 21:42 ` Sam Ravnborg 2019-03-11 21:42 ` Sam Ravnborg
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.