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: 778663 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-fbdev@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: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: 778113 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 C23E91292C7; 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=1709655877; cv=none; b=mUnhzxCcA2vw2+BZsjMJnQ9uFE2OJaw4gG/GEYECw4465EClHUP5T2yPHjIbIoxXODzOrQrSCiyhzAGerQnNS/v9HNzV0hmj0S1HFR5Dh5JMxAXMlinj8AxGro+oWefVDIedSrH3jj7oeg8iFDMBRS+KNd5iyDkPUNUTGnbRGhM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709655877; c=relaxed/simple; bh=MVnT1GcB9mZoAtZdM+8qrT/edK7G7vR5qVyJTuLE/Gk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dhigQ8FR6+MxKeh47kldGy3LugMKAMiVv1Jk+K4G80Z0mIcEzzkaiIU3OgvZKKZ0VqyDlnAk5eNeStGO/sRBbZ/QU7ZXW2DO7wwe/doaK0n0vL3/pCafNxJruZZAywLpLLMIb48RC4JPWPU/KNNRjRH+slaDKozJ0hdT0RChljE= 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=Od7B8ulY; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=PRiFPArm; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=rA9DL+BV; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=82t82tdE; 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="Od7B8ulY"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="PRiFPArm"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="rA9DL+BV"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="82t82tdE" 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 D566076812; 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=1709655871; 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=lQ3sK+9yV9Ua9Fkbkvpx8TNNPEaeONOzmEHQ+4kI0JQ=; b=Od7B8ulYW9cY4L8mqAlCkM+vn44w94fX/bnFXlXxCfZuOU2eAaulFia7qJe2G6RPt7dq8T oaUj1Bj76ZHN4GuO7FxKPkxzPbjZIJFkAXdWMFEZpqAE52YuH2X34GvbZ62YLtJDdOHmmB xLPKsoW1xvGV+1YmcxXYeoVD32AQbfQ= 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lQ3sK+9yV9Ua9Fkbkvpx8TNNPEaeONOzmEHQ+4kI0JQ=; b=PRiFPArmyZV65gQ5caZ6cRZN4/uC3uFW+qZ9+++lZ/8S9deMDe0yr35knzem49wi/zn4n2 fgRt6H39yZE902AA== 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=lQ3sK+9yV9Ua9Fkbkvpx8TNNPEaeONOzmEHQ+4kI0JQ=; b=rA9DL+BV4ZruUbP2XuW+MYK7eMqaLy5qlOYto94aUKf2RR6uixZUNN9bK7mLR6jEMUXYCe P2UrJwZUagetV9mYvPVTGeNy/9v1odZW8jnklRfoQzImASwTIxbrGvN9Wm3ipfl6i4T+ll y8Bscl5kDwFebNGN/Voo96i6/FMSviY= 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=lQ3sK+9yV9Ua9Fkbkvpx8TNNPEaeONOzmEHQ+4kI0JQ=; b=82t82tdEPoMUbkkqeICuE26n/hKFKuADQ3cgSZGjwkqk1yd5GzwkLgYVhNAco/1UfkXBNn 1Fg4TrlMJ+tIH9Dg== 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 84EA013A5D; 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 wM8tHz5H52WwYwAAn2gu4w (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 02/10] auxdisplay/ht16k33: Remove struct backlight_ops.check_fb Date: Tue, 5 Mar 2024 17:22:35 +0100 Message-ID: <20240305162425.23845-3-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-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: X-Spamd-Bar: / Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=rA9DL+BV; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=82t82tdE X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-0.63 / 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(-1.62)[92.62%]; 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.63 X-Rspamd-Queue-Id: D566076812 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. v3: * use 'check_fb()' in commit message (Andy) Signed-off-by: Thomas Zimmermann Cc: Robin van der Gracht Acked-by: Robin van der Gracht Acked-by: Andy Shevchenko 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 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: 778659 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-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 [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: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: 778112 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 765FA1292E4; Tue, 5 Mar 2024 16:24:33 +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=1709655882; cv=none; b=IX1N0JVOX80rOiqALdbzJOkAHeF3+rwPasiudsjwnjF4wLMR1Cy0qgLmRmecx3iy508jZ9IrV8ChEHqtaDrAncaS2ZPxWbBcqnSCCWKsi7w7BkIVIzqPAN6rETsaTKqMM0z7U0+jipyUdjXiyRwYyt88XdbEMwKiwnTZh1LE4dU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709655882; c=relaxed/simple; bh=vKr5mElKlCE9ez3QEO/1NXFNqefBHLhR/ArilKitksI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hIfUAQoOJVRQRCaKpehfj5Lk0NWaUmLhTaTUYdYeEoZIs7UlwtgskeJTDa58l8CLi87fGT/wraDjxBeRJjRfh3fv2/bAFzAXpIaF8IO8DTjblN6JVI/lthjBmPVPDUglxPafuUx3z78bz0vzmHaj3lwSr0jQJfUp/VJqkzfd9vY= 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=ow/ICrkB; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=NLvI49J5; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=ow/ICrkB; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=NLvI49J5; 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="ow/ICrkB"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="NLvI49J5"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="ow/ICrkB"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="NLvI49J5" 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 991FF6B967; 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=Qfhcy/hEHxfuNqfhSlDlbxTKM4p4+a+utzcPfxG9fCY=; b=ow/ICrkB5snCc6Q8wnVuQnKFjkSEsO9IihW7FJb44T2OHgmOnEOXUmJD5NHWprJx+OSd4o 7zh82zVmHcYlyFoVuZ3/jPZyTUVhlYEHK7VFnVlFOCmviItfJLnzvEjmH6dJE8kc+GPAeQ 6pBY6aJEujDHaupuVSndMpulCeQb8Vo= 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=Qfhcy/hEHxfuNqfhSlDlbxTKM4p4+a+utzcPfxG9fCY=; b=NLvI49J5lywvRQh78g+2O+QCdlGSOZyqsXjlrnb1OaNhywTsFApm+g8q0lIS5PW+GfVof9 4YfdLv6rISoUeYCw== 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=Qfhcy/hEHxfuNqfhSlDlbxTKM4p4+a+utzcPfxG9fCY=; b=ow/ICrkB5snCc6Q8wnVuQnKFjkSEsO9IihW7FJb44T2OHgmOnEOXUmJD5NHWprJx+OSd4o 7zh82zVmHcYlyFoVuZ3/jPZyTUVhlYEHK7VFnVlFOCmviItfJLnzvEjmH6dJE8kc+GPAeQ 6pBY6aJEujDHaupuVSndMpulCeQb8Vo= 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=Qfhcy/hEHxfuNqfhSlDlbxTKM4p4+a+utzcPfxG9fCY=; b=NLvI49J5lywvRQh78g+2O+QCdlGSOZyqsXjlrnb1OaNhywTsFApm+g8q0lIS5PW+GfVof9 4YfdLv6rISoUeYCw== 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 42D3913A5D; 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 4EELDz9H52WwYwAAn2gu4w (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?Bruno_Pr=C3=A9mont?= Subject: [PATCH v4 04/10] hid/hid-picolcd: Remove struct backlight_ops.check_fb Date: Tue, 5 Mar 2024 17:22:37 +0100 Message-ID: <20240305162425.23845-5-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-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="ow/ICrkB"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=NLvI49J5 X-Spamd-Result: default: False [-4.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_RATELIMIT(0.00)[to_ip_from(RLmbat3p9xsccqh5oowmzmthut)]; 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)[13]; 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-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: 991FF6B967 X-Spam-Level: X-Spam-Score: -4.81 X-Spam-Flag: NO Update the driver to initialize struct fb_info.bl_dev to its backlight device, if any. Thus rely on the backlight core code to match backlight and framebuffer devices, and remove the extra check_fb function from struct backlight_ops. v2: * protect against CONFIG_FB_BACKLIGHT (Javier, kernel test robot) * reword commit message (Daniel) 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 | 6 ++++++ 2 files changed, 6 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..750206f5fc674 100644 --- a/drivers/hid/hid-picolcd_fb.c +++ b/drivers/hid/hid-picolcd_fb.c @@ -493,6 +493,12 @@ int picolcd_init_framebuffer(struct picolcd_data *data) info->fix = picolcdfb_fix; info->fix.smem_len = PICOLCDFB_SIZE*8; +#ifdef CONFIG_FB_BACKLIGHT +#ifdef CONFIG_HID_PICOLCD_BACKLIGHT + info->bl_dev = data->backlight; +#endif +#endif + fbdata = info->par; spin_lock_init(&fbdata->lock); fbdata->picolcd = data; From patchwork Tue Mar 5 16:22: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: 778662 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 DC905129A69; Tue, 5 Mar 2024 16:24:33 +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=FJAMcILnubQiC4zbPiDM+dzKxWyPWrVRjwQSbN7cIgIhwgs5UXfP8mPYWWGiD+ExEF8xvIeG5hEcMz/5th8nVGpx0cKsOuZpHJJio39pXYS5VM/8FYcEyBPGxvmJGbQ8S0eNs7U/8nEFZHUcOomWqpXSYT8yRU5lQ2/TBOHiUxI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709655878; c=relaxed/simple; bh=2bPOPNIHmcZTgpWYlyNa1KiHEaRnhgkL5SGpobPm8Vg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T452whrtplPuqiMIqG5nDWRwfzloAMAwehf/P7DebjgabaOZ1uVZO9fxb++jjWQsDiAWxc35GLyzJGoUSsG6zk20nckuvcMEVJGIqUqsMDGDPjSJz5j2vf/0zEaTRVdLBeWj1IRazzBJ5Em5JVQuyKjsOUOKRci+rs87kCG8Q4M= 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=QNlmEcIz; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=C4D0Naq6; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=QNlmEcIz; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=C4D0Naq6; 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="QNlmEcIz"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="C4D0Naq6"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="QNlmEcIz"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="C4D0Naq6" 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 071C16B969; 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=W0DH+ovuFKZKkAPGVkfdyjheKXnKjpTcQmUhHMaVdfE=; b=QNlmEcIzyyOHrDKttcS56wXbIuhagQkSKbCIHwwidg9J6YTZKwkPkunxSehm1tNdUiBzwv Xw0/3NysoR9abWA9IH/a800WPWo6GSPZTc8yHd2ZdDdRX4oky1EM4eaP9h2Xfp3itfNe7B a8ZcgtZ0YEgT+oMlJ7NuXK4BqrcCRik= 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=W0DH+ovuFKZKkAPGVkfdyjheKXnKjpTcQmUhHMaVdfE=; b=C4D0Naq6/Y6ug+HRRSC9g8OdPSn+urMMgWhotX6TYc5O2b+WSwSa44viPiokVWPjz0zXkq FFDFAEydDWLyxMAg== 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=W0DH+ovuFKZKkAPGVkfdyjheKXnKjpTcQmUhHMaVdfE=; b=QNlmEcIzyyOHrDKttcS56wXbIuhagQkSKbCIHwwidg9J6YTZKwkPkunxSehm1tNdUiBzwv Xw0/3NysoR9abWA9IH/a800WPWo6GSPZTc8yHd2ZdDdRX4oky1EM4eaP9h2Xfp3itfNe7B a8ZcgtZ0YEgT+oMlJ7NuXK4BqrcCRik= 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=W0DH+ovuFKZKkAPGVkfdyjheKXnKjpTcQmUhHMaVdfE=; b=C4D0Naq6/Y6ug+HRRSC9g8OdPSn+urMMgWhotX6TYc5O2b+WSwSa44viPiokVWPjz0zXkq FFDFAEydDWLyxMAg== 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 9F4FA13A8A; 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 oBCEJT9H52WwYwAAn2gu4w (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 Subject: [PATCH v4 05/10] backlight/aat2870-backlight: Remove struct backlight.check_fb Date: Tue, 5 Mar 2024 17:22:38 +0100 Message-ID: <20240305162425.23845-6-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-fbdev@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=QNlmEcIz; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=C4D0Naq6 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-0.80 / 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(-1.79)[93.72%]; 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)[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: -0.80 X-Rspamd-Queue-Id: 071C16B969 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 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: 778661 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-fbdev@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: 778114 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-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 [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: 778658 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-fbdev@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); From patchwork Tue Mar 5 16:22: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: 778111 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 353DC1292E1; Tue, 5 Mar 2024 16:24:34 +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=1709655890; cv=none; b=MBl0DoX2wg0hZniolqYlqtXHq0hbKaQwtFTTuiB0og5Dz4NTDYqMpZFUsYZsar62NWM88jIWi+fc/NBXcyAYO9/BSfsU1z1SLuDy1Z3CfwiP8dD10yJi0qoAxLuTn64SXlnvAbokIFJ6chVN5Mvd9ybJFXblrmDoR4h5H6pV3Wc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709655890; c=relaxed/simple; bh=yB9U8pxB5LZw6YezPCdGXhKlJEofyPuV184w3Vd2mr4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VVzdtPSzPwTpi6BYKeJfHg5+PeW6MtqUbAYmXymJ+rFixqlEhZzMQm600ceiZDNXX/bZP+caRHtypMV4Zi3Cf1NzQQOmtSh74iOZ8zBGSkWRGKl2TrYzjBgMTTuBJVnfY2D8r1c4oMG9nQRrBP5cwOHikSAMtV0hnIR+wNFXAl8= 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=Dv/pxbwY; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=li52bVwV; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Dv/pxbwY; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=li52bVwV; 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="Dv/pxbwY"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="li52bVwV"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Dv/pxbwY"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="li52bVwV" 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 700A47682A; 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=zHZBh32ao496BlueMq4KcqWuXhq9l/azWpYIHeOrlrM=; b=Dv/pxbwY/hTAA0sNC4CPRNTfFSnQaKJ7Ij08/Ylr/DpUlXxH5jl6HbMhJ8bIPjq7UX3UDd 4FW5ywFo87hd5aFwO+UKqYSG1elLjGQgh22aatAxEczZwBGDdRD1cwe9ztJRjdxBq98SrM aub2i/fMsWEHs7g0ObnNjx5dLlmnB34= 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=zHZBh32ao496BlueMq4KcqWuXhq9l/azWpYIHeOrlrM=; b=li52bVwVt9eD86L7h10ran4lRlXaBgPC0w0btJVrAlgzxU8yqrLqaQAyWHR7sjdJfA6QTF UeX09m+8vsmQPjCQ== 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=zHZBh32ao496BlueMq4KcqWuXhq9l/azWpYIHeOrlrM=; b=Dv/pxbwY/hTAA0sNC4CPRNTfFSnQaKJ7Ij08/Ylr/DpUlXxH5jl6HbMhJ8bIPjq7UX3UDd 4FW5ywFo87hd5aFwO+UKqYSG1elLjGQgh22aatAxEczZwBGDdRD1cwe9ztJRjdxBq98SrM aub2i/fMsWEHs7g0ObnNjx5dLlmnB34= 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=zHZBh32ao496BlueMq4KcqWuXhq9l/azWpYIHeOrlrM=; b=li52bVwVt9eD86L7h10ran4lRlXaBgPC0w0btJVrAlgzxU8yqrLqaQAyWHR7sjdJfA6QTF UeX09m+8vsmQPjCQ== 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 1AC3D13A8A; Tue, 5 Mar 2024 16:24:33 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id uIo1BUFH52WwYwAAn2gu4w (envelope-from ); Tue, 05 Mar 2024 16:24:33 +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 09/10] fbdev/ssd1307fb: Remove struct backlight_ops.check_fb Date: Tue, 5 Mar 2024 17:22:42 +0100 Message-ID: <20240305162425.23845-10-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-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 [3.92 / 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(-0.98)[86.97%] X-Spam-Level: *** X-Spam-Score: 3.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/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 Tue Mar 5 16:22: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: 778660 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 8572E12882D; Tue, 5 Mar 2024 16:24:35 +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=1709655882; cv=none; b=k2zkr7XcdI9Q+dDEJWI+oghOV7onHArAaZ9jG0siD0UJPVfPhmgnB7WnP0u5tVoYnmdy3BqJdYlrOgPfr6N79VExfi69mYyO+fDXDRRDkuF163sE9yvdo2GTYtuKUj0sn8rpCPDO4FkYK36AFoftofOPTstTaXDvnTzOPpE08fo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709655882; c=relaxed/simple; bh=bMs+YviT9a5PJBq0kYU9+v/g/M2h8Kk35Nc8GSAAXP8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XbFb9H/T+7GYmLKTpcjcOFPt/jKm3fSgc13U/AqE1ifhZwimaLAIv3eoziZIcLZME5SGJ0oMey75aXIh4APTx6JuZptM53YIlyMN+NYcdkxSWpB7Ej5lqJ5r6T0zzCMXyicWQ/8Zs954zdigJ/FcFnskebaGLn8+sw6vuuPbIvU= 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=ZbdGAuue; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=q7G7ZjK5; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=ZbdGAuue; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=q7G7ZjK5; 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="ZbdGAuue"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="q7G7ZjK5"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="ZbdGAuue"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="q7G7ZjK5" 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 C90667682F; 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=JURAHaIiAGODQu+OMFZsQUsTpqu3o+HuUSrSNz6fe2M=; b=ZbdGAuueytSQUmY25kXdjsfpbToHMNCgjjE6w5YDzNpWJeibnhdoDDR9S0avGGdn85i/0g dhSJzQCaRRR3J6Z9Lyne7hlm16ZA6+jbkV7MdNESCsrIzMuE0OSMJyzJJ0UbJjWLzbmWuX OSHJyChrmqfzV8Vi+euluP0cqjV/yQI= 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=JURAHaIiAGODQu+OMFZsQUsTpqu3o+HuUSrSNz6fe2M=; b=q7G7ZjK5mMe6CZK7sozed9xig7zW6AtIn3xDcK9RU9LgjKrmGxhw9kuEmkBLOBH/QSw+8p vNAUDXknMZwjn8AQ== 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=JURAHaIiAGODQu+OMFZsQUsTpqu3o+HuUSrSNz6fe2M=; b=ZbdGAuueytSQUmY25kXdjsfpbToHMNCgjjE6w5YDzNpWJeibnhdoDDR9S0avGGdn85i/0g dhSJzQCaRRR3J6Z9Lyne7hlm16ZA6+jbkV7MdNESCsrIzMuE0OSMJyzJJ0UbJjWLzbmWuX OSHJyChrmqfzV8Vi+euluP0cqjV/yQI= 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=JURAHaIiAGODQu+OMFZsQUsTpqu3o+HuUSrSNz6fe2M=; b=q7G7ZjK5mMe6CZK7sozed9xig7zW6AtIn3xDcK9RU9LgjKrmGxhw9kuEmkBLOBH/QSw+8p vNAUDXknMZwjn8AQ== 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 75F4B13A5D; Tue, 5 Mar 2024 16:24:33 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id 6GyFG0FH52WwYwAAn2gu4w (envelope-from ); Tue, 05 Mar 2024 16:24:33 +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 10/10] backlight: Add controls_device callback to struct backlight_ops Date: Tue, 5 Mar 2024 17:22:43 +0100 Message-ID: <20240305162425.23845-11-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-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=ZbdGAuue; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=q7G7ZjK5 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-2.01 / 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(-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]; 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,linaro.org: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: -2.01 X-Rspamd-Queue-Id: C90667682F X-Spam-Flag: NO 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 4f7973c6fcc79..2bd4299206aef 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -112,7 +112,7 @@ static int fb_notifier_callback(struct notifier_block *self, if (!bd->ops) goto out; - if (bd->ops->check_fb && !bd->ops->check_fb(bd, info)) + if (bd->ops->controls_device && !bd->ops->controls_device(bd, info->device)) goto out; if (fb_bd && fb_bd != bd) goto out; 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); }; /**