Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2544192pxf; Sun, 14 Mar 2021 03:23:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3H2HLGg2JLsFXtmi5MDjBZUisq7DbYgLzqdLHig5sJUFvRMFbQWjnm4Qx3sDEX2sZHT+G X-Received: by 2002:a17:906:dfcc:: with SMTP id jt12mr18278095ejc.31.1615717385498; Sun, 14 Mar 2021 03:23:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615717385; cv=none; d=google.com; s=arc-20160816; b=RsMBVBVnwID9MLQK5f7Gpzmw9/VAZxpKXG2+VzB9zlJ4MLD6S2dFr1GFIc5j2e/UyR 46hUouQqQjETM2mmAMcpn3/ceEkOqEfg2ypcOARtlQwJzpc1Vp/oUGPJzHNqrWkQPiZm KAq87CAvLj3o7UsDI5gd/QNk2UmbPhJLsh/86zpJjgrc6SaS2Jvbv9lomAAJzITAVehu BGFDmQcUnG74rAQ2XUuflYIZgxOOJl/szgaDhDchd/VBOzCPkDgHahYOKllbPn8B/W7G gagRkcUlAzDhP7v6sP4JLDRLL3LoNJPu9zdU0G5h6sXE4FI9x43vIPUiah25tVYuNttk qxBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=TamlXtZKV2XIqbgxAbPLPN5HoVc6Di1CLqqQ2k01C3I=; b=a8E+HUYDXhNh8+ZK7q0zWZS0MhH0YwJMRmiHsvk6vz34m5S00E/EkBXvwZ8kOZYnGt tQx6/JxP/v7phClhKIKQgd2wIu+sZOTKS5qBoBpozgGY2Qb4qADBm2240BrySiFn0wXo SAgUlhlax4YyXyX/pq5Oek0tQYOoHz9l9X2bn0ku57xLCm2EYvoW8v+XLSBAAj+4jo8j NAnbQupCL6Afe2ZeZD02j2C5kQ9vEj7oQ3g0qtxxyhnpXNpatQMMH6mn3JYeJ0NPVtta kpVIT5oEotfRNujmqHZEssvs2HgJ1/+NHN0QDH66ndR5hhKQDxQPNYcdpludtXW2Ny4E BXjg== ARC-Authentication-Results: i=1; mx.google.com; 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 p10si8102407edw.62.2021.03.14.03.22.43; Sun, 14 Mar 2021 03:23:05 -0700 (PDT) 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; 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 S234904AbhCNKM7 (ORCPT + 99 others); Sun, 14 Mar 2021 06:12:59 -0400 Received: from relay05.th.seeweb.it ([5.144.164.166]:44369 "EHLO relay05.th.seeweb.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229495AbhCNKM3 (ORCPT ); Sun, 14 Mar 2021 06:12:29 -0400 Received: from Marijn-Arch-PC.localdomain (94-209-165-62.cable.dynamic.v4.ziggo.nl [94.209.165.62]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r2.th.seeweb.it (Postfix) with ESMTPSA id 8F3943E8EC; Sun, 14 Mar 2021 11:12:15 +0100 (CET) From: Marijn Suijten To: phone-devel@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Konrad Dybcio , Martin Botka , Kiran Gunda , Obeida Shamoun , Marijn Suijten , Andy Gross , Bjorn Andersson , Lee Jones , Daniel Thompson , Jingoo Han , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] backlight: qcom-wled: Use sink_addr for sync toggle Date: Sun, 14 Mar 2021 11:11:10 +0100 Message-Id: <20210314101110.48024-1-marijn.suijten@somainline.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Obeida Shamoun WLED3_SINK_REG_SYNC is, as the name implies, a sink register offset. Therefore, use the sink address as base instead of the ctrl address. This fixes the sync toggle on wled4, which can be observed by the fact that adjusting brightness now works. It has no effect on wled3 because sink and ctrl base addresses are the same. This allows adjusting the brightness without having to disable then reenable the module. Signed-off-by: Obeida Shamoun Signed-off-by: Konrad Dybcio Signed-off-by: Marijn Suijten --- drivers/video/backlight/qcom-wled.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/backlight/qcom-wled.c b/drivers/video/backlight/qcom-wled.c index 091f07e7c145..fc8b443d10fd 100644 --- a/drivers/video/backlight/qcom-wled.c +++ b/drivers/video/backlight/qcom-wled.c @@ -336,13 +336,13 @@ static int wled3_sync_toggle(struct wled *wled) unsigned int mask = GENMASK(wled->max_string_count - 1, 0); rc = regmap_update_bits(wled->regmap, - wled->ctrl_addr + WLED3_SINK_REG_SYNC, + wled->sink_addr + WLED3_SINK_REG_SYNC, mask, mask); if (rc < 0) return rc; rc = regmap_update_bits(wled->regmap, - wled->ctrl_addr + WLED3_SINK_REG_SYNC, + wled->sink_addr + WLED3_SINK_REG_SYNC, mask, WLED3_SINK_REG_SYNC_CLEAR); return rc; -- 2.30.2