Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3677765pxb; Mon, 24 Jan 2022 15:07:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJzPKdSmcr9yJFgD9idirR4gbZUwU4+PhgjMIwFBQUkQCgKAaUsbpNce/YotQaIZzamr09l5 X-Received: by 2002:a17:90a:8b82:: with SMTP id z2mr585360pjn.146.1643065661510; Mon, 24 Jan 2022 15:07:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643065661; cv=none; d=google.com; s=arc-20160816; b=Y0xsmZ9mdMsceLc2Ux+Fc89vEfrYGWsI9/pMGHcKx8q9fXPtRukgdLq21c6nyC7LGx 2Xb5ZNHlQx/YjeylBvvO12xyl3UMgUb5HlqaOsZBtOjuM/Q1kLFqOWj6O6U/nf9sMKxo frax67oWCjPxR+/OF02xE+7t475JxB5rw+P4qyRO5ITzpR748DMDjKJFGMjtUClMXIw4 ASvLJNnokiGKv5mUw7QuHflXDqI1EcTofv4BL/cV3WoufmgkEIfiCNvDNm3k/Nw/D8vA 6Dwz4qlHTzSUeA+ABwHiqg+DuDY8X94j/0zjWHqS7uJw6D1WpqjfHiYrTrb0XM4lpVn7 xgug== 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=vfJZxqOTCnkWE/M1D9IwbbPJH/PFE2dDBWe81M9yaZA=; b=x5MDrCxvFqydwPiDYkm9fpCUd0x1iJIxcFFuE5Zrqk0H14JuMf9jqbRXC5ojJxx3XG TAkpB66dzTLZIcY+4E3Hc7h0aOLl0CuRMPg1HJ16Z320Gp29VqzxUya6C3blgzKEkeTJ 1Jx6aIAGm+nRLLrJEzUD6d+SXOYCwdwSXJGpp4lNISUDdIqIGOX3VMIglGoTVsDllzsp fvkM0zbAtvvH4eR9lkB8AQb9chdX7s/iT2ypQCyAWP0lMDkR+xxbNNHklzlNQ1odutzd 1u6zKxJcEfidFMx+KraSBs/ITNAivuMNdAhjrPOvjE7EqcRFlo/KE1z8vNDkinse+yjB a02A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=a2yCkKBH; 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 j6si8401753pld.55.2022.01.24.15.07.29; Mon, 24 Jan 2022 15:07:41 -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=a2yCkKBH; 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 S1843463AbiAXXEC (ORCPT + 99 others); Mon, 24 Jan 2022 18:04:02 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:46606 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1578129AbiAXWBp (ORCPT ); Mon, 24 Jan 2022 17:01:45 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: detlev) with ESMTPSA id 2623B1F438F5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1643061704; bh=uSJHLoKhBOSZViMqnrdcTgo72DKBbNURHymWklur8XE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a2yCkKBHr2uUjSxIMcYN3dmciK6j6fWs///x9K1LcFfD814QT9O0L+p8ARn6+V+z2 n13j7E9skyrNQh6nr8JVnoPjEIZLk6kx8GsfIf8yJyWnkmnX87IKDHVYd0iuIfpSDy JCLlYsZNM/AtjdeNd8aKLoqVTVCJO1jhhpGavRKEhYE/Z97xy3IpfDanNBolcZgGBH 22VP5z7PslPyWbqUHl+hTlpMsq+XLePs7Trfr+MIy8GiW9lsyBJHNwfcrMB3g3jDq7 7zQszH3Hc8tk52wlUIg+yOyZofcxlUzFDZw3H0vqqlU7+Cwqktp53GG17PuyzY7l7U kEXw5y0r9zLSA== From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: Dave Stevenson , Liam Girdwood , Mark Brown , Detlev Casanova Subject: [PATCH v3 7/9] regulator: rpi-panel: Remove get_brightness hook Date: Mon, 24 Jan 2022 17:01:27 -0500 Message-Id: <20220124220129.158891-8-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124220129.158891-1-detlev.casanova@collabora.com> References: <20220124220129.158891-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 Signed-off-by: Detlev Casanova --- .../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