From patchwork Mon May 14 11:19:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 10397973 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A70F36038F for ; Mon, 14 May 2018 11:20:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9703F29117 for ; Mon, 14 May 2018 11:20:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8AE3529113; Mon, 14 May 2018 11:20:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0702429113 for ; Mon, 14 May 2018 11:20:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=ghg5lyJm8OHhI/A6h3AQLSSNTxfN3VrR9peAfmc+r2Y=; b=lIs Gnfd1iORngVYDZPp+7SZrKlAePzMdPorqQ+GSdmJFYa4Pv2/H5S2VNKTFyv/R6f/FPCJvxViuC3YO mTTyj93EWy46IaKpNziF61wmL2AumosJ3jfveX/8By7ps1myzHM7A3znXJoK/IOozr3/NPx4eUlSa xKnMnWJj8HPb/CxRGB+GUsTqR/DzYFN9qQKlzkxfzc5nVxj24DbxLWyJunEFwN5zaUXMPiuQqEDir Ys3solnD1b46cTonK93Usc86TsUeHr5on/jyDU+W9gCL74QhoHXrQCTEwEGqssgx5iek3v4ME1cnB wafxcqOi99bFNZ6WCJ8P3/MragSCdOQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIBWO-0005Yr-8y; Mon, 14 May 2018 11:20:04 +0000 Received: from mail-it0-x242.google.com ([2607:f8b0:4001:c0b::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIBWJ-0005WJ-T7 for linux-arm-kernel@lists.infradead.org; Mon, 14 May 2018 11:20:01 +0000 Received: by mail-it0-x242.google.com with SMTP id p3-v6so9672363itc.0 for ; Mon, 14 May 2018 04:19:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=pzy06plR4uuzVoWW53RsbQC4ILgVp9RHfSAS+gEXQNU=; b=YOomKbhRIZgj0aP4+4vT4GrEWsSZo/qXeTpLGvot6/i1cy1lS0ypFaNJicnSHzNiOH Xdf/zDOYtHPoUDvCXXlAc1knuuqWtq/xVm+5GJLW/LAEQBwsz/IB/hIUNhVxeGjXD/lU qHuCfwoyEcznEbGNvlHyxeMtMldraxC2jD47B9z25cJZeFEkAMnH7+iAqZ0jpKZkXZDH khJFpRBKUpDbGIrrJ1UlSqJClrhnLhLPrHhRfn+B32KJhTppIUIAkd6fDJ9y4Yzam9g8 ZrU23QTwm3R7aGqBEZYisdzq19Fl1FMmYBg2Wl858ZbF0Wsw4VHdf4d6blYNQ3YWUdso 009A== 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=pzy06plR4uuzVoWW53RsbQC4ILgVp9RHfSAS+gEXQNU=; b=ZNsL8zJK0Wdd272EHYIBUJ5murOV8yZuG4Hn1J7dptOd0qUkotC1ZJ50152DUgh1Jy Ljg+1fJUS4xFWjjjCGnMiebS0GI2o7rPcV4mRknv3zfUlGXJdo/uB9m7xt2aFOxb8Q6O wbNiUOp1ph2483nk5iB4Bc1WSjH4LSIl5hdOpdQwPGJWmKAxLAs7HiCYWXIKE7CQOkQl v8iqmNODF8EBOZtbKst34/7wmSSObImueCiULkZaSg/x/QTBAeZvu4Y1RI11A4anU7f1 xf8OEPqryulvmMhxlaRboWbNwAwVXpaLequSxQlyobOT/1z7cMnDRhUcECas4v6k2BGS 4LNQ== X-Gm-Message-State: ALKqPwcJuZ8Qz7b6x7dsrrUROCcGWzGPtShAJYjqEa+KK0w3ta/+BaSZ 4SPie/+rHU0kpQb+8ft4iAtvEQ== X-Google-Smtp-Source: AB8JxZoHdNyInusqM4Xh8mwlmNmBwBfyz1hgCqG9rRTwMz7Iosnoxtv4o3HWTUyXE6CtI1Z8I9mSqQ== X-Received: by 2002:a24:e40d:: with SMTP id o13-v6mr8762532ith.25.1526296787135; Mon, 14 May 2018 04:19:47 -0700 (PDT) Received: from localhost.localdomain (c-73-65-120-235.hsd1.mn.comcast.net. [73.65.120.235]) by smtp.gmail.com with ESMTPSA id 2-v6sm4700466iom.34.2018.05.14.04.19.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 May 2018 04:19:46 -0700 (PDT) From: Adam Ford To: linux-arm-kernel@lists.infradead.org Subject: [PATCH V4] ARM: dts: da850-evm: Enable LCD and Backlight Date: Mon, 14 May 2018 06:19:28 -0500 Message-Id: <20180514111928.28172-1-aford173@gmail.com> X-Mailer: git-send-email 2.17.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180514_041959_978651_BB4C9673 X-CRM114-Status: GOOD ( 17.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, khilman@kernel.org, Adam Ford , nsekhar@ti.com, adam.ford@logicpd.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When using the board files the LCD works, but not with the DT. This adds enables the original da850-evm to work with the same LCD in device tree mode. The EVM has a gpios for the lcd_panel_pwr, lcd_backlight_pwr, and lcd_pwm0. Both lcd_backlight_pwr and lcd_pwm0 must be driven to enable the backlight, so a gpio-regulator is used to drive lcd_backlight_prw. The LCD and the vpif display pins are mutually exclusive, so if using the LCD, disable the vpif. If using the vpif, disable panel. Extra code comments are inserted to further explain this Signed-off-by: Adam Ford --- V4: Add comments into the code explaining the LCD and VPIF are mutually exclusive with instructions on how to enable/disable each. Rename GPIO pins based on schematic net name. Fix gpio enable in backlight V3: Fix errant GPIO, label GPIO pins, and rename the regulator to be more explict to backlight which better matches the schematic. Updated the description to explain that it cannot be used at the same time as the vpif driver. V2: Add regulator and GPIO enable pins. Remove PWM backlight and replace with GPIO diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts index 2e817da37fdb..f6a5497d9c97 100644 --- a/arch/arm/boot/dts/da850-evm.dts +++ b/arch/arm/boot/dts/da850-evm.dts @@ -27,6 +27,53 @@ spi0 = &spi1; }; + backlight { + compatible = "gpio-backlight"; + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; /* lcd_pwm0 */ + }; + + panel { + compatible = "ti,tilcdc,panel"; + pinctrl-names = "default"; + pinctrl-0 = <&lcd_pins>; + /* The vpif and the LCD are mutually exclusive. + * To enable VPIF, change the status below to 'disabled' then + * then change the status of the vpif below to 'okay' */ + status = "okay"; + enable-gpios = <&gpio 40 GPIO_ACTIVE_HIGH>; /* lcd_panel_pwr */ + + panel-info { + ac-bias = <255>; + ac-bias-intrpt = <0>; + dma-burst-sz = <16>; + bpp = <16>; + fdd = <0x80>; + sync-edge = <0>; + sync-ctrl = <1>; + raster-order = <0>; + fifo-th = <0>; + }; + + display-timings { + native-mode = <&timing0>; + timing0: 480x272 { + clock-frequency = <9000000>; + hactive = <480>; + vactive = <272>; + hfront-porch = <3>; + hback-porch = <2>; + hsync-len = <42>; + vback-porch = <3>; + vfront-porch = <4>; + vsync-len = <11>; + hsync-active = <0>; + vsync-active = <0>; + de-active = <1>; + pixelclk-active = <1>; + }; + }; + }; + vbat: fixedregulator0 { compatible = "regulator-fixed"; regulator-name = "vbat"; @@ -35,6 +82,16 @@ regulator-boot-on; }; + backlight_reg: backlight-regulator { + compatible = "regulator-fixed"; + regulator-name = "lcd_backlight_pwr"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio 47 GPIO_ACTIVE_HIGH>; /* lcd_backlight_pwr */ + regulator-always-on; + enable-active-high; + }; + sound { compatible = "simple-audio-card"; simple-audio-card,name = "DA850/OMAP-L138 EVM"; @@ -109,6 +166,10 @@ status = "okay"; }; +&lcdc { + status = "okay"; +}; + &i2c0 { status = "okay"; clock-frequency = <100000>; @@ -339,5 +400,8 @@ &vpif { pinctrl-names = "default"; pinctrl-0 = <&vpif_capture_pins>, <&vpif_display_pins>; - status = "okay"; + /* The vpif and the LCD are mutually exclusive. + * To enable VPIF, disable the ti,tilcdc,panel then + * changed the status below to 'okay' */ + status = "disabled"; };