From patchwork Sun Apr 30 08:17:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 98388 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp962316qgf; Sun, 30 Apr 2017 01:18:30 -0700 (PDT) X-Received: by 10.84.142.133 with SMTP id 5mr26610287plx.52.1493540310210; Sun, 30 Apr 2017 01:18:30 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l17si10979552pgj.292.2017.04.30.01.18.29; Sun, 30 Apr 2017 01:18:30 -0700 (PDT) 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=@linaro.org; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1167145AbdD3IR7 (ORCPT + 25 others); Sun, 30 Apr 2017 04:17:59 -0400 Received: from mail-lf0-f47.google.com ([209.85.215.47]:35056 "EHLO mail-lf0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1167126AbdD3IRv (ORCPT ); Sun, 30 Apr 2017 04:17:51 -0400 Received: by mail-lf0-f47.google.com with SMTP id 75so50559669lfs.2 for ; Sun, 30 Apr 2017 01:17:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=p58cNgvoF7FKjL4Zp2N7MojaB1BroU8Ni35TZk5pmBE=; b=Y8CW1zZdK/oux63cqaN86msRu++vGBymXkJcRrvxRe+dyHpeCaynCnVUsUOksJHMYC PPeNJurjvCD2EIixHsGKczyQwy6NCbQrL2LVQCzxJ7LXOu5zu0epjMQ81RxiCCd7Lb5f Zlr5wmua1c2aKRaaV0t4JNLs4vCPQNizl5t/w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=p58cNgvoF7FKjL4Zp2N7MojaB1BroU8Ni35TZk5pmBE=; b=PdSkouZXXXQgUSAbInUdSlqxa4KzTe8qqkcWAPyCydgw/nGe8L+ZeLUKIwt1Z6gmhR x6ZadeVSfn5mXoHB+Q2gzAwBCZ1WPyUW1ysvhMQW4lANb364bCQYAPCuf1rR8JUg9QhQ APylJamy+/lh1bIfNAIqWc04fqOIN2VisMYDPXBSB4VOBbfLWOtc/usbcanZujxRZ+C/ 7bENoD9r2klHkmJNWcaaLREj6yr0rmGD9o3jBe+tXqra+Ly5mTGH5xgvls7dwqplFG4+ cL5/sqj34qzGLWDOiW90cQxX/B9+P0fs16JUOGLbR1FFuhMOTq485gALYZbEBeQGZeen T9Fw== X-Gm-Message-State: AN3rC/48EE5KY4Esu2q6NTQo4n0USlOCEGop6biOQbWo0F3bBFbmxFJG FiDk8N69tWPlh2jy X-Received: by 10.46.20.14 with SMTP id u14mr7483231ljd.101.1493540270084; Sun, 30 Apr 2017 01:17:50 -0700 (PDT) Received: from fabina.bredbandsbolaget.se (c-d67b71d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.123.214]) by smtp.gmail.com with ESMTPSA id b80sm2025152lfe.39.2017.04.30.01.17.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Apr 2017 01:17:48 -0700 (PDT) From: Linus Walleij To: Lee Jones , Daniel Thompson , Jingoo Han , linux-kernel@vger.kernel.org Cc: Laurent Pinchart , Linus Walleij Subject: [PATCH 2/2] backlight: gpio: delete pdata inversion Date: Sun, 30 Apr 2017 10:17:45 +0200 Message-Id: <20170430081745.14364-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The option to invert the output of the GPIO (active low) is not used by the only platform still using platform data to set up a GPIO backlight (one SH board). Delete the option as we do not expect to expand the use of board files for this driver, and GPIO descriptors intrinsically keep track of any signal inversion. Signed-off-by: Linus Walleij --- drivers/video/backlight/gpio_backlight.c | 15 ++------------- include/linux/platform_data/gpio_backlight.h | 1 - 2 files changed, 2 insertions(+), 14 deletions(-) -- 2.9.3 Acked-by: Daniel Thompson diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index 17dd8071ad4d..8c19dc6c9236 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -25,7 +25,6 @@ struct gpio_backlight { struct device *fbdev; struct gpio_desc *gpiod; - int active; int def_value; }; @@ -39,8 +38,7 @@ static int gpio_backlight_update_status(struct backlight_device *bl) bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK)) brightness = 0; - gpiod_set_value_cansleep(gbl->gpiod, - brightness ? gbl->active : !gbl->active); + gpiod_set_value_cansleep(gbl->gpiod, brightness); return 0; } @@ -72,8 +70,6 @@ static int gpio_backlight_probe_dt(struct platform_device *pdev, flags = GPIOD_OUT_HIGH; else flags = GPIOD_OUT_LOW; - /* GPIO descriptors keep track of inversion */ - gbl->active = 1; gbl->gpiod = devm_gpiod_get(dev, NULL, flags); if (IS_ERR(gbl->gpiod)) { @@ -124,15 +120,8 @@ static int gpio_backlight_probe(struct platform_device *pdev) unsigned long flags = GPIOF_DIR_OUT; gbl->fbdev = pdata->fbdev; - gbl->active = pdata->active_low ? 0 : 1; gbl->def_value = pdata->def_value; - - if (gbl->active) - flags |= gbl->def_value ? - GPIOF_INIT_HIGH : GPIOF_INIT_LOW; - else - flags |= gbl->def_value ? - GPIOF_INIT_LOW : GPIOF_INIT_HIGH; + flags |= gbl->def_value ? GPIOF_INIT_HIGH : GPIOF_INIT_LOW; ret = devm_gpio_request_one(gbl->dev, pdata->gpio, flags, pdata ? pdata->name : "backlight"); diff --git a/include/linux/platform_data/gpio_backlight.h b/include/linux/platform_data/gpio_backlight.h index 5ae0d9c80d4d..683d90453c41 100644 --- a/include/linux/platform_data/gpio_backlight.h +++ b/include/linux/platform_data/gpio_backlight.h @@ -14,7 +14,6 @@ struct gpio_backlight_platform_data { struct device *fbdev; int gpio; int def_value; - bool active_low; const char *name; };