[PATCH v2 4/9] drm/panel: Add driver for the LG Philips LB035Q02 panel

Noralf Trønnes noralf at tronnes.org
Sun Aug 11 14:13:54 UTC 2019


Hi Laurent,

Den 11.08.2019 15.35, skrev Laurent Pinchart:
> Hi Noralf,
> 
> On Sun, Aug 11, 2019 at 03:19:13PM +0200, Noralf Trønnes wrote:
>> Sam,
>>
>> Den 11.08.2019 01.10, skrev Laurent Pinchart:
>>> This panel is used on the Gumstix Overo Palo35.
>>>
>>> The code is based on the omapdrm-specific panel-lgphilips-lb035q02
>>> driver.
>>>
>>> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
>>> Reviewed-by: Sam Ravnborg <sam at ravnborg.org>
>>> ---
>>
>> <snip>
>>
>>> diff --git a/drivers/gpu/drm/panel/panel-lg-lb035q02.c b/drivers/gpu/drm/panel/panel-lg-lb035q02.c
>>
>> <snip>
>>
>>> +static int lb035q02_write(struct lb035q02_device *lcd, u16 reg, u16 val)
>>> +{
>>> +	struct spi_message msg;
>>> +	struct spi_transfer index_xfer = {
>>> +		.len		= 3,
>>> +		.cs_change	= 1,
>>> +	};
>>> +	struct spi_transfer value_xfer = {
>>> +		.len		= 3,
>>> +	};
>>> +	u8	buffer[16];
>>> +
>>> +	spi_message_init(&msg);
>>> +
>>> +	/* register index */
>>> +	buffer[0] = 0x70;
>>> +	buffer[1] = 0x00;
>>> +	buffer[2] = reg & 0x7f;
>>> +	index_xfer.tx_buf = buffer;
>>> +	spi_message_add_tail(&index_xfer, &msg);
>>> +
>>> +	/* register value */
>>> +	buffer[4] = 0x72;
>>> +	buffer[5] = val >> 8;
>>> +	buffer[6] = val;
>>> +	value_xfer.tx_buf = buffer + 4;
>>> +	spi_message_add_tail(&value_xfer, &msg);
>>> +
>>> +	return spi_sync(lcd->spi, &msg);
>>> +}
>>
>> Just a note to Sam:
>> This is the same spi protocol that the ili9325 controller on the hy28b
>> panel uses.
>>
>> I remembered that I have experimented with a regmap implementation:
>> https://github.com/notro/tinydrm/blob/master/tinydrm-ili9325.c#L191
> 
> That's useful information, thanks. The controller seems different
> though, the limited information available in
> https://www.beyondinfinite.com/lcd/Library/LG-Philips/LB035Q02.pdf
> doesn't match the registers from
> https://github.com/notro/tinydrm/blob/master/fb_ili9325.c.
> 

I've seen several controllers that use this protocol, and one that had a
different start byte configuration. The details unfortunately is lost in
time, it's been a while since I worked on these controllers.

Noralf.


More information about the dri-devel mailing list