From patchwork Mon Feb 12 16:16:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13553462 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 3C3493D0D1; Mon, 12 Feb 2024 16:26:50 +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=1707755212; cv=none; b=urUyv6+ygc5+I6yjgpXLYYFJiPcTqfIy5KMDhcIt5dGja59wMyICGQeEsCG0HahPaAp8ZFBRxibK1IhS9BpVf3ViZ5gqsKXRkP6CO4KRVoTNCq+0u8iNruSSa3gx87ujiRAZqMed3E0VTQc+tp00M/6nGZ3N4KtNJGfZMrUTShY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707755212; c=relaxed/simple; bh=C2WavXORd0CbbT0k9Kv+WFEysZqm+sHXxqvEfYE3OYs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eMedevoXUT0gZSedA3LYHHIF9v8T9vbI0wbKAc+z5GQ2x1dkvPOv3aU/gCn+YhTwiiG4ksUOQlqs8You+3sIbRuRul15q/BCkTwjL3DGL+kRKCS6dDPvHDeV47aLksk1BbV+nG3qPpssHN4I4VgZLjgYTtmgRMjHQukkxlyl9zg= 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 imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (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 7508E1FD53; Mon, 12 Feb 2024 16:26:49 +0000 (UTC) Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 34E6F13A3D; Mon, 12 Feb 2024 16:26:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id gDOlC8lGymXmXgAAn2gu4w (envelope-from ); Mon, 12 Feb 2024 16:26:49 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-input@vger.kernel.org, linux-pwm@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 01/10] backlight: Match backlight device against struct fb_info.bl_dev Date: Mon, 12 Feb 2024 17:16:34 +0100 Message-ID: <20240212162645.5661-2-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240212162645.5661-1-tzimmermann@suse.de> References: <20240212162645.5661-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: 7508E1FD53 X-Spam-Flag: NO Framebuffer drivers for devices with dedicated backlight are supposed to set struct fb_info.bl_dev to the backlight's respective device. Use the value to match backlight and framebuffer in the backlight core code. Signed-off-by: Thomas Zimmermann Reviewed-by: Daniel Thompson Reviewed-by: Javier Martinez Canillas --- drivers/video/backlight/backlight.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 86e1cdc8e3697..48844a4f28ad3 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -98,7 +98,8 @@ static int fb_notifier_callback(struct notifier_block *self, { struct backlight_device *bd; struct fb_event *evdata = data; - int node = evdata->info->node; + struct fb_info *info = evdata->info; + int node = info->node; int fb_blank = 0; /* If we aren't interested in this event, skip it immediately ... */ @@ -110,8 +111,12 @@ static int fb_notifier_callback(struct notifier_block *self, if (!bd->ops) goto out; - if (bd->ops->check_fb && !bd->ops->check_fb(bd, evdata->info)) + else if (bd->ops->check_fb && !bd->ops->check_fb(bd, info)) goto out; +#if IS_ENABLED(CONFIG_FB_BACKLIGHT) + else if (info->bl_dev && info->bl_dev != bd) + goto out; +#endif fb_blank = *(int *)evdata->data; if (fb_blank == FB_BLANK_UNBLANK && !bd->fb_bl_on[node]) { From patchwork Mon Feb 12 16:16:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13553463 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 A2B093D0D2; Mon, 12 Feb 2024 16:26:51 +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=1707755213; cv=none; b=F2zD4ibOU4YRVum10Q6IBbJGDRW3rH5TuDCjpJTkLEs0s07/fdAtSFOEWTWRMKZL6YWdT+7P1YfVeRbHT4T9JtUUF4eVkwRLeb+FdL8XOwsJvubwjHaWddqOINQueBpqC7GudR85AKF2jugK1NCsMpMfvJi68gOGzikHb7aacEo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707755213; c=relaxed/simple; bh=H+UuV4jrWI69sWyQx+P8r3Xj+qldFT1G7UMwDg90HNM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eWutqiJmDgK194ArbYkyFgVj9UVGnPSS41N+HME756GpSZdrkS1MR7xfmH5DInBk26vgNlpWszzaisb+3xRb2vjf0/ufAWW0wnpXQTtUxDWOJSCtH/j9mdjxLEiTuRHoMfB380PrtKQ3MWFXveiojt+q7jZu0Aybdj8L3LCX19k= 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=HJb6k7Jd; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=DqB73Qrs; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=HJb6k7Jd; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=DqB73Qrs; 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="HJb6k7Jd"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="DqB73Qrs"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="HJb6k7Jd"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="DqB73Qrs" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (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 C31E52209C; Mon, 12 Feb 2024 16:26:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707755209; 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=YVY8JDGCUpRWMipTF/sWYOAMXRX+W5q/EN06D8H6f8k=; b=HJb6k7JdeXftaiQusrGFpL6C5hSn6ZiU81yJor8JdGz8qkNW0ryDg6vcDdbh9vfWc0LF3m bdJmLXeLj4oVg7E7q9Uo9A1E/g6pgx9Sob0cAzDRUyC8A/14KF1fdLkxoGhbEYGndxvrBx IIyMHKG/RNIFFMiU8KK79nv3lGI6jwE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707755209; 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=YVY8JDGCUpRWMipTF/sWYOAMXRX+W5q/EN06D8H6f8k=; b=DqB73QrsRkvZqS4kA1tXsJgGHHg+yKmHl6lkSjw097Px+ifmJt1x11nxgp5Fefsl8HqGb4 1kPCkMXrOKCAahDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707755209; 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=YVY8JDGCUpRWMipTF/sWYOAMXRX+W5q/EN06D8H6f8k=; b=HJb6k7JdeXftaiQusrGFpL6C5hSn6ZiU81yJor8JdGz8qkNW0ryDg6vcDdbh9vfWc0LF3m bdJmLXeLj4oVg7E7q9Uo9A1E/g6pgx9Sob0cAzDRUyC8A/14KF1fdLkxoGhbEYGndxvrBx IIyMHKG/RNIFFMiU8KK79nv3lGI6jwE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707755209; 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=YVY8JDGCUpRWMipTF/sWYOAMXRX+W5q/EN06D8H6f8k=; b=DqB73QrsRkvZqS4kA1tXsJgGHHg+yKmHl6lkSjw097Px+ifmJt1x11nxgp5Fefsl8HqGb4 1kPCkMXrOKCAahDA== Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 79C6E13A0E; Mon, 12 Feb 2024 16:26:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id 4LqOHMlGymXmXgAAn2gu4w (envelope-from ); Mon, 12 Feb 2024 16:26:49 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-input@vger.kernel.org, linux-pwm@vger.kernel.org, Thomas Zimmermann , Robin van der Gracht Subject: [PATCH 02/10] auxdisplay/ht16k33: Remove struct backlight_ops.check_fb Date: Mon, 12 Feb 2024 17:16:35 +0100 Message-ID: <20240212162645.5661-3-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240212162645.5661-1-tzimmermann@suse.de> References: <20240212162645.5661-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-out1.suse.de; none X-Spamd-Result: default: False [-2.10 / 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)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_SEVEN(0.00)[11]; MID_CONTAINS_FROM(1.00)[]; FREEMAIL_TO(0.00)[kernel.org,linaro.org,gmail.com,gmx.de,redhat.com]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[99.99%] X-Spam-Level: X-Spam-Flag: NO X-Spam-Score: -2.10 The driver sets struct fb_info.bl_dev to the correct backlight device. Thus rely on the backlight core code to match backlight and framebuffer devices, and remove the extra check_fb function from struct backlight_ops. Signed-off-by: Thomas Zimmermann Cc: Robin van der Gracht Acked-By: Robin van der Gracht Reviewed-by: Javier Martinez Canillas --- drivers/auxdisplay/ht16k33.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c index a90430b7d07ba..0a858db32486b 100644 --- a/drivers/auxdisplay/ht16k33.c +++ b/drivers/auxdisplay/ht16k33.c @@ -325,16 +325,8 @@ static int ht16k33_bl_update_status(struct backlight_device *bl) return ht16k33_brightness_set(priv, brightness); } -static int ht16k33_bl_check_fb(struct backlight_device *bl, struct fb_info *fi) -{ - struct ht16k33_priv *priv = bl_get_data(bl); - - return (fi == NULL) || (fi->par == priv); -} - static const struct backlight_ops ht16k33_bl_ops = { .update_status = ht16k33_bl_update_status, - .check_fb = ht16k33_bl_check_fb, }; /* From patchwork Mon Feb 12 16:16:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13553471 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 C681F3D0D4; Mon, 12 Feb 2024 16:26:51 +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=1707755217; cv=none; b=pyieL2q/xCL9GVkZZkW2JI/LJhr/CHunypyXsl1wVCuV4++CqIgeKbJj+871RPTme2u4Zx5kT7tI5SnBbEIcaD4uJjTZ+4TZEmRFbfNTqyp7fHJvKKW5+Egh3PexZ1AmdYV+ZDkg8w7hLDMxtVGay0QuFydn4uSa8jwQ3icYlF4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707755217; c=relaxed/simple; bh=AieS5dJ5Nfhit1dWCXPmx6XhOYR0e/KtOWgCbU60kEc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nih5p8m6cnqmhZNSX3ZNuqhOFRt4Y9NmmmGVnR83Aiim7rk4oHYcfdxoWSeJrQ6ty4FiUmzQhmSkvlkj5m8Ie7VyyBZ84GW4u8AFIE6Xrx1//hf2pau2tmS+HT/vFqpX5PTX09h0SsGW7NSCb8MfX3zvvBbXQQL2IHRE77RxC4s= 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=ITSm5xUY; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=zD8fuXtl; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=ITSm5xUY; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=zD8fuXtl; 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="ITSm5xUY"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="zD8fuXtl"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="ITSm5xUY"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="zD8fuXtl" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (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 257B11FD55; Mon, 12 Feb 2024 16:26:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707755210; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yxISTntkPhzhHroXWtNxLJRq1PFjq8ruleuT4zEM1tw=; b=ITSm5xUY60pFGthZdkuMpzG5iuG9pjDxrMpg0Oqpl1rdFOw52C3F/S4jA9LRKU7FE3dRkU FBWAco82UysTguAgGX1VV5GAIzFCzYPEHExRlnERWP3dVQWYCfiuh5FqYlTNDEzDGJBjaZ 8sd6KJNWo4F/Uo/FaxwSY5LlM35gUjM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707755210; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yxISTntkPhzhHroXWtNxLJRq1PFjq8ruleuT4zEM1tw=; b=zD8fuXtlXGiU5oPXqFrnw0qskYZMmRFGdwsq0uk497BVCJ31Xaiz/kKHmXg3mnEG0Bjr4K ZAMFdd5gqmdGi9BQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707755210; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yxISTntkPhzhHroXWtNxLJRq1PFjq8ruleuT4zEM1tw=; b=ITSm5xUY60pFGthZdkuMpzG5iuG9pjDxrMpg0Oqpl1rdFOw52C3F/S4jA9LRKU7FE3dRkU FBWAco82UysTguAgGX1VV5GAIzFCzYPEHExRlnERWP3dVQWYCfiuh5FqYlTNDEzDGJBjaZ 8sd6KJNWo4F/Uo/FaxwSY5LlM35gUjM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707755210; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yxISTntkPhzhHroXWtNxLJRq1PFjq8ruleuT4zEM1tw=; b=zD8fuXtlXGiU5oPXqFrnw0qskYZMmRFGdwsq0uk497BVCJ31Xaiz/kKHmXg3mnEG0Bjr4K ZAMFdd5gqmdGi9BQ== Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id C856B13A3D; Mon, 12 Feb 2024 16:26:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id mPWmL8lGymXmXgAAn2gu4w (envelope-from ); Mon, 12 Feb 2024 16:26:49 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-input@vger.kernel.org, linux-pwm@vger.kernel.org, Thomas Zimmermann , =?utf-8?q?Bruno_Pr=C3=A9mont?= Subject: [PATCH 03/10] hid/hid-picolcd: Fix initialization order Date: Mon, 12 Feb 2024 17:16:36 +0100 Message-ID: <20240212162645.5661-4-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240212162645.5661-1-tzimmermann@suse.de> References: <20240212162645.5661-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: -4.42 X-Spamd-Result: default: False [-4.42 / 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]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_RATELIMIT(0.00)[to_ip_from(RLbrmj4aennmrpd7btm9n9zy3k)]; 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_SEVEN(0.00)[11]; MID_CONTAINS_FROM(1.00)[]; FREEMAIL_TO(0.00)[kernel.org,linaro.org,gmail.com,gmx.de,redhat.com]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.12)[67.14%] X-Spam-Flag: NO For drivers that support backlight, LCD and fbdev devices, fbdev has to be initialized last. See documentation for struct fbinfo.bl_dev. Signed-off-by: Thomas Zimmermann Cc: "Bruno Prémont" Reviewed-by: Javier Martinez Canillas --- drivers/hid/hid-picolcd_core.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/hid/hid-picolcd_core.c b/drivers/hid/hid-picolcd_core.c index bbda231a7ce30..5ddebe25eb91f 100644 --- a/drivers/hid/hid-picolcd_core.c +++ b/drivers/hid/hid-picolcd_core.c @@ -474,11 +474,6 @@ static int picolcd_probe_lcd(struct hid_device *hdev, struct picolcd_data *data) if (error) goto err; - /* Set up the framebuffer device */ - error = picolcd_init_framebuffer(data); - if (error) - goto err; - /* Setup lcd class device */ error = picolcd_init_lcd(data, picolcd_out_report(REPORT_CONTRAST, hdev)); if (error) @@ -489,6 +484,11 @@ static int picolcd_probe_lcd(struct hid_device *hdev, struct picolcd_data *data) if (error) goto err; + /* Set up the framebuffer device */ + error = picolcd_init_framebuffer(data); + if (error) + goto err; + /* Setup the LED class devices */ error = picolcd_init_leds(data, picolcd_out_report(REPORT_LED_STATE, hdev)); if (error) @@ -502,9 +502,9 @@ static int picolcd_probe_lcd(struct hid_device *hdev, struct picolcd_data *data) return 0; err: picolcd_exit_leds(data); + picolcd_exit_framebuffer(data); picolcd_exit_backlight(data); picolcd_exit_lcd(data); - picolcd_exit_framebuffer(data); picolcd_exit_cir(data); picolcd_exit_keys(data); return error; @@ -623,9 +623,9 @@ static void picolcd_remove(struct hid_device *hdev) /* Cleanup LED */ picolcd_exit_leds(data); /* Clean up the framebuffer */ + picolcd_exit_framebuffer(data); picolcd_exit_backlight(data); picolcd_exit_lcd(data); - picolcd_exit_framebuffer(data); /* Cleanup input */ picolcd_exit_cir(data); picolcd_exit_keys(data); From patchwork Mon Feb 12 16:16:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13553470 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 308543D0DB; Mon, 12 Feb 2024 16:26:51 +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=1707755217; cv=none; b=gcnTDMQ5ggwo4Nbw3TqfIZht3khmqxbn+R/dUaoiLOv+oqN6EkI0TcY6PeXk94q5OTmrPmME0LTbtU37riUiqZvrY0qnR7LFEAs6tb3JvjmfkZa/JYSshIlqOIpFwkt2rqDNPqJJDGK57qdTCEEtwnF0RM0qoPTlHPKGS1L87iY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707755217; c=relaxed/simple; bh=doPlAeeoNyzg8g1FNUHqySR+q77Ac5U+2PLrjqK5vg4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XGKDisPJNoJtTOc2qpAPDNxUK+NE5/Wcu+RhBBATQdJoKJLEPTCyHRZdZrRTwKKIM5X7EIsvd1MybkbPmdZowjfzVpzSjE+fS1LdwWrEv3/ae4zRgJ7edmoqT8gky/ebD9ZQMUl3z7e9QgBLxd48nr3Rr88CfkrC7ijxZcR6dfw= 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 imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (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 70966220E6; Mon, 12 Feb 2024 16:26:50 +0000 (UTC) Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 2011213A0E; Mon, 12 Feb 2024 16:26:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id gIKhBspGymXmXgAAn2gu4w (envelope-from ); Mon, 12 Feb 2024 16:26:50 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-input@vger.kernel.org, linux-pwm@vger.kernel.org, Thomas Zimmermann , =?utf-8?q?Bruno_Pr=C3=A9mont?= Subject: [PATCH 04/10] hid/hid-picolcd: Remove struct backlight_ops.check_fb Date: Mon, 12 Feb 2024 17:16:37 +0100 Message-ID: <20240212162645.5661-5-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240212162645.5661-1-tzimmermann@suse.de> References: <20240212162645.5661-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-out1.suse.de; none X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: 70966220E6 X-Spam-Level: X-Spam-Score: -4.00 X-Spam-Flag: NO The driver sets struct fb_info.bl_dev to the correct backlight device. Thus rely on the backlight core code to match backlight and framebuffer devices, and remove the extra check_fb function from struct backlight_ops. Signed-off-by: Thomas Zimmermann Cc: "Bruno Prémont" Reviewed-by: Javier Martinez Canillas --- drivers/hid/hid-picolcd_backlight.c | 7 ------- drivers/hid/hid-picolcd_fb.c | 4 ++++ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/hid/hid-picolcd_backlight.c b/drivers/hid/hid-picolcd_backlight.c index 5bd2a8c4bbd66..08d16917eb60b 100644 --- a/drivers/hid/hid-picolcd_backlight.c +++ b/drivers/hid/hid-picolcd_backlight.c @@ -9,7 +9,6 @@ #include -#include #include #include "hid-picolcd.h" @@ -39,15 +38,9 @@ static int picolcd_set_brightness(struct backlight_device *bdev) return 0; } -static int picolcd_check_bl_fb(struct backlight_device *bdev, struct fb_info *fb) -{ - return fb && fb == picolcd_fbinfo((struct picolcd_data *)bl_get_data(bdev)); -} - static const struct backlight_ops picolcd_blops = { .update_status = picolcd_set_brightness, .get_brightness = picolcd_get_brightness, - .check_fb = picolcd_check_bl_fb, }; int picolcd_init_backlight(struct picolcd_data *data, struct hid_report *report) diff --git a/drivers/hid/hid-picolcd_fb.c b/drivers/hid/hid-picolcd_fb.c index d7dddd99d325e..4500f6e03d32f 100644 --- a/drivers/hid/hid-picolcd_fb.c +++ b/drivers/hid/hid-picolcd_fb.c @@ -493,6 +493,10 @@ int picolcd_init_framebuffer(struct picolcd_data *data) info->fix = picolcdfb_fix; info->fix.smem_len = PICOLCDFB_SIZE*8; +#ifdef CONFIG_HID_PICOLCD_BACKLIGHT + info->bl_dev = data->backlight; +#endif + fbdata = info->par; spin_lock_init(&fbdata->lock); fbdata->picolcd = data; From patchwork Mon Feb 12 16:16:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13553464 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 84B713D0DD; Mon, 12 Feb 2024 16:26:52 +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=1707755214; cv=none; b=W14RkahAyzsde6Pg/ff2hUslU3GZ14ztzUCljMj39uk1vbIvVQY++uPepxyfH9276qMj1an2ygWeQEbRGy4Uuef77dP4LB8ovDKNd2vZ6bB5rJ9oguY/NKov/sUiT0QuAxRp+2iGnTI61qUrDDqrfvZ5PbdT24uEKkYENVe2gzQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707755214; c=relaxed/simple; bh=uw2CvIalkaV8QLettoE/ekU1CX5amrAUkxPZxJ8MkiA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=beTB/myJUUAjW6Hpf3uABIJYEQzUBdtQu1f/6cyBelH7KdFAf5VztaEmtN5IgvyJgx1blmLRYGQSGJK/fCUGi65V+GhD/pWPcDlLPg6oMP+vJhr0dbP3rx6L9m32uf1BMBk/WYSjzcMcGxTJctNv+oiAdEf8dB+d1SHXth5wArE= 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=qj3iQ9qd; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=d5YaXlb9; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=qj3iQ9qd; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=d5YaXlb9; 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="qj3iQ9qd"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="d5YaXlb9"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="qj3iQ9qd"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="d5YaXlb9" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (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 B60A6220EB; Mon, 12 Feb 2024 16:26:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707755210; 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=XeEbhE7gJBfpRZnf7wbtBQJjMg65ulylVLZqUtDUC6Y=; b=qj3iQ9qdLUI66aBQIuJXD+7eRASXi9qTxCnorDFis5wqqDXUpqnmme/MN5QSeobcjwvHwO gE2455wmv/X4t2hoeBMHWc6H2KEhglXbEusHJ0zROm4KgITYbgbk7D9cMVEB7kWV0zz79b czYLPYN36Z/AYUyeI3ubUovf7FhMzJU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707755210; 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=XeEbhE7gJBfpRZnf7wbtBQJjMg65ulylVLZqUtDUC6Y=; b=d5YaXlb97upgeiOX1sJOvLimqwCQfs6eX62681Ug74ks0tuql+Mhig5w2mDBiJ5QJfieLa MqUqcEZn5V/ZmUBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707755210; 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=XeEbhE7gJBfpRZnf7wbtBQJjMg65ulylVLZqUtDUC6Y=; b=qj3iQ9qdLUI66aBQIuJXD+7eRASXi9qTxCnorDFis5wqqDXUpqnmme/MN5QSeobcjwvHwO gE2455wmv/X4t2hoeBMHWc6H2KEhglXbEusHJ0zROm4KgITYbgbk7D9cMVEB7kWV0zz79b czYLPYN36Z/AYUyeI3ubUovf7FhMzJU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707755210; 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=XeEbhE7gJBfpRZnf7wbtBQJjMg65ulylVLZqUtDUC6Y=; b=d5YaXlb97upgeiOX1sJOvLimqwCQfs6eX62681Ug74ks0tuql+Mhig5w2mDBiJ5QJfieLa MqUqcEZn5V/ZmUBQ== Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 6A5A313A3D; Mon, 12 Feb 2024 16:26:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id UOSjGMpGymXmXgAAn2gu4w (envelope-from ); Mon, 12 Feb 2024 16:26:50 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-input@vger.kernel.org, linux-pwm@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 05/10] backlight/aat2870-backlight: Remove struct backlight.check_fb Date: Mon, 12 Feb 2024 17:16:38 +0100 Message-ID: <20240212162645.5661-6-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240212162645.5661-1-tzimmermann@suse.de> References: <20240212162645.5661-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-out1.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(RLbrmj4aennmrpd7btm9n9zy3k)]; 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_SEVEN(0.00)[10]; MID_CONTAINS_FROM(1.00)[]; FREEMAIL_TO(0.00)[kernel.org,linaro.org,gmail.com,gmx.de,redhat.com]; 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)[41.17%] X-Spam-Flag: NO The driver's implementation of check_fb always returns true, which is the default if no implementation has been set. So remove the code from the driver. Signed-off-by: Thomas Zimmermann Reviewed-by: Daniel Thompson Reviewed-by: Javier Martinez Canillas --- drivers/video/backlight/aat2870_bl.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/video/backlight/aat2870_bl.c b/drivers/video/backlight/aat2870_bl.c index 81fde3abb92c4..b4c3354a1a8a6 100644 --- a/drivers/video/backlight/aat2870_bl.c +++ b/drivers/video/backlight/aat2870_bl.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include @@ -90,15 +89,9 @@ static int aat2870_bl_update_status(struct backlight_device *bd) return 0; } -static int aat2870_bl_check_fb(struct backlight_device *bd, struct fb_info *fi) -{ - return 1; -} - static const struct backlight_ops aat2870_bl_ops = { .options = BL_CORE_SUSPENDRESUME, .update_status = aat2870_bl_update_status, - .check_fb = aat2870_bl_check_fb, }; static int aat2870_bl_probe(struct platform_device *pdev) From patchwork Mon Feb 12 16:16:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13553465 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 C49363D397; Mon, 12 Feb 2024 16:26:52 +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=1707755214; cv=none; b=Q5LAHYdAdSQRDOPFiKVNag3ZzgmzCg3rFu5HavEFH/TbYhC6q9+MRjY1zOygwdMKUcoYD5hsX3RFG7vVKwqvyPzVqCcUQfF/4OJskaqwew5/dbYZ1rGh6E225DyVsSccw+QLTwDnBHgEL0m14H6HRQFNeniyJAcRtsxyX2lpveU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707755214; c=relaxed/simple; bh=9EBL+tejszEFDi/LE68caUJLPpBCHgUe8WI/NDk/gqw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RtC4zI9bb3mTpLFp8rDrT8LodcjEz5asYv7DNMvLB2YeFtXfPRcHwcxumJat8mh3S0Tu4tFPcy7ydbx76aSqNrjv/aYRHRptpkBmWpK3ICxWcyEU0WvWHL2/apIxZoSjgcLAjXPZDh0VmY3gxbSalb2TVntvQAv8W+0Z1RHyPvU= 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=PT/8qR1c; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=N/iDH5bx; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=PT/8qR1c; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=N/iDH5bx; 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="PT/8qR1c"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="N/iDH5bx"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="PT/8qR1c"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="N/iDH5bx" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (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 03E6C2211C; Mon, 12 Feb 2024 16:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707755211; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GPjtN8qJEIMbX0lL0lVoNRNOYWns1/I1H1N1TQ8+8wA=; b=PT/8qR1ciEy9FGuMdR2l1p6nB0oYT/jR7cd5ZYHgiN7WWeA1OEsPk/wL0i/EG3zFwM97tZ 4RGCqRmMFNJ92os34EMI3g7Hza8FvuNHh+LEwpXIrtWiZClm7cTC4mzDcP8ZdUAbJQWIvj /C9vdl7qgOWC7b3WKf4gfPPKQaJ25gE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707755211; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GPjtN8qJEIMbX0lL0lVoNRNOYWns1/I1H1N1TQ8+8wA=; b=N/iDH5bx1m7ndjFlxxfx7rFUfgqVVXPLsTYS9M3zB4TrmAUZpJMDT2ZPEl+lorGsYRXRgg fll5FETod5m6SvCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707755211; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GPjtN8qJEIMbX0lL0lVoNRNOYWns1/I1H1N1TQ8+8wA=; b=PT/8qR1ciEy9FGuMdR2l1p6nB0oYT/jR7cd5ZYHgiN7WWeA1OEsPk/wL0i/EG3zFwM97tZ 4RGCqRmMFNJ92os34EMI3g7Hza8FvuNHh+LEwpXIrtWiZClm7cTC4mzDcP8ZdUAbJQWIvj /C9vdl7qgOWC7b3WKf4gfPPKQaJ25gE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707755211; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GPjtN8qJEIMbX0lL0lVoNRNOYWns1/I1H1N1TQ8+8wA=; b=N/iDH5bx1m7ndjFlxxfx7rFUfgqVVXPLsTYS9M3zB4TrmAUZpJMDT2ZPEl+lorGsYRXRgg fll5FETod5m6SvCw== Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id B0C7713A0E; Mon, 12 Feb 2024 16:26:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id qBT2KcpGymXmXgAAn2gu4w (envelope-from ); Mon, 12 Feb 2024 16:26:50 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-input@vger.kernel.org, linux-pwm@vger.kernel.org, Thomas Zimmermann , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= Subject: [PATCH 06/10] backlight/pwm-backlight: Remove struct backlight_ops.check_fb Date: Mon, 12 Feb 2024 17:16:39 +0100 Message-ID: <20240212162645.5661-7-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240212162645.5661-1-tzimmermann@suse.de> References: <20240212162645.5661-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-out1.suse.de; none X-Spamd-Result: default: False [-3.10 / 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]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; REPLY(-4.00)[]; R_RATELIMIT(0.00)[to_ip_from(RLbrmj4aennmrpd7btm9n9zy3k)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_SEVEN(0.00)[11]; MID_CONTAINS_FROM(1.00)[]; FREEMAIL_TO(0.00)[kernel.org,linaro.org,gmail.com,gmx.de,redhat.com]; 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)[20.96%] X-Spam-Level: X-Spam-Flag: NO X-Spam-Score: -3.10 The internal check_fb callback from struct pwm_bl_data is never implemented. thus the driver's implementation of check_fb always returns true, which is the backlight core's default if no implementation has been set. So remove the code from the driver. Signed-off-by: Thomas Zimmermann Cc: "Uwe Kleine-König" Acked-by: Uwe Kleine-König Reviewed-by: Daniel Thompson Reviewed-by: Javier Martinez Canillas --- drivers/video/backlight/pwm_bl.c | 12 ------------ include/linux/pwm_backlight.h | 1 - 2 files changed, 13 deletions(-) diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index ffcebf6aa76a9..61d30bc98eea5 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -34,7 +33,6 @@ struct pwm_bl_data { int brightness); void (*notify_after)(struct device *, int brightness); - int (*check_fb)(struct device *, struct fb_info *); void (*exit)(struct device *); }; @@ -129,17 +127,8 @@ static int pwm_backlight_update_status(struct backlight_device *bl) return 0; } -static int pwm_backlight_check_fb(struct backlight_device *bl, - struct fb_info *info) -{ - struct pwm_bl_data *pb = bl_get_data(bl); - - return !pb->check_fb || pb->check_fb(pb->dev, info); -} - static const struct backlight_ops pwm_backlight_ops = { .update_status = pwm_backlight_update_status, - .check_fb = pwm_backlight_check_fb, }; #ifdef CONFIG_OF @@ -482,7 +471,6 @@ static int pwm_backlight_probe(struct platform_device *pdev) pb->notify = data->notify; pb->notify_after = data->notify_after; - pb->check_fb = data->check_fb; pb->exit = data->exit; pb->dev = &pdev->dev; pb->enabled = false; diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h index cdd2ac366bc72..0bf80e98d5b40 100644 --- a/include/linux/pwm_backlight.h +++ b/include/linux/pwm_backlight.h @@ -19,7 +19,6 @@ struct platform_pwm_backlight_data { int (*notify)(struct device *dev, int brightness); void (*notify_after)(struct device *dev, int brightness); void (*exit)(struct device *dev); - int (*check_fb)(struct device *dev, struct fb_info *info); }; #endif From patchwork Mon Feb 12 16:16:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13553466 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 0EBFE3D3B1; Mon, 12 Feb 2024 16:26:52 +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=1707755214; cv=none; b=j12t0eNO7gXA1NLnNjBu/n2guG5vAJc7x4/sDt5q4xs4JvM0D9ucqNOwS/K+DhEtcDyy8hVsmSCHGZa+lyJk6QghKp2DfjKDwotIu/JgSe/lsbFIuDhoEs00CKrTXF0QH1x1gxf25zraOsN7iN/WFgxEUYBHzGROgiJtQNchgUw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707755214; c=relaxed/simple; bh=XNnNJLnyGQzHvM/K968wp9eTcL5XIIdEMbBVIBH0usk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Z8ToPtpAMShO/ffF1dH9IWDoAL93X2CXpowYBQXZ33vbisiUnKCWytxN3Me5tQrSzmgztO2XvZCeiArXyNoZ+PMKEi1I0mJRHE4iajB1F3xjyjt3olirg947hwacVndSabzzbMmQILiRD1poLpkuGOAkUJbEyJC9fbuo3+E4tac= 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=apwABlUF; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=h+kBDd7W; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=apwABlUF; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=h+kBDd7W; 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="apwABlUF"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="h+kBDd7W"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="apwABlUF"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="h+kBDd7W" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (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 4B9EA1FD57; Mon, 12 Feb 2024 16:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707755211; 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=Ro4snmsEnHJB29EgpEEblL2WKrNaOw8ZqXzEeIQrbUU=; b=apwABlUFtTWOvox6/NgvvHBe8AVk3/m/WiDsWo2dLEJgmHQKlPAqk0Vz3iSsJfSMeodoXY NfNKG3MYi1plYxfOlRgMyKVko0IMn8zYjv1CE4lXyIaf/HYQh9TbXmA7N/zPYve4bMX7oc LXyr9khZ6JhJ4pJVeSGeQIr96xsEDYI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707755211; 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=Ro4snmsEnHJB29EgpEEblL2WKrNaOw8ZqXzEeIQrbUU=; b=h+kBDd7WYZtMODOk7ikksp0F+H+i7GbnOJ1WMGsoAHaHnKnNPQNXUPok8Ly6bOkhNYyeWQ VXWQzegvohAqljAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707755211; 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=Ro4snmsEnHJB29EgpEEblL2WKrNaOw8ZqXzEeIQrbUU=; b=apwABlUFtTWOvox6/NgvvHBe8AVk3/m/WiDsWo2dLEJgmHQKlPAqk0Vz3iSsJfSMeodoXY NfNKG3MYi1plYxfOlRgMyKVko0IMn8zYjv1CE4lXyIaf/HYQh9TbXmA7N/zPYve4bMX7oc LXyr9khZ6JhJ4pJVeSGeQIr96xsEDYI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707755211; 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=Ro4snmsEnHJB29EgpEEblL2WKrNaOw8ZqXzEeIQrbUU=; b=h+kBDd7WYZtMODOk7ikksp0F+H+i7GbnOJ1WMGsoAHaHnKnNPQNXUPok8Ly6bOkhNYyeWQ VXWQzegvohAqljAQ== Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 09F8F13A3D; Mon, 12 Feb 2024 16:26:51 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id kC4YActGymXmXgAAn2gu4w (envelope-from ); Mon, 12 Feb 2024 16:26:51 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-input@vger.kernel.org, linux-pwm@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 07/10] fbdev/sh_mobile_lcdc_fb: Remove struct backlight_ops.check_fb Date: Mon, 12 Feb 2024 17:16:40 +0100 Message-ID: <20240212162645.5661-8-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240212162645.5661-1-tzimmermann@suse.de> References: <20240212162645.5661-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: -3.28 X-Spamd-Result: default: False [-3.28 / 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(RLbrmj4aennmrpd7btm9n9zy3k)]; 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_SEVEN(0.00)[10]; MID_CONTAINS_FROM(1.00)[]; FREEMAIL_TO(0.00)[kernel.org,linaro.org,gmail.com,gmx.de,redhat.com]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-2.98)[99.92%] X-Spam-Flag: NO The driver sets struct fb_info.bl_dev to the correct backlight device. Thus rely on the backlight core code to match backlight and framebuffer devices, and remove the extra check_fb function from struct backlight_ops. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/video/fbdev/sh_mobile_lcdcfb.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c index eb2297b37504c..bf34c8ec1a26c 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c @@ -2140,17 +2140,10 @@ static int sh_mobile_lcdc_get_brightness(struct backlight_device *bdev) return ch->bl_brightness; } -static int sh_mobile_lcdc_check_fb(struct backlight_device *bdev, - struct fb_info *info) -{ - return (info->bl_dev == bdev); -} - static const struct backlight_ops sh_mobile_lcdc_bl_ops = { .options = BL_CORE_SUSPENDRESUME, .update_status = sh_mobile_lcdc_update_bl, .get_brightness = sh_mobile_lcdc_get_brightness, - .check_fb = sh_mobile_lcdc_check_fb, }; static struct backlight_device *sh_mobile_lcdc_bl_probe(struct device *parent, From patchwork Mon Feb 12 16:16:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13553468 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 739623D3B9; Mon, 12 Feb 2024 16:26:53 +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=1707755215; cv=none; b=lqbKbUcrj+QFiRhdE8dtRL1Xv7XMGpDULFx4LzHqOj+PSqroifFXG/4FguLuVBuS9nXhAsqjOjQXAz9nRtYHpd3F3Gx/P/V1Ht+fcAS1pGmi1UnJkKnklnwJTWpJZuddAvGOMffLb2vEqtqyHrELRavLEWCso+K+95I2zvTfUC8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707755215; c=relaxed/simple; bh=Wwjg7fv2dKQUrCsLPtqwBOl/vpsRnAhDYuD9iAqk5iY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VZyUi+r1jOqKPj2OWCgAwm6cN3O7sPNiNtYttNmsTa3+j2N8vLAng/gw8Kjzg2T6I+Jq1dJnXD3/eVjhET4fErD6xsqMdEmjY0z0IEx/aNsh5P3zEcmVJiQGqyP33Hx1+v/P06A9MtwKbTnMdUNH4/MkRUs0Xq8ODvU5tciulJI= 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=pv3s66Yr; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=1Tgt2qGL; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=pv3s66Yr; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=1Tgt2qGL; 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="pv3s66Yr"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="1Tgt2qGL"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="pv3s66Yr"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="1Tgt2qGL" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (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 8FC601FD58; Mon, 12 Feb 2024 16:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707755211; 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=5nsHrbgFef9XhUX0pSiNccQNsgEN0ZGZB6ATRSeNPxc=; b=pv3s66Yrq2GDn9Y5ayb1q8vTJSdxrruVJOPPyJIz0VtfdSrED47bk6Z0ezvngwEXYZhWMD gpkvqZbjWdve67m1ipY7ymhXF5VOOSQosJyzmQPJ1tZcAyK5mO73FyHqIrx/luFzarPrJb eLpBCCHEsG7QXifBanJywqojZaFyM3E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707755211; 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=5nsHrbgFef9XhUX0pSiNccQNsgEN0ZGZB6ATRSeNPxc=; b=1Tgt2qGLJhvPYGeEIbVnftd3+RoRWW0r4rkVRJiPeyRYvzl6FGRpgZxfPvJ19ghsUV8yfI vViPOOAfM4UvAfCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707755211; 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=5nsHrbgFef9XhUX0pSiNccQNsgEN0ZGZB6ATRSeNPxc=; b=pv3s66Yrq2GDn9Y5ayb1q8vTJSdxrruVJOPPyJIz0VtfdSrED47bk6Z0ezvngwEXYZhWMD gpkvqZbjWdve67m1ipY7ymhXF5VOOSQosJyzmQPJ1tZcAyK5mO73FyHqIrx/luFzarPrJb eLpBCCHEsG7QXifBanJywqojZaFyM3E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707755211; 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=5nsHrbgFef9XhUX0pSiNccQNsgEN0ZGZB6ATRSeNPxc=; b=1Tgt2qGLJhvPYGeEIbVnftd3+RoRWW0r4rkVRJiPeyRYvzl6FGRpgZxfPvJ19ghsUV8yfI vViPOOAfM4UvAfCw== Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 5126F13A0E; Mon, 12 Feb 2024 16:26:51 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id WBWPEstGymXmXgAAn2gu4w (envelope-from ); Mon, 12 Feb 2024 16:26:51 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-input@vger.kernel.org, linux-pwm@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 08/10] fbdev/ssd1307fb: Init backlight before registering framebuffer Date: Mon, 12 Feb 2024 17:16:41 +0100 Message-ID: <20240212162645.5661-9-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240212162645.5661-1-tzimmermann@suse.de> References: <20240212162645.5661-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-Spamd-Result: default: False [0.90 / 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)[]; R_RATELIMIT(0.00)[to_ip_from(RLbrmj4aennmrpd7btm9n9zy3k)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_SEVEN(0.00)[10]; MID_CONTAINS_FROM(1.00)[]; FREEMAIL_TO(0.00)[kernel.org,linaro.org,gmail.com,gmx.de,redhat.com]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[] X-Spam-Level: X-Spam-Flag: NO X-Spam-Score: 0.90 For drivers that support backlight, LCD and fbdev devices, fbdev has to be initialized last. See documentation for struct fbinfo.bl_dev. The backlight name's index number comes from register_framebuffer(), which now happens after initializing the backlight device. So like in all other backlight drivers, we now give the backlight device a generic name without the fbdev index. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/video/fbdev/ssd1307fb.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c index 1a4f90ea7d5a8..0d1590c61eb06 100644 --- a/drivers/video/fbdev/ssd1307fb.c +++ b/drivers/video/fbdev/ssd1307fb.c @@ -594,7 +594,6 @@ static int ssd1307fb_probe(struct i2c_client *client) { struct device *dev = &client->dev; struct backlight_device *bl; - char bl_name[12]; struct fb_info *info; struct fb_deferred_io *ssd1307fb_defio; u32 vmem_size; @@ -733,31 +732,30 @@ static int ssd1307fb_probe(struct i2c_client *client) if (ret) goto regulator_enable_error; - ret = register_framebuffer(info); - if (ret) { - dev_err(dev, "Couldn't register the framebuffer\n"); - goto panel_init_error; - } - - snprintf(bl_name, sizeof(bl_name), "ssd1307fb%d", info->node); - bl = backlight_device_register(bl_name, dev, par, &ssd1307fb_bl_ops, + bl = backlight_device_register("ssd1307fb-bl", dev, par, &ssd1307fb_bl_ops, NULL); if (IS_ERR(bl)) { ret = PTR_ERR(bl); dev_err(dev, "unable to register backlight device: %d\n", ret); - goto bl_init_error; + goto panel_init_error; + } + info->bl_dev = bl; + + ret = register_framebuffer(info); + if (ret) { + dev_err(dev, "Couldn't register the framebuffer\n"); + goto fb_init_error; } bl->props.brightness = par->contrast; bl->props.max_brightness = MAX_CONTRAST; - info->bl_dev = bl; dev_info(dev, "fb%d: %s framebuffer device registered, using %d bytes of video memory\n", info->node, info->fix.id, vmem_size); return 0; -bl_init_error: - unregister_framebuffer(info); +fb_init_error: + backlight_device_unregister(bl); panel_init_error: pwm_disable(par->pwm); pwm_put(par->pwm); From patchwork Mon Feb 12 16:16:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13553467 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 8B2943D3BC; Mon, 12 Feb 2024 16:26:53 +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=1707755215; cv=none; b=Eb940tryRRzdmdQ2wtBfF8laBjEDSH9apOa9yH0+VBywN/AM920rfQiQ5ifqcN5dNVejLIXsSe7AgF3flCgWTxFCboVOuPaZ9s4HIuanwG+SXZ2nOJGvGsqDJjpbs2jvQh+QWf/Gk5hpQbFp+mDzJCg7xrz6A4t8cCVfhpvh0ZQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707755215; c=relaxed/simple; bh=Ip1iT85HlJAH6A07JsI3qif8Wgw5KeoLW86H2X4k/ok=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sjAZZmaEpR+a41xTvnWN/HXvxzPDP4ZIOzEAcjrAr33F5D7th8Kc5DfE4+YT0oRx/bURukx24jtd1o5IPUlRZtCVzaxBZewAzFcYKLAdj9Bu51FIfuuzs/3nFsTaHVWUZb16rCuigaaNZ9vX1tlZ9jVCDCf5cxoKehrqEmt0wzY= 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 imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (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 D888D2211E; Mon, 12 Feb 2024 16:26:51 +0000 (UTC) Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 9647913A3D; Mon, 12 Feb 2024 16:26:51 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id QHSCI8tGymXmXgAAn2gu4w (envelope-from ); Mon, 12 Feb 2024 16:26:51 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-input@vger.kernel.org, linux-pwm@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 09/10] fbdev/ssd1307fb: Remove struct backlight_ops.check_fb Date: Mon, 12 Feb 2024 17:16:42 +0100 Message-ID: <20240212162645.5661-10-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240212162645.5661-1-tzimmermann@suse.de> References: <20240212162645.5661-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: D888D2211E X-Spam-Flag: NO The driver sets struct fb_info.bl_dev to the correct backlight device. Thus rely on the backlight core code to match backlight and framebuffer devices, and remove the extra check_fb function from struct backlight_ops. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/video/fbdev/ssd1307fb.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c index 0d1590c61eb06..3f30af3c059e0 100644 --- a/drivers/video/fbdev/ssd1307fb.c +++ b/drivers/video/fbdev/ssd1307fb.c @@ -530,17 +530,10 @@ static int ssd1307fb_get_brightness(struct backlight_device *bdev) return par->contrast; } -static int ssd1307fb_check_fb(struct backlight_device *bdev, - struct fb_info *info) -{ - return (info->bl_dev == bdev); -} - static const struct backlight_ops ssd1307fb_bl_ops = { .options = BL_CORE_SUSPENDRESUME, .update_status = ssd1307fb_update_bl, .get_brightness = ssd1307fb_get_brightness, - .check_fb = ssd1307fb_check_fb, }; static struct ssd1307fb_deviceinfo ssd1307fb_ssd1305_deviceinfo = { From patchwork Mon Feb 12 16:16:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13553469 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 3C93A3D546; Mon, 12 Feb 2024 16:26:54 +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=1707755215; cv=none; b=uxWffxogIt4byGtHZ0ihVhNTpwjNunxp5WHFnLs2nvmXFIe27wJcS6wC4Uas44TvRQ44TVgFkis5Tx7EfSABomten5jjUs5HpSZkMdp1raRgIiYLzRS5hgnekPV5OAjcvH6ICWLxKcJ/tF+XvNyq7ZnidIX37dbr8RKRnwcgZv4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707755215; c=relaxed/simple; bh=5rRi1dfkRkL0wcQo6T211JgGKp7pgDrOQgsaD6MiGpw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hwibYRXCZcROcbbaJm3Crjp0XXF1kF26iyR8iA7AvxM2/pksUDJWo7/IcDMn4G0BKVSnxHRSk2p+tPmwzns7TOas9ounPy2+ESQXY6BM2IA3osQg6GMRy2IpUNt11OkjBPODMO3F+WCnz8IakksghQtv+GML8y/2at1d3mUF1Kw= 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=V8q7JZzN; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=Jhw3w7hV; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=V8q7JZzN; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=Jhw3w7hV; 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="V8q7JZzN"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Jhw3w7hV"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="V8q7JZzN"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Jhw3w7hV" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (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 2A5161FD5A; Mon, 12 Feb 2024 16:26:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707755212; 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=V0RJP2AFYM7EHR/WrMMVdqLqHIA7RaYHlLIE7G5Jeog=; b=V8q7JZzNAeag89ZEoYZ7lzIPEWowTBPb2XTbdtIKHa6FanTzyBjOseDxx161CnDXsMDOF3 Pxnrmc3pJQU0RCQQkHmL4/WKqyRZa9PS0xlTpDbjSa4PmXiOGbRuRnK5CruheuDkMBzzn3 jhU+PA02SnCf05nTjkDCoM9eQwEvRmo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707755212; 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=V0RJP2AFYM7EHR/WrMMVdqLqHIA7RaYHlLIE7G5Jeog=; b=Jhw3w7hVMi18P9r5sp+XFRcHoc517ZN2taYr4YrFQ47c9UwW+rwcL7sSKnfmKPl3XFvwlI o+c6wkO7dkEBokDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707755212; 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=V0RJP2AFYM7EHR/WrMMVdqLqHIA7RaYHlLIE7G5Jeog=; b=V8q7JZzNAeag89ZEoYZ7lzIPEWowTBPb2XTbdtIKHa6FanTzyBjOseDxx161CnDXsMDOF3 Pxnrmc3pJQU0RCQQkHmL4/WKqyRZa9PS0xlTpDbjSa4PmXiOGbRuRnK5CruheuDkMBzzn3 jhU+PA02SnCf05nTjkDCoM9eQwEvRmo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707755212; 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=V0RJP2AFYM7EHR/WrMMVdqLqHIA7RaYHlLIE7G5Jeog=; b=Jhw3w7hVMi18P9r5sp+XFRcHoc517ZN2taYr4YrFQ47c9UwW+rwcL7sSKnfmKPl3XFvwlI o+c6wkO7dkEBokDQ== Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id DCE4113A0E; Mon, 12 Feb 2024 16:26:51 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id wKTFNMtGymXmXgAAn2gu4w (envelope-from ); Mon, 12 Feb 2024 16:26:51 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-input@vger.kernel.org, linux-pwm@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 10/10] backlight: Add controls_device callback to struct backlight_ops Date: Mon, 12 Feb 2024 17:16:43 +0100 Message-ID: <20240212162645.5661-11-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240212162645.5661-1-tzimmermann@suse.de> References: <20240212162645.5661-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-Spamd-Result: default: False [-2.10 / 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)[]; R_RATELIMIT(0.00)[to_ip_from(RLbrmj4aennmrpd7btm9n9zy3k)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_SEVEN(0.00)[10]; MID_CONTAINS_FROM(1.00)[]; FREEMAIL_TO(0.00)[kernel.org,linaro.org,gmail.com,gmx.de,redhat.com]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Level: X-Spam-Flag: NO X-Spam-Score: -2.10 Replace check_fb with controls_device in struct backlight_ops. The new callback interface takes a Linux device instead of a framebuffer. Resolves one of the dependencies of backlight.h on fb.h. The few drivers that had custom implementations of check_fb can easily use the framebuffer's Linux device instead. Update them accordingly. Signed-off-by: Thomas Zimmermann Reviewed-by: Daniel Thompson Reviewed-by: Javier Martinez Canillas --- drivers/video/backlight/backlight.c | 2 +- drivers/video/backlight/bd6107.c | 12 ++++++------ drivers/video/backlight/gpio_backlight.c | 12 ++++++------ drivers/video/backlight/lv5207lp.c | 12 ++++++------ include/linux/backlight.h | 16 ++++++++-------- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 48844a4f28ad3..18a0ac4bd6005 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -111,7 +111,7 @@ static int fb_notifier_callback(struct notifier_block *self, if (!bd->ops) goto out; - else if (bd->ops->check_fb && !bd->ops->check_fb(bd, info)) + else if (bd->ops->controls_device && !bd->ops->controls_device(bd, info->device)) goto out; #if IS_ENABLED(CONFIG_FB_BACKLIGHT) else if (info->bl_dev && info->bl_dev != bd) diff --git a/drivers/video/backlight/bd6107.c b/drivers/video/backlight/bd6107.c index c95a12bf0ce26..d124ede084ef9 100644 --- a/drivers/video/backlight/bd6107.c +++ b/drivers/video/backlight/bd6107.c @@ -99,18 +99,18 @@ static int bd6107_backlight_update_status(struct backlight_device *backlight) return 0; } -static int bd6107_backlight_check_fb(struct backlight_device *backlight, - struct fb_info *info) +static bool bd6107_backlight_controls_device(struct backlight_device *backlight, + struct device *display_dev) { struct bd6107 *bd = bl_get_data(backlight); - return !bd->pdata->dev || bd->pdata->dev == info->device; + return !bd->pdata->dev || bd->pdata->dev == display_dev; } static const struct backlight_ops bd6107_backlight_ops = { - .options = BL_CORE_SUSPENDRESUME, - .update_status = bd6107_backlight_update_status, - .check_fb = bd6107_backlight_check_fb, + .options = BL_CORE_SUSPENDRESUME, + .update_status = bd6107_backlight_update_status, + .controls_device = bd6107_backlight_controls_device, }; static int bd6107_probe(struct i2c_client *client) diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index d28c30b2a35d2..c0cff685ea848 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -30,18 +30,18 @@ static int gpio_backlight_update_status(struct backlight_device *bl) return 0; } -static int gpio_backlight_check_fb(struct backlight_device *bl, - struct fb_info *info) +static bool gpio_backlight_controls_device(struct backlight_device *bl, + struct device *display_dev) { struct gpio_backlight *gbl = bl_get_data(bl); - return !gbl->dev || gbl->dev == info->device; + return !gbl->dev || gbl->dev == display_dev; } static const struct backlight_ops gpio_backlight_ops = { - .options = BL_CORE_SUSPENDRESUME, - .update_status = gpio_backlight_update_status, - .check_fb = gpio_backlight_check_fb, + .options = BL_CORE_SUSPENDRESUME, + .update_status = gpio_backlight_update_status, + .controls_device = gpio_backlight_controls_device, }; static int gpio_backlight_probe(struct platform_device *pdev) diff --git a/drivers/video/backlight/lv5207lp.c b/drivers/video/backlight/lv5207lp.c index 1f1d06b4e119a..0cf00fee0f605 100644 --- a/drivers/video/backlight/lv5207lp.c +++ b/drivers/video/backlight/lv5207lp.c @@ -62,18 +62,18 @@ static int lv5207lp_backlight_update_status(struct backlight_device *backlight) return 0; } -static int lv5207lp_backlight_check_fb(struct backlight_device *backlight, - struct fb_info *info) +static bool lv5207lp_backlight_controls_device(struct backlight_device *backlight, + struct device *display_dev) { struct lv5207lp *lv = bl_get_data(backlight); - return !lv->pdata->dev || lv->pdata->dev == info->device; + return !lv->pdata->dev || lv->pdata->dev == display_dev; } static const struct backlight_ops lv5207lp_backlight_ops = { - .options = BL_CORE_SUSPENDRESUME, - .update_status = lv5207lp_backlight_update_status, - .check_fb = lv5207lp_backlight_check_fb, + .options = BL_CORE_SUSPENDRESUME, + .update_status = lv5207lp_backlight_update_status, + .controls_device = lv5207lp_backlight_controls_device, }; static int lv5207lp_probe(struct i2c_client *client) diff --git a/include/linux/backlight.h b/include/linux/backlight.h index 614653e07e3a8..2db4c70053c46 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h @@ -13,6 +13,7 @@ #include #include #include +#include /** * enum backlight_update_reason - what method was used to update backlight @@ -110,7 +111,6 @@ enum backlight_scale { }; struct backlight_device; -struct fb_info; /** * struct backlight_ops - backlight operations @@ -160,18 +160,18 @@ struct backlight_ops { int (*get_brightness)(struct backlight_device *); /** - * @check_fb: Check the framebuffer device. + * @controls_device: Check against the display device * - * Check if given framebuffer device is the one bound to this backlight. - * This operation is optional and if not implemented it is assumed that the - * fbdev is always the one bound to the backlight. + * Check if the backlight controls the given display device. This + * operation is optional and if not implemented it is assumed that + * the display is always the one controlled by the backlight. * * RETURNS: * - * If info is NULL or the info matches the fbdev bound to the backlight return true. - * If info does not match the fbdev bound to the backlight return false. + * If display_dev is NULL or display_dev matches the device controlled by + * the backlight, return true. Otherwise return false. */ - int (*check_fb)(struct backlight_device *bd, struct fb_info *info); + bool (*controls_device)(struct backlight_device *bd, struct device *display_dev); }; /**