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


Groups > linux.kernel > #1550084 > unrolled thread

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

Started byAndy Shevchenko <andriy.shevchenko@linux.intel.com>
First post2017-01-03 19:40 +0100
Last post2017-01-11 17:20 +0100
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v3 0/5] fbtft: make it work with DMA enabled SPI Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-01-03 19:40 +0100
    [PATCH v3 5/5] staging: fbtft: fb_ssd1306: Refactor write_vmem() Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-01-03 19:40 +0100
    Re: [PATCH v3 0/5] fbtft: make it work with DMA enabled SPI Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-01-11 15:50 +0100
      Re: [PATCH v3 0/5] fbtft: make it work with DMA enabled SPI Noralf Trønnes <noralf@tronnes.org> - 2017-01-11 17:20 +0100

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

FromAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Date2017-01-03 19:40 +0100
Subject[PATCH v3 0/5] fbtft: make it work with DMA enabled SPI
Message-ID<sVCa6-1SP-7@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 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]


#1550085 — [PATCH v3 5/5] staging: fbtft: fb_ssd1306: Refactor write_vmem()

FromAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Date2017-01-03 19:40 +0100
Subject[PATCH v3 5/5] staging: fbtft: fb_ssd1306: Refactor write_vmem()
Message-ID<sVCa7-1SP-61@gated-at.bofh.it>
In reply to#1550084
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] | [next] | [standalone]


#1556554

FromAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Date2017-01-11 15:50 +0100
Message-ID<sYsnU-86a-45@gated-at.bofh.it>
In reply to#1550084
On Tue, 2017-01-03 at 20:29 +0200, Andy Shevchenko wrote:
> 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).

Noralf, are you okay with this version of series?

> 
> 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(-)
> 

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

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


#1556672

FromNoralf Trønnes <noralf@tronnes.org>
Date2017-01-11 17:20 +0100
Message-ID<sYtMZ-Fd-5@gated-at.bofh.it>
In reply to#1556554
Den 11.01.2017 15:43, skrev Andy Shevchenko:
> On Tue, 2017-01-03 at 20:29 +0200, Andy Shevchenko wrote:
>> 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).
> Noralf, are you okay with this version of series?

Yes, Greg applies them without my ack, unless it touches core stuff.

Series:
Acked-by: Noralf Trønnes <noralf@tronnes.org>


>> 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(-)
>>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web