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: 13582686 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;