Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1406079pxb; Fri, 21 Jan 2022 17:55:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzv+za32XVGyHX8MzTyAxC/ScZ1mpP9l+yDyzrdmHNY9ZaxDBrn6JCE/LWe3bxED5QJv7Z X-Received: by 2002:a17:902:e845:b0:14a:4ef1:dd0b with SMTP id t5-20020a170902e84500b0014a4ef1dd0bmr5922883plg.21.1642816500739; Fri, 21 Jan 2022 17:55:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642816500; cv=none; d=google.com; s=arc-20160816; b=QQMQLKvHE99bqyEOOJXyVm/UTBExDwHGZqq4TVBCVKwR0be+J4WsawoDlhev1s7YXv S7GIULFbQRFdC2vNjUVuanCVPd8vXIb3yUGKC8pLXVlznk+KV49iYekTsATP9HJ1q9Vr FyUD8jig8504gu2Wepms2XhBrsDL0Fq5zLtzs5hikx7Tj3lzJRuWpj+hAfFBnHDlNy7q e4Im0TM7l85038HgVRBo4JykU167HBwKmX4lBL/7G+wJUme+B/DkGtiXvzuALUqfCKrf GbQr+qaq8UnUKSFyqTKj6Anw2NGQB52fNJ4NCsFyOwSiJqUBkx5YUVi8+xuwqlZJss4r Zcuw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KJoLpKkbmxcTYc+vtjqgipY4xEWjp72f07mX3NG8rHI=; b=ci9qiywGhncSOErGQ9hTPoM4G9Gl4uaykDzSK5xny1Yus1/wBtDxTpAIt7V4Tk23I9 mJ6dxB+2+Sm+gYCNPOT/H6mZGvjYc1YwGdvFlsnPgC5md+nS7Bc88JoM4skqqQlKBbu/ NYxEPdsPNRPkrpiRXjZZf4u7WElDJf4oviuCNsEps9ltfkwAE/EG6XidTPw/MxMYvIyz 9Sa1cS1pPpxk5AdnQTf7PcN4oKasFqkQ3HjWZIYHKd5WHWjrztbpFg3QSj1PxKQe68Ra tQyOSg798OkejxNlTbmjUwR1QetqzbDLHIW+v88/oYNAvyWZAdLAquW1uSfGt3+RCEun h+IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=XqgHGYbI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s64si7072413pgs.339.2022.01.21.17.54.48; Fri, 21 Jan 2022 17:55:00 -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=@collabora.com header.s=mail header.b=XqgHGYbI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381611AbiAUPVv (ORCPT + 99 others); Fri, 21 Jan 2022 10:21:51 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:47838 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381529AbiAUPVd (ORCPT ); Fri, 21 Jan 2022 10:21:33 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: detlev) with ESMTPSA id 01A921F46217 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1642778492; bh=toJZplNzOWnhWEhBs7DUXgaZJA8ric2HVhNCIQ2EX3A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XqgHGYbIUpwONda9BtSBVlb7CfKHzeaWUE/kEYPfCXaGkokHTJFC9x4V1bSYCZlum g+oNqn1rZThILFP8Jm90EwKOynZPZMdSZevmfBLScjOaw/TJg/O6h7HcFySwSPNpbs hNfEFvmaoX+jS97166PT+LEoLZQkAu2kJqf8kFi0A2WT0xbi2BRrqyp7DP9RvMOkR7 qk4o2r95jFf0P5sffZGSVlL8TVCh8d0E70UFwokAT1MwXcez3KjzrVSM2KhooAQdJu RR9oCKq+ozabRHmjLhhtPYArpjGiGHz/dwRLs7zcxbIuLNKfs/nt06dSze99BGGEyL yz5PYx4t/v+pQ== From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: Dave Stevenson , Liam Girdwood , Mark Brown Subject: [PATCH v2 7/9] regulator: rpi-panel: Remove get_brightness hook Date: Fri, 21 Jan 2022 10:20:54 -0500 Message-Id: <20220121152056.2044551-8-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220121152056.2044551-1-detlev.casanova@collabora.com> References: <20220121152056.2044551-1-detlev.casanova@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dave Stevenson The driver was implementing a get_brightness function that tried to read back the PWM setting of the display to report as the current brightness. The controller on the display does not support that, therefore we end up reporting a brightness of 0, and that confuses systemd's backlight service. Remove the hook so that the framework returns the current brightness automatically. Signed-off-by: Dave Stevenson --- .../regulator/rpi-panel-attiny-regulator.c | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/drivers/regulator/rpi-panel-attiny-regulator.c b/drivers/regulator/rpi-panel-attiny-regulator.c index 998233f14085..8090b9a485b5 100644 --- a/drivers/regulator/rpi-panel-attiny-regulator.c +++ b/drivers/regulator/rpi-panel-attiny-regulator.c @@ -207,31 +207,8 @@ static int attiny_update_status(struct backlight_device *bl) return ret; } -static int attiny_get_brightness(struct backlight_device *bl) -{ - struct attiny_lcd *state = bl_get_data(bl); - struct regmap *regmap = state->regmap; - int ret, brightness, i; - - mutex_lock(&state->lock); - - for (i = 0; i < 10; i++) { - ret = regmap_read(regmap, REG_PWM, &brightness); - if (!ret) - break; - } - - mutex_unlock(&state->lock); - - if (ret) - return ret; - - return brightness; -} - static const struct backlight_ops attiny_bl = { .update_status = attiny_update_status, - .get_brightness = attiny_get_brightness, }; static int attiny_gpio_get_direction(struct gpio_chip *gc, unsigned int off) -- 2.34.1