From patchwork Tue Mar 19 09:37:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13596490 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FF677D084 for ; Tue, 19 Mar 2024 09:39:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710841167; cv=none; b=D+Fa/oKpNh9W1eKiax1LHqm7UeF1HgOKVbdOtUKvVUVNRv9nXHD8XKXLyBLq1TbV4bNHyGs8rvz8e9Mf2DYpU4vaKxIjQUCtqJY/uojKtPlWhxdX2b1BuHK5cD6EpEcORdgawpgr/MT0DrGWTQGZijRFHpYIwN24/ESOCiy9VIE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710841167; c=relaxed/simple; bh=tx7ym4I8MHggnsZUJdJCIJccs/0EBm9r7yAvEhJGsH4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lByQEc9tbHrp3ap0YrJ815RDI3i7iisEKc9Lwfd1cXfze9rkqLLXOt9uX0SreYt707c3GRK3Mb7dYbjh+sF8EwuNSEXjN72Ug57c3IXvl3GvY0J1J8t0Dk5t3Q7vIPNOe268tW2O54ye9qWEwZvhiQv86uQHPDqv1yrmsdDKH3s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 45AB55D410; Tue, 19 Mar 2024 09:39:18 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D9D3A13700; Tue, 19 Mar 2024 09:39:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id kM0ENEVd+WU6GAAAD6G6ig (envelope-from ); Tue, 19 Mar 2024 09:39:17 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, andy@kernel.org, geert@linux-m68k.org, dan.carpenter@linaro.org, sam@ravnborg.org Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev, Thomas Zimmermann , Robin van der Gracht , Miguel Ojeda Subject: [PATCH v2 1/6] auxdisplay: ht16k33: Replace use of fb_blank with backlight helper Date: Tue, 19 Mar 2024 10:37:20 +0100 Message-ID: <20240319093915.31778-2-tzimmermann@suse.de> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240319093915.31778-1-tzimmermann@suse.de> References: <20240319093915.31778-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: Authentication-Results: smtp-out2.suse.de; none X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Score: -4.00 X-Rspamd-Queue-Id: 45AB55D410 X-Spam-Flag: NO Replace the use of struct backlight_properties.fb_blank with a call to backlight_get_brightness(). The helper implements similar logic as the driver's function. It also accounts for BL_CORE_SUSPENDED for drivers that set BL_CORE_SUSPENDRESUME. Ht16k33 doesn't use this, so there's no change in behaviour here. Signed-off-by: Thomas Zimmermann Cc: Robin van der Gracht Cc: Miguel Ojeda Reviewed-by: Sam Ravnborg Reviewed-by: Geert Uytterhoeven Reviewed-by: Miguel Ojeda Reviewed-by: Robin van der Gracht Reviewed-by: Dan Carpenter --- v2: - update commit-message style according to subsystem (Lee) - declare local var as const (Miguel) - clarify BL_CORE_SUSPENDED (Miguel) - fix grammar in commit message (Dan) --- drivers/auxdisplay/ht16k33.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c index a90430b7d07ba..9081a5797c552 100644 --- a/drivers/auxdisplay/ht16k33.c +++ b/drivers/auxdisplay/ht16k33.c @@ -314,14 +314,9 @@ static int ht16k33_initialize(struct ht16k33_priv *priv) static int ht16k33_bl_update_status(struct backlight_device *bl) { - int brightness = bl->props.brightness; + const int brightness = backlight_get_brightness(bl); struct ht16k33_priv *priv = bl_get_data(bl); - if (bl->props.power != FB_BLANK_UNBLANK || - bl->props.fb_blank != FB_BLANK_UNBLANK || - bl->props.state & BL_CORE_FBBLANK) - brightness = 0; - return ht16k33_brightness_set(priv, brightness); } From patchwork Tue Mar 19 09:37:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13596486 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B3727D071 for ; Tue, 19 Mar 2024 09:39:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710841161; cv=none; b=PBzBJCL2fFu09gXq8usJCwc3glwv71svB8cW831qvV4yxEKErHEAwFMRHBejJv5rx7D6reXsIrQbO0EAJ1kLY5F9Htxc76WP+opMxsGowuWKpdrAefS8AmFt3qGcCVM6Ik1MU7DWkSSdXBQ/iYA5dwBZmzRODd2eNtibHH5r2LI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710841161; c=relaxed/simple; bh=bNXHHmZJWa7N3lqWlNBEM+S6RX9zWS6DnfyavrrndS0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QwoVP439MncMLn3GupqCkrjDc6c/ERCPLKLPINcvDgQjt43DSv6FCylWNBEarjS0RyDkxf61sg7WquBLZnUiaNiJqBasv6QvBKe3bQuSjqwe69WF9Ue5P7ew2femEsvL47fXbbP6p+SpBU/qZr37JLWXyf09P+kfTV/fMXmxYVY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=KiM60/Gz; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=6XvTzvIh; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=KiM60/Gz; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=6XvTzvIh; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="KiM60/Gz"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="6XvTzvIh"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="KiM60/Gz"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="6XvTzvIh" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 8A2AF37613; Tue, 19 Mar 2024 09:39:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1710841158; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K0dty1vPLuigpCpTtELGxHmUHZvuK7IRWWV7zcr3R7Y=; b=KiM60/GzY88C4jxMVD6cjR3zTJ0UK7EFNSDSN2njmz08CDWnvslEAJ4Hj/ij0L6pYLSM34 YHKzOtIl7DY4LtJ1JEWHJ54wpZIr9Yv2WDWKDgK6cl7PNpwJVAYVuXj+1GdnW0rCl00VZU tpSAM2ZJ9WtNGAtnSSFajK8LctqCMgI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1710841158; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K0dty1vPLuigpCpTtELGxHmUHZvuK7IRWWV7zcr3R7Y=; b=6XvTzvIhZj0BJZbs4mE5DPeKIDRXKJm9J78AmDuA7nANHIPZr9ngvA786C9WtzlrT7lZoG EWdIyj6mFkRD8JBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1710841158; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K0dty1vPLuigpCpTtELGxHmUHZvuK7IRWWV7zcr3R7Y=; b=KiM60/GzY88C4jxMVD6cjR3zTJ0UK7EFNSDSN2njmz08CDWnvslEAJ4Hj/ij0L6pYLSM34 YHKzOtIl7DY4LtJ1JEWHJ54wpZIr9Yv2WDWKDgK6cl7PNpwJVAYVuXj+1GdnW0rCl00VZU tpSAM2ZJ9WtNGAtnSSFajK8LctqCMgI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1710841158; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K0dty1vPLuigpCpTtELGxHmUHZvuK7IRWWV7zcr3R7Y=; b=6XvTzvIhZj0BJZbs4mE5DPeKIDRXKJm9J78AmDuA7nANHIPZr9ngvA786C9WtzlrT7lZoG EWdIyj6mFkRD8JBA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 3F671136A5; Tue, 19 Mar 2024 09:39:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id SOIrDkZd+WU6GAAAD6G6ig (envelope-from ); Tue, 19 Mar 2024 09:39:18 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, andy@kernel.org, geert@linux-m68k.org, dan.carpenter@linaro.org, sam@ravnborg.org Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev, Thomas Zimmermann Subject: [PATCH v2 2/6] backlight: omap1: Remove unused struct omap_backlight_config.set_power Date: Tue, 19 Mar 2024 10:37:21 +0100 Message-ID: <20240319093915.31778-3-tzimmermann@suse.de> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240319093915.31778-1-tzimmermann@suse.de> References: <20240319093915.31778-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Score: -0.35 X-Spamd-Result: default: False [-0.35 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; REPLY(-4.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.20)[-1.000]; FREEMAIL_TO(0.00)[kernel.org,linaro.org,gmail.com,gmx.de,linux-m68k.org,ravnborg.org]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-0.05)[60.05%]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com,gmx.de]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_TWELVE(0.00)[12]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,linaro.org:email,ravnborg.org:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_TLS_ALL(0.00)[] X-Spam-Level: Authentication-Results: smtp-out1.suse.de; none X-Spam-Flag: NO The callback set_power in struct omap_backlight_config is not implemented anywhere. Remove it from the structure and driver. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Reviewed-by: Daniel Thompson Reviewed-by: Dan Carpenter --- v2: - update commit-message style according to subsystem (Lee) --- drivers/video/backlight/omap1_bl.c | 3 --- include/linux/platform_data/omap1_bl.h | 1 - 2 files changed, 4 deletions(-) diff --git a/drivers/video/backlight/omap1_bl.c b/drivers/video/backlight/omap1_bl.c index 69a49384b3de4..84d148f385951 100644 --- a/drivers/video/backlight/omap1_bl.c +++ b/drivers/video/backlight/omap1_bl.c @@ -39,9 +39,6 @@ static inline void omapbl_send_enable(int enable) static void omapbl_blank(struct omap_backlight *bl, int mode) { - if (bl->pdata->set_power) - bl->pdata->set_power(bl->dev, mode); - switch (mode) { case FB_BLANK_NORMAL: case FB_BLANK_VSYNC_SUSPEND: diff --git a/include/linux/platform_data/omap1_bl.h b/include/linux/platform_data/omap1_bl.h index 5e8b17d77a5fe..3d0bab31a0a94 100644 --- a/include/linux/platform_data/omap1_bl.h +++ b/include/linux/platform_data/omap1_bl.h @@ -6,7 +6,6 @@ struct omap_backlight_config { int default_intensity; - int (*set_power)(struct device *dev, int state); }; #endif From patchwork Tue Mar 19 09:37:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13596487 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5BB977D075 for ; Tue, 19 Mar 2024 09:39:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710841162; cv=none; b=TpUZiwBLGOd7FgJdpAFZXpmD6xiGYaZArAOslCOOfKmGadMUY8wWo+4qnpJ9c0Aiyr2A6q/+byUshLOnQ6NcAT5O81vxCiljh1EeLu7cdcdIq3A+ZzqQI9GcHnpJ0chEIR3uhNpX/yaw9O2qj9oOLzQRUPzrHc9scvcsIbYJRtg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710841162; c=relaxed/simple; bh=s2rcjk2xWxLikKnKuD3iwroCkSUh5zUCDjiArzuRmyw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=j4Df/pvtd11kOe5FCSKUYKtocykTgcyBO7KmyW5zwqud2+MoPXJ/DQHgWaecdK9AXA/U3ngXHXry9UT/PHzFdGcx1m9+eOdnADxYKrnB6D4cEiN+/1JbLWFsW6bMsJTJ6D8xFxPmS/h8VDUfaI7jxtry3YH+AQKBTJO0MtG4zYs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id D952E37616; Tue, 19 Mar 2024 09:39:18 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 8FED113700; Tue, 19 Mar 2024 09:39:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id gAX5IUZd+WU6GAAAD6G6ig (envelope-from ); Tue, 19 Mar 2024 09:39:18 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, andy@kernel.org, geert@linux-m68k.org, dan.carpenter@linaro.org, sam@ravnborg.org Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev, Thomas Zimmermann Subject: [PATCH v2 3/6] backlight: omap1: Replace FB_BLANK_ states with simple on/off Date: Tue, 19 Mar 2024 10:37:22 +0100 Message-ID: <20240319093915.31778-4-tzimmermann@suse.de> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240319093915.31778-1-tzimmermann@suse.de> References: <20240319093915.31778-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: Authentication-Results: smtp-out1.suse.de; none X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Score: -4.00 X-Rspamd-Queue-Id: D952E37616 X-Spam-Flag: NO The backlight is on for fb_blank eq FB_BLANK_UNBLANK, or off for any other value in fb_blank. But the field fb_blank in struct backlight_properties is deprecated and should not be used any longer. Replace the test for fb_blank in omap's backlight code with a simple boolean parameter and push the test into the update_status helper. Instead of reading fb_blank directly, decode the backlight device's status with backlight_is_blank(). Signed-off-by: Thomas Zimmermann Reviewed-by: Dan Carpenter Reviewed-by: Daniel Thompson --- v2: - update commit-message style according to subsystem (Lee) - rename 'power/on' to 'enable/enabled' (Daniel) --- drivers/video/backlight/omap1_bl.c | 43 +++++++++++++----------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/drivers/video/backlight/omap1_bl.c b/drivers/video/backlight/omap1_bl.c index 84d148f385951..636b390f78f04 100644 --- a/drivers/video/backlight/omap1_bl.c +++ b/drivers/video/backlight/omap1_bl.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -20,7 +19,7 @@ #define OMAPBL_MAX_INTENSITY 0xff struct omap_backlight { - int powermode; + bool enabled; int current_intensity; struct device *dev; @@ -37,21 +36,14 @@ static inline void omapbl_send_enable(int enable) omap_writeb(enable, OMAP_PWL_CLK_ENABLE); } -static void omapbl_blank(struct omap_backlight *bl, int mode) +static void omapbl_enable(struct omap_backlight *bl, bool enable) { - switch (mode) { - case FB_BLANK_NORMAL: - case FB_BLANK_VSYNC_SUSPEND: - case FB_BLANK_HSYNC_SUSPEND: - case FB_BLANK_POWERDOWN: - omapbl_send_intensity(0); - omapbl_send_enable(0); - break; - - case FB_BLANK_UNBLANK: + if (enable) { omapbl_send_intensity(bl->current_intensity); omapbl_send_enable(1); - break; + } else { + omapbl_send_intensity(0); + omapbl_send_enable(0); } } @@ -61,7 +53,7 @@ static int omapbl_suspend(struct device *dev) struct backlight_device *bl_dev = dev_get_drvdata(dev); struct omap_backlight *bl = bl_get_data(bl_dev); - omapbl_blank(bl, FB_BLANK_POWERDOWN); + omapbl_enable(bl, false); return 0; } @@ -70,33 +62,34 @@ static int omapbl_resume(struct device *dev) struct backlight_device *bl_dev = dev_get_drvdata(dev); struct omap_backlight *bl = bl_get_data(bl_dev); - omapbl_blank(bl, bl->powermode); + omapbl_enable(bl, bl->enabled); return 0; } #endif -static int omapbl_set_power(struct backlight_device *dev, int state) +static void omapbl_set_enabled(struct backlight_device *dev, bool enable) { struct omap_backlight *bl = bl_get_data(dev); - omapbl_blank(bl, state); - bl->powermode = state; - - return 0; + omapbl_enable(bl, enable); + bl->enabled = enable; } static int omapbl_update_status(struct backlight_device *dev) { struct omap_backlight *bl = bl_get_data(dev); + bool enable; if (bl->current_intensity != dev->props.brightness) { - if (bl->powermode == FB_BLANK_UNBLANK) + if (bl->enabled) omapbl_send_intensity(dev->props.brightness); bl->current_intensity = dev->props.brightness; } - if (dev->props.fb_blank != bl->powermode) - omapbl_set_power(dev, dev->props.fb_blank); + enable = !backlight_is_blank(dev); + + if (enable != bl->enabled) + omapbl_set_enabled(dev, enable); return 0; } @@ -136,7 +129,7 @@ static int omapbl_probe(struct platform_device *pdev) if (IS_ERR(dev)) return PTR_ERR(dev); - bl->powermode = FB_BLANK_POWERDOWN; + bl->enabled = false; bl->current_intensity = 0; bl->pdata = pdata; From patchwork Tue Mar 19 09:37:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13596488 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB9197D06B for ; Tue, 19 Mar 2024 09:39:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710841162; cv=none; b=evlpqOWEPlW25mo3S1ZWLNcxXNorZd+SGIysU1lJDF4izzIhEH1uH8aENoSnEc3z1EYh7Ell1s5zRRpuyUmfJiBERRrZJweW3Po2EVuweFbd9q95dJYFl+Y7EymyaE8YNTMdM4xyFxijeG7nzCq5HKmNfSrzFJk4KO/Cl4ytRrs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710841162; c=relaxed/simple; bh=MDfilVIl7daH5Kcq2D+3yq3JcOFEQvcxqUd2x4jchmM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K0fJoOvDHgD2iQCwMZkPfYLKlXe0VlHc5eMeVK1RahFvlAwOz9DKwMfHbBRAZnGB/dT8TN89/S2ulvb7tT5W7d9d2m8yCp7wltY3Mj49CHqWsZNDFnb0nuMEC5mVq8SNdroU2IHgJF2NVIgbUOfywcFj2bg7CbRsTcb2nvvSk/w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=udaekWZp; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=ZLiviilM; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=udaekWZp; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=ZLiviilM; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="udaekWZp"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="ZLiviilM"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="udaekWZp"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="ZLiviilM" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 3311D37617; Tue, 19 Mar 2024 09:39:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1710841159; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/k2Wu79j5YoxwvEpkDnkCxLMZfLnw7DCJcpK6VvKv9k=; b=udaekWZpqPiColuydRyOG0vuE5VeTVGUKs4+r5jLKd8/Ps/MSUwZxk1Fb/LXHpPU3oMuKO EVbg8HkrbhI1uT59N97eE0s9a6Hrcg7MkauhAbejvaEjL97QNf9eYtsfaN/bE9O/J/Ol8p HzScvspIc50hV6USYCsRIu6o6x5Iy/k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1710841159; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/k2Wu79j5YoxwvEpkDnkCxLMZfLnw7DCJcpK6VvKv9k=; b=ZLiviilMEsBiDJm+avWUVRa5LhmjoSXtyLLbQ2YOCFCRqmpRlycohwSSQnPnwoKUgcCOHm pSgm0Y+fiArLX9Bg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1710841159; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/k2Wu79j5YoxwvEpkDnkCxLMZfLnw7DCJcpK6VvKv9k=; b=udaekWZpqPiColuydRyOG0vuE5VeTVGUKs4+r5jLKd8/Ps/MSUwZxk1Fb/LXHpPU3oMuKO EVbg8HkrbhI1uT59N97eE0s9a6Hrcg7MkauhAbejvaEjL97QNf9eYtsfaN/bE9O/J/Ol8p HzScvspIc50hV6USYCsRIu6o6x5Iy/k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1710841159; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/k2Wu79j5YoxwvEpkDnkCxLMZfLnw7DCJcpK6VvKv9k=; b=ZLiviilMEsBiDJm+avWUVRa5LhmjoSXtyLLbQ2YOCFCRqmpRlycohwSSQnPnwoKUgcCOHm pSgm0Y+fiArLX9Bg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id DF42C136A5; Tue, 19 Mar 2024 09:39:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id SClFNUZd+WU6GAAAD6G6ig (envelope-from ); Tue, 19 Mar 2024 09:39:18 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, andy@kernel.org, geert@linux-m68k.org, dan.carpenter@linaro.org, sam@ravnborg.org Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev, Thomas Zimmermann Subject: [PATCH v2 4/6] fbdev: omap2/omapfb: Replace use of fb_blank with backlight helpers Date: Tue, 19 Mar 2024 10:37:23 +0100 Message-ID: <20240319093915.31778-5-tzimmermann@suse.de> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240319093915.31778-1-tzimmermann@suse.de> References: <20240319093915.31778-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Score: -0.59 X-Spamd-Result: default: False [-0.59 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com,gmx.de]; R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; REPLY(-4.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_RATELIMIT(0.00)[to_ip_from(RLe6e1dyhqp7xrfznmmjiny17d)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_TWELVE(0.00)[12]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,linaro.org:email]; FREEMAIL_TO(0.00)[kernel.org,linaro.org,gmail.com,gmx.de,linux-m68k.org,ravnborg.org]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.29)[74.64%] X-Spam-Level: Authentication-Results: smtp-out1.suse.de; none X-Spam-Flag: NO Replace the use of struct backlight_properties.fb_blank with backlight helpers. This effects testing if the backlight is blanked and reading the backlight's brightness level. Signed-off-by: Thomas Zimmermann Reviewed-by: Dan Carpenter --- v2: - update commit-message style according to subsystem (Lee) --- drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c | 6 +----- .../fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c | 9 ++------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c index adb8881bac285..47683a6c00767 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c @@ -356,11 +356,7 @@ static int dsicm_bl_update_status(struct backlight_device *dev) static int dsicm_bl_get_intensity(struct backlight_device *dev) { - if (dev->props.fb_blank == FB_BLANK_UNBLANK && - dev->props.power == FB_BLANK_UNBLANK) - return dev->props.brightness; - - return 0; + return backlight_get_brightness(dev); } static const struct backlight_ops dsicm_bl_ops = { diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c index 685c63aa4e030..9d3ce234a7874 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c @@ -340,11 +340,7 @@ static int acx565akm_bl_update_status(struct backlight_device *dev) dev_dbg(&ddata->spi->dev, "%s\n", __func__); - if (dev->props.fb_blank == FB_BLANK_UNBLANK && - dev->props.power == FB_BLANK_UNBLANK) - level = dev->props.brightness; - else - level = 0; + level = backlight_get_brightness(dev); if (ddata->has_bc) acx565akm_set_brightness(ddata, level); @@ -363,8 +359,7 @@ static int acx565akm_bl_get_intensity(struct backlight_device *dev) if (!ddata->has_bc) return -ENODEV; - if (dev->props.fb_blank == FB_BLANK_UNBLANK && - dev->props.power == FB_BLANK_UNBLANK) { + if (!backlight_is_blank(dev)) { if (ddata->has_bc) return acx565akm_get_actual_brightness(ddata); else From patchwork Tue Mar 19 09:37:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13596491 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1DC453379 for ; Tue, 19 Mar 2024 09:39:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710841169; cv=none; b=cUgY8QRiUI68oaGB4tMrQA6XD5E93RJnBD5q5SqY4BuzL76G/s5Qt1/T/YgmVryodH0ANnWDglxk15C1xndWy6EUUozQbSOEfvOLfCHUxiGXXZ+JD9u49iQyzK1IfTbAz4sexM9JpGggSX0go6QOl3i4u22Ie6LF5V7FBVBJ/7Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710841169; c=relaxed/simple; bh=HKnw7C4eWtSdq4lPuUfuRKifzgi2CLT9yTnkdhpsrIk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DS0F2BURcYBZUMJfeL4gfOeW0+8LXDRvazhDz9OIDpMzoZ0rL4u0NJTtSM8FG0MrKJJElG7H7Q9Ows7K9L5lfdWla1ZH+dmkBMn2tkDRBYl8e+rMBHlUXYflvZJCPt0wPDbh8pR3HapuYtMssFhguIEZ+d2khtIzuTc/dpB3CjA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=q0Cgf4cV; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=DCbnmhkI; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=q0Cgf4cV; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=DCbnmhkI; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="q0Cgf4cV"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="DCbnmhkI"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="q0Cgf4cV"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="DCbnmhkI" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 822825D40D; Tue, 19 Mar 2024 09:39:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1710841159; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EsLgC6a7SLMWzCnsR8L8i4IJJpXfcwCqgqO3xARUgMw=; b=q0Cgf4cVKLh9CoqX7WY+E+NNbuXOFB4q5vx8GltZJugFNEKJXOEQXUl4aUJGPSMYTlEMa9 pE7iVI9mJAxM9Aw3nkutJMLO63MbyhqdoOlPJfJWuA84VPEGL4vbPB/NAzPc+1hIynGw6l 1RcDtd2BakdWSFmHIOWZHY/XuXStBV0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1710841159; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EsLgC6a7SLMWzCnsR8L8i4IJJpXfcwCqgqO3xARUgMw=; b=DCbnmhkI+FTn+to9rEBVMAB0xkQgu1TOjIpPBO13yTdgWJoLMYmPPqAqFEQBzOaH+JRbGh jhjrAE8Ibtm2A6Bg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1710841159; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EsLgC6a7SLMWzCnsR8L8i4IJJpXfcwCqgqO3xARUgMw=; b=q0Cgf4cVKLh9CoqX7WY+E+NNbuXOFB4q5vx8GltZJugFNEKJXOEQXUl4aUJGPSMYTlEMa9 pE7iVI9mJAxM9Aw3nkutJMLO63MbyhqdoOlPJfJWuA84VPEGL4vbPB/NAzPc+1hIynGw6l 1RcDtd2BakdWSFmHIOWZHY/XuXStBV0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1710841159; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EsLgC6a7SLMWzCnsR8L8i4IJJpXfcwCqgqO3xARUgMw=; b=DCbnmhkI+FTn+to9rEBVMAB0xkQgu1TOjIpPBO13yTdgWJoLMYmPPqAqFEQBzOaH+JRbGh jhjrAE8Ibtm2A6Bg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 3902213700; Tue, 19 Mar 2024 09:39:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 2Ii/DEdd+WU6GAAAD6G6ig (envelope-from ); Tue, 19 Mar 2024 09:39:19 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, andy@kernel.org, geert@linux-m68k.org, dan.carpenter@linaro.org, sam@ravnborg.org Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev, Thomas Zimmermann Subject: [PATCH v2 5/6] staging: fbtft: Remove reference to fb_blank Date: Tue, 19 Mar 2024 10:37:24 +0100 Message-ID: <20240319093915.31778-6-tzimmermann@suse.de> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240319093915.31778-1-tzimmermann@suse.de> References: <20240319093915.31778-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -0.30 X-Spamd-Result: default: False [-0.30 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com,gmx.de]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; REPLY(-4.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_RATELIMIT(0.00)[to_ip_from(RLe6e1dyhqp7xrfznmmjiny17d)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_TWELVE(0.00)[12]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[linaro.org:email,suse.de:email]; FREEMAIL_TO(0.00)[kernel.org,linaro.org,gmail.com,gmx.de,linux-m68k.org,ravnborg.org]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[28.52%] X-Spam-Flag: NO The field fb_blank in struct backlight_properties is deprecated and should not be used. Don't output its value in the driver's debug print. Signed-off-by: Thomas Zimmermann Reviewed-by: Dan Carpenter Acked-by: Greg Kroah-Hartman --- drivers/staging/fbtft/fb_ssd1351.c | 4 +--- drivers/staging/fbtft/fbtft-core.c | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/fbtft/fb_ssd1351.c b/drivers/staging/fbtft/fb_ssd1351.c index 72172e870007e..ca2cba2185ae3 100644 --- a/drivers/staging/fbtft/fb_ssd1351.c +++ b/drivers/staging/fbtft/fb_ssd1351.c @@ -194,9 +194,7 @@ static int update_onboard_backlight(struct backlight_device *bd) struct fbtft_par *par = bl_get_data(bd); bool on; - fbtft_par_dbg(DEBUG_BACKLIGHT, par, - "%s: power=%d, fb_blank=%d\n", - __func__, bd->props.power, bd->props.fb_blank); + fbtft_par_dbg(DEBUG_BACKLIGHT, par, "%s: power=%d\n", __func__, bd->props.power); on = !backlight_is_blank(bd); /* Onboard backlight connected to GPIO0 on SSD1351, GPIO1 unused */ diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index 3626f429b002c..5ca150c409c3c 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -133,9 +133,8 @@ static int fbtft_backlight_update_status(struct backlight_device *bd) struct fbtft_par *par = bl_get_data(bd); bool polarity = par->polarity; - fbtft_par_dbg(DEBUG_BACKLIGHT, par, - "%s: polarity=%d, power=%d, fb_blank=%d\n", - __func__, polarity, bd->props.power, bd->props.fb_blank); + fbtft_par_dbg(DEBUG_BACKLIGHT, par, "%s: polarity=%d, power=%d\n", __func__, + polarity, bd->props.power); if (!backlight_is_blank(bd)) gpiod_set_value(par->gpio.led[0], polarity); From patchwork Tue Mar 19 09:37:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13596489 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 812407D081 for ; Tue, 19 Mar 2024 09:39:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710841163; cv=none; b=TBeBijtwHd4OUjkJAUxZ5fpAqP/djooFNC8/hlwLTUs7iFeyI7axooVQ0/zhWF/Jo3AtYCBVRw6iAVt/0GGyClarADhPc3wqjeO/zTzV/kvkb6AZ4hpvhq9YJZvviWwEf6ahaWEcjTrTC8L4j2/CEVI5q10gEh/pNL7mBjaeI2k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710841163; c=relaxed/simple; bh=OpuayS1lTyMjOXSypA3vnR+xc8M4EXiRl5OrpOS79FQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q+eF6UB/FpKf8LOOzU1pFXpSiLTlsAHRQeFx1gPbZcWDLwIuFDjSkWb/tNlu+cYCvTzY/FWl6Dvb7kXFFssmlZuMNvYrSsRNuBVN7dHkNnEtuNf8y3Gvl3qbQ+2BsfDnpfRoI4F6farYWcIFgl8NEQxROSUbnF9v9vmsvc783tc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E710137618; Tue, 19 Mar 2024 09:39:19 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 882F4136A5; Tue, 19 Mar 2024 09:39:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id OFEkIEdd+WU6GAAAD6G6ig (envelope-from ); Tue, 19 Mar 2024 09:39:19 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, andy@kernel.org, geert@linux-m68k.org, dan.carpenter@linaro.org, sam@ravnborg.org Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev, Thomas Zimmermann , Flavio Suligoi , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Subject: [PATCH v2 6/6] backlight: Remove fb_blank from struct backlight_properties Date: Tue, 19 Mar 2024 10:37:25 +0100 Message-ID: <20240319093915.31778-7-tzimmermann@suse.de> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240319093915.31778-1-tzimmermann@suse.de> References: <20240319093915.31778-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: Authentication-Results: smtp-out1.suse.de; none X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Score: -4.00 X-Rspamd-Queue-Id: E710137618 X-Spam-Flag: NO Remove the field fb_blank from struct backlight_properties and remove all code that still sets or reads it. Backlight blank status is now tracked exclusively in struct backlight_properties.state. The core backlight code keeps the fb_blank and state fields in sync, but doesn't do anything else with fb_blank. Several drivers initialize fb_blank to FB_BLANK_UNBLANK to enable the backlight. This is already the default for the state field. So we can delete the fb_blank code from core and drivers and rely on the state field. Signed-off-by: Thomas Zimmermann Cc: Flavio Suligoi Cc: Nicolas Ferre Cc: Alexandre Belloni Cc: Claudiu Beznea Tested-by: Flavio Suligoi Reviewed-by: Daniel Thompson Reviewed-by: Dan Carpenter --- drivers/video/backlight/backlight.c | 2 -- drivers/video/backlight/mp3309c.c | 1 - drivers/video/backlight/omap1_bl.c | 1 - drivers/video/fbdev/atmel_lcdfb.c | 1 - .../omap2/omapfb/displays/panel-dsi-cm.c | 1 - .../omapfb/displays/panel-sony-acx565akm.c | 1 - include/linux/backlight.h | 25 +------------------ 7 files changed, 1 insertion(+), 31 deletions(-) diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 86e1cdc8e3697..691f1f3030e98 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -118,14 +118,12 @@ static int fb_notifier_callback(struct notifier_block *self, bd->fb_bl_on[node] = true; if (!bd->use_count++) { bd->props.state &= ~BL_CORE_FBBLANK; - bd->props.fb_blank = FB_BLANK_UNBLANK; backlight_update_status(bd); } } else if (fb_blank != FB_BLANK_UNBLANK && bd->fb_bl_on[node]) { bd->fb_bl_on[node] = false; if (!(--bd->use_count)) { bd->props.state |= BL_CORE_FBBLANK; - bd->props.fb_blank = fb_blank; backlight_update_status(bd); } } diff --git a/drivers/video/backlight/mp3309c.c b/drivers/video/backlight/mp3309c.c index 34d71259fac1d..059f4ddbbc842 100644 --- a/drivers/video/backlight/mp3309c.c +++ b/drivers/video/backlight/mp3309c.c @@ -378,7 +378,6 @@ static int mp3309c_probe(struct i2c_client *client) props.scale = BACKLIGHT_SCALE_LINEAR; props.type = BACKLIGHT_RAW; props.power = FB_BLANK_UNBLANK; - props.fb_blank = FB_BLANK_UNBLANK; chip->bl = devm_backlight_device_register(chip->dev, "mp3309c", chip->dev, chip, &mp3309c_bl_ops, &props); diff --git a/drivers/video/backlight/omap1_bl.c b/drivers/video/backlight/omap1_bl.c index 636b390f78f04..e461e19231ae3 100644 --- a/drivers/video/backlight/omap1_bl.c +++ b/drivers/video/backlight/omap1_bl.c @@ -139,7 +139,6 @@ static int omapbl_probe(struct platform_device *pdev) omap_cfg_reg(PWL); /* Conflicts with UART3 */ - dev->props.fb_blank = FB_BLANK_UNBLANK; dev->props.brightness = pdata->default_intensity; omapbl_update_status(dev); diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c index 9e391e5eaf9da..5574fb0361ee3 100644 --- a/drivers/video/fbdev/atmel_lcdfb.c +++ b/drivers/video/fbdev/atmel_lcdfb.c @@ -153,7 +153,6 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo) sinfo->backlight = bl; bl->props.power = FB_BLANK_UNBLANK; - bl->props.fb_blank = FB_BLANK_UNBLANK; bl->props.brightness = atmel_bl_get_brightness(bl); } diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c index 47683a6c00767..274bdf7b3b459 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c @@ -1215,7 +1215,6 @@ static int dsicm_probe(struct platform_device *pdev) ddata->bldev = bldev; - bldev->props.fb_blank = FB_BLANK_UNBLANK; bldev->props.power = FB_BLANK_UNBLANK; bldev->props.brightness = 255; diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c index 9d3ce234a7874..71d2e015960c7 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c @@ -753,7 +753,6 @@ static int acx565akm_probe(struct spi_device *spi) } memset(&props, 0, sizeof(props)); - props.fb_blank = FB_BLANK_UNBLANK; props.power = FB_BLANK_UNBLANK; props.type = BACKLIGHT_RAW; diff --git a/include/linux/backlight.h b/include/linux/backlight.h index 614653e07e3a8..31600b144d794 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h @@ -218,25 +218,6 @@ struct backlight_properties { */ int power; - /** - * @fb_blank: The power state from the FBIOBLANK ioctl. - * - * When the FBIOBLANK ioctl is called @fb_blank is set to the - * blank parameter and the update_status() operation is called. - * - * When the backlight device is enabled @fb_blank is set - * to FB_BLANK_UNBLANK. When the backlight device is disabled - * @fb_blank is set to FB_BLANK_POWERDOWN. - * - * Backlight drivers should avoid using this property. It has been - * replaced by state & BL_CORE_FBLANK (although most drivers should - * use backlight_is_blank() as the preferred means to get the blank - * state). - * - * fb_blank is deprecated and will be removed. - */ - int fb_blank; - /** * @type: The type of backlight supported. * @@ -366,7 +347,6 @@ static inline int backlight_enable(struct backlight_device *bd) return 0; bd->props.power = FB_BLANK_UNBLANK; - bd->props.fb_blank = FB_BLANK_UNBLANK; bd->props.state &= ~BL_CORE_FBBLANK; return backlight_update_status(bd); @@ -382,7 +362,6 @@ static inline int backlight_disable(struct backlight_device *bd) return 0; bd->props.power = FB_BLANK_POWERDOWN; - bd->props.fb_blank = FB_BLANK_POWERDOWN; bd->props.state |= BL_CORE_FBBLANK; return backlight_update_status(bd); @@ -395,15 +374,13 @@ static inline int backlight_disable(struct backlight_device *bd) * Display is expected to be blank if any of these is true:: * * 1) if power in not UNBLANK - * 2) if fb_blank is not UNBLANK - * 3) if state indicate BLANK or SUSPENDED + * 2) if state indicate BLANK or SUSPENDED * * Returns true if display is expected to be blank, false otherwise. */ static inline bool backlight_is_blank(const struct backlight_device *bd) { return bd->props.power != FB_BLANK_UNBLANK || - bd->props.fb_blank != FB_BLANK_UNBLANK || bd->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK); }