Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4084744ybg; Mon, 21 Oct 2019 03:35:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNkH/HpnkChUFMXmR79uz1JR3XkdGEUiQyOYugmZwhJ1daWHueu2ZTgl/XNj4cCqGsmh7/ X-Received: by 2002:a17:906:85c5:: with SMTP id i5mr21059738ejy.222.1571654106483; Mon, 21 Oct 2019 03:35:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571654106; cv=none; d=google.com; s=arc-20160816; b=KsqzH1P8Zy1jad1N5xe6vPARpEB1BADTeHcA4pR9+y4scqpQMGqcZfYvmvk/oHpeTQ 3y4prVvdz51r6RLdIvu30GHZyZ+g71uHvqdiJCS/d33TYWNaVxcQwovlLnGCJO+8W4HI eRWY1KlBQxAeADAYljWO3P8y/F+ZHijHEufEw/qgWukqUMsnrHCapeyrHSnVhGYeq2ai nB244AHMPwHdyPGV7EGKh/v48GfKhZ35MeajUdYp0kmGoaHcq+KhIJazjc/FaKJaHDPd 5scrf84yHjmj1pxheNrWPFLWzjCadbXzm0rVm3oQecJ1OAXOO3MkwGxrCUeocpUeR1Er M8DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=fQUvlL0V3Iz6E4Ap+lDL6E5wl3Ji5YJZ7TElhvimK6s=; b=ynj6jf1i/Kf/HaYa+rJA3HCG3uVyVYS62resXOAK9bz2LJ7jVX724Q3n2mB6EeSh1L 0OIiSqaxCTekT/rmGHVrkNdkdTDS9K04ZVva1wF/9AnrgJE2gELFxslLjGJPZd0ox7GV BCWDySguFfV50YZf7jIX6BFoeroz4wFwFzHwhHNhWCea2pB2MEAUs6POACA1Dl9av38M egRN42t1Cny/8ggKyeR/L2JbTKcSoXW9/d2+qpCWBkLA/vOb/jtZIOg3uO4JPq+NaiEK xrPIh06LLIcmms5OhZjQvT1eGRT367RSw1WHQdkkOW1HgvjnKDA5Xj5Mq0bBekiONHcB qAbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sNQbgSe6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m90si4541370ede.52.2019.10.21.03.34.43; Mon, 21 Oct 2019 03:35:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sNQbgSe6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728137AbfJUKb4 (ORCPT + 99 others); Mon, 21 Oct 2019 06:31:56 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:45315 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728101AbfJUKby (ORCPT ); Mon, 21 Oct 2019 06:31:54 -0400 Received: by mail-wr1-f67.google.com with SMTP id q13so8334988wrs.12 for ; Mon, 21 Oct 2019 03:31:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fQUvlL0V3Iz6E4Ap+lDL6E5wl3Ji5YJZ7TElhvimK6s=; b=sNQbgSe6MW9Sf188uOBYTA+NasNjY7oDNNSVRg80tBE27c9oTBKOeTOMBhKbIfSnFo 9fkgnUIi2Drnm02trdz8ueWMyzH7rb45BJPDAsHxAC/uVs45kb4m9g09Pvcas5OGWFzf DWH9vGPLNAryoDnEviIkDk+cuhXVfHBR3FK+/IkRRLTVbLQ4eRInplmskDLz0elRyE2X tAAQe/vc0QIYP8i8VqLixnry7C+73poCoC+aSEnJYUbKzt+ax6O/itJJr1sCUStytl3u gbMqKpuJQWKu/lh1fykZ1lIpc5ZxKzp1T0h77Op17uH6xYjSi9/TCYQ9yy8bIxKylSQ4 Zq0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=fQUvlL0V3Iz6E4Ap+lDL6E5wl3Ji5YJZ7TElhvimK6s=; b=hhIxdJuuxNBu+ptzWz0euCx0rdVzFoa4MBRNv+/Ovx8PXrMvMetp9ZjXb2m73xtXBo RcoFDiwBOtWAC6aBad/9qCsDbp0zmtpRsK0dqowxEvCCl7qxqwDdnbmn437NAbcs/PDY 7t4rfWbPu1GV7mp8Y5eZC1RacvCY3Z1hbIf0RtsV6U+w9BRaT4GOvZKJhFkcznjr5eXP vFubViA+CO9RTkA5p2bbQNGodpPYAhYtm9wscETliygBQvhGK5YMFMibtbojJiiGx8W/ iC/U0GeLhnYuGUgWyg1xppyVR7CAlczD+lEGjRW/9xbWb7DaYgUQL/B0fdnnvG6e8ZDe 1qFg== X-Gm-Message-State: APjAAAXb/Y+uxaB3mxejajhJIBOSowvD/515owq5/NcZJhfJxtuAP8Ow gYUqZGGQJGQCgsZS9eUdby6/lQ== X-Received: by 2002:adf:e702:: with SMTP id c2mr17251611wrm.70.1571653912695; Mon, 21 Oct 2019 03:31:52 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id f143sm27637543wme.40.2019.10.21.03.31.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 03:31:52 -0700 (PDT) Date: Mon, 21 Oct 2019 11:31:50 +0100 From: Daniel Thompson To: Kiran Gunda Cc: bjorn.andersson@linaro.org, jingoohan1@gmail.com, lee.jones@linaro.org, b.zolnierkie@samsung.com, dri-devel@lists.freedesktop.org, jacek.anaszewski@gmail.com, pavel@ucw.cz, robh+dt@kernel.org, mark.rutland@arm.com, linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Gross , linux-arm-msm@vger.kernel.org, linux-fbdev@vger.kernel.org Subject: Re: [PATCH V8 6/6] backlight: qcom-wled: Add auto string detection logic Message-ID: <20191021103150.ta7qalltldofouh4@holly.lan> References: <1571402009-8706-1-git-send-email-kgunda@codeaurora.org> <1571402009-8706-7-git-send-email-kgunda@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1571402009-8706-7-git-send-email-kgunda@codeaurora.org> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 18, 2019 at 06:03:29PM +0530, Kiran Gunda wrote: > The auto string detection algorithm checks if the current WLED > sink configuration is valid. It tries enabling every sink and > checks if the OVP fault is observed. Based on this information > it detects and enables the valid sink configuration. > Auto calibration will be triggered when the OVP fault interrupts > are seen frequently thereby it tries to fix the sink configuration. > > The auto-detection also kicks in when the connected LED string > of the display-backlight malfunctions (because of damage) and > requires the damaged string to be turned off to prevent the > complete panel and/or board from being damaged. > > Signed-off-by: Kiran Gunda > --- > drivers/video/backlight/qcom-wled.c | 398 +++++++++++++++++++++++++++++++++++- > 1 file changed, 392 insertions(+), 6 deletions(-) > > diff --git a/drivers/video/backlight/qcom-wled.c b/drivers/video/backlight/qcom-wled.c > index 658b1e0..b2e6754 100644 > --- a/drivers/video/backlight/qcom-wled.c > +++ b/drivers/video/backlight/qcom-wled.c > @@ -193,7 +216,23 @@ static int wled_module_enable(struct wled *wled, int val) > WLED3_CTRL_REG_MOD_EN, > WLED3_CTRL_REG_MOD_EN_MASK, > val << WLED3_CTRL_REG_MOD_EN_SHIFT); > - return rc; > + if (rc < 0) > + return rc; > + > + if (wled->ovp_irq > 0) { > + if (val) { > + /* > + * Wait for at least 10ms before enabling OVP interrupt > + * after module enable so that soft start is completed. > + */ Comments should not say what is does (we can read that). It should be saying what is weird about the hardware the results in us enabling the interrupt in an unusual way. More like: "The hardware generates a storm of spurious OVP interrupts during soft start operations so defer enabling the IRQ for 10ms to ensure that the soft start is complete." Note that I am only guessing that is an spurious interrupt storm that caused you to defer the interrupt enable... I don't want to have to guess which is why I am asking for a good quality comment! Daniel.