Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1562597 > unrolled thread

[PATCH v4 0/5] fbtft: make it work with DMA enabled SPI

Started byAndy Shevchenko <andriy.shevchenko@linux.intel.com>
First post2017-01-19 11:50 +0100
Last post2017-01-19 12:30 +0100
Articles 3 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH v4 0/5] fbtft: make it work with DMA enabled SPI Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-01-19 11:50 +0100
    [PATCH v4 3/5] staging: fbtft: propagate error code from kstrto*() Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-01-19 12:00 +0100
    [PATCH v4 5/5] staging: fbtft: fb_ssd1306: Refactor write_vmem() Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-01-19 12:30 +0100

#1562597 — [PATCH v4 0/5] fbtft: make it work with DMA enabled SPI

FromAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Date2017-01-19 11:50 +0100
Subject[PATCH v4 0/5] fbtft: make it work with DMA enabled SPI
Message-ID<t1is2-qM-11@gated-at.bofh.it>
This series enables 64x48 OLED display and fixes the driver to work with DMA
enabled SPI properly.

Has been tested on Intel Edison board with Adafruit 2'8" and SSD1306 64x48
(Sparkfun for Intel Edison) OLED displays at their maximum speed (25MHz and
10MHz).

Since v3:
- add Noralf's ACKs
- rebased on top of v4.10-rc4

Since v2:
- fix kbuild bot warning
- remove duplication of might_sleep() (Noralf)
- re-do DMA appoach based on Noralf's suggestion
- append Noralf's tags

Andy Shevchenko (5):
  staging: fbtft: convert fbtft_reset() to be non-atomic
  staging: fbtft: remove custom DMA mapped buffer
  staging: fbtft: propagate error code from kstrto*()
  staging: fbtft: fb_ssd1306: Support smaller screen sizes
  staging: fbtft: fb_ssd1306: Refactor write_vmem()

 drivers/staging/fbtft/fb_ra8875.c   |  4 ----
 drivers/staging/fbtft/fb_ssd1306.c  | 37 ++++++++++++++++++++++++++++---------
 drivers/staging/fbtft/fbtft-core.c  | 30 ++++++------------------------
 drivers/staging/fbtft/fbtft-io.c    |  4 ----
 drivers/staging/fbtft/fbtft-sysfs.c |  7 +------
 drivers/staging/fbtft/fbtft.h       |  1 -
 6 files changed, 35 insertions(+), 48 deletions(-)

-- 
2.11.0

[toc] | [next] | [standalone]


#1562603 — [PATCH v4 3/5] staging: fbtft: propagate error code from kstrto*()

FromAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Date2017-01-19 12:00 +0100
Subject[PATCH v4 3/5] staging: fbtft: propagate error code from kstrto*()
Message-ID<t1iBI-uk-9@gated-at.bofh.it>
In reply to#1562597
kstrto*() functions return proper error code.

Do propogate it to the user.

Acked-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/staging/fbtft/fbtft-sysfs.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft-sysfs.c b/drivers/staging/fbtft/fbtft-sysfs.c
index 8d8bd12b90a1..5922f1b6d8d6 100644
--- a/drivers/staging/fbtft/fbtft-sysfs.c
+++ b/drivers/staging/fbtft/fbtft-sysfs.c
@@ -4,7 +4,6 @@
 static int get_next_ulong(char **str_p, unsigned long *val, char *sep, int base)
 {
 	char *p_val;
-	int ret;
 
 	if (!str_p || !(*str_p))
 		return -EINVAL;
@@ -14,11 +13,7 @@ static int get_next_ulong(char **str_p, unsigned long *val, char *sep, int base)
 	if (!p_val)
 		return -EINVAL;
 
-	ret = kstrtoul(p_val, base, val);
-	if (ret)
-		return -EINVAL;
-
-	return 0;
+	return kstrtoul(p_val, base, val);
 }
 
 int fbtft_gamma_parse_str(struct fbtft_par *par, unsigned long *curves,
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1562628 — [PATCH v4 5/5] staging: fbtft: fb_ssd1306: Refactor write_vmem()

FromAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Date2017-01-19 12:30 +0100
Subject[PATCH v4 5/5] staging: fbtft: fb_ssd1306: Refactor write_vmem()
Message-ID<t1j4K-TE-3@gated-at.bofh.it>
In reply to#1562597
Refactor write_vmem() for sake of readability.

While here, fix indentation in one comment.

Acked-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/staging/fbtft/fb_ssd1306.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/fbtft/fb_ssd1306.c b/drivers/staging/fbtft/fb_ssd1306.c
index bede2d5a5571..76f7da3c7703 100644
--- a/drivers/staging/fbtft/fb_ssd1306.c
+++ b/drivers/staging/fbtft/fb_ssd1306.c
@@ -84,7 +84,7 @@ static int init_display(struct fbtft_par *par)
 	/* Vertical addressing mode  */
 	write_reg(par, 0x01);
 
-	/*Set Segment Re-map */
+	/* Set Segment Re-map */
 	/* column address 127 is mapped to SEG0 */
 	write_reg(par, 0xA0 | 0x1);
 
@@ -183,26 +183,24 @@ static int set_gamma(struct fbtft_par *par, unsigned long *curves)
 static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
 {
 	u16 *vmem16 = (u16 *)par->info->screen_buffer;
+	u32 xres = par->info->var.xres;
+	u32 yres = par->info->var.yres;
 	u8 *buf = par->txbuf.buf;
 	int x, y, i;
 	int ret = 0;
 
-	for (x = 0; x < par->info->var.xres; x++) {
-		for (y = 0; y < par->info->var.yres/8; y++) {
+	for (x = 0; x < xres; x++) {
+		for (y = 0; y < yres / 8; y++) {
 			*buf = 0x00;
 			for (i = 0; i < 8; i++)
-				*buf |= (vmem16[(y * 8 + i) *
-						par->info->var.xres + x] ?
-					 1 : 0) << i;
+				*buf |= (vmem16[(y * 8 + i) * xres + x] ? 1 : 0) << i;
 			buf++;
 		}
 	}
 
 	/* Write data */
 	gpio_set_value(par->gpio.dc, 1);
-	ret = par->fbtftops.write(par, par->txbuf.buf,
-				  par->info->var.xres * par->info->var.yres /
-				  8);
+	ret = par->fbtftops.write(par, par->txbuf.buf, xres * yres / 8);
 	if (ret < 0)
 		dev_err(par->info->device, "write failed and returned: %d\n",
 			ret);
-- 
2.11.0

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web