From patchwork Sun Jul 19 08:07:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11672303 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7565A913 for ; Sun, 19 Jul 2020 08:08:44 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 53A9E207DF for ; Sun, 19 Jul 2020 08:08:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qZbLaesp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 53A9E207DF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E78006E4FE; Sun, 19 Jul 2020 08:08:35 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id F05966E4F1 for ; Sun, 19 Jul 2020 08:08:27 +0000 (UTC) Received: by mail-lj1-x241.google.com with SMTP id b25so17025659ljp.6 for ; Sun, 19 Jul 2020 01:08:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hDwomWBaZyGmgAqcrUivq0LeYUSJfOi4w7mumAORuIo=; b=qZbLaespDfNwaOoZYjfwSw6uv2x1yI8DDERHdue+PXEnXZi63Azp8gN/o6R4QC9uOx Wa9NRMfnp4AF+nYsndHsy0/Rf0v6v5bcZ+LsJesG+AUfxfAjBwK4UoGNhAdffeDlG4Dd zM18q1hxAF4FFLXJNrD0rGFlDztvCd/LczZhAb4HDXSmAyJzC4zqDMaqjn3BLZV+dFlG uQRjjiTydR9+lcFtGZXKGBYIGYCJrDPYszDiwe6M4EcQ1+JviCm8AHkpV9za14e4TDhj cP/PXZRls6E9RZedtoijUBWUc8qP41t/uqSHMAFcg3H5H3I4Wlms6FKQaesrgyQfLUnZ sk/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=hDwomWBaZyGmgAqcrUivq0LeYUSJfOi4w7mumAORuIo=; b=U0y2OW9l+CDbn0j6LqUszqQ1yGh5+QcqfYIB8bEuaILwYJATExmcjZZLuJmS3E6aJt 1JjV4ugdv94iiQ3/XtveNa1eZ77MerG2Pc2EQcai2uUkpFB2GylTpyqmVY+m37j4cSfv U25/e9V10qyv26MOZzwCSno7pjki2YidN6Fgw/D1SZe7hJpNMKKVwZopztbywv6KgiZ9 U8fhCP30JgjRAVGG85WS11MIfRNpNVKWLzv/ly8EeLalh2nV9AqVzGypIdT2VgW/+ju+ KBLtLT+H1NoBdcgv9GMeysRkXmzipm8TI2yeFCzmQZ2lVVGpqbWr0oLtiXbJvzCuqDpT /rGg== X-Gm-Message-State: AOAM533CHG2WmKTYtb5dU4GfHNiOS1SH/kACG0Jg1PBbix+5CVpqL8Vr R5+djhSGatBmy07gN2u8E8lJGNA0J5E= X-Google-Smtp-Source: ABdhPJxl8rnN+FIc4hwfdlTsc9yUhDElaMadQ4i8ACenfj10jhR5RM+e3Rdb5asOLrfsrLf1PxnkFw== X-Received: by 2002:a2e:571c:: with SMTP id l28mr7549009ljb.432.1595146106225; Sun, 19 Jul 2020 01:08:26 -0700 (PDT) Received: from saturn.lan ([2a00:fd00:805f:db00:d5fe:fe9c:fc06:b74c]) by smtp.gmail.com with ESMTPSA id 72sm732407lfh.97.2020.07.19.01.08.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jul 2020 01:08:25 -0700 (PDT) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Jingoo Han , Lee Jones , Daniel Thompson Subject: [PATCH v5 16/19] backlight: jornada720_bl: introduce backlight_is_blank() Date: Sun, 19 Jul 2020 10:07:40 +0200 Message-Id: <20200719080743.8560-17-sam@ravnborg.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200719080743.8560-1-sam@ravnborg.org> References: <20200719080743.8560-1-sam@ravnborg.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pwm@vger.kernel.org, Support Opensource , Michael Hennerich , Bartlomiej Zolnierkiewicz , David Airlie , Daniel Vetter , Tomi Valkeinen , Jonathan Corbet , Emil Velikov , Bjorn Andersson , Peter Ujfalusi , Andy Gross , Thierry Reding , Thomas Zimmermann , linux-arm-msm@vger.kernel.org, Uwe Kleine-Konig , Sam Ravnborg , patches@opensource.cirrus.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use the backlight_is_blank() helper to simplify the code a bit. The jornada720_bl driver distingush between backlight off and brightness set to 0. Thus this driver turn off backlight only when backlight_is_blank() returns true. v2: - Updated changelog (Daniel) Signed-off-by: Sam Ravnborg Reviewed-by: Daniel Thompson Cc: Lee Jones Cc: Daniel Thompson Cc: Jingoo Han --- drivers/video/backlight/jornada720_bl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/backlight/jornada720_bl.c b/drivers/video/backlight/jornada720_bl.c index f0385f9cf9da..996f7ba3b373 100644 --- a/drivers/video/backlight/jornada720_bl.c +++ b/drivers/video/backlight/jornada720_bl.c @@ -54,7 +54,7 @@ static int jornada_bl_update_status(struct backlight_device *bd) jornada_ssp_start(); /* If backlight is off then really turn it off */ - if ((bd->props.power != FB_BLANK_UNBLANK) || (bd->props.fb_blank != FB_BLANK_UNBLANK)) { + if (backlight_is_blank(bd)) { ret = jornada_ssp_byte(BRIGHTNESSOFF); if (ret != TXDUMMY) { dev_info(&bd->dev, "brightness off timeout\n");