Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5284474rwl; Sun, 8 Jan 2023 12:04:15 -0800 (PST) X-Google-Smtp-Source: AMrXdXsebLuee9VBHzjPHs8E03l59NXJelGJvFGYSHeaMVXVV6ri4GBKSjIHDWHK956r+QvTyB3q X-Received: by 2002:a05:6a20:13a6:b0:af:9c75:6699 with SMTP id w38-20020a056a2013a600b000af9c756699mr103940879pzh.1.1673208254822; Sun, 08 Jan 2023 12:04:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673208254; cv=none; d=google.com; s=arc-20160816; b=HqTQPmQ3+d+qjvkuECY4RERitpB3ItV1jMG/jtzZ7RQCnIUNwdG8xSPSqiInIyXa/m tvq6rjiMiRBuFtvCBIVpCr+/1FZkL3osA4MMBqoOXnwznMBBsMneW8VwsNKTjHAQPYuU gK89lUOlzHremCvc9dmOg2avXqHLFl/jnpL5QWKBXUkMzlm3yoxOu0LiGGENG2wcpR1v kn6q8wGVu77lLPf9GJ+O3orwtMH5fbbJMemSBk+U0Lm8R2d6SBE8RR0cy2PjHnxhboE9 jM8U/70kU3+kZmUqgyx4vJQIMvo/dc6Hke5UGtGjvOJrvNMDwgbka5jM7Vlj87NNuEcq U3fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :subject:cc:to:from:date; bh=295yLKSBK6yrtD4SYnxK4BnTEYMIMkVe059QNLnchiU=; b=BQJqFDHxPwnBIRXHMcQ6qMqrDqWiYyADUic8QO5xkpQX/qDmofqD19Ycur58lG2BlX ETFiyy73ykAIIpcfVNeJ6YkK7XVdtQA5BnC/ZnNIroatQSy7tJQJfAol4fcls/5JLKHm Z2o7J9VeruFTn0HjYCKG+LGx+YSeCKagHjrYm5kY8mq997Qqi6Px4n8V41gaYh2AN2dB 3n5WZ/8qpd0Q2dj2ud/KYP/YPLn+F/cNKxSjlqjFXeg4o0tPwrvhTgzo+Qb0/1C8/P4a uqmaYcY1LWQI47+hVEfd9pyP5x2xA3fEU/fmnYQuadxsICU3SqPrvLy0m85v34BKyYza V44g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 37-20020a631965000000b004787836f4b4si7656719pgz.420.2023.01.08.12.04.08; Sun, 08 Jan 2023 12:04:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233550AbjAHTr3 (ORCPT + 51 others); Sun, 8 Jan 2023 14:47:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233451AbjAHTr1 (ORCPT ); Sun, 8 Jan 2023 14:47:27 -0500 X-Greylist: delayed 187 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sun, 08 Jan 2023 11:47:26 PST Received: from 1.mo575.mail-out.ovh.net (1.mo575.mail-out.ovh.net [46.105.41.146]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D00DBCA4 for ; Sun, 8 Jan 2023 11:47:26 -0800 (PST) Received: from director9.ghost.mail-out.ovh.net (unknown [10.108.20.16]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id 658B521440 for ; Sun, 8 Jan 2023 19:32:18 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-rxrrl (unknown [10.110.208.237]) by director9.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 531A61FED5; Sun, 8 Jan 2023 19:32:17 +0000 (UTC) Received: from sk2.org ([37.59.142.102]) by ghost-submission-6684bf9d7b-rxrrl with ESMTPSA id GQDvD0Eau2MQfAAAaOw9AQ (envelope-from ); Sun, 08 Jan 2023 19:32:17 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-102R004bd0c23e1-a184-484d-af6b-234daf9726ce, 5128B599F7D401446F64D4771BE19AB2B9CD7A8B) smtp.auth=steve@sk2.org X-OVh-ClientIp: 82.65.25.201 Date: Sun, 8 Jan 2023 20:32:15 +0100 From: Stephen Kitt To: Sam Ravnborg via B4 Submission Endpoint Cc: , Nicolas Ferre , Helge Deller , Alexandre Belloni , Claudiu Beznea , Antonino Daplas , Benjamin Herrenschmidt , Paul Mackerras , Greg Kroah-Hartman , Robin van der Gracht , Miguel Ojeda , Lee Jones , Daniel Thompson , Jingoo Han , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-staging@lists.linux.dev, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH 13/15] backlight: omap1: Use backlight helpers Message-ID: <20230108203215.30037a70@heffalump.sk2.org> In-Reply-To: <20230107-sam-video-backlight-drop-fb_blank-v1-13-1bd9bafb351f@ravnborg.org> References: <20230107-sam-video-backlight-drop-fb_blank-v1-0-1bd9bafb351f@ravnborg.org> <20230107-sam-video-backlight-drop-fb_blank-v1-13-1bd9bafb351f@ravnborg.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/GypAq4FXG4m.CwTF5BhTXQF"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Ovh-Tracer-Id: 1892074796039898758 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrkeeggdduvdelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepfffhvfevuffkjghfofggtgesghdtreerredtvdenucfhrhhomhepufhtvghphhgvnhcumfhithhtuceoshhtvghvvgesshhkvddrohhrgheqnecuggftrfgrthhtvghrnhepfeffgefhgfeuueeffeejieefieefgfefffethfdtudegvdejueelhffhfeegjeeinecukfhppeduvdejrddtrddtrddupdefjedrheelrddugedvrddutddvnecuvehluhhsthgvrhfuihiivgepieenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeoshhtvghvvgesshhkvddrohhrgheqpdhnsggprhgtphhtthhopedupdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehjeehpdhmohguvgepshhmthhpohhuth X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Sig_/GypAq4FXG4m.CwTF5BhTXQF Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sat, 07 Jan 2023 19:26:27 +0100, Sam Ravnborg via B4 Submission Endpoint wrote: > From: Sam Ravnborg >=20 > Rework backlight handling to avoid access to the deprecated > backlight_properties.fb_blank member. >=20 > The rework includes removal of get_brightness() operation, > because there was no read back from HW so no use for it. >=20 > Signed-off-by: Sam Ravnborg > Cc: Lee Jones > Cc: Daniel Thompson > Cc: Jingoo Han > --- > drivers/video/backlight/omap1_bl.c | 67 > +++++--------------------------------- 1 file changed, 9 insertions(+), 58 > deletions(-) >=20 > diff --git a/drivers/video/backlight/omap1_bl.c > b/drivers/video/backlight/omap1_bl.c index 69a49384b3de..49f37da857e7 100= 644 > --- a/drivers/video/backlight/omap1_bl.c > +++ b/drivers/video/backlight/omap1_bl.c > @@ -20,9 +20,6 @@ > #define OMAPBL_MAX_INTENSITY 0xff > =20 > struct omap_backlight { > - int powermode; > - int current_intensity; > - > struct device *dev; > struct omap_backlight_config *pdata; > }; > @@ -37,82 +34,40 @@ static inline void omapbl_send_enable(int enable) > omap_writeb(enable, OMAP_PWL_CLK_ENABLE); > } > =20 > -static void omapbl_blank(struct omap_backlight *bl, int mode) > -{ > - if (bl->pdata->set_power) > - bl->pdata->set_power(bl->dev, mode); > - > - switch (mode) { > - case FB_BLANK_NORMAL: > - case FB_BLANK_VSYNC_SUSPEND: > - case FB_BLANK_HSYNC_SUSPEND: > - case FB_BLANK_POWERDOWN: > - omapbl_send_intensity(0); > - omapbl_send_enable(0); > - break; > - > - case FB_BLANK_UNBLANK: > - omapbl_send_intensity(bl->current_intensity); > - omapbl_send_enable(1); > - break; > - } > -} > - > #ifdef CONFIG_PM_SLEEP > static int omapbl_suspend(struct device *dev) > { > struct backlight_device *bl_dev =3D dev_get_drvdata(dev); > - struct omap_backlight *bl =3D bl_get_data(bl_dev); > =20 > - omapbl_blank(bl, FB_BLANK_POWERDOWN); > + backlight_disable(bl_dev); > return 0; > } > =20 > static int omapbl_resume(struct device *dev) > { > struct backlight_device *bl_dev =3D dev_get_drvdata(dev); > - struct omap_backlight *bl =3D bl_get_data(bl_dev); > =20 > - omapbl_blank(bl, bl->powermode); > + backlight_enable(bl_dev); > return 0; > } > #endif > =20 > -static int omapbl_set_power(struct backlight_device *dev, int state) > -{ > - struct omap_backlight *bl =3D bl_get_data(dev); > - > - omapbl_blank(bl, state); > - bl->powermode =3D state; > - > - return 0; > -} > - > static int omapbl_update_status(struct backlight_device *dev) > { > - struct omap_backlight *bl =3D bl_get_data(dev); > + int brightness =3D backlight_get_brightness(dev); > =20 > - if (bl->current_intensity !=3D dev->props.brightness) { > - if (bl->powermode =3D=3D FB_BLANK_UNBLANK) > - omapbl_send_intensity(dev->props.brightness); > - bl->current_intensity =3D dev->props.brightness; > + if (brightness > 0) { > + omapbl_send_intensity(dev->props.brightness); > + omapbl_send_enable(1); > + } else { > + omapbl_send_intensity(0); > + omapbl_send_enable(0); > } > =20 > - if (dev->props.fb_blank !=3D bl->powermode) > - omapbl_set_power(dev, dev->props.fb_blank); > - > return 0; > } > =20 > -static int omapbl_get_intensity(struct backlight_device *dev) > -{ > - struct omap_backlight *bl =3D bl_get_data(dev); > - > - return bl->current_intensity; > -} > - > static const struct backlight_ops omapbl_ops =3D { > - .get_brightness =3D omapbl_get_intensity, > .update_status =3D omapbl_update_status, > }; > =20 > @@ -139,9 +94,6 @@ static int omapbl_probe(struct platform_device *pdev) > if (IS_ERR(dev)) > return PTR_ERR(dev); > =20 > - bl->powermode =3D FB_BLANK_POWERDOWN; > - bl->current_intensity =3D 0; > - > bl->pdata =3D pdata; > bl->dev =3D &pdev->dev; > =20 > @@ -149,7 +101,6 @@ static int omapbl_probe(struct platform_device *pdev) > =20 > omap_cfg_reg(PWL); /* Conflicts with UART3 */ > =20 > - dev->props.fb_blank =3D FB_BLANK_UNBLANK; > dev->props.brightness =3D pdata->default_intensity; > omapbl_update_status(dev); > =20 >=20 > --=20 > 2.34.1 Wow that gets rid of a lot of unnecessary code! Reviewed-by: Stephen Kitt --Sig_/GypAq4FXG4m.CwTF5BhTXQF Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEnPVX/hPLkMoq7x0ggNMC9Yhtg5wFAmO7GkAACgkQgNMC9Yht g5wbPw//Ss+kTsAfHvbPabK9dJV/X66aYDEyoOZ3yDLe6E2BoTflL+WrHBw8VFNa AJvgfHwrJ1T4yIWpz0T/hzHKeO1gx0bj+VMDMJnCwGueAAZoz3rE9NXDPclWfqzb LkSkCDgIu44dDRbvFE3Sd0azg0lN35evn+zyEqbpw+QKfsv5O3S+LX9iY2rkLXcv CkEynsPcOzfQSUBMgCvrvkDK0L0Gi0OghVh5WEnYfB0RMs31qFaEd8i+maho3DKP p78tgvWNxAw62OxEvlXK66XvibuCJpwsVmDCN6pLZXQCqmIUgUa3U6PS3kINzIVp vd0Mlca7QxaPrqWINi8SQhO8O9bVhQWK5FgPP719ay6QGtyR85FhNsW5DZQHG7yd kxrvExOJDvZ0GnrAvSNGPrPXqp/rlelpeHW4dyf67t8bQkpaUIsNYVha0XrhuZv9 tFwdW5RA0Ay/uqReXzMn+qXJqcakZ0YBsRunzpSjvXC2ejg8K056tncizpvAFY6o B427h2bO5F1gZ83eXMFVNuhxk8ve2Bi4A62l2J0lJb1UZNuLy0I2YSTgvvOlHN/E GCsrQFZZc6T0ETq1STqS1b8yGFbB47xQTluCqOD5Pk91cisLsUL7uFAyI/6HnbrA gdlHJTW4bxnEHedzYUUIW40PlyoAW01YP3dvwrUSUgFvQqJQfAs= =WGiV -----END PGP SIGNATURE----- --Sig_/GypAq4FXG4m.CwTF5BhTXQF--