Received: by 10.223.176.46 with SMTP id f43csp973804wra; Wed, 24 Jan 2018 08:40:31 -0800 (PST) X-Google-Smtp-Source: AH8x227bQoMJcOcCCkGUkRbbE6pkQlsHfkMmMEFlBnOadhfGsNVuVRCzHGYvKgWYBJw2dqunmEec X-Received: by 10.98.155.8 with SMTP id r8mr13334089pfd.94.1516812031635; Wed, 24 Jan 2018 08:40:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516812031; cv=none; d=google.com; s=arc-20160816; b=eqRXWm9O6OyMnBh5w5pk6bjPkqUXjQXNEY7rnFkRZgNf7H8GICTYUPbocSIPDMqz2G au+rV9gqyzJUUikJzTKrJXtFBJEYl0bb0pQOCKZN8YRdnaO7q1Tq5ZWjz6dNgV8wMTns j+665Tng3x7Cg3faNBAEUMaVMP4MXwRshb+XYG7OEZkJn5bUZGgR/pk6+f9aeJRX6iXn KkUkqcEuDjy4K1Z4RqaoFFuO8csED5aAn2rtXzKM2undBb0WFxoCDuHZUnycRRfWIVWp j5VMCAeD8IG3+VQLuYWY2ZBj4dJeF7XIBX6vc9GCRbwshRUnIC6ktS7HzSGo0ojuGJbL /A2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature :arc-authentication-results; bh=Ufavlsu1aGTSkDA8QUL2K/TvVYWkK0u8Xh3QCeFtuU0=; b=b5ZUcm07qMPqZHTPszBfLPePkrJBqOLyCJc1Ehk89RCGpjVIepSLHTdGjPz2titNsy QTO2CU0JS4RSov7zUo8oycdo0yn8pgLDs+/hV9pOHN1hPXQ3J8P3B0kwPIOfwhSttHo5 Xo1rqxlB2nT0tvPaoj/KzrUpjAnrfYQlVD6L6j8nwCkhNuZTPXFZNxDDbjEd8P/JQIlw F4s9DHUDv/KRHIme6+sr/kAlrWYAtI/7ZEfyFWPXw40uvUspFM4QbnDFOqkkALGCptvV hsaohqib47WPRgUzkDLoTsRpDM4P+g0C59uTrw9kAO5rE4pYtNdp+q5E2T5oThRfhzh3 1ibQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OCQLL02+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q12si342366pgc.64.2018.01.24.08.40.17; Wed, 24 Jan 2018 08:40:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OCQLL02+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934327AbeAXQjg (ORCPT + 99 others); Wed, 24 Jan 2018 11:39:36 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:40176 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964803AbeAXQje (ORCPT ); Wed, 24 Jan 2018 11:39:34 -0500 Received: by mail-pg0-f66.google.com with SMTP id g16so3069591pgn.7 for ; Wed, 24 Jan 2018 08:39:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Ufavlsu1aGTSkDA8QUL2K/TvVYWkK0u8Xh3QCeFtuU0=; b=OCQLL02+qQTK9p8OrryY0oqPwBeanDG2VFHNgfM8SwrAAgNNFM2im8Hyf8/kso2xbn xZaem05fHjRxLWm+DGHU2uBY968vomQFvOsucCW5PfIwyGzKh56+6NvvVRTI7/Qh05jK HGjLFEbdR6nuYTItxYN8++25ZdGaq3x+gHVV2ODd60/7NVFBEytNHQmM+tYscgIcyHZ1 Vc5mJ73qXH+weSKgnFIXrgOfLJpMt+lpzAyUr8IFSTOtB9uGsIcl/vIl4bSK73wOugEm vDkIO8fOsNJY973HjkNmEuWxg9zJvF666++6XjoZkwad4LgZL1VsuJZW9M18CiOy9tqM pe1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Ufavlsu1aGTSkDA8QUL2K/TvVYWkK0u8Xh3QCeFtuU0=; b=CAE729/c9TqIzkIbJXtvK0LfmG14eMbDe3wUu05jSr7eKcwBDpNqyEHk+5O3F+2pDs uYxWt1u/xofPe9if+BjBNUMDBCtTb3q/WXJnEPbBg5dt85oBbpDmOQ/9XvH4S/EnnJsw hl7kZTsgxfqdlH0HJzYjJr3QUlYGhAcEdFaIi5l6qJuiARzkVwa/H4LKL64CjFsso0rE ZArbJrCt5C7s+rXZQkYYLcspUh2j7auwCHJerQUlVqtxrBpDI0aoDkysTereXSvgj8pA DGQxzXvI4x4dCJm90zX+jXfFtZvj2PYoQ8yV/6eeu4mcN1B6hrY0WYxeGGUDCN2iH0QO t/iA== X-Gm-Message-State: AKwxytfdCt7o9c7tAS8ZOvJA5fxTZzaDdhTIvDSXrMUGiXCjDZTLo74R Vb/jVvmsFr7sgT8Qfw2IqYw= X-Received: by 10.98.57.27 with SMTP id g27mr13683805pfa.128.1516811973998; Wed, 24 Jan 2018 08:39:33 -0800 (PST) Received: from raspberrypi ([122.172.61.122]) by smtp.gmail.com with ESMTPSA id d5sm15802701pfk.2.2018.01.24.08.39.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jan 2018 08:39:33 -0800 (PST) Date: Wed, 24 Jan 2018 16:39:27 +0000 From: Meghana Madhyastha To: Lee Jones , Daniel Thompson , Jingoo Han , Thierry Reding , Noralf =?iso-8859-1?Q?Tr=F8nnes?= , Tomi Valkeinen , Daniel Vetter , Sean Paul , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v19 07/10] drm/panel: Use backlight_enable/disable helpers Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use backlight_enable/disable helpers instead of changing the property and calling backlight_update_status for cleaner and simpler code and also to avoid repetitions. Reviewed-by: Noralf Tr?nnes Reviewed-by: Sean Paul Signed-off-by: Meghana Madhyastha --- drivers/gpu/drm/panel/panel-innolux-p079zca.c | 6 ++---- drivers/gpu/drm/panel/panel-jdi-lt070me05000.c | 6 ++---- drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c | 10 ++-------- drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c | 10 ++-------- 4 files changed, 8 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c b/drivers/gpu/drm/panel/panel-innolux-p079zca.c index 6ba93449f..4c1b29eec 100644 --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c @@ -45,8 +45,7 @@ static int innolux_panel_disable(struct drm_panel *panel) if (!innolux->enabled) return 0; - innolux->backlight->props.power = FB_BLANK_POWERDOWN; - backlight_update_status(innolux->backlight); + backlight_disable(innolux->backlight); err = mipi_dsi_dcs_set_display_off(innolux->link); if (err < 0) @@ -151,8 +150,7 @@ static int innolux_panel_enable(struct drm_panel *panel) if (innolux->enabled) return 0; - innolux->backlight->props.power = FB_BLANK_UNBLANK; - ret = backlight_update_status(innolux->backlight); + ret = backlight_enable(innolux->backlight); if (ret) { DRM_DEV_ERROR(panel->drm->dev, "Failed to enable backlight %d\n", ret); diff --git a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c index 5b2340ef7..0a94ab79a 100644 --- a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c +++ b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c @@ -192,8 +192,7 @@ static int jdi_panel_disable(struct drm_panel *panel) if (!jdi->enabled) return 0; - jdi->backlight->props.power = FB_BLANK_POWERDOWN; - backlight_update_status(jdi->backlight); + backlight_disable(jdi->backlight); jdi->enabled = false; @@ -289,8 +288,7 @@ static int jdi_panel_enable(struct drm_panel *panel) if (jdi->enabled) return 0; - jdi->backlight->props.power = FB_BLANK_UNBLANK; - backlight_update_status(jdi->backlight); + backlight_enable(jdi->backlight); jdi->enabled = true; diff --git a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c b/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c index 3cce3ca19..072c0fc79 100644 --- a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c +++ b/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c @@ -96,10 +96,7 @@ static int sharp_panel_disable(struct drm_panel *panel) if (!sharp->enabled) return 0; - if (sharp->backlight) { - sharp->backlight->props.power = FB_BLANK_POWERDOWN; - backlight_update_status(sharp->backlight); - } + backlight_disable(sharp->backlight); sharp->enabled = false; @@ -263,10 +260,7 @@ static int sharp_panel_enable(struct drm_panel *panel) if (sharp->enabled) return 0; - if (sharp->backlight) { - sharp->backlight->props.power = FB_BLANK_UNBLANK; - backlight_update_status(sharp->backlight); - } + backlight_enable(sharp->backlight); sharp->enabled = true; diff --git a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c index 3aeb0bda4..8a5137963 100644 --- a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c +++ b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c @@ -117,10 +117,7 @@ static int sharp_nt_panel_disable(struct drm_panel *panel) if (!sharp_nt->enabled) return 0; - if (sharp_nt->backlight) { - sharp_nt->backlight->props.power = FB_BLANK_POWERDOWN; - backlight_update_status(sharp_nt->backlight); - } + backlight_disable(sharp_nt->backlight); sharp_nt->enabled = false; @@ -203,10 +200,7 @@ static int sharp_nt_panel_enable(struct drm_panel *panel) if (sharp_nt->enabled) return 0; - if (sharp_nt->backlight) { - sharp_nt->backlight->props.power = FB_BLANK_UNBLANK; - backlight_update_status(sharp_nt->backlight); - } + backlight_enable(sharp_nt->backlight); sharp_nt->enabled = true; -- 2.11.0