From patchwork Mon Sep 23 21:40:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 2930531 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 A2C529F2B8 for ; Mon, 23 Sep 2013 21:46:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CCC182012D for ; Mon, 23 Sep 2013 21:46:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 018EA2010A for ; Mon, 23 Sep 2013 21:46:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754304Ab3IWVmh (ORCPT ); Mon, 23 Sep 2013 17:42:37 -0400 Received: from mail-bk0-f48.google.com ([209.85.214.48]:34660 "EHLO mail-bk0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754193Ab3IWVmg (ORCPT ); Mon, 23 Sep 2013 17:42:36 -0400 Received: by mail-bk0-f48.google.com with SMTP id my13so1365609bkb.21 for ; Mon, 23 Sep 2013 14:42:34 -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=p0s4Q3CzLmkEPnqimnN1wjgcJx4iyZ2gpxr01tVfSyk=; b=n7TVJML3pB+iIm6JdzhUaE5VhHjvfTMldMoPgaD5/YeyI0d1P2BxhhF/klhu5yB/bx yeOCIe63WsKBJoxDgORv8q1hlJuGHQZLeVf3HymNgQdSoF7C8amJxIx0/jtuCoc23Z9Q txguXxJNTYRtv06Q69sxbPMxvJaZyVT6rKhryVO+6y7fCAhmHR8JQKw7QMa0hNtNY90y cTIUpQbkHSh/nmQN0rxjrEE7NcbMvyC/Zl3dAVGyZvBlIqQ97byHCsj+5cAnkyU6jn0I vEZHa0gyYHMrTwginF6p0hFlgzKnwdYkXa6rQSnxkRlXhO4/dHcvUqRbUuh0vwaBS+84 Hk8Q== X-Received: by 10.204.234.8 with SMTP id ka8mr18037511bkb.5.1379972553982; Mon, 23 Sep 2013 14:42:33 -0700 (PDT) Received: from localhost (port-13639.pppoe.wtnet.de. [84.46.53.124]) by mx.google.com with ESMTPSA id z6sm9647992bkn.8.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 23 Sep 2013 14:42:33 -0700 (PDT) From: Thierry Reding To: Thierry Reding Cc: Rob Herring , Pawel Moll , Mark Rutland , Stephen Warren , Ian Campbell , Tony Lindgren , Eric Miao , Haojian Zhuang , Ben Dooks , Kukjin Kim , Simon Horman , Magnus Damm , Guan Xuetao , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, openezx-devel@lists.openezx.org, linux-samsung-soc@vger.kernel.org, linux-sh@vger.kernel.org, linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/10] pwm-backlight: Add optional enable GPIO Date: Mon, 23 Sep 2013 23:40:59 +0200 Message-Id: <1379972467-11243-3-git-send-email-treding@nvidia.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1379972467-11243-1-git-send-email-treding@nvidia.com> References: <1379972467-11243-1-git-send-email-treding@nvidia.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, KHOP_BIG_TO_CC, 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 To support a wider variety of backlight setups, introduce an optional enable GPIO. Legacy users of the platform data already have a means of supporting GPIOs by using the .init(), .exit() and .notify() hooks. DT users however cannot use those, so an alternative method is required. In order to ease the introduction of the optional enable GPIO, make it available in the platform data first, so that existing users can be converted. Once that has happened a second patch will add code to make use of it in the driver. Signed-off-by: Thierry Reding --- include/linux/pwm_backlight.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h index 56f4a86..2de2e27 100644 --- a/include/linux/pwm_backlight.h +++ b/include/linux/pwm_backlight.h @@ -6,6 +6,9 @@ #include +/* TODO: convert to gpiod_*() API once it has been merged */ +#define PWM_BACKLIGHT_GPIO_ACTIVE_LOW (1 << 0) + struct platform_pwm_backlight_data { int pwm_id; unsigned int max_brightness; @@ -13,6 +16,8 @@ struct platform_pwm_backlight_data { unsigned int lth_brightness; unsigned int pwm_period_ns; unsigned int *levels; + int enable_gpio; + unsigned long enable_gpio_flags; int (*init)(struct device *dev); int (*notify)(struct device *dev, int brightness); void (*notify_after)(struct device *dev, int brightness);