Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp338181imm; Tue, 19 Jun 2018 22:31:36 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKlcsKFwPqtxEE9NhTViM+c/RGIGVlA1ZOB0Nzvaqhy0A9KOFB3CLsGWeMquDPISrkUfrVm X-Received: by 2002:a63:5fcb:: with SMTP id t194-v6mr16896676pgb.176.1529472696671; Tue, 19 Jun 2018 22:31:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529472696; cv=none; d=google.com; s=arc-20160816; b=rlX2rwie7uOQhB6YR5/v9Heo5aGAo5z9JeCsgM4pppdxzuPqjKnfeCXcoyATqovWc5 RBYCIGt1y0SzXoVEbwzOW31YvMSMb2AD8720+7PR+HNdyZOvJ25Gq/nxO5Ai/dD6sfQ9 HswGmcVLNrwQgaZ33/2yWsSCJ3sMpD9WHKv9eEej4yFYNyCTzzxoWBNg8UkGnWonlxCg X5xoLiWBPoKx5QykHumH22jGK0KH10Hj/8pEa0yL+e5jWMFf3TZiBDpzOPoyGzzzk7mc p/HlZecJeL8qJmRvxzwcjH9oztZwCfuF4NFk1Q3LWzgQUSgT2TgSigktbfmxjpLX9jlx TYDw== 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:arc-authentication-results; bh=wVEjvg9/auh78Yp7eygOiEd93wKWQFjekJSe/F2LizI=; b=FghyCrbLruExcwRP9yrOn8W3Ph2Omldz6tTvcM8MDe+vpONEktdK81Kau4nJMXL1iC 8RB7c5g5GpakieetRxEW7CLjgE2gxge7x3BI0tkS37U1gu/eDBB/toovWSAkdN+qXG1L GIeaHM2fbRc8hL5Ngw3uJPwg/hCh0zy+Nvl/p6P1kYDJNhhB2WzpLVw2XDR1p5UPGfLL VHILOsFxsafVyodCJ69IIATV4ikBCRUPM8hAtDa+Q5+RPTgV6WyqGx+rwL1A67Dv8/27 2NfIWChRiJSjQcD3hysnxhsDj/fonNFOHdIbpyrwk0/tjw/RIdGP6JI0UARxPop5QUx0 vn5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VXzDxn6A; 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 u21-v6si1534219pfd.78.2018.06.19.22.31.22; Tue, 19 Jun 2018 22:31:36 -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=VXzDxn6A; 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 S1751753AbeFTFaq (ORCPT + 99 others); Wed, 20 Jun 2018 01:30:46 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:38862 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750852AbeFTFan (ORCPT ); Wed, 20 Jun 2018 01:30:43 -0400 Received: by mail-pl0-f67.google.com with SMTP id d10-v6so1107899plo.5 for ; Tue, 19 Jun 2018 22:30:43 -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=wVEjvg9/auh78Yp7eygOiEd93wKWQFjekJSe/F2LizI=; b=VXzDxn6A+FBPFyjpCa8d/BZDqdBFwQemcCUvBoR1VMWTXcAjLx0AWOQOz0xdFalP5M fUD88OKlwoQ06dvOS0eTa0/S8sRC1DZDVjBz2MEJkA8N+7hWBCaWe8eoqkcQ8xuwQwMT P3KFGgIcQ6aavqC2aC78fiXCPSC0G1cBpxQSU= 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=wVEjvg9/auh78Yp7eygOiEd93wKWQFjekJSe/F2LizI=; b=ht2CquZKDxgC6wjraBMbnsfgYRWl2Uo9zBzHoj38K2S8JyKpkUDAUX9lM5JGP7rztC SFnSMgPs8g0ZgN2uYKLEeVlScQNo/hGzdFXOdv4IyIx4K1GhaKvgrQ5ck1uFN00o4Wzy hmERQLmWfRQdFWJSGoTQ/px6cy2hJC9uRVoONArrXco3L6iobRmCC9/HSsPrybKqvhmO d0yvpXl+6fG0LaxnSnUqLjgSPTE6hn9hmLsD8/WFmHopM4O/ICmaHc8YG20fbsnhbocd EXvoDpNst/p44VslWQ9GjrUUL8ocSWI/xDWGOPkrqiCpX4mpN1RRlyg8qSE6u+KyYmFP m/bA== X-Gm-Message-State: APt69E1q6Q7AzTR+RCpdhbYzyFj+z4oYGnpH1zPZl88CrRWS9+2iuyJy ppqyyml7AYRkYbdwJPqRySX95A== X-Received: by 2002:a17:902:14b:: with SMTP id 69-v6mr22100964plb.184.1529472642885; Tue, 19 Jun 2018 22:30:42 -0700 (PDT) Received: from tuxbook-pro (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id v13-v6sm2473810pfa.131.2018.06.19.22.30.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Jun 2018 22:30:42 -0700 (PDT) Date: Tue, 19 Jun 2018 22:33:00 -0700 From: Bjorn Andersson To: Kiran Gunda Cc: jingoohan1@gmail.com, lee.jones@linaro.org, b.zolnierkie@samsung.com, dri-devel@lists.freedesktop.org, Daniel Thompson , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-leds@vger.kernel.org Subject: Re: [PATCH V3 6/7] backlight: qcom-wled: add support for short circuit handling Message-ID: <20180620053300.GJ15126@tuxbook-pro> References: <1529406822-15379-1-git-send-email-kgunda@codeaurora.org> <1529406822-15379-7-git-send-email-kgunda@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1529406822-15379-7-git-send-email-kgunda@codeaurora.org> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 19 Jun 04:13 PDT 2018, Kiran Gunda wrote: > Handle the short circuit interrupt and check if the short circuit > interrupt is valid. Re-enable the module to check if it goes > away. Disable the module altogether if the short circuit event > persists. > > Signed-off-by: Kiran Gunda > --- > drivers/video/backlight/qcom-wled.c | 130 +++++++++++++++++++++++++++++++++++- > 1 file changed, 127 insertions(+), 3 deletions(-) > > diff --git a/drivers/video/backlight/qcom-wled.c b/drivers/video/backlight/qcom-wled.c [..] > struct wled { > const char *name; > struct device *dev; > struct regmap *regmap; > + struct mutex lock; /* Lock to avoid race from ISR */ > + ktime_t last_short_event; > u16 ctrl_addr; > u16 sink_addr; > u32 brightness; > u32 max_brightness; > + u32 short_count; > const int *version; > + bool disabled_by_short; > + bool has_short_detect; The use of feature flags, instead of checking the version, like this is good! > > struct wled_config cfg; > int (*wled_set_brightness)(struct wled *wled, u16 brightness); Reviewed-by: Bjorn Andersson Regards, Bjorn