Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp373149pxb; Wed, 24 Feb 2021 04:41:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJylXwVGCIy9CjVpevBW5PCju8u2rQG4szDXEz+0epz4jFkBkU3W5rO+5YyEhcj8anKNXCBP X-Received: by 2002:aa7:d5d3:: with SMTP id d19mr31195782eds.216.1614170478193; Wed, 24 Feb 2021 04:41:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614170478; cv=none; d=google.com; s=arc-20160816; b=ude+wn3ncszax4nqBZRlw0hnTQLyotnOV3rM06Y7InbggPLPamr390JCXS+wbXn5P8 sbjMkRU2VU/plAydfwHMLrYxYe1xrdBjjUt8AExKo/pFC9tYZb+WVGnd8y8awEDGDRbB NLL9xssKopu+c2KVPlwEOTqdRIxGevGV9PUyY9rZZrg7Vr5C2Qra54muns1lsu5LHiJw OPP0sJKKRMQHfx983kydLnQmfFukjTN7IV9+AtLVIzJ27NvSlk+68LXpwGSZ1Ne7WZ7M 3ENmN7c9OIjkLdz0kRyv9pjK3nCUTf5xL6XZXvarwrRk2yToRDgMbdrrCS2JRbRtLGq3 bT4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dmarc-filter:sender:dkim-signature; bh=BvCkg/paXzY5wotaiWjohuLxYHDvmIcymi+lM0WTGmY=; b=fXMz/rFI839Q89R49YSq7LhZb0UgRlPgt3CgADzSMWfuOL7ah8DHXM3zHZf71Xmw+r v9xb3hP+GIltBcpgI1J1Ft5W2G6Ru+fIOZL99EG4iUtgR8fGCI4KcsW/eq5dzv2YvuW6 7NqDP59AHUI+amZLowyA9ZQrNtwnU2RClnsB+OD+aORZbSS5u/mdJy8eu7rnoXzcKkA1 oJvdxxBiDzqsChzA/pe87Et+uXahPIB8wQrfKmyDrrGv7cYb2my3yDWoV4/aQRk5sPtp PXtIMATFL9jwwmKNfAMs9pyL1hnxRve6eZCDlkGQ8qijbhm0I2KwBLGdBVfTvr7Faw+v Mx3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b="B/uvXepk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t9si1280859ejx.434.2021.02.24.04.40.55; Wed, 24 Feb 2021 04:41:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b="B/uvXepk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232227AbhBXDw1 (ORCPT + 99 others); Tue, 23 Feb 2021 22:52:27 -0500 Received: from m42-2.mailgun.net ([69.72.42.2]:47822 "EHLO m42-2.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233735AbhBXDwL (ORCPT ); Tue, 23 Feb 2021 22:52:11 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1614138707; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=BvCkg/paXzY5wotaiWjohuLxYHDvmIcymi+lM0WTGmY=; b=B/uvXepky/ljDFSmxsO43rVMRlJaqd4uE8SAX85FPaKXw6LQ2J6OWANwTsDKVwLRsT7ZbWSe 3WnI7pf4Onxj0KMVs57fKyFWBf6zSIfGzYy57ruIzndnkNqH9CKJILoWwFS2q0CBfFADd4jh fEbNNURrKblSNzgwsU5bZ8/U5pg= X-Mailgun-Sending-Ip: 69.72.42.2 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n02.prod.us-west-2.postgun.com with SMTP id 6035cd35ba0866383082da79 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 24 Feb 2021 03:51:17 GMT Sender: kgunda=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id EB220C433CA; Wed, 24 Feb 2021 03:51:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from kgunda-linux.qualcomm.com (unknown [202.46.22.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kgunda) by smtp.codeaurora.org (Postfix) with ESMTPSA id BF4A9C433ED; Wed, 24 Feb 2021 03:51:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org BF4A9C433ED Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=kgunda@codeaurora.org From: Kiran Gunda To: bjorn.andersson@linaro.org, jingoohan1@gmail.com, lee.jones@linaro.org, b.zolnierkie@samsung.com, dri-devel@lists.freedesktop.org, daniel.thompson@linaro.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 Cc: phone-devel@vger.kernel.org, Kiran Gunda Subject: [PATCH V1 1/2] backlight: qcom-wled: Fix FSC update issue for WLED5 Date: Wed, 24 Feb 2021 09:20:47 +0530 Message-Id: <1614138648-2963-2-git-send-email-kgunda@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614138648-2963-1-git-send-email-kgunda@codeaurora.org> References: <1614138648-2963-1-git-send-email-kgunda@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, for WLED5, after FSC register update MOD_SYNC_BIT is toggled instead of SYNC_BIT. MOD_SYNC_BIT has to be toggled after the brightness update and SYNC_BIT has to be toggled after FSC update for WLED5. Fix it. Signed-off-by: Kiran Gunda --- drivers/video/backlight/qcom-wled.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/drivers/video/backlight/qcom-wled.c b/drivers/video/backlight/qcom-wled.c index 3bc7800..aef52b9 100644 --- a/drivers/video/backlight/qcom-wled.c +++ b/drivers/video/backlight/qcom-wled.c @@ -348,7 +348,7 @@ static int wled3_sync_toggle(struct wled *wled) return rc; } -static int wled5_sync_toggle(struct wled *wled) +static int wled5_mod_sync_toggle(struct wled *wled) { int rc; u8 val; @@ -445,10 +445,23 @@ static int wled_update_status(struct backlight_device *bl) goto unlock_mutex; } - rc = wled->wled_sync_toggle(wled); - if (rc < 0) { - dev_err(wled->dev, "wled sync failed rc:%d\n", rc); - goto unlock_mutex; + if (wled->version < 5) { + rc = wled->wled_sync_toggle(wled); + if (rc < 0) { + dev_err(wled->dev, "wled sync failed rc:%d\n", rc); + goto unlock_mutex; + } + } else { + /* + * For WLED5 toggling the MOD_SYNC_BIT updates the + * brightness + */ + rc = wled5_mod_sync_toggle(wled); + if (rc < 0) { + dev_err(wled->dev, "wled mod sync failed rc:%d\n", + rc); + goto unlock_mutex; + } } } @@ -1459,7 +1472,7 @@ static int wled_configure(struct wled *wled) size = ARRAY_SIZE(wled5_opts); *cfg = wled5_config_defaults; wled->wled_set_brightness = wled5_set_brightness; - wled->wled_sync_toggle = wled5_sync_toggle; + wled->wled_sync_toggle = wled3_sync_toggle; wled->wled_cabc_config = wled5_cabc_config; wled->wled_ovp_delay = wled5_ovp_delay; wled->wled_auto_detection_required = -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project