From patchwork Wed Feb 21 09:41:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13565241 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 539F93D96E; Wed, 21 Feb 2024 09:43:31 +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=1708508612; cv=none; b=codoSCyzOykQxLIvgWHVfVGrvYNLXCRe2aG0l48gQ1CDG0lV3q0qzkn/M++AVxOjMjir5IXi7+xi3YshrO/UAWZS1XofoqEOFsZl6qmrjLIS2sQXL2+xf32prc2jC3nh3pvcvfNss37CWYo4SXhNK1m11PO6HITh8QyYbeD7bQM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708508612; c=relaxed/simple; bh=Jug75c2ke4yjzX3Y3UZqQDE+plNzb33btNc9dp7f5Jc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Qb+d130txs+sbQP8/OGdvt+dKxtWI3Oo8RBunw/qrKZ1hri1Tta5nZy3z3l/XFV2n7p3B/3p56Rl0sUXgkJlNEF/zCxAG5WsiNe9aSwomPk0QDFLQyLaaHz2gBfw2sSpICtIayI+MZIWNDTROsF9yv5kOWIkgc7Z1aPtG1Llx1E= 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=we6kFgkA; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=B9nLsGvD; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=VW3d1jGj; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=fRYzmhj7; 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="we6kFgkA"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="B9nLsGvD"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="VW3d1jGj"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="fRYzmhj7" 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 749031FB50; Wed, 21 Feb 2024 09:43:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708508609; 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=cavlvMvX53yvycI8hdkIGQzWjA/A2JtxVQIXxU8e+nY=; b=we6kFgkA2wxdqpQf90Oskg507cXRFMSCY39eDu+Q8F9CpyY/lCTOcIzDD4SrXH5FzMprU7 noTJepXGRldAaqW5IuvggvO1VZdztoMVxXWvETkmNWo98yjlL89jPJgILhok3CSeFrk34h xK7XZgjahBGB1EzhVQEIFyTRnLucRdY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708508609; 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=cavlvMvX53yvycI8hdkIGQzWjA/A2JtxVQIXxU8e+nY=; b=B9nLsGvDLXZ6HVJTI0TyF6xncf2YmdZtpDa3XH2RZ9Z1/cP+aVh68ApKoGdK68u8lsXwoQ KV92M7YSwbwYVmDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708508607; 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=cavlvMvX53yvycI8hdkIGQzWjA/A2JtxVQIXxU8e+nY=; b=VW3d1jGjiUVrZrLMHnykCiYqZ3qOuCuOuXlAqFytxFk0wVKTadAuVq/Hd1FZruKQpUSOP4 KQxC2rjQ5uKTaIpTCd0MY9w3AfmtziVqHFNvDLs3XrQOfnei0CpKwqEiepZs0+UjMKiKUO 1j6+RTwFieyAOGfkt+XGVKetM3VqRG0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708508607; 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=cavlvMvX53yvycI8hdkIGQzWjA/A2JtxVQIXxU8e+nY=; b=fRYzmhj7n+FqPdBocNVvlKsGZXrb5H3liZk569qyQkuG1cInPowDdrNYb66RNmkVQqVLNo loB+7s3sYTDWOMBA== 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 1655F13A42; Wed, 21 Feb 2024 09:43:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id ECD+A7/F1WUpCwAAn2gu4w (envelope-from ); Wed, 21 Feb 2024 09:43:27 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, andy@kernel.org, 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 v2 01/10] backlight: Match backlight device against struct fb_info.bl_dev Date: Wed, 21 Feb 2024 10:41:28 +0100 Message-ID: <20240221094324.27436-2-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240221094324.27436-1-tzimmermann@suse.de> References: <20240221094324.27436-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -0.31 X-Spamd-Result: default: False [-0.31 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com,gmx.de]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; REPLY(-4.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_RATELIMIT(0.00)[to_ip_from(RLbrmj4aennmrpd7btm9n9zy3k)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_TWELVE(0.00)[12]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[linaro.org:email,suse.de:email]; FREEMAIL_TO(0.00)[kernel.org,linaro.org,gmail.com,gmx.de,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.01)[50.25%] X-Spam-Flag: NO Framebuffer drivers for devices with dedicated backlight are supposed to set struct fb_info.bl_dev to the backlight's respective device. Use the value to match backlight and framebuffer in the backlight core code. Signed-off-by: Thomas Zimmermann Reviewed-by: Daniel Thompson Reviewed-by: Javier Martinez Canillas --- drivers/video/backlight/backlight.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 86e1cdc8e3697..48844a4f28ad3 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -98,7 +98,8 @@ static int fb_notifier_callback(struct notifier_block *self, { struct backlight_device *bd; struct fb_event *evdata = data; - int node = evdata->info->node; + struct fb_info *info = evdata->info; + int node = info->node; int fb_blank = 0; /* If we aren't interested in this event, skip it immediately ... */ @@ -110,8 +111,12 @@ static int fb_notifier_callback(struct notifier_block *self, if (!bd->ops) goto out; - if (bd->ops->check_fb && !bd->ops->check_fb(bd, evdata->info)) + else if (bd->ops->check_fb && !bd->ops->check_fb(bd, info)) goto out; +#if IS_ENABLED(CONFIG_FB_BACKLIGHT) + else if (info->bl_dev && info->bl_dev != bd) + goto out; +#endif fb_blank = *(int *)evdata->data; if (fb_blank == FB_BLANK_UNBLANK && !bd->fb_bl_on[node]) { From patchwork Wed Feb 21 09:41:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13565240 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 9B1933D992; Wed, 21 Feb 2024 09:43:29 +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=1708508611; cv=none; b=us7HukAvrKIez8bvCHxIsu3nTkLvUPusQJlRcd0RRqqIrkQ8mFDADjdCDGNDVDR+MwxCJlLq00ksypcc+Tw7zE+61EIkwYrjajzhBIqy9r7XjHlB4hmgScFY4q85U5aSzb6hd2JAV0aFV6WRySBobIN0UIscByI9yzQF780fzKE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708508611; c=relaxed/simple; bh=VHUznNjlFjJuOZabIOyDD6zRZsSGaZP1YduWN5QGFc8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CYjY2KXgVydMwTSEIM4/W3pKOAy3DB0kqNJt9xy5TNFRYkdoLrhZTIl0IEWS1tHxyztXU38ePz/P5KUVXcMT7Uvxp/t7UBNznf7cRtsn0CslI1hwiwYSLbbYOry1te/TQ4QAtRt0Vz1EmTU3rffaACnnAf/XhutNNUk7dB8bElw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E2D4C22148; Wed, 21 Feb 2024 09:43:27 +0000 (UTC) Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 7CEC113A25; Wed, 21 Feb 2024 09:43:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id GPr4HL/F1WUpCwAAn2gu4w (envelope-from ); Wed, 21 Feb 2024 09:43:27 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, andy@kernel.org, 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 v2 02/10] auxdisplay/ht16k33: Remove struct backlight_ops.check_fb Date: Wed, 21 Feb 2024 10:41:29 +0100 Message-ID: <20240221094324.27436-3-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240221094324.27436-1-tzimmermann@suse.de> References: <20240221094324.27436-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; none X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: E2D4C22148 X-Spam-Level: X-Spam-Score: -4.00 X-Spam-Flag: NO The driver sets struct fb_info.bl_dev to the correct backlight device. Thus rely on the backlight core code to match backlight and framebuffer devices, and remove the extra check_fb function from struct backlight_ops. Signed-off-by: Thomas Zimmermann Cc: Robin van der Gracht Acked-by: Robin van der Gracht Reviewed-by: Javier Martinez Canillas Acked-by: Andy Shevchenko --- 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 Wed Feb 21 09:41:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13565246 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 28C243D995; Wed, 21 Feb 2024 09:43:29 +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=1708508614; cv=none; b=WEPs4H8xfH9CPNcbyhEwWe+we29kEzR5yoTPIotUKGKTzefrN2571C6UiYkJvOyISwgJNyM7EyIwo+0/KYhymhvmwKFRCpMXEr6Vfuxsl3H4xYbZdI1BmfQIAojFi2xULgXk4dmQltzcvpRFM/tpzcXmI9q3xWomAjVeZZxMzWA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708508614; c=relaxed/simple; bh=pYORUPjgZxymnXgGDfpgr1hnPbabxhGJFr2Ri2emk+E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ruQHvIs4afxS4IPZD8jxct65D35bulvBEC7/KUFPYwuoBJTekWaECTIgbRsCihzkUb85Rg81X5v2tEsZHnVm0PHal5GZZyUGdx4Zp8d4KJOVnuPIBLo6SHwAjADBH8N5/7cuxuStvzfdESfkvWktnQLOZvA42JUPQCJ/f6cOEbY= 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=Vg3LEfB2; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=798d/gMQ; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Vg3LEfB2; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=798d/gMQ; 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="Vg3LEfB2"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="798d/gMQ"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Vg3LEfB2"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="798d/gMQ" 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 5138B1FB4F; Wed, 21 Feb 2024 09:43:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708508608; 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=PtixQVizv1gFoo8SvQU9nQzVSWG+j9t0ClPmcGl6r30=; b=Vg3LEfB2SM9vQPy5SBDpBgBa49OM5RS9m8enUUt0zqXTU8SX0bFFR4U7UmMHuFThO4nZpO seVR2Udleqj/mJoHYH2p2wPbMWe0o/2885SmDaGwiXDMxLU+zLtPcGKtWe3v0+XeB844N0 5suGiPy0y/TOKcAskSylnJjxE4byZ18= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708508608; 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=PtixQVizv1gFoo8SvQU9nQzVSWG+j9t0ClPmcGl6r30=; b=798d/gMQ2O7fG9jQLjXoGsPMSF06B+q29MMkRw3s2kJpL2WdflbNCnlr1pGPGQiXjGPWez QK4SjX7zRIQDfyCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708508608; 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=PtixQVizv1gFoo8SvQU9nQzVSWG+j9t0ClPmcGl6r30=; b=Vg3LEfB2SM9vQPy5SBDpBgBa49OM5RS9m8enUUt0zqXTU8SX0bFFR4U7UmMHuFThO4nZpO seVR2Udleqj/mJoHYH2p2wPbMWe0o/2885SmDaGwiXDMxLU+zLtPcGKtWe3v0+XeB844N0 5suGiPy0y/TOKcAskSylnJjxE4byZ18= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708508608; 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=PtixQVizv1gFoo8SvQU9nQzVSWG+j9t0ClPmcGl6r30=; b=798d/gMQ2O7fG9jQLjXoGsPMSF06B+q29MMkRw3s2kJpL2WdflbNCnlr1pGPGQiXjGPWez QK4SjX7zRIQDfyCQ== 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 DF2F613A6D; Wed, 21 Feb 2024 09:43:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id IOD3NL/F1WUpCwAAn2gu4w (envelope-from ); Wed, 21 Feb 2024 09:43:27 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, andy@kernel.org, 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 v2 03/10] hid/hid-picolcd: Fix initialization order Date: Wed, 21 Feb 2024 10:41:30 +0100 Message-ID: <20240221094324.27436-4-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240221094324.27436-1-tzimmermann@suse.de> References: <20240221094324.27436-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.19 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com,gmx.de]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; REPLY(-4.00)[]; 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.09)[64.52%] X-Spam-Level: X-Spam-Flag: NO X-Spam-Score: -3.19 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 Wed Feb 21 09:41:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13565249 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 7E3523D996; Wed, 21 Feb 2024 09:43:30 +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=1708508615; cv=none; b=FOyjR7aZbSOJNs2JBKWMMt7KrM7EJYoc2hTVlR5M70ixuMqwUB6qC2a6UgMNNqO9cRXQbi6EWvsrNXkoivuX5VRmMmKdtR+vJdA1KoZFzr785G9HCUSf02j4lm3xgb7+ijd1zyVUVgWjKc+NI9C8eu7uf1W5QVqw937Y5MQp9bU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708508615; c=relaxed/simple; bh=dm6dUWs5eYK7iDD0KXEIKym4BzOLgtmh5PvRibkkMSc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gfIyRIPr5kCcUyxU1Z7dHwmgp2DBLXWr71kDunSxAVnOhcVvuiAY9T2CHucliz8OZ25qHGjxgfZ0LblUB9zY/hIt7TOZ4ZJXAAqAinhLn3/Sxb9L66JZhy+B3rJjRItsBGDmy4xESc9nvzTLq18PNqybcC8a/y7nq8rVDfsa8Jo= 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=Pa/61KEn; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=pZCukhie; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Pa/61KEn; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=pZCukhie; 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="Pa/61KEn"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="pZCukhie"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Pa/61KEn"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="pZCukhie" 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 BA1782212A; Wed, 21 Feb 2024 09:43:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708508608; 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=2vbH6fXbw5kSaZe8A6x1Pisz/54U5gjhrI6eNLro4oQ=; b=Pa/61KEnUsNnytdLB8GtCF/LdojJ8cxpXJ3Z8dySP0iUXfys7ORmXoeGfQxfpN8Wt1YL/M 5qSEHYaK2KVjhoY9UktzMc40m3tV8P4XNDOpDOiBxoAhE+vRsm1ILcG9l5NAWOkChRBEIW EMoScmgkEGQrqfXdCl+ZMp3DUosRHLI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708508608; 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=2vbH6fXbw5kSaZe8A6x1Pisz/54U5gjhrI6eNLro4oQ=; b=pZCukhiepzqX7o8ZwERsMLn7dqMUJW1wOQO4dzmZS8SH6y8zuH3JGxQk+aj9UwLgow89ox cJR4WxQgE2VqssBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708508608; 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=2vbH6fXbw5kSaZe8A6x1Pisz/54U5gjhrI6eNLro4oQ=; b=Pa/61KEnUsNnytdLB8GtCF/LdojJ8cxpXJ3Z8dySP0iUXfys7ORmXoeGfQxfpN8Wt1YL/M 5qSEHYaK2KVjhoY9UktzMc40m3tV8P4XNDOpDOiBxoAhE+vRsm1ILcG9l5NAWOkChRBEIW EMoScmgkEGQrqfXdCl+ZMp3DUosRHLI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708508608; 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=2vbH6fXbw5kSaZe8A6x1Pisz/54U5gjhrI6eNLro4oQ=; b=pZCukhiepzqX7o8ZwERsMLn7dqMUJW1wOQO4dzmZS8SH6y8zuH3JGxQk+aj9UwLgow89ox cJR4WxQgE2VqssBg== 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 576AE13A25; Wed, 21 Feb 2024 09:43:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id aGPBE8DF1WUpCwAAn2gu4w (envelope-from ); Wed, 21 Feb 2024 09:43:28 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, andy@kernel.org, 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 v2 04/10] hid/hid-picolcd: Remove struct backlight_ops.check_fb Date: Wed, 21 Feb 2024 10:41:31 +0100 Message-ID: <20240221094324.27436-5-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240221094324.27436-1-tzimmermann@suse.de> References: <20240221094324.27436-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: X-Spam-Score: -4.30 X-Spamd-Result: default: False [-4.30 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com,gmx.de]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_RATELIMIT(0.00)[to_ip_from(RLbrmj4aennmrpd7btm9n9zy3k)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_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)[] 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 Wed Feb 21 09:41:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13565245 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 6216D3DB8B; Wed, 21 Feb 2024 09:43:30 +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=1708508614; cv=none; b=LyuLZ4nE1PSl3pEAwoNQWtvC+VpiZ57irpYata1TBw/UR1itD9XEZ2Qd6ZFLFFouoZItcNDnGLxG2Sgy7LneTFfThBB8tN5hT0rRpHTWH+H/HS/3N8U3TdFjrKh5/O9K3x6zjVujnRRBDlT+RoyDpaF2CHRfMe7uUH/iTVoo6xU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708508614; c=relaxed/simple; bh=CZDge2NPbk+kofPGQYd5KOfRxWljJqpA0AJTrTX1pm8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dGxc9HGRRKA3GwF5sQUvlfMpMCz4QnvoVI95LC/Op+byIYmTxVt+hdzN4JMp7ul1Xs4/QHAMVNB0XJVVOdA26uD3Sbg8M4oYACYDkJ1+ix/AaVEV2XPgGj4DMvtF80spFG5DWM0NR/v+ihA3qydR9L9OUeu0O4VomvkXFBlbjU0= 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=yUWafFyY; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=ZOKPxJWJ; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=yUWafFyY; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=ZOKPxJWJ; 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="yUWafFyY"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="ZOKPxJWJ"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="yUWafFyY"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="ZOKPxJWJ" 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 27EE121ED8; Wed, 21 Feb 2024 09:43:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708508609; 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=HmHOaf1sO3yn0g8TKvW7sjLNXGxLzPU0y2+ebOZCwiE=; b=yUWafFyYe/zHZJPfVa1zDU87NchQjeUff6/3bsnjWULTULIyoeTb3ckyw3P/Fk9ShTE6KE GnXXrkzoQmB3AbJg8kBv45RtsWUH2z1kuhTIvKaAhJEQiN5cghb2sr4o9dIYexzu1PrLmT cCUSM5iZ4lhwKSDV5oE31sHo1iJpyKA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708508609; 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=HmHOaf1sO3yn0g8TKvW7sjLNXGxLzPU0y2+ebOZCwiE=; b=ZOKPxJWJpkV96seqFu1H4WhnunY4KtcFMzc6shwRzYOoIQMpm+ErTNFswMgoZSEjB9DcEG H5uDo3OpytT/c7AQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708508609; 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=HmHOaf1sO3yn0g8TKvW7sjLNXGxLzPU0y2+ebOZCwiE=; b=yUWafFyYe/zHZJPfVa1zDU87NchQjeUff6/3bsnjWULTULIyoeTb3ckyw3P/Fk9ShTE6KE GnXXrkzoQmB3AbJg8kBv45RtsWUH2z1kuhTIvKaAhJEQiN5cghb2sr4o9dIYexzu1PrLmT cCUSM5iZ4lhwKSDV5oE31sHo1iJpyKA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708508609; 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=HmHOaf1sO3yn0g8TKvW7sjLNXGxLzPU0y2+ebOZCwiE=; b=ZOKPxJWJpkV96seqFu1H4WhnunY4KtcFMzc6shwRzYOoIQMpm+ErTNFswMgoZSEjB9DcEG H5uDo3OpytT/c7AQ== 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 C24B213A6D; Wed, 21 Feb 2024 09:43:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id SAoMLsDF1WUpCwAAn2gu4w (envelope-from ); Wed, 21 Feb 2024 09:43:28 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, andy@kernel.org, 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 v2 05/10] backlight/aat2870-backlight: Remove struct backlight.check_fb Date: Wed, 21 Feb 2024 10:41:32 +0100 Message-ID: <20240221094324.27436-6-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240221094324.27436-1-tzimmermann@suse.de> References: <20240221094324.27436-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.80 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com,gmx.de]; R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; REPLY(-4.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; R_RATELIMIT(0.00)[to_ip_from(RLbrmj4aennmrpd7btm9n9zy3k)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_TWELVE(0.00)[12]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,linaro.org:email]; FREEMAIL_TO(0.00)[kernel.org,linaro.org,gmail.com,gmx.de,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.10)[65.56%] X-Spam-Level: X-Spam-Flag: NO X-Spam-Score: 0.80 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 Wed Feb 21 09:41:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13565242 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 621A93DB8C; Wed, 21 Feb 2024 09:43:31 +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=1708508613; cv=none; b=WDe43tAjEgvvk2EwTOsJqsoJkfjOzK51YIo+8RrGgjFZ4+rhI4FGnIA2b8l7xRNyhwaX34gg/ZBMsENaVHYZhLP1xsrO7G5KXE0H9OSFhixVIy/cY4mve7w7K+7Go6RCEHhMZiHrF7N817JdNbY+WfioPuPgzaKJpryfIDABBl0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708508613; c=relaxed/simple; bh=i1r591TCS4efOmhWAmEnfHCX7eYHB76WSo0sOsjD5qo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Tncn8UPBcTK1k1BFJNrhCHbz+zHcQXTl5eolhPYInTLCUbsCqB1TY7BvSMBDZc/PIfq2VoP/Dsdnch+YHw48Qsti5vL+P8frAdRsrsAVdaDq+faZqWHjH0WpCIRCk0e8V9Hp0/4kA7V7VF311L7T/t9xRgXV92DDcDj4bwr9WyQ= 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=srGuooPZ; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=qIuPNSs5; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=srGuooPZ; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=qIuPNSs5; 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="srGuooPZ"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="qIuPNSs5"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="srGuooPZ"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="qIuPNSs5" 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 8F5B121E10; Wed, 21 Feb 2024 09:43:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708508609; 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=rTCwtXX1L/OgL82R+ITUhLkItI9LhaWzY88CufWd7K8=; b=srGuooPZkSIkF1ddlGIboRuR6Q6yood9cqLDOJuszSWzH3Z+RZTKL9d7eGH0gvz+tF1xjC kf88Fj3knkfVLDWXqWyvMNvESoQZDCiG0yP2z143sxo7FJdL0+n7/iBoBIvZfFESabPxUj e0gtlvRb+whNKh8Shgsbd42YN7fu6tA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708508609; 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=rTCwtXX1L/OgL82R+ITUhLkItI9LhaWzY88CufWd7K8=; b=qIuPNSs55M32OzcOfVEBLtnVy1age6dmTpazLqJrNofbblTmBDJP1CcODiuzy+CsXVdI42 A+wIwxbQtQub5tAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708508609; 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=rTCwtXX1L/OgL82R+ITUhLkItI9LhaWzY88CufWd7K8=; b=srGuooPZkSIkF1ddlGIboRuR6Q6yood9cqLDOJuszSWzH3Z+RZTKL9d7eGH0gvz+tF1xjC kf88Fj3knkfVLDWXqWyvMNvESoQZDCiG0yP2z143sxo7FJdL0+n7/iBoBIvZfFESabPxUj e0gtlvRb+whNKh8Shgsbd42YN7fu6tA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708508609; 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=rTCwtXX1L/OgL82R+ITUhLkItI9LhaWzY88CufWd7K8=; b=qIuPNSs55M32OzcOfVEBLtnVy1age6dmTpazLqJrNofbblTmBDJP1CcODiuzy+CsXVdI42 A+wIwxbQtQub5tAA== 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 301B213A25; Wed, 21 Feb 2024 09:43:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id 4J9DCsHF1WUpCwAAn2gu4w (envelope-from ); Wed, 21 Feb 2024 09:43:29 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, andy@kernel.org, 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 v2 06/10] backlight/pwm-backlight: Remove struct backlight_ops.check_fb Date: Wed, 21 Feb 2024 10:41:33 +0100 Message-ID: <20240221094324.27436-7-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240221094324.27436-1-tzimmermann@suse.de> References: <20240221094324.27436-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; none X-Spamd-Result: default: False [-3.10 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com,gmx.de]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; REPLY(-4.00)[]; R_RATELIMIT(0.00)[to_ip_from(RLbrmj4aennmrpd7btm9n9zy3k)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_TWELVE(0.00)[13]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[linaro.org:email,suse.de:email]; FREEMAIL_TO(0.00)[kernel.org,linaro.org,gmail.com,gmx.de,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.00)[37.66%] X-Spam-Level: X-Spam-Flag: NO X-Spam-Score: -3.10 The internal check_fb callback from struct pwm_bl_data is never implemented. 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 Wed Feb 21 09:41: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: 13565243 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 ABC643D992; Wed, 21 Feb 2024 09:43:31 +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=1708508613; cv=none; b=FSq0t7fH1zRv89IorYSkm+ahiBhrdHSBwGdj8QAgh5Pg0FCUUa2XlHhVCyOkcQBW20Fem5rxTCplAVlwVVRkoKk4DdMqVcZrVup2oWEKecV9dJ96CU/KaFrxSkHhoF+t6J4C997Nyh6tB5rGVED47Dh0cxsrB40c8EFl600W7ZA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708508613; c=relaxed/simple; bh=IP9F+nPkTSoLpYVE+tcQQH19sQIAY0CQpagfnrWY/nE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jllUye8mvCCi7ye4LlxdWVLjN25XVz2TS8YVEwInlZ9GLSHrDESCSZfb7mTyW4atOOkbE7ZrD2patkIcoarnGz8HCvuaaBppnid3vbwgcQx5zB53m6VkW3gw2E2CnvTBxei1tlLFOHEu2LMj8X72+ec8m3oH/RME2nUdBNVvswY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id F2BCA2210E; Wed, 21 Feb 2024 09:43:29 +0000 (UTC) Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 97D2613A42; Wed, 21 Feb 2024 09:43:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id +DajI8HF1WUpCwAAn2gu4w (envelope-from ); Wed, 21 Feb 2024 09:43:29 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, andy@kernel.org, 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 v2 07/10] fbdev/sh_mobile_lcdc_fb: Remove struct backlight_ops.check_fb Date: Wed, 21 Feb 2024 10:41:34 +0100 Message-ID: <20240221094324.27436-8-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240221094324.27436-1-tzimmermann@suse.de> References: <20240221094324.27436-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; none X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: F2BCA2210E X-Spam-Level: X-Spam-Score: -4.00 X-Spam-Flag: NO The driver sets struct fb_info.bl_dev to the correct backlight device. Thus rely on the backlight core code to match backlight and framebuffer devices, and remove the extra check_fb function from struct backlight_ops. Signed-off-by: Thomas Zimmermann 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 Wed Feb 21 09:41: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: 13565244 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 04DB63DBA1; Wed, 21 Feb 2024 09:43:31 +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=1708508613; cv=none; b=cipfyoY8j0wap9tuKTohVyRig+om5uvYa5ydf0Ur4ubIfN2L6o94n/q4f1vo/zhctkNTwgp6YxTfn2pjyk4eKgGQdLkVyy+0sUOgfkTGQHqKMmlaZNkgLXZud2aUU7DIWezWEnu1BMenFVbXUC2cUu5RbaL79FCXTjIMzmVvsCA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708508613; c=relaxed/simple; bh=N0nPYyTU6ZW0Z2iwEnOgeVAYh4ux/fuS07RWleI4p1o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dkU7hIMUfN/dzuRNv73WaYTEcQi8JTZ4hn+0rBQJbggQqShFfTH/d6/qNi1+Mo9VyGpuNst21MDsi7k9nrDi4FJE5Z9WeVl8Ya8Pq1zilk241VIP0aLUKPPG4pTE60a8mvDevffQ9OWms0VubOc1Wvsur9VCUqOj0ZkfaM6PSpw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 60FA61FB4A; Wed, 21 Feb 2024 09:43:30 +0000 (UTC) Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 07FFF13A25; Wed, 21 Feb 2024 09:43:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id IEtUO8HF1WUpCwAAn2gu4w (envelope-from ); Wed, 21 Feb 2024 09:43:29 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, andy@kernel.org, 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 v2 08/10] fbdev/ssd1307fb: Init backlight before registering framebuffer Date: Wed, 21 Feb 2024 10:41:35 +0100 Message-ID: <20240221094324.27436-9-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240221094324.27436-1-tzimmermann@suse.de> References: <20240221094324.27436-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: Authentication-Results: smtp-out2.suse.de; none X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Score: -4.00 X-Rspamd-Queue-Id: 60FA61FB4A 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 Wed Feb 21 09:41:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13565247 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 2867C3E476; Wed, 21 Feb 2024 09:43: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=1708508614; cv=none; b=UrtWnriEH3S3s64CdO1lVKE0gBnQ5pSPVWzu1TD8NUdy42vTWW3rvxydYm/0gVbaSqXhlMcA6crRmK2O+42UYOAIHyPwD9mayrsv1L+7hnaRpOSFis5xmnI7BMFBehVKlZDN6YARzNy1XbwJh45WUlAmnqMoQqclkZTOR5NWv0Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708508614; c=relaxed/simple; bh=ULiONwxGySw2NOJ67ycr/w1ptbYUqSXogsN0uAmnYjw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gNGiRMCZT/dLy004hcrgzxgm7n1aYcaibm++/hFiReNMiTEy1g1++rlhLiCZdxE0cwzmwVKrTJs1f6nEPDv50sT0EH8loiPwztk8I7JnT1p69o2VKE2O/Dcpeuxep6QuHeKsOyxi2d7ZKMrAZskX+wbuUkYZJ5coknvqCE3IiB4= 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=umQsCj5l; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=MwvHq6uj; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=umQsCj5l; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=MwvHq6uj; 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="umQsCj5l"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="MwvHq6uj"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="umQsCj5l"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="MwvHq6uj" 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 C91C222127; Wed, 21 Feb 2024 09:43:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708508610; 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=hlRgnNrze55CLjOfXEge3l50s+drMdqYBnjoZMl9n8U=; b=umQsCj5lRaWfW0cKhFk9Tca+b+MaveuOgowpQka0NSseZdlAH37DSsuv8V0B3I+Bbp65hZ ZxKiqvgfLeCjMPmI3Ikt5XtCscVJmt4x57hudXm/hUcFX/6QV0Al+FKpkzPAArffhhNRwM wf3Ovt2s/5LJ4HEVaMb/8URkLBYPaig= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708508610; 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=hlRgnNrze55CLjOfXEge3l50s+drMdqYBnjoZMl9n8U=; b=MwvHq6ujnI3dahhcn0n60BwuovJyTgTbnQjlBCwpY4rUXUyFB5rSHAUlglowMxQWhdHhPt gkkqJJktlxD3IoBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708508610; 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=hlRgnNrze55CLjOfXEge3l50s+drMdqYBnjoZMl9n8U=; b=umQsCj5lRaWfW0cKhFk9Tca+b+MaveuOgowpQka0NSseZdlAH37DSsuv8V0B3I+Bbp65hZ ZxKiqvgfLeCjMPmI3Ikt5XtCscVJmt4x57hudXm/hUcFX/6QV0Al+FKpkzPAArffhhNRwM wf3Ovt2s/5LJ4HEVaMb/8URkLBYPaig= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708508610; 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=hlRgnNrze55CLjOfXEge3l50s+drMdqYBnjoZMl9n8U=; b=MwvHq6ujnI3dahhcn0n60BwuovJyTgTbnQjlBCwpY4rUXUyFB5rSHAUlglowMxQWhdHhPt gkkqJJktlxD3IoBw== 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 692C413A25; Wed, 21 Feb 2024 09:43:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id EFQkGMLF1WUpCwAAn2gu4w (envelope-from ); Wed, 21 Feb 2024 09:43:30 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, andy@kernel.org, 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 v2 09/10] fbdev/ssd1307fb: Remove struct backlight_ops.check_fb Date: Wed, 21 Feb 2024 10:41:36 +0100 Message-ID: <20240221094324.27436-10-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240221094324.27436-1-tzimmermann@suse.de> References: <20240221094324.27436-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.21 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com,gmx.de]; R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; REPLY(-4.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; R_RATELIMIT(0.00)[to_ip_from(RLbrmj4aennmrpd7btm9n9zy3k)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_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(-1.11)[88.30%] X-Spam-Level: X-Spam-Flag: NO X-Spam-Score: -0.21 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 Wed Feb 21 09:41:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13565248 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 284943E470; Wed, 21 Feb 2024 09:43: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=1708508615; cv=none; b=E6TXXpCuj+karju6oeRnqNAdbYJuWIhKU3lHB7BQNYBrdzcy0VsNRBrAyh5YTFpeZQSffyRO4pWjiTm+Mh25O7242V8kn1hXUXsLSca8zioCsl+VSVfwKRF4FksgAfEXR+Bvj61T6bL+bKaFh3YaT6qiIoy5SsMWK78mw1+IqJg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708508615; c=relaxed/simple; bh=BVHjxKUQNx6YtDqBqrT5tXu2Vz0zGrthGbEiJkri11Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ASBrsUeZjn5Jyb3jcu1rbCLQwBdlBnlKPGvL4Jd50JqDZxcStqdwpGptDv4CMgxmAH/cnhBWkgbn9ctm77qQ9w7Ldp3IzIyspiCJIboKJRM9mNODZOKZT6MVIA8nVhIqO9m45zOeE1zHRLcs52h59lT1viQC7y6ESeFTD3ocprw= 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=lsATnrjx; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=8TFBqIGS; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=lsATnrjx; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=8TFBqIGS; 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="lsATnrjx"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="8TFBqIGS"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="lsATnrjx"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="8TFBqIGS" 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 4982C22149; Wed, 21 Feb 2024 09:43:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708508611; 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=9poqBGT1D4fdmvAl6rpVBJMyFuTWxjtusItU2HOV0Sc=; b=lsATnrjxW9kbUCri3Z9QiTUQMw6Dieqk6fUFX7mmSZl1rb5w9FKGHxXX8fwV4nC8Swi4Xk nIBFzG9p59bAbc2O4hpIvE4/yPkUxDKmlrNlRuZNSQQuMtTlvNp1DmfQmak7Y35o1IkIdi Tew86zcSJz/MnIsC9F/2dILNWJXrdVg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708508611; 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=9poqBGT1D4fdmvAl6rpVBJMyFuTWxjtusItU2HOV0Sc=; b=8TFBqIGSgIY3LqR8c/7+PJaqa20uDN1lHoz3R1d5g4qc32jDiseM+McDGdzp9OYed/X7Gy LAQcS8pd8nnIvsCA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708508611; 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=9poqBGT1D4fdmvAl6rpVBJMyFuTWxjtusItU2HOV0Sc=; b=lsATnrjxW9kbUCri3Z9QiTUQMw6Dieqk6fUFX7mmSZl1rb5w9FKGHxXX8fwV4nC8Swi4Xk nIBFzG9p59bAbc2O4hpIvE4/yPkUxDKmlrNlRuZNSQQuMtTlvNp1DmfQmak7Y35o1IkIdi Tew86zcSJz/MnIsC9F/2dILNWJXrdVg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708508611; 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=9poqBGT1D4fdmvAl6rpVBJMyFuTWxjtusItU2HOV0Sc=; b=8TFBqIGSgIY3LqR8c/7+PJaqa20uDN1lHoz3R1d5g4qc32jDiseM+McDGdzp9OYed/X7Gy LAQcS8pd8nnIvsCA== 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 D1A0E13A42; Wed, 21 Feb 2024 09:43:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id 2O+1McLF1WUpCwAAn2gu4w (envelope-from ); Wed, 21 Feb 2024 09:43:30 +0000 From: Thomas Zimmermann To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, andy@kernel.org, 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 v2 10/10] backlight: Add controls_device callback to struct backlight_ops Date: Wed, 21 Feb 2024 10:41:37 +0100 Message-ID: <20240221094324.27436-11-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240221094324.27436-1-tzimmermann@suse.de> References: <20240221094324.27436-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: X-Spam-Score: -3.30 X-Spamd-Result: default: False [-3.30 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com,gmx.de]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; REPLY(-4.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_RATELIMIT(0.00)[to_ip_from(RLbrmj4aennmrpd7btm9n9zy3k)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_TWELVE(0.00)[12]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[linaro.org:email,suse.de:email]; FREEMAIL_TO(0.00)[kernel.org,linaro.org,gmail.com,gmx.de,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(-3.00)[100.00%] 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 48844a4f28ad3..18a0ac4bd6005 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -111,7 +111,7 @@ static int fb_notifier_callback(struct notifier_block *self, if (!bd->ops) goto out; - else if (bd->ops->check_fb && !bd->ops->check_fb(bd, info)) + else if (bd->ops->controls_device && !bd->ops->controls_device(bd, info->device)) goto out; #if IS_ENABLED(CONFIG_FB_BACKLIGHT) else if (info->bl_dev && info->bl_dev != bd) diff --git a/drivers/video/backlight/bd6107.c b/drivers/video/backlight/bd6107.c index c95a12bf0ce26..d124ede084ef9 100644 --- a/drivers/video/backlight/bd6107.c +++ b/drivers/video/backlight/bd6107.c @@ -99,18 +99,18 @@ static int bd6107_backlight_update_status(struct backlight_device *backlight) return 0; } -static int bd6107_backlight_check_fb(struct backlight_device *backlight, - struct fb_info *info) +static bool bd6107_backlight_controls_device(struct backlight_device *backlight, + struct device *display_dev) { struct bd6107 *bd = bl_get_data(backlight); - return !bd->pdata->dev || bd->pdata->dev == info->device; + return !bd->pdata->dev || bd->pdata->dev == display_dev; } static const struct backlight_ops bd6107_backlight_ops = { - .options = BL_CORE_SUSPENDRESUME, - .update_status = bd6107_backlight_update_status, - .check_fb = bd6107_backlight_check_fb, + .options = BL_CORE_SUSPENDRESUME, + .update_status = bd6107_backlight_update_status, + .controls_device = bd6107_backlight_controls_device, }; static int bd6107_probe(struct i2c_client *client) diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index d28c30b2a35d2..c0cff685ea848 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -30,18 +30,18 @@ static int gpio_backlight_update_status(struct backlight_device *bl) return 0; } -static int gpio_backlight_check_fb(struct backlight_device *bl, - struct fb_info *info) +static bool gpio_backlight_controls_device(struct backlight_device *bl, + struct device *display_dev) { struct gpio_backlight *gbl = bl_get_data(bl); - return !gbl->dev || gbl->dev == info->device; + return !gbl->dev || gbl->dev == display_dev; } static const struct backlight_ops gpio_backlight_ops = { - .options = BL_CORE_SUSPENDRESUME, - .update_status = gpio_backlight_update_status, - .check_fb = gpio_backlight_check_fb, + .options = BL_CORE_SUSPENDRESUME, + .update_status = gpio_backlight_update_status, + .controls_device = gpio_backlight_controls_device, }; static int gpio_backlight_probe(struct platform_device *pdev) diff --git a/drivers/video/backlight/lv5207lp.c b/drivers/video/backlight/lv5207lp.c index 1f1d06b4e119a..0cf00fee0f605 100644 --- a/drivers/video/backlight/lv5207lp.c +++ b/drivers/video/backlight/lv5207lp.c @@ -62,18 +62,18 @@ static int lv5207lp_backlight_update_status(struct backlight_device *backlight) return 0; } -static int lv5207lp_backlight_check_fb(struct backlight_device *backlight, - struct fb_info *info) +static bool lv5207lp_backlight_controls_device(struct backlight_device *backlight, + struct device *display_dev) { struct lv5207lp *lv = bl_get_data(backlight); - return !lv->pdata->dev || lv->pdata->dev == info->device; + return !lv->pdata->dev || lv->pdata->dev == display_dev; } static const struct backlight_ops lv5207lp_backlight_ops = { - .options = BL_CORE_SUSPENDRESUME, - .update_status = lv5207lp_backlight_update_status, - .check_fb = lv5207lp_backlight_check_fb, + .options = BL_CORE_SUSPENDRESUME, + .update_status = lv5207lp_backlight_update_status, + .controls_device = lv5207lp_backlight_controls_device, }; static int lv5207lp_probe(struct i2c_client *client) diff --git a/include/linux/backlight.h b/include/linux/backlight.h index 614653e07e3a8..2db4c70053c46 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h @@ -13,6 +13,7 @@ #include #include #include +#include /** * enum backlight_update_reason - what method was used to update backlight @@ -110,7 +111,6 @@ enum backlight_scale { }; struct backlight_device; -struct fb_info; /** * struct backlight_ops - backlight operations @@ -160,18 +160,18 @@ struct backlight_ops { int (*get_brightness)(struct backlight_device *); /** - * @check_fb: Check the framebuffer device. + * @controls_device: Check against the display device * - * Check if given framebuffer device is the one bound to this backlight. - * This operation is optional and if not implemented it is assumed that the - * fbdev is always the one bound to the backlight. + * Check if the backlight controls the given display device. This + * operation is optional and if not implemented it is assumed that + * the display is always the one controlled by the backlight. * * RETURNS: * - * If info is NULL or the info matches the fbdev bound to the backlight return true. - * If info does not match the fbdev bound to the backlight return false. + * If display_dev is NULL or display_dev matches the device controlled by + * the backlight, return true. Otherwise return false. */ - int (*check_fb)(struct backlight_device *bd, struct fb_info *info); + bool (*controls_device)(struct backlight_device *bd, struct device *display_dev); }; /**