Staging: fbtft: Fix wrong check in fbtft_write_wmem16_bus8()
Subsystems (3)
PATCH 1/1 Staging: fbtft: Fix wrong check in fbtft_write_wmem16_bus8()
We actually want to set the gpio pin if it's avilable, not the other way around.
--- drivers/staging/fbtft/fbtft-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/fbtft/fbtft-bus.c +1 -1
@@ -135,7 +135,7 @@ int fbtft_write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len) remain = len /2 ; vmem16 = (u16 *)(par->info->screen_buffer + offset); -if (!par->gpio.dc) +if (par->gpio.dc)gpiod_set_value (par->gpio.dc,1 );/* non buffered write */
Signature · 1 line
2.22.0
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH] Staging: fbtft: Fix wrong check in,fbtft_write_wmem16_bus8()
Coincidentially, I've worked on the exact same issue this weekend. I can confirm this change is necessary, and with this and the other two patches from Phil Reid the driver works again. The same mistake occurred in several other locations, though. I'll send a patch fixing all of them.
I've tested this on a ili9486-based display connected to a raspberry pi 3b+.
Regards, Jan
Quoted 25 lines · On Mon, 15 Jul 2019 Nicolas Saenz Julienne wrote:
We actually want to set the gpio pin if it's avilable, not the other way around.
Fixes c440eee1a7a1 ("Staging: fbtft: Switch to the gpio descriptorinterface")
Signed-off-by Nicolas Saenz Julienne <[email protected]>--- drivers/staging/fbtft/fbtft-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/fbtft/fbtft-bus.c +1
-1@@ -135,7 +135,7 @@ int fbtft_write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len) remain = len /2 ; vmem16 = (u16 *)(par->info->screen_buffer + offset); - if (!par->gpio.dc) +if (par->gpio.dc)gpiod_set_value (par->gpio.dc,1 );/* non buffered write */ --2.22.0
PATCH 1/1 Staging: fbtft: Fix GPIO handling
Commit c440eee1a7a1 ("Staging: fbtft: Switch to the gpio descriptor interface") breaks GPIO handling. In several places, checks to only set a GPIO if it was configured ended up backwards.
I have tested this fix. The fixed driver works with a ili9486 display connected to a raspberry pi via SPI.
--- drivers/staging/fbtft/fb_bd663474.c | 2 +- drivers/staging/fbtft/fb_ili9163.c | 2 +- drivers/staging/fbtft/fb_ili9325.c | 2 +- drivers/staging/fbtft/fb_s6d1121.c | 2 +- drivers/staging/fbtft/fb_ssd1289.c | 2 +- drivers/staging/fbtft/fb_ssd1331.c | 4 ++-- drivers/staging/fbtft/fb_upd161704.c | 2 +- drivers/staging/fbtft/fbtft-bus.c | 2 +- drivers/staging/fbtft/fbtft-core.c | 4 ++-- 9 files changed, 11 insertions(+), 11 deletions(-)
drivers/staging/fbtft/fb_bd663474.c +1 -1
@@ -24,7 +24,7 @@static int init_display (struct fbtft_par *par) { -if (!par->gpio.cs) +if (par->gpio.cs)gpiod_set_value (par->gpio.cs,0 );/* Activate chip */ par->fbtftops.reset (par);
drivers/staging/fbtft/fb_ili9163.c +1 -1
@@ -77,7 +77,7 @@ static int init_display(struct fbtft_par *par) { par->fbtftops.reset (par); -if (!par->gpio.cs) +if (par->gpio.cs)gpiod_set_value (par->gpio.cs,0 );/* Activate chip */ write_reg (par,MIPI_DCS_SOFT_RESET );/* software reset */
drivers/staging/fbtft/fb_ili9325.c +1 -1
@@ -85,7 +85,7 @@ static int init_display(struct fbtft_par *par) { par->fbtftops.reset (par); -if (!par->gpio.cs) +if (par->gpio.cs)gpiod_set_value (par->gpio.cs,0 );/* Activate chip */ bt &=0x07 ;
drivers/staging/fbtft/fb_s6d1121.c +1 -1
@@ -29,7 +29,7 @@ static int init_display(struct fbtft_par *par) { par->fbtftops.reset (par); -if (!par->gpio.cs) +if (par->gpio.cs)gpiod_set_value (par->gpio.cs,0 );/* Activate chip */ /* Initialization sequence from Lib_UTFT */
drivers/staging/fbtft/fb_ssd1289.c +1 -1
@@ -28,7 +28,7 @@ static int init_display(struct fbtft_par *par) { par->fbtftops.reset (par); -if (!par->gpio.cs) +if (par->gpio.cs)gpiod_set_value (par->gpio.cs,0 );/* Activate chip */ write_reg (par,0x00 ,0x0001 );
drivers/staging/fbtft/fb_ssd1331.c +2 -2
@@ -81,7 +81,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)va_start (args, len); *buf = (u8)va_arg(args, unsigned int); -if (!par->gpio.dc) +if (par->gpio.dc)gpiod_set_value (par->gpio.dc,0 ); ret = par->fbtftops.write (par, par->buf,sizeof (u8));if (ret <0 ) {
@@ -104,7 +104,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)return ; } } -if (!par->gpio.dc) +if (par->gpio.dc)gpiod_set_value (par->gpio.dc,1 );va_end (args); }
drivers/staging/fbtft/fb_upd161704.c +1 -1
@@ -26,7 +26,7 @@ static int init_display(struct fbtft_par *par) { par->fbtftops.reset (par); -if (!par->gpio.cs) +if (par->gpio.cs)gpiod_set_value (par->gpio.cs,0 );/* Activate chip */ /* Initialization sequence from Lib_UTFT */
drivers/staging/fbtft/fbtft-bus.c +1 -1
@@ -135,7 +135,7 @@ int fbtft_write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len) remain = len /2 ; vmem16 = (u16 *)(par->info->screen_buffer + offset); -if (!par->gpio.dc) +if (par->gpio.dc)gpiod_set_value (par->gpio.dc,1 );/* non buffered write */
drivers/staging/fbtft/fbtft-core.c +2 -2
@@ -916,7 +916,7 @@ static int fbtft_init_display_dt(struct fbtft_par *par)return -EINVAL ; par->fbtftops.reset (par); -if (!par->gpio.cs) +if (par->gpio.cs)gpiod_set_value (par->gpio.cs,0 );/* Activate chip */ while (p) {
@@ -1007,7 +1007,7 @@ int fbtft_init_display(struct fbtft_par *par) } par->fbtftops.reset (par); -if (!par->gpio.cs) +if (par->gpio.cs)gpiod_set_value (par->gpio.cs,0 );/* Activate chip */ i =0 ;
Signature · 1 line
2.21.0
Re: [PATCH] Staging: fbtft: Fix GPIO handling
Quoted 10 lines · Jan Sebastian Götte
Commit
c440eee1a7a1("Staging: fbtft: Switch to the gpio descriptor interface") breaks GPIO handling. In several places, checks to only set a GPIO if it was configured ended up backwards.
I have tested this fix. The fixed driver works with a ili9486 display connected to a raspberry pi via SPI.Fixes commit c440eee1a7a1d ("Staging: fbtft: Switch to the gpio descriptorinterface")
Tested-by Jan Sebastian Götte <[email protected]>Signed-off-by Jan Sebastian Götte <[email protected]>
Thanks Jan, this version is indeed more complete.
Regards,
Nicolas
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
PATCH v2 1/1 Staging: fbtft: Fix GPIO handling
In reply to Jan Sebastian GötteCommit c440eee1a7a1 ("Staging: fbtft: Switch to the gpio descriptor interface") breaks GPIO handling. In several places, checks to only set a GPIO if it was configured ended up backwards.
I have tested this fix. The fixed driver works with a ili9486 display connected to a raspberry pi via SPI.
--- drivers/staging/fbtft/fb_bd663474.c | 2 +- drivers/staging/fbtft/fb_ili9163.c | 2 +- drivers/staging/fbtft/fb_ili9325.c | 2 +- drivers/staging/fbtft/fb_s6d1121.c | 2 +- drivers/staging/fbtft/fb_ssd1289.c | 2 +- drivers/staging/fbtft/fb_ssd1331.c | 4 ++-- drivers/staging/fbtft/fb_upd161704.c | 2 +- drivers/staging/fbtft/fbtft-bus.c | 2 +- drivers/staging/fbtft/fbtft-core.c | 4 ++-- 9 files changed, 11 insertions(+), 11 deletions(-)
drivers/staging/fbtft/fb_bd663474.c +1 -1
@@ -24,7 +24,7 @@static int init_display (struct fbtft_par *par) { -if (!par->gpio.cs) +if (par->gpio.cs)gpiod_set_value (par->gpio.cs,0 );/* Activate chip */ par->fbtftops.reset (par);
drivers/staging/fbtft/fb_ili9163.c +1 -1
@@ -77,7 +77,7 @@ static int init_display(struct fbtft_par *par) { par->fbtftops.reset (par); -if (!par->gpio.cs) +if (par->gpio.cs)gpiod_set_value (par->gpio.cs,0 );/* Activate chip */ write_reg (par,MIPI_DCS_SOFT_RESET );/* software reset */
drivers/staging/fbtft/fb_ili9325.c +1 -1
@@ -85,7 +85,7 @@ static int init_display(struct fbtft_par *par) { par->fbtftops.reset (par); -if (!par->gpio.cs) +if (par->gpio.cs)gpiod_set_value (par->gpio.cs,0 );/* Activate chip */ bt &=0x07 ;
drivers/staging/fbtft/fb_s6d1121.c +1 -1
@@ -29,7 +29,7 @@ static int init_display(struct fbtft_par *par) { par->fbtftops.reset (par); -if (!par->gpio.cs) +if (par->gpio.cs)gpiod_set_value (par->gpio.cs,0 );/* Activate chip */ /* Initialization sequence from Lib_UTFT */
drivers/staging/fbtft/fb_ssd1289.c +1 -1
@@ -28,7 +28,7 @@ static int init_display(struct fbtft_par *par) { par->fbtftops.reset (par); -if (!par->gpio.cs) +if (par->gpio.cs)gpiod_set_value (par->gpio.cs,0 );/* Activate chip */ write_reg (par,0x00 ,0x0001 );
drivers/staging/fbtft/fb_ssd1331.c +2 -2
@@ -81,7 +81,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)va_start (args, len); *buf = (u8)va_arg(args, unsigned int); -if (!par->gpio.dc) +if (par->gpio.dc)gpiod_set_value (par->gpio.dc,0 ); ret = par->fbtftops.write (par, par->buf,sizeof (u8));if (ret <0 ) {
@@ -104,7 +104,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)return ; } } -if (!par->gpio.dc) +if (par->gpio.dc)gpiod_set_value (par->gpio.dc,1 );va_end (args); }
drivers/staging/fbtft/fb_upd161704.c +1 -1
@@ -26,7 +26,7 @@ static int init_display(struct fbtft_par *par) { par->fbtftops.reset (par); -if (!par->gpio.cs) +if (par->gpio.cs)gpiod_set_value (par->gpio.cs,0 );/* Activate chip */ /* Initialization sequence from Lib_UTFT */
drivers/staging/fbtft/fbtft-bus.c +1 -1
@@ -135,7 +135,7 @@ int fbtft_write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len) remain = len /2 ; vmem16 = (u16 *)(par->info->screen_buffer + offset); -if (!par->gpio.dc) +if (par->gpio.dc)gpiod_set_value (par->gpio.dc,1 );/* non buffered write */
drivers/staging/fbtft/fbtft-core.c +2 -2
@@ -916,7 +916,7 @@ static int fbtft_init_display_dt(struct fbtft_par *par)return -EINVAL ; par->fbtftops.reset (par); -if (!par->gpio.cs) +if (par->gpio.cs)gpiod_set_value (par->gpio.cs,0 );/* Activate chip */ while (p) {
@@ -1007,7 +1007,7 @@ int fbtft_init_display(struct fbtft_par *par) } par->fbtftops.reset (par); -if (!par->gpio.cs) +if (par->gpio.cs)gpiod_set_value (par->gpio.cs,0 );/* Activate chip */ i =0 ;
Signature · 1 line
2.21.0
Greg KH
maintainerRe: [PATCH v2] Staging: fbtft: Fix GPIO handling
Quoted 11 lines · Jan Sebastian Götte
Commit
c440eee1a7a1("Staging: fbtft: Switch to the gpio descriptor interface") breaks GPIO handling. In several places, checks to only set a GPIO if it was configured ended up backwards.
I have tested this fix. The fixed driver works with a ili9486 display connected to a raspberry pi via SPI.Fixes commit c440eee1a7a1d ("Staging: fbtft: Switch to the gpio descriptor interface")Tested-by Jan Sebastian Götte <[email protected]>Reviewed-by Nicolas Saenz Julienne <[email protected]>Signed-off-by Jan Sebastian Götte <[email protected]>---
Can this go on top of Phil's patches? Or does it replace it?
I can't figure out what to do here, sorry.
thanks,
greg k-h
Re: [PATCH v2] Staging: fbtft: Fix GPIO handling
Quoted 7 lines · Greg KH
Quoted 6 lines · Jan Sebastian Götte
Commit
c440eee1a7a1("Staging: fbtft: Switch to the gpio descriptor interface") breaks GPIO handling. In several places, checks to only set a GPIO if it was configured ended up backwards.
I have tested this fix. The fixed driver works with a ili9486 display connected to a raspberry pi via SPI.
Quoted 8 lines
Quoted 6 lines
Fixes commit c440eee1a7a1d ("Staging: fbtft: Switch to the gpio descriptorinterface")
Tested-by Jan Sebastian Götte <[email protected]>Reviewed-by Nicolas Saenz Julienne <[email protected]>Signed-off-by Jan Sebastian Götte <[email protected]>---
Can this go on top of Phil's patches? Or does it replace it?
This is needed on top of Phil patches.
Regards,
Nicolas
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel