From patchwork Tue Mar 5 16:22: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: 778147 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 4EC08128833; Tue, 5 Mar 2024 16:24:32 +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=1709655874; cv=none; b=iBcDOXWefdzsCn4a4oyRuB/6Q8LrPV7LGVtGrQFd6gaVI6FghpromWrtRg/rOBZH/fojT5k/RefaHHKvwYRdmc8d4yJnZFQEwRIb8xPlH5XBa3FOo+6Gc2VTLuNxa5k69aKDu6sluqHukIVcnPGSX6Zb3W+r7YKC1V9IUM6c/V8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709655874; c=relaxed/simple; bh=Geet9zHtyoPfTclnIQiLdAfHmUz9X7lYZLWxnwQbYsw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jbx1AanOfwmZisuddBfhI+YX+z/GMndXUoaKT/7CyzhQV/n/fQd5/++OgG2pHrNlICuWZg5/CQrIjg7sGhWnWwRQgrFzRVsKXgsNnTZNH4PefPhMPWuNusQGVW1tjdf0fp7SPRSOQdfVJIw0ioGsfeUAbeAEOZU6qE+6SypgwHw= 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=A1aTRjM6; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=cs4HrCOo; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=A1aTRjM6; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=cs4HrCOo; 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="A1aTRjM6"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="cs4HrCOo"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="A1aTRjM6"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="cs4HrCOo" 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 7ECC27680E; Tue, 5 Mar 2024 16:24:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709655870; 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=L1WjLxpZIYQCrdPUjEkYkZ3IQ5J3+0S0X90f17cfdNU=; b=A1aTRjM6zrVM0wP4zt9JNiRgoYiULaP03xT/PO7ZC0cI9wzoKi4kLQubat3TKUifXfthsO DKIIaWODH60X9TUqrsS8LBdMI/0DDrCKi8HoUNtZzmbFpjeVhqDTxhqjo6B5P9vUneyUgr pTSBhM1pX4uNocpu5NeMRo3kIy1q6PI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709655870; 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=L1WjLxpZIYQCrdPUjEkYkZ3IQ5J3+0S0X90f17cfdNU=; b=cs4HrCOon5Aqb92yiPbOx+SP7CX60sOxRs0g7A1YZ+dUC5IMQtcwIkhGBY7yU/1s73GOYh v+OyDMXva4xcJRAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709655870; 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=L1WjLxpZIYQCrdPUjEkYkZ3IQ5J3+0S0X90f17cfdNU=; b=A1aTRjM6zrVM0wP4zt9JNiRgoYiULaP03xT/PO7ZC0cI9wzoKi4kLQubat3TKUifXfthsO DKIIaWODH60X9TUqrsS8LBdMI/0DDrCKi8HoUNtZzmbFpjeVhqDTxhqjo6B5P9vUneyUgr pTSBhM1pX4uNocpu5NeMRo3kIy1q6PI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709655870; 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=L1WjLxpZIYQCrdPUjEkYkZ3IQ5J3+0S0X90f17cfdNU=; b=cs4HrCOon5Aqb92yiPbOx+SP7CX60sOxRs0g7A1YZ+dUC5IMQtcwIkhGBY7yU/1s73GOYh v+OyDMXva4xcJRAg== 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 304B313A8A; Tue, 5 Mar 2024 16:24:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id cPaECj5H52WwYwAAn2gu4w (envelope-from ); Tue, 05 Mar 2024 16:24:30 +0000 From: Thomas Zimmermann To: lee@kernel.org, andy@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, robin@protonic.nl, 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 v4 01/10] backlight: Match backlight device against struct fb_info.bl_dev Date: Tue, 5 Mar 2024 17:22:34 +0100 Message-ID: <20240305162425.23845-2-tzimmermann@suse.de> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240305162425.23845-1-tzimmermann@suse.de> References: <20240305162425.23845-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=A1aTRjM6; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=cs4HrCOo X-Spamd-Result: default: False [-0.81 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:98:from]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; FREEMAIL_TO(0.00)[kernel.org,linaro.org,gmail.com,gmx.de,protonic.nl,redhat.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-3.00)[100.00%]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCVD_DKIM_ARC_DNSWL_HI(-1.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]; DWL_DNSWL_LOW(-1.00)[suse.de:dkim]; 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)[linaro.org:email,suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_IN_DNSWL_HI(-0.50)[2a07:de40:b281:104:10:150:64:98:from]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: -0.81 X-Rspamd-Queue-Id: 7ECC27680E X-Spam-Level: X-Spam-Flag: NO X-Spamd-Bar: / 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. The code first tests against struct backlight_ops.check_ops. If this test succeeds, it performs the test against fbdev. So backlight drivers can override the later test as before. Fbdev's backlight support depends on CONFIG_FB_BACKLIGHT. To avoid ifdef in the code, the new helper fb_bl_device() returns the backlight device, or NULL if the config option has been disabled. The test in the backlight code will then do nothing. v4: * declare empty fb_bl_device() as static inline * export fb_bl_device() v3: * hide ifdef in fb_bl_device() (Lee) * no if-else blocks (Andy) Signed-off-by: Thomas Zimmermann Reviewed-by: Daniel Thompson Reviewed-by: Javier Martinez Canillas --- drivers/video/backlight/backlight.c | 8 ++++++-- drivers/video/fbdev/core/fb_backlight.c | 6 ++++++ include/linux/fb.h | 9 +++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 86e1cdc8e3697..4f7973c6fcc79 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -98,7 +98,9 @@ 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; + struct backlight_device *fb_bd = fb_bl_device(info); + int node = info->node; int fb_blank = 0; /* If we aren't interested in this event, skip it immediately ... */ @@ -110,7 +112,9 @@ 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)) + if (bd->ops->check_fb && !bd->ops->check_fb(bd, info)) + goto out; + if (fb_bd && fb_bd != bd) goto out; fb_blank = *(int *)evdata->data; diff --git a/drivers/video/fbdev/core/fb_backlight.c b/drivers/video/fbdev/core/fb_backlight.c index e2d3b3adc870f..6fdaa9f81be90 100644 --- a/drivers/video/fbdev/core/fb_backlight.c +++ b/drivers/video/fbdev/core/fb_backlight.c @@ -30,4 +30,10 @@ void fb_bl_default_curve(struct fb_info *fb_info, u8 off, u8 min, u8 max) mutex_unlock(&fb_info->bl_curve_mutex); } EXPORT_SYMBOL_GPL(fb_bl_default_curve); + +struct backlight_device *fb_bl_device(struct fb_info *info) +{ + return info->bl_dev; +} +EXPORT_SYMBOL(fb_bl_device); #endif diff --git a/include/linux/fb.h b/include/linux/fb.h index 708e6a177b1be..15e91c04758c8 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -732,6 +732,15 @@ extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev); extern void framebuffer_release(struct fb_info *info); extern void fb_bl_default_curve(struct fb_info *fb_info, u8 off, u8 min, u8 max); +#if IS_ENABLED(CONFIG_FB_BACKLIGHT) +struct backlight_device *fb_bl_device(struct fb_info *info); +#else +static inline struct backlight_device *fb_bl_device(struct fb_info *info) +{ + return NULL; +} +#endif + /* fbmon.c */ #define FB_MAXTIMINGS 0 #define FB_VSYNCTIMINGS 1 From patchwork Tue Mar 5 16:22: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: 778143 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 3EFE21292C8; Tue, 5 Mar 2024 16:24:32 +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=1709655885; cv=none; b=akdKph2hF34yqzq6QHxNPL0Kh0zhP0tV7sz1GdPSJKq5RVXWA88WHkVLKErvIBij8edW5imkrA6nWNnQfmKatozgMmgW49LVZN501602Gg4iEJQehSnNxI4GSkQThFCd2R3j3BWQsI+yW5w30jn+re0v1+ZjXq8gYtZIba0bzT4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709655885; c=relaxed/simple; bh=1y+6KrrTlqONyKuX80nFfFCgfKVi7IrUmbZtLouk0g0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KNDqQBMkD0bz7YFuFSeVlNdlJted1S3frvXBryD2eeMfeYEOSgpA4HDAXFV1qYHoZ2aKAxi3452PEt1yQKFBmuRI238ymJhTd4uWYvGidcxBjHZtXbCXT7Ode/7hz1qK7Nn9jsqJM0ZnqKInbRFGWknAsUVPisHh6NDW4quwucA= 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=Xc6NdHWX; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=IKR6MdEL; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Xc6NdHWX; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=IKR6MdEL; 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="Xc6NdHWX"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="IKR6MdEL"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Xc6NdHWX"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="IKR6MdEL" 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 488D46B966; Tue, 5 Mar 2024 16:24:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709655871; 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=Um9G5Ls9++DRKuAUMV6tbE4vZGmL1TD2IaQItszLy/U=; b=Xc6NdHWXFboiE1sOhhZ8J06LeaZKILwYw7GXBolX4GjbntgQKExHlXDPTgfHtzIPQU0UCh ziQdvyC8mN8vlbQfx4TTn1gCQ3NvwaJIf5ICnupP117occmBx+jDyWc2/KjyrFF4b15HIL 2I2dEYRR2REUTaKvY+QGyIAD4vtt6DQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709655871; 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=Um9G5Ls9++DRKuAUMV6tbE4vZGmL1TD2IaQItszLy/U=; b=IKR6MdELZw2THKe8P7dypx1asWkzgSMh53NlsZi+XJ/RpNP74+431lenfbw7dFL/nF5aGF vkys1lfiCqgSMOBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709655871; 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=Um9G5Ls9++DRKuAUMV6tbE4vZGmL1TD2IaQItszLy/U=; b=Xc6NdHWXFboiE1sOhhZ8J06LeaZKILwYw7GXBolX4GjbntgQKExHlXDPTgfHtzIPQU0UCh ziQdvyC8mN8vlbQfx4TTn1gCQ3NvwaJIf5ICnupP117occmBx+jDyWc2/KjyrFF4b15HIL 2I2dEYRR2REUTaKvY+QGyIAD4vtt6DQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709655871; 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=Um9G5Ls9++DRKuAUMV6tbE4vZGmL1TD2IaQItszLy/U=; b=IKR6MdELZw2THKe8P7dypx1asWkzgSMh53NlsZi+XJ/RpNP74+431lenfbw7dFL/nF5aGF vkys1lfiCqgSMOBA== 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 DBDA513A8A; Tue, 5 Mar 2024 16:24:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id iH5CND5H52WwYwAAn2gu4w (envelope-from ); Tue, 05 Mar 2024 16:24:30 +0000 From: Thomas Zimmermann To: lee@kernel.org, andy@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, robin@protonic.nl, 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 v4 03/10] hid/hid-picolcd: Fix initialization order Date: Tue, 5 Mar 2024 17:22:36 +0100 Message-ID: <20240305162425.23845-4-tzimmermann@suse.de> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240305162425.23845-1-tzimmermann@suse.de> References: <20240305162425.23845-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-input@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 [0.33 / 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]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_TWELVE(0.00)[13]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FREEMAIL_TO(0.00)[kernel.org,linaro.org,gmail.com,gmx.de,protonic.nl,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.57)[81.29%] X-Spam-Level: X-Spam-Flag: NO X-Spam-Score: 0.33 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 Tue Mar 5 16:22: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: 778144 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 40E0312DD91; Tue, 5 Mar 2024 16:24:34 +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=1709655878; cv=none; b=An+QEdFrSWdIgaHg+gx/aWDHrrpjwjRUmmjIdNqrebKZB5n9fuc+sjuXaASqWt24kKQPxLGBivGFV96DOxa45PREWd064v3eiJVav9GD/nlk1XJ7bEX1mjxpo5wvk4W6gRrzDE5KKCWM4OCnyNbQUmRD1T7iraUM2tTgp6SRM20= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709655878; c=relaxed/simple; bh=xRj4kKc6f2k5uLI8oGBFudAYfK6dEXKOpLVGByVO3tw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IeFdt53aiqnD8wwC64ZCr/sgmPTuOjs2xxCxZUET+M7cb3ZOLk61j/WxYxbaY+vea/drfZv9JPzTAu41YUdwopJa26tuVyTE9J+XBvFvkqMbnRkO3z+88jDG5Q043W1aoPOYjb0Hr/RHy54Pl96c7TPM9Xfih5PUAGV10p9ydkA= 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=W0PNgio3; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=KsUTLYv2; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=W0PNgio3; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=KsUTLYv2; 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="W0PNgio3"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="KsUTLYv2"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="W0PNgio3"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="KsUTLYv2" 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 596536B96B; Tue, 5 Mar 2024 16:24:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709655872; 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=5EM1dsMS8ciY5XroJVXglx2pw68rH+KuHUZfHYNIwP4=; b=W0PNgio3QStK2Q0QP7XeJ4L7jA+7PQWWpPPNM3aibL76omc+KrS59bNzVX63GIz4K9/xvV pSI9s/eL+NbhcX6M+AvwVIzmoRofPY991r0bZyjAWmlZv4Z6rY4XywzEreBtfK7pvUUhQ4 MNd1ifdFb5QG1Tl1q2O9oD2sLpbN2jQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709655872; 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=5EM1dsMS8ciY5XroJVXglx2pw68rH+KuHUZfHYNIwP4=; b=KsUTLYv2L4HqFmnFgxR9mGQ9HyydBYaKXbaF1OMTDQse0QUTiabUZxPsBap8v7ORuW78Pa bXFsWC6SAiuBHbBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709655872; 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=5EM1dsMS8ciY5XroJVXglx2pw68rH+KuHUZfHYNIwP4=; b=W0PNgio3QStK2Q0QP7XeJ4L7jA+7PQWWpPPNM3aibL76omc+KrS59bNzVX63GIz4K9/xvV pSI9s/eL+NbhcX6M+AvwVIzmoRofPY991r0bZyjAWmlZv4Z6rY4XywzEreBtfK7pvUUhQ4 MNd1ifdFb5QG1Tl1q2O9oD2sLpbN2jQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709655872; 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=5EM1dsMS8ciY5XroJVXglx2pw68rH+KuHUZfHYNIwP4=; b=KsUTLYv2L4HqFmnFgxR9mGQ9HyydBYaKXbaF1OMTDQse0QUTiabUZxPsBap8v7ORuW78Pa bXFsWC6SAiuBHbBw== 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 03FCA13A5D; Tue, 5 Mar 2024 16:24:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id AFgwOz9H52WwYwAAn2gu4w (envelope-from ); Tue, 05 Mar 2024 16:24:31 +0000 From: Thomas Zimmermann To: lee@kernel.org, andy@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, robin@protonic.nl, 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 v4 06/10] backlight/pwm-backlight: Remove struct backlight_ops.check_fb Date: Tue, 5 Mar 2024 17:22:39 +0100 Message-ID: <20240305162425.23845-7-tzimmermann@suse.de> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240305162425.23845-1-tzimmermann@suse.de> References: <20240305162425.23845-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=W0PNgio3; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=KsUTLYv2 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-3.06 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:98:from]; TO_DN_SOME(0.00)[]; R_RATELIMIT(0.00)[to_ip_from(RLmbat3p9xsccqh5oowmzmthut)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; FREEMAIL_TO(0.00)[kernel.org,linaro.org,gmail.com,gmx.de,protonic.nl,redhat.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-0.05)[59.53%]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCVD_DKIM_ARC_DNSWL_HI(-1.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]; DWL_DNSWL_LOW(-1.00)[suse.de:dkim]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_TWELVE(0.00)[13]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[linaro.org:email,suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_IN_DNSWL_HI(-0.50)[2a07:de40:b281:104:10:150:64:98:from]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: -3.06 X-Rspamd-Queue-Id: 596536B96B X-Spam-Flag: NO The internal check_fb callback from struct pwm_bl_data is never implemented. 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. v2: * reword commit message 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 Tue Mar 5 16:22: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: 778145 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 5DADB12DD97; Tue, 5 Mar 2024 16:24:34 +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=1709655879; cv=none; b=qeMMXQwRcOuYsOrBeDBGtI/+/9JvDVKvoSWfMlReDHXDzVX7KsKZuixy/VZ5G+P7fkEgaPIyHEY8FxDdbFSdUw6IQShr/qAb706PFWG73Q9tRU3qE70d8quLbkr1M1PLbJXUogF7Hv7hDE9jyKMuFQ79ON2iLCy5WAiZz+fdO0k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709655879; c=relaxed/simple; bh=anHyUTDav91fJJwn4bR1XECLfTyS41goqV45hx+UkNQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KUzNU+exXRqiUsXUyv/cZ3idXskdMNSPMu7RURtDEek5qwS5kFJvkkErfLdcvVle8/Su5HTY76k4MyXk0dcJ81YlNy2FGmPcXKFKGsYpped9hwpVBLDwa+hH9FWUSmYGV4SFiqcV/q2+4FLb3uoyaFP11MfWN/tvzStNihLcq6U= 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=hxXixgZZ; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=SnYarAK+; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=hxXixgZZ; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=SnYarAK+; 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="hxXixgZZ"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="SnYarAK+"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="hxXixgZZ"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="SnYarAK+" 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 B12AF6B96A; Tue, 5 Mar 2024 16:24:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709655872; 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=3VYLDIGgRwJLPzdzx4kSlZKwRuQwMEIA4/2EDJniS6s=; b=hxXixgZZPuVwPqtASoI53N5wEucjH9w/XmnKwhh9R1uJ2MXZ/6mW/MtTdzZr5VvAkmFYD8 hzuDsE8Mmxrc7S5X8fey4v4zwPx5fXzPdpCPC24dYlkylTrFpj5Y3IBTYnRX5NHH90FWqp wGCTDHq7avkfRkbg8X9d5cpvxxHsqVA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709655872; 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=3VYLDIGgRwJLPzdzx4kSlZKwRuQwMEIA4/2EDJniS6s=; b=SnYarAK+Cb9dtA5L2ioXDm6Q0BArwHPZW1lsvn1wjyYmJkp1bbvEGlNizCodOw95iM+vZe 8BAWJbvIT7P26cAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709655872; 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=3VYLDIGgRwJLPzdzx4kSlZKwRuQwMEIA4/2EDJniS6s=; b=hxXixgZZPuVwPqtASoI53N5wEucjH9w/XmnKwhh9R1uJ2MXZ/6mW/MtTdzZr5VvAkmFYD8 hzuDsE8Mmxrc7S5X8fey4v4zwPx5fXzPdpCPC24dYlkylTrFpj5Y3IBTYnRX5NHH90FWqp wGCTDHq7avkfRkbg8X9d5cpvxxHsqVA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709655872; 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=3VYLDIGgRwJLPzdzx4kSlZKwRuQwMEIA4/2EDJniS6s=; b=SnYarAK+Cb9dtA5L2ioXDm6Q0BArwHPZW1lsvn1wjyYmJkp1bbvEGlNizCodOw95iM+vZe 8BAWJbvIT7P26cAA== 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 5FA4D13A8A; Tue, 5 Mar 2024 16:24:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id IL4QFkBH52WwYwAAn2gu4w (envelope-from ); Tue, 05 Mar 2024 16:24:32 +0000 From: Thomas Zimmermann To: lee@kernel.org, andy@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, robin@protonic.nl, 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 v4 07/10] fbdev/sh_mobile_lcdc_fb: Remove struct backlight_ops.check_fb Date: Tue, 5 Mar 2024 17:22:40 +0100 Message-ID: <20240305162425.23845-8-tzimmermann@suse.de> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240305162425.23845-1-tzimmermann@suse.de> References: <20240305162425.23845-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-input@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 [1.91 / 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)[]; 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_TWELVE(0.00)[12]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FREEMAIL_TO(0.00)[kernel.org,linaro.org,gmail.com,gmx.de,protonic.nl,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.99)[99.96%] X-Spam-Level: * X-Spam-Score: 1.91 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 Tue Mar 5 16:22: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: 778142 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 6A268128830; Tue, 5 Mar 2024 16:24:40 +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=1709655895; cv=none; b=WXwEJg/WPz0dmM06K2FBqjy5VGoeGBDmBsoVP8NoZTN14jphCDIVFzXih+8R6Pmv2bHD2EBuGIIC/iGM7TkcPYtbACD1nGIRo1JKtGSRAD3BY1p45VxtH73dO1gNelqQ9ipAV+JQa6DxRaUvi3IeED0i4MRZC9RXmNzVXXubvAU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709655895; c=relaxed/simple; bh=uOwFMt+83EsKNNhkY2N+wi4oavD08Okoo2gbXz7O1jY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KiaZA8sqVT5o+YqhVYCpHg37Ymv/RZDpVNMgDNygFyUSm6gtDMzba77uYdXcAmmdhdH7hlVVndoD+UdT/fdze0U2nG6NUuhI0GCxLrT+lWnKR+Da8M7S1ut4h2hu/nhxiz2U81pIQgRNTCO0HXN0g+dMdJ/upIARotyHdlTJmkU= 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=KKaAQYgN; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=bYeOyE+Y; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=KKaAQYgN; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=bYeOyE+Y; 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="KKaAQYgN"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="bYeOyE+Y"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="KKaAQYgN"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="bYeOyE+Y" 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 1402F6B96C; Tue, 5 Mar 2024 16:24:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709655873; 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=tiW8oMxRirFfgXm1wCsY/SJh6175DL+59YAwCG6IkK4=; b=KKaAQYgNert5uKY+9h5Cn0u97seXJ0D67DcxnT9vQ5lou/tg3kdRw6qoLlOrmZtEtrueoK e0+vmcR6vRoUg4gNsOth4gCnOIjFStqBsUyV4tRpK5MqZKKI8VTFhBzhjKcljmUe8pI/3M VWXXl/z2me4sQOB4Io0Rbml3eEBVWt8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709655873; 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=tiW8oMxRirFfgXm1wCsY/SJh6175DL+59YAwCG6IkK4=; b=bYeOyE+YUoawS1yySKcNQ5AbZwa5rxaZ7F2e5Ggt8UZ3LV9+9FCcgsX+9XRf6bsQz2iHBf fsV9ImWBO1cGN+BA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709655873; 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=tiW8oMxRirFfgXm1wCsY/SJh6175DL+59YAwCG6IkK4=; b=KKaAQYgNert5uKY+9h5Cn0u97seXJ0D67DcxnT9vQ5lou/tg3kdRw6qoLlOrmZtEtrueoK e0+vmcR6vRoUg4gNsOth4gCnOIjFStqBsUyV4tRpK5MqZKKI8VTFhBzhjKcljmUe8pI/3M VWXXl/z2me4sQOB4Io0Rbml3eEBVWt8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709655873; 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=tiW8oMxRirFfgXm1wCsY/SJh6175DL+59YAwCG6IkK4=; b=bYeOyE+YUoawS1yySKcNQ5AbZwa5rxaZ7F2e5Ggt8UZ3LV9+9FCcgsX+9XRf6bsQz2iHBf fsV9ImWBO1cGN+BA== 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 B7D9A13A5D; Tue, 5 Mar 2024 16:24:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id 6O+hK0BH52WwYwAAn2gu4w (envelope-from ); Tue, 05 Mar 2024 16:24:32 +0000 From: Thomas Zimmermann To: lee@kernel.org, andy@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, robin@protonic.nl, 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 v4 08/10] fbdev/ssd1307fb: Init backlight before registering framebuffer Date: Tue, 5 Mar 2024 17:22:41 +0100 Message-ID: <20240305162425.23845-9-tzimmermann@suse.de> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240305162425.23845-1-tzimmermann@suse.de> References: <20240305162425.23845-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: X-Spamd-Bar: / Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=KKaAQYgN; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=bYeOyE+Y X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [0.99 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:98:from]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; BROKEN_CONTENT_TYPE(1.50)[]; R_RATELIMIT(0.00)[to_ip_from(RLmbat3p9xsccqh5oowmzmthut)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; FREEMAIL_TO(0.00)[kernel.org,linaro.org,gmail.com,gmx.de,protonic.nl,redhat.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-0.00)[21.65%]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCVD_DKIM_ARC_DNSWL_HI(-1.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]; DWL_DNSWL_LOW(-1.00)[suse.de:dkim]; 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:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_IN_DNSWL_HI(-0.50)[2a07:de40:b281:104:10:150:64:98:from]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: 0.99 X-Rspamd-Queue-Id: 1402F6B96C 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. 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);