[2/2] drm/panel: Enable DSI transactions on the RPi panel.
diff mbox

Message ID 20171031193258.17373-2-eric@anholt.net
State New
Headers show

Commit Message

Eric Anholt Oct. 31, 2017, 7:32 p.m. UTC
It turns out that I had just mistaken what type of write the register
writes were supposed to be, using DCS instead of generic long writes.

Switching to transactions instead of using the atmel as a bridge also
seems to resolve the sparkling pixels problem I've had.

Signed-off-by: Eric Anholt <eric@anholt.net>
Fixes: 2f733d6194bd ("drm/panel: Add support for the Raspberry Pi 7" Touchscreen.")
---
 drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

Comments

Boris Brezillon April 30, 2018, 9:04 a.m. UTC | #1
On Tue, 31 Oct 2017 12:32:58 -0700
Eric Anholt <eric@anholt.net> wrote:

> It turns out that I had just mistaken what type of write the register
> writes were supposed to be, using DCS instead of generic long writes.
> 
> Switching to transactions instead of using the atmel as a bridge also
> seems to resolve the sparkling pixels problem I've had.
> 
> Signed-off-by: Eric Anholt <eric@anholt.net>
> Fixes: 2f733d6194bd ("drm/panel: Add support for the Raspberry Pi 7" Touchscreen.")

Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>

> ---
>  drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 14 +-------------
>  1 file changed, 1 insertion(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> index d964d454e4ae..2c9c9722734f 100644
> --- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> +++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> @@ -238,12 +238,6 @@ static void rpi_touchscreen_i2c_write(struct rpi_touchscreen *ts,
>  
>  static int rpi_touchscreen_write(struct rpi_touchscreen *ts, u16 reg, u32 val)
>  {
> -#if 0
> -	/* The firmware uses LP DSI transactions like this to bring up
> -	 * the hardware, which should be faster than using I2C to then
> -	 * pass to the Toshiba.  However, I was unable to get it to
> -	 * work.
> -	 */
>  	u8 msg[] = {
>  		reg,
>  		reg >> 8,
> @@ -253,13 +247,7 @@ static int rpi_touchscreen_write(struct rpi_touchscreen *ts, u16 reg, u32 val)
>  		val >> 24,
>  	};
>  
> -	mipi_dsi_dcs_write_buffer(ts->dsi, msg, sizeof(msg));
> -#else
> -	rpi_touchscreen_i2c_write(ts, REG_WR_ADDRH, reg >> 8);
> -	rpi_touchscreen_i2c_write(ts, REG_WR_ADDRL, reg);
> -	rpi_touchscreen_i2c_write(ts, REG_WRITEH, val >> 8);
> -	rpi_touchscreen_i2c_write(ts, REG_WRITEL, val);
> -#endif
> +	mipi_dsi_generic_write(ts->dsi, msg, sizeof(msg));
>  
>  	return 0;
>  }
Thierry Reding April 30, 2018, 9:27 a.m. UTC | #2
On Tue, Oct 31, 2017 at 12:32:58PM -0700, Eric Anholt wrote:
> It turns out that I had just mistaken what type of write the register
> writes were supposed to be, using DCS instead of generic long writes.
> 
> Switching to transactions instead of using the atmel as a bridge also
> seems to resolve the sparkling pixels problem I've had.
> 
> Signed-off-by: Eric Anholt <eric@anholt.net>
> Fixes: 2f733d6194bd ("drm/panel: Add support for the Raspberry Pi 7" Touchscreen.")
> ---
>  drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 14 +-------------
>  1 file changed, 1 insertion(+), 13 deletions(-)

Did you want to take this along with patch 1 through drm-misc-next? If
so:

Acked-by: Thierry Reding <treding@nvidia.com>
Eric Anholt April 30, 2018, 9:04 p.m. UTC | #3
Thierry Reding <thierry.reding@gmail.com> writes:

> [ Unknown signature status ]
> On Tue, Oct 31, 2017 at 12:32:58PM -0700, Eric Anholt wrote:
>> It turns out that I had just mistaken what type of write the register
>> writes were supposed to be, using DCS instead of generic long writes.
>> 
>> Switching to transactions instead of using the atmel as a bridge also
>> seems to resolve the sparkling pixels problem I've had.
>> 
>> Signed-off-by: Eric Anholt <eric@anholt.net>
>> Fixes: 2f733d6194bd ("drm/panel: Add support for the Raspberry Pi 7" Touchscreen.")
>> ---
>>  drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 14 +-------------
>>  1 file changed, 1 insertion(+), 13 deletions(-)
>
> Did you want to take this along with patch 1 through drm-misc-next? If
> so:
>
> Acked-by: Thierry Reding <treding@nvidia.com>

I've pushed both to drm-misc-next.  Thanks!

Patch
diff mbox

diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
index d964d454e4ae..2c9c9722734f 100644
--- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
+++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
@@ -238,12 +238,6 @@  static void rpi_touchscreen_i2c_write(struct rpi_touchscreen *ts,
 
 static int rpi_touchscreen_write(struct rpi_touchscreen *ts, u16 reg, u32 val)
 {
-#if 0
-	/* The firmware uses LP DSI transactions like this to bring up
-	 * the hardware, which should be faster than using I2C to then
-	 * pass to the Toshiba.  However, I was unable to get it to
-	 * work.
-	 */
 	u8 msg[] = {
 		reg,
 		reg >> 8,
@@ -253,13 +247,7 @@  static int rpi_touchscreen_write(struct rpi_touchscreen *ts, u16 reg, u32 val)
 		val >> 24,
 	};
 
-	mipi_dsi_dcs_write_buffer(ts->dsi, msg, sizeof(msg));
-#else
-	rpi_touchscreen_i2c_write(ts, REG_WR_ADDRH, reg >> 8);
-	rpi_touchscreen_i2c_write(ts, REG_WR_ADDRL, reg);
-	rpi_touchscreen_i2c_write(ts, REG_WRITEH, val >> 8);
-	rpi_touchscreen_i2c_write(ts, REG_WRITEL, val);
-#endif
+	mipi_dsi_generic_write(ts->dsi, msg, sizeof(msg));
 
 	return 0;
 }