Re: [PATCH v2] drm/panel: elida-kd35t133: transition to mipi_dsi wrapped functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 9/25/24 1:25 AM, Doug Anderson wrote:
> Hi,
> 
> On Mon, Sep 23, 2024 at 5:33 AM Tejas Vipin <tejasvipin76@xxxxxxxxx> wrote:
>>
>> -static int kd35t133_init_sequence(struct kd35t133 *ctx)
>> +static void kd35t133_init_sequence(struct mipi_dsi_multi_context *dsi_ctx)
>>  {
>> -       struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
>> -       struct device *dev = ctx->dev;
>> -
>>         /*
>>          * Init sequence was supplied by the panel vendor with minimal
>>          * documentation.
>>          */
>> -       mipi_dsi_dcs_write_seq(dsi, KD35T133_CMD_POSITIVEGAMMA,
>> -                              0x00, 0x13, 0x18, 0x04, 0x0f, 0x06, 0x3a, 0x56,
>> -                              0x4d, 0x03, 0x0a, 0x06, 0x30, 0x3e, 0x0f);
>> -       mipi_dsi_dcs_write_seq(dsi, KD35T133_CMD_NEGATIVEGAMMA,
>> -                              0x00, 0x13, 0x18, 0x01, 0x11, 0x06, 0x38, 0x34,
>> -                              0x4d, 0x06, 0x0d, 0x0b, 0x31, 0x37, 0x0f);
>> -       mipi_dsi_dcs_write_seq(dsi, KD35T133_CMD_POWERCONTROL1, 0x18, 0x17);
>> -       mipi_dsi_dcs_write_seq(dsi, KD35T133_CMD_POWERCONTROL2, 0x41);
>> -       mipi_dsi_dcs_write_seq(dsi, KD35T133_CMD_VCOMCONTROL, 0x00, 0x1a, 0x80);
>> -       mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_SET_ADDRESS_MODE, 0x48);
>> -       mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_SET_PIXEL_FORMAT, 0x55);
>> -       mipi_dsi_dcs_write_seq(dsi, KD35T133_CMD_INTERFACEMODECTRL, 0x00);
>> -       mipi_dsi_dcs_write_seq(dsi, KD35T133_CMD_FRAMERATECTRL, 0xa0);
>> -       mipi_dsi_dcs_write_seq(dsi, KD35T133_CMD_DISPLAYINVERSIONCTRL, 0x02);
>> -       mipi_dsi_dcs_write_seq(dsi, KD35T133_CMD_DISPLAYFUNCTIONCTRL,
>> -                              0x20, 0x02);
>> -       mipi_dsi_dcs_write_seq(dsi, KD35T133_CMD_SETIMAGEFUNCTION, 0x00);
>> -       mipi_dsi_dcs_write_seq(dsi, KD35T133_CMD_ADJUSTCONTROL3,
>> -                              0xa9, 0x51, 0x2c, 0x82);
>> -       mipi_dsi_dcs_write(dsi, MIPI_DCS_ENTER_INVERT_MODE, NULL, 0);
>> -
>> -       dev_dbg(dev, "Panel init sequence done\n");
>> -       return 0;
>> +       mipi_dsi_dcs_write_seq_multi(dsi_ctx, KD35T133_CMD_POSITIVEGAMMA,
>> +                                    0x00, 0x13, 0x18, 0x04, 0x0f, 0x06, 0x3a, 0x56,
>> +                                    0x4d, 0x03, 0x0a, 0x06, 0x30, 0x3e, 0x0f);
>> +       mipi_dsi_dcs_write_seq_multi(dsi_ctx, KD35T133_CMD_NEGATIVEGAMMA,
>> +                                    0x13, 0x18, 0x01, 0x11, 0x06, 0x38, 0x34,
>> +                                    0x06, 0x0d, 0x0b, 0x31, 0x37, 0x0f);
> 
> It seems like you dropped a few bytes in the above. Was this
> intentional? You seem to have dropped the first byte from both of the
> continuation lines (0x00 from the first, 0x4d from the second).
> 
> 
>> +       mipi_dsi_dcs_write_seq_multi(dsi_ctx, KD35T133_CMD_POWERCONTROL1, 0x18, 0x17);
>> +       mipi_dsi_dcs_write_seq_multi(dsi_ctx, KD35T133_CMD_POWERCONTROL2, 0x41);
>> +       mipi_dsi_dcs_write_seq_multi(dsi_ctx, KD35T133_CMD_VCOMCONTROL, 0x00, 0x1a, 0x80);
>> +       mipi_dsi_dcs_write_seq_multi(dsi_ctx, MIPI_DCS_SET_ADDRESS_MODE, 0x48);
>> +       mipi_dsi_dcs_write_seq_multi(dsi_ctx, MIPI_DCS_SET_PIXEL_FORMAT, 0x55);
>> +       mipi_dsi_dcs_write_seq_multi(dsi_ctx, KD35T133_CMD_INTERFACEMODECTRL, 0x00);
>> +       mipi_dsi_dcs_write_seq_multi(dsi_ctx, KD35T133_CMD_FRAMERATECTRL, 0xa0);
>> +       mipi_dsi_dcs_write_seq_multi(dsi_ctx, KD35T133_CMD_DISPLAYINVERSIONCTRL, 0x02);
>> +       mipi_dsi_dcs_write_seq_multi(dsi_ctx, KD35T133_CMD_DISPLAYFUNCTIONCTRL,
>> +                                    0x02);
> 
> This used to be the bytes 0x20, 0x02. Now it's just 0x02?
> 
> 
>> +       mipi_dsi_dcs_write_seq_multi(dsi_ctx, KD35T133_CMD_SETIMAGEFUNCTION, 0x00);
>> +       mipi_dsi_dcs_write_seq_multi(dsi_ctx, KD35T133_CMD_ADJUSTCONTROL3,
>> +                                    0x51, 0x2c, 0x82);
> 
> This used to be the bytes 0xa9, 0x51, 0x2c, 0x82. Now it's just 0x51,
> 0x2c, 0x82?
>

Oh dear. No, this was not intentional. Most likely I think I wrote a vim
macro poorly.

> 
>> +       mipi_dsi_dcs_write_buffer_multi(dsi_ctx, NULL, 0);
> 
> Are you certain that the above is equivalent to the old
> "mipi_dsi_dcs_write(dsi, MIPI_DCS_ENTER_INVERT_MODE, NULL, 0);" ?
> Where is the "MIPI_DCS_ENTER_INVERT_MODE" constant?
> 
> I think the above needs to be:
> 
>   mipi_dsi_dcs_write_seq_multi(dsi_ctx, MIPI_DCS_ENTER_INVERT_MODE);
> 
> I've confirmed that this compiles OK and that there's no need to
> actually have any bytes in the sequence.
>

I'll do a v3 addressing all of this.

> 
> -Doug

-- 
Tejas Vipin



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux