Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp8044658pxb; Fri, 19 Feb 2021 06:10:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5npgmL1PqlIM/Rdmle0hY7mhCctur8WPhT6PtfarPJkt7NyKMjaACWhXe74dkSoZYSNGS X-Received: by 2002:a17:907:1187:: with SMTP id uz7mr7817796ejb.266.1613743824870; Fri, 19 Feb 2021 06:10:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613743824; cv=none; d=google.com; s=arc-20160816; b=dJFkqjiPdy9SKtvJMXbDzh6cdMT0liEYW9UEIqf0Q7mai59LpHXctdcCf1Ax92kDlz e31eOmyIxuzHLiNvGQ/L2W6eZcOM2OMlez2kkMpF6i8o7B/uDS5tsUoY2QCjnek+IgiH zoeSJvQKgEsEx+Pu6aNNN58T6PLareDJPeX/10hGyBWpD2Y4oSbYnIe7GGbh7QJ+7e/J 3RVstvS6Cb6MN1ZfU4k7kpB0KR9ehT7BTVssEcIJy4GztvRqorIhn5rhi/eRIjaZW1gs bOV8kAB5yq1ht4H5Bo9KWRP8sKC0rnXIhOOrFWZx7uBDQHkPpL07S8wU1QT4dULplxyc dtyw== 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=sZfPO4nzi/Vme+2+n/FuIk219P6E7VwgY0PUlpjW5bt/zfGSzIfb4gnWFSUiK98iEl L+PNyjnYFPNI7pgxcGOOwDL+ovVsRDahR1peu8ybTX8N84/HQ+2biQfcqwrFDrZgzST1 Ulhi2K+ZriGL+yFlwVxA1EW5e4Cw3O2y5IFWHXNVnHLUlZV2HzlayFCLbt/1jtwCReWi qagwCIBxWoVTXcTnSfhNBUbQGTOxdh1Z8vdBQZ0OtWtnwBZbDn7upwsco5F4r1+oOUc2 GgiL6D17Fw/990CmjsEtpOGO0p522gbCQ8WeorcNaChpNZMMTCurBv+IYcZTRnUoHtPa x6Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=WtLweImt; 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 m13si5848512ejx.348.2021.02.19.06.09.59; Fri, 19 Feb 2021 06:10:24 -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=WtLweImt; 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 S230261AbhBSOJL (ORCPT + 99 others); Fri, 19 Feb 2021 09:09:11 -0500 Received: from z11.mailgun.us ([104.130.96.11]:64474 "EHLO z11.mailgun.us" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230235AbhBSOJH (ORCPT ); Fri, 19 Feb 2021 09:09:07 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1613743727; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=BvCkg/paXzY5wotaiWjohuLxYHDvmIcymi+lM0WTGmY=; b=WtLweImtFLB+wky5qdVdlF7ARb45Wyat2G4U2L/f7eJqoSqOP+GOc4oxr6poHuAh5tvuGmiR RF6LbjxS7n1QqDYGJjvGH31EtUSeWoQmqpflh2hzOw8Bz5J8wd3dRdR3bAciUJlwqFxFRS7U dSSOx1M+qSKXP5XXnXioamhrul4= X-Mailgun-Sending-Ip: 104.130.96.11 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-n05.prod.us-west-2.postgun.com with SMTP id 602fc64d37f02eb714dab40b (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 19 Feb 2021 14:08:13 GMT Sender: kgunda=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id CC9C1C43466; Fri, 19 Feb 2021 14:08:13 +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 32529C433C6; Fri, 19 Feb 2021 14:08:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 32529C433C6 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: Kiran Gunda Subject: [PATCH V1 1/2] backlight: qcom-wled: Fix FSC update issue for WLED5 Date: Fri, 19 Feb 2021 19:37:38 +0530 Message-Id: <1613743659-4726-2-git-send-email-kgunda@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613743659-4726-1-git-send-email-kgunda@codeaurora.org> References: <1613743659-4726-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