From patchwork Fri Jul 4 02:26:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Welling X-Patchwork-Id: 4478001 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2EFB5BEEAA for ; Fri, 4 Jul 2014 02:26:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 52466201F5 for ; Fri, 4 Jul 2014 02:26:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4D948201F2 for ; Fri, 4 Jul 2014 02:26:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752151AbaGDC0n (ORCPT ); Thu, 3 Jul 2014 22:26:43 -0400 Received: from mail-ie0-f178.google.com ([209.85.223.178]:52732 "EHLO mail-ie0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752012AbaGDC0m (ORCPT ); Thu, 3 Jul 2014 22:26:42 -0400 Received: by mail-ie0-f178.google.com with SMTP id rl12so1070999iec.23 for ; Thu, 03 Jul 2014 19:26:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=gZN2/SF9/doztwXeEqa9r2T0dIFYm4OOk1zkDrq9Se8=; b=Srdt69HazgrodtEKEz1pL6byk0qeBHVnQSWNyVuM7vwrplmLiiTUa+kQ1veOV+ThBd 6YRrvjc4fKCfKwhigbuTxlQcR3YcGePL7raHJM/Wfpp4NhNtqK0tLNKArQHZNIugdVBs Z+d8xJTXXXJrb4O2lqRo9xucrs64NghBvqNmO25g8Ose/tVkCzTMh307q484+NkLu9YH X8n4GPrxjFmgdNNF4i5HOusMQ/7ehyCV5P4qLLvye2F7MUguoxnhYWjsCE0lqazq2OLb E43vJXchPtMZ6Cb8yCy+h5rogYyCWQDZXXxQ8NMmwSD1kXaO5A2ZI5ohWnw1rxoUxz53 1b8Q== X-Received: by 10.50.39.45 with SMTP id m13mr59903998igk.1.1404440802075; Thu, 03 Jul 2014 19:26:42 -0700 (PDT) Received: from deathray.hitronhub.home (173-22-240-38.client.mchsi.com. [173.22.240.38]) by mx.google.com with ESMTPSA id y15sm58094308igy.2.2014.07.03.19.26.39 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Jul 2014 19:26:40 -0700 (PDT) From: Michael Welling To: Nicolas Ferre , Jean-Christophe Plagniol-Villard , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: Michael Welling Subject: [PATCH] drivers: video: fbdev: atmel_lcdfb.c: Add ability to inverted backlight PWM. Date: Thu, 3 Jul 2014 21:26:36 -0500 Message-Id: <1404440796-11090-1-git-send-email-mwelling@ieee.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,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 The code has a variable to change the polarity of the PWM backlight control but it was not being initialized. This patch adds a devicetree entry to set the variable if required. Signed-off-by: Michael Welling Acked-by: Nicolas Ferre --- .../devicetree/bindings/video/atmel,lcdc.txt | 1 + drivers/video/fbdev/atmel_lcdfb.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/video/atmel,lcdc.txt b/Documentation/devicetree/bindings/video/atmel,lcdc.txt index 1ec175e..b75af94 100644 --- a/Documentation/devicetree/bindings/video/atmel,lcdc.txt +++ b/Documentation/devicetree/bindings/video/atmel,lcdc.txt @@ -46,6 +46,7 @@ Required properties (as per of_videomode_helper): Optional properties (as per of_videomode_helper): - atmel,lcdcon-backlight: enable backlight + - atmel,lcdcon-backlight-inverted: invert backlight PWM polarity - atmel,lcd-wiring-mode: lcd wiring mode "RGB" or "BRG" - atmel,power-control-gpio: gpio to power on or off the LCD (as many as needed) diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c index d36e830..92640d4 100644 --- a/drivers/video/fbdev/atmel_lcdfb.c +++ b/drivers/video/fbdev/atmel_lcdfb.c @@ -290,7 +290,7 @@ static void init_contrast(struct atmel_lcdfb_info *sinfo) /* contrast pwm can be 'inverted' */ if (pdata->lcdcon_pol_negative) - contrast_ctr &= ~(ATMEL_LCDC_POL_POSITIVE); + contrast_ctr &= ~(ATMEL_LCDC_POL_POSITIVE); /* have some default contrast/backlight settings */ lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, contrast_ctr); @@ -1097,6 +1097,7 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo) pdata->lcd_wiring_mode = ret; pdata->lcdcon_is_backlight = of_property_read_bool(display_np, "atmel,lcdcon-backlight"); + pdata->lcdcon_pol_negative = of_property_read_bool(display_np, "atmel,lcdcon-backlight-inverted"); timings = of_get_display_timings(display_np); if (!timings) {