From patchwork Thu Oct 31 17:57:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 3121561 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6ABA59F3E2 for ; Thu, 31 Oct 2013 17:53:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A1475202E6 for ; Thu, 31 Oct 2013 17:59:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CB6FD202D1 for ; Thu, 31 Oct 2013 17:59:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752036Ab3JaR6W (ORCPT ); Thu, 31 Oct 2013 13:58:22 -0400 Received: from mail-lb0-f171.google.com ([209.85.217.171]:55445 "EHLO mail-lb0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752300Ab3JaR6T (ORCPT ); Thu, 31 Oct 2013 13:58:19 -0400 Received: by mail-lb0-f171.google.com with SMTP id x18so2719701lbi.30 for ; Thu, 31 Oct 2013 10:58:17 -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:in-reply-to:references; bh=pE9tBcXyZK9mD+jpBqSQdFCwGUVmqndRS/zulXn0Ddo=; b=JfEkB0kbIAsFqRiFD2/Ty6oTY3MlssmjVYYQCFXcMArvM9P3oqlb8rAtk+L0kUpYns QtMacvtCm7qd41O3wzOfaj6ZXmxS/uQZ3KPI/O5NsQap2c7R/Q8AMWG4q+aq5FXkFYgM OPehzzRcfBI8RTAVG5LYgI6/DdM3oS58mvpOFf2I7c6PjVCgQictCEhlk4Gpc5XSb5+1 5vmK86jbNV0W6+Hzy9rLi44vt34EBRwYePdk0onM2SyT8oMMgFgCeSLJgKhsc3TnGaeh zXydEFH9XFn6BTQI8HKlVnPcUz2dBrqk+TMUP3nmP18DorWNBBbKrf5tniNheTFgdaIT qGuw== X-Received: by 10.152.116.109 with SMTP id jv13mr2870849lab.30.1383242297723; Thu, 31 Oct 2013 10:58:17 -0700 (PDT) Received: from xi.terra (c193-14-141-227.cust.tele2.se. [193.14.141.227]) by mx.google.com with ESMTPSA id ac2sm3462763lbc.10.2013.10.31.10.58.15 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 31 Oct 2013 10:58:16 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.80.1) (envelope-from ) id 1VbwVY-00020e-N1; Thu, 31 Oct 2013 18:58:12 +0100 From: Johan Hovold To: Richard Purdie , Jingoo Han Cc: Nicolas Ferre , Tomi Valkeinen , Jean-Christophe Plagniol-Villard , Andrew Morton , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org Subject: [PATCH v3 2/9] backlight: atmel-pwm-bl: fix gpio polarity in remove Date: Thu, 31 Oct 2013 18:57:37 +0100 Message-Id: <1383242264-7652-3-git-send-email-jhovold@gmail.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1383242264-7652-1-git-send-email-jhovold@gmail.com> References: <1383064064-4983-1-git-send-email-jhovold@gmail.com> <1383242264-7652-1-git-send-email-jhovold@gmail.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make sure to honour gpio polarity also at remove so that the backlight is actually disabled on boards with active-low enable pin. Cc: stable@vger.kernel.org Acked-by: Jingoo Han Signed-off-by: Johan Hovold --- drivers/video/backlight/atmel-pwm-bl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/video/backlight/atmel-pwm-bl.c b/drivers/video/backlight/atmel-pwm-bl.c index 0971a8e..e21beb6 100644 --- a/drivers/video/backlight/atmel-pwm-bl.c +++ b/drivers/video/backlight/atmel-pwm-bl.c @@ -205,8 +205,10 @@ static int atmel_pwm_bl_remove(struct platform_device *pdev) { struct atmel_pwm_bl *pwmbl = platform_get_drvdata(pdev); - if (pwmbl->gpio_on != -1) - gpio_set_value(pwmbl->gpio_on, 0); + if (pwmbl->gpio_on != -1) { + gpio_set_value(pwmbl->gpio_on, + 0 ^ pwmbl->pdata->on_active_low); + } pwm_channel_disable(&pwmbl->pwmc); pwm_channel_free(&pwmbl->pwmc);