[PATCH v2 4/6] drm/tinydrm/mipi-dbi: Add poweron-reset functions

David Lechner david at lechnology.com
Tue Jan 9 01:40:29 UTC 2018


On 01/08/2018 07:38 PM, David Lechner wrote:
> On 01/07/2018 11:44 AM, Noralf Trønnes wrote:
>> Split out common poweron-reset functionality.
>>
>> Signed-off-by: Noralf Trønnes <noralf at tronnes.org>
>> ---
>>   drivers/gpu/drm/tinydrm/mi0283qt.c | 20 ++----------
>>   drivers/gpu/drm/tinydrm/mipi-dbi.c | 63 ++++++++++++++++++++++++++++++++++++++
>>   drivers/gpu/drm/tinydrm/st7586.c   |  9 ++----
>>   drivers/gpu/drm/tinydrm/st7735r.c  |  8 ++---
>>   include/drm/tinydrm/mipi-dbi.h     |  2 ++
>>   5 files changed, 73 insertions(+), 29 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/tinydrm/mi0283qt.c b/drivers/gpu/drm/tinydrm/mi0283qt.c
>> index c69a4d958f24..2a78bcd35045 100644
>> --- a/drivers/gpu/drm/tinydrm/mi0283qt.c
>> +++ b/drivers/gpu/drm/tinydrm/mi0283qt.c
>> @@ -49,31 +49,17 @@
>>   static int mi0283qt_init(struct mipi_dbi *mipi)
>>   {
>> -    struct tinydrm_device *tdev = &mipi->tinydrm;
>> -    struct device *dev = tdev->drm->dev;
>>       u8 addr_mode;
>>       int ret;
>>       DRM_DEBUG_KMS("\n");
>> -    ret = regulator_enable(mipi->regulator);
>> -    if (ret) {
>> -        DRM_DEV_ERROR(dev, "Failed to enable regulator %d\n", ret);
>> +    ret = mipi_dbi_poweron_conditional_reset(mipi);
>> +    if (ret < 0)
>>           return ret;
>> -    }
>> -
>> -    /* Avoid flicker by skipping setup if the bootloader has done it */
>> -    if (mipi_dbi_display_is_on(mipi))
>> +    if (ret > 0)
>>           return 0;
> 
> If I am reading the patch right, it looks like there are two
> 
>      if (ret > 0)
>             return 0;
> 
> in a row with nothing in between when this is applied.
> 

I see now that I missed < vs. >. Probably better to say (ret == 1) instead of (ret > 0).


More information about the dri-devel mailing list