Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1285347pxb; Fri, 21 Jan 2022 14:21:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJydUOtwanCxbte0mzCGr9R+rB7ITqwQlop8216TimVW69Ev1czje+dy1nLJ/3yrPOv+Tsap X-Received: by 2002:a05:6a00:1a47:b0:4c4:394:8a22 with SMTP id h7-20020a056a001a4700b004c403948a22mr2297298pfv.63.1642803702228; Fri, 21 Jan 2022 14:21:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642803702; cv=none; d=google.com; s=arc-20160816; b=biYFKQw3+nXkOtcwPyyd1+tqIkMDEkIYNEhD+EAxI/tXWbxnpPU8kvt3R6PS1Iuh8e kaSCKTJsZaPfC9B3NmTsK55LOm4zUTrr0MIG6paRYxnKTOMKNlBIoGBomzbMKRgcKbkL 1LlIQWxCMyryCCt4fcKeY6+qdU0axriLDWJgPLIRTyHI6l0nh3yC2N0CtgMGSaw16RHU Dm3c5Us75R2WXKGI8uzXT14HYqf8FmQBKYt5MUC7EMxV4vmUk1iM2U6CdcilpVYHlxVV vEzDK5yTf5dpo9BxOKcI8RIAWf3pry1ZkquaKSSWMayuwZNH6DBsveiC13sjr/oiOqa3 u7SA== 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=DL6Ndi+JuKRqbUIfAeHhiGRbc9lMOwq1K2W8GaTmtgnOSujr/ati2luvYghL2/YjeE HxKUy3YYC1rkIbTNxiU5FqTmTk4KjTwwfnYuFps7VUvQospvn9R3Y+Ff8eHOzSQ8nSso /LOqXq+nYKHT3f64YqKkrUCS6a2QTk6v8S54g1mOtuALI/mElLLpBz7Jg9k7uZ6mZ1A1 TduV82WsSUmPB22qGOXtlbcL9HlSk5sI67sVuOXjTk+Urmsfj16P3qg+Hfgf7HPDI8l0 ZRgU82eq1yAnebO6FcI+dgOgV5E6wuEtc1frD2JnLQuFXu+XHgHNrecKToOSbGXk2I/G EFTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ErOZIZkG; 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 f17si7241473pgv.733.2022.01.21.14.21.27; Fri, 21 Jan 2022 14:21:42 -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=ErOZIZkG; 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 S1376614AbiATPW5 (ORCPT + 99 others); Thu, 20 Jan 2022 10:22:57 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:35492 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376617AbiATPWj (ORCPT ); Thu, 20 Jan 2022 10:22:39 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: detlev) with ESMTPSA id 756C81F45345 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1642692159; bh=toJZplNzOWnhWEhBs7DUXgaZJA8ric2HVhNCIQ2EX3A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ErOZIZkGc0EWd6WWHuaidybGNKG6sbnjaGPSHW67m5eI5/kCGGkhVm7RSgoVWBAUT MmQMuAy4PRL9Gsc9mw6rtOrEzn6mQBdaI2pFpMidSD3PBroHLKxHjmsuF9Aa/90A/o A2NvWcQYuM4HdehjU+TWEGK1vX1Z/OVYbH2MfrQ+4R3fH0FuUnLM8Qr80w1COeiNfW ZXd8VZj0FHFc4QLrA9GIvHtSFIgbCWFuFwCFaZ39grzl3whN1uPiuzYOMAn4VZ5f5s UNGU2acAlRSQZX0BSGe1Xk6R79CDV/gTSEp1bzdp7lbTUFT0kGUiHphivfqIKmsNVW h9tVeuCyID94w== From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: Dave Stevenson , Liam Girdwood , Mark Brown Subject: [PATCH 7/9] regulator: rpi-panel: Remove get_brightness hook Date: Thu, 20 Jan 2022 10:21:48 -0500 Message-Id: <20220120152150.1952568-8-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220120152150.1952568-1-detlev.casanova@collabora.com> References: <20220120152150.1952568-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