From patchwork Fri May 31 15:49:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Genoud X-Patchwork-Id: 2644721 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id AD3493FD2B for ; Fri, 31 May 2013 15:49:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753869Ab3EaPto (ORCPT ); Fri, 31 May 2013 11:49:44 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:62047 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752889Ab3EaPto (ORCPT ); Fri, 31 May 2013 11:49:44 -0400 Received: by mail-we0-f174.google.com with SMTP id x50so1430563wes.33 for ; Fri, 31 May 2013 08:49:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=Lh8k5nP1AxzsX1cfIfEu4uBENBMGOu8/6RVDAbk9PL4=; b=gYGEJic3xXq0lJspMM5sZTRw92uYdIjxcKkCsBgBULKbqmnuO7DfbOrNP+iPy6+Bvu LcrPKJ4wfQLAfWRZ0UTyHZrsNz/pJ7DEobfFh2167Z/KUGMMwcK2iUjd3HY6q2IX9eXd RXBpyjBiBm5+H19eqFNWuKt9s0fce5fjWk/U9Kd7HAjoyxX4kQaJ6jfz7ZopPC4oKyhE mgzH8Dexddd13nmMvi9UvPc27ycd3G8h7SFkBJXghUhjKOPWI/pM+Uct8kygefmhWb+W y9+EBuK8iJ443Vv6zGKFdL3dsomgqSG+tcXeJbBz+NjuL77Vr/lTd2w3BbZNQCr8I+b0 NKdQ== X-Received: by 10.180.90.141 with SMTP id bw13mr3749757wib.64.1370015382952; Fri, 31 May 2013 08:49:42 -0700 (PDT) Received: from lnx-rg.pr (lyon.paratronic.fr. [213.41.177.106]) by mx.google.com with ESMTPSA id h8sm4782906wiz.9.2013.05.31.08.49.41 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 May 2013 08:49:42 -0700 (PDT) From: Richard Genoud To: Nicolas Ferre Cc: Jean-Christophe Plagniol-Villard , Tomi Valkeinen , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Genoud Subject: [PATCHv2 2/2] atmel_lcdfb: blank the backlight on remove Date: Fri, 31 May 2013 17:49:35 +0200 Message-Id: <1370015375-5954-1-git-send-email-richard.genoud@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org When removing atmel_lcdfb module, the backlight is unregistered but not blanked. (only for CONFIG_BACKLIGHT_ATMEL_LCDC case). This can result in the screen going full white depending on how the PWM is wired. Signed-off-by: Richard Genoud --- drivers/video/atmel_lcdfb.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 6e6491f..effdb37 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c @@ -223,8 +223,14 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo) static void exit_backlight(struct atmel_lcdfb_info *sinfo) { - if (sinfo->backlight) - backlight_device_unregister(sinfo->backlight); + if (!sinfo->backlight) + return; + + if (sinfo->backlight->ops) { + sinfo->backlight->props.power = FB_BLANK_POWERDOWN; + sinfo->backlight->ops->update_status(sinfo->backlight); + } + backlight_device_unregister(sinfo->backlight); } #else