From patchwork Wed May 13 23:57:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chubb X-Patchwork-Id: 6401401 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 01328BEEE1 for ; Wed, 13 May 2015 23:58:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 27F3920390 for ; Wed, 13 May 2015 23:58:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 22C7020382 for ; Wed, 13 May 2015 23:58:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753182AbbEMX6K (ORCPT ); Wed, 13 May 2015 19:58:10 -0400 Received: from lemon.ertos.nicta.com.au ([203.143.174.143]:42583 "EHLO lemon.ertos.nicta.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752584AbbEMX6J (ORCPT ); Wed, 13 May 2015 19:58:09 -0400 Received: from [2402:1800:4000:2:224:d7ff:feaf:390] (port=35523 helo=Diprotodon.chubb.wattle.id.au) by lemon.ertos.nicta.com.au with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1YsgRj-00044h-FA; Thu, 14 May 2015 09:52:18 +1000 Date: Thu, 14 May 2015 09:57:56 +1000 Message-ID: <84iobwuj23.wl-peter.chubb@nicta.com.au> From: Peter Chubb To: Peter Chubb Cc: Krzysztof Kozlowski , , References: <84vbfyk4w4.wl-peter.chubb@nicta.com.au> <84r3qmk2n6.wl-peter.chubb@nicta.com.au> <84pp66k1aa.wl-peter.chubb@nicta.com.au> <843831qg6h.wl-peter.chubb@nicta.com.au> <55534EF2.1090307@samsung.com> <84sib0gjdo.wl-peter.chubb@nicta.com.au> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/24.4 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-Face: GgFg(Z>fx((4\32hvXq<)|jndSniCH~~$D)Ka:P@e@JR1P%Vr}EwUdfwf-4j\rUs#JR{'h# !]])6%Jh~b$VA|ALhnpPiHu[-x~@<"@Iv&|%R)Fq[[, (&Z'O)Q)xCqe1\M[F8#9l8~}#u$S$Rm`S9% \'T@`:&8>Sb*c5d'=eDYI&GF`+t[LfDH="MP5rwOO]w>ALi7'=QJHz&y&C&TE_3j! Organization: NICTA MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 2402:1800:4000:2:224:d7ff:feaf:390 X-SA-Exim-Mail-From: peter.chubb@nicta.com.au X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Subject: [PATCH v4] ARM: dts: exynos5422-odroidxu3: Hook up PWM and use it for LEDs X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:56:45 +0000) X-SA-Exim-Scanned: Yes (on lemon.ertos.nicta.com.au) Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP PWM output wasn't working because it wasn't hooked up to its pincontrol. This patch: - hooks up PWM to its pincontrol, and documents what the outputs are on the XU3 - switches the LEDs that are on PWM outputs to use PWM rather than GPIO. The main effect is that the brightness of the LEDs can be controlled, and user-mode fan control is enabled via /sys/class/pwm Acked-by: Krzysztof Kozlowski Signed-off-by: Peter Chubb --- arch/arm/boot/dts/exynos5422-odroidxu3.dts | 50 +++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm/boot/dts/exynos5422-odroidxu3.dts index f0ce60b..0c62156 100644 --- a/arch/arm/boot/dts/exynos5422-odroidxu3.dts +++ b/arch/arm/boot/dts/exynos5422-odroidxu3.dts @@ -287,25 +287,35 @@ status = "okay"; }; - leds { - compatible = "gpio-leds"; - heartbeat { - label = "blue:heartbeart"; - gpios = <&gpb2 2 0>; - default-state = "off"; - linux,default-trigger = "heartbeat"; + pwmleds { + compatible = "pwm-leds"; + + greenled { + label = "green:mmc0"; + pwms = <&pwm 1 2000000 0>; + pwm-names = "pwm1"; + /* + * Green LED is much brighter than the others + * so limit its max brightness + */ + max_brightness = <127>; + linux,default-trigger = "mmc0"; }; - eMMC { - label = "green:eMMC"; - gpios = <&gpb2 1 0>; - default-state = "off"; - linux,default-trigger = "mmc0"; + blueled { + label = "blue:heartbeat"; + pwms = <&pwm 2 2000000 0>; + pwm-names = "pwm2"; + max_brightness = <255>; + linux,default-trigger = "heartbeat"; }; + }; - microSD { + gpioleds { + compatible = "gpio-leds"; + redled { label = "red:microSD"; - gpios = <&gpx2 3 0>; + gpios = <&gpx2 3 GPIO_ACTIVE_HIGH>; default-state = "off"; linux,default-trigger = "mmc1"; }; @@ -415,3 +425,15 @@ shunt-resistor = <10000>; }; }; + +&pwm { + /* + * PWM 0 -- fan + * PWM 1 -- Green LED + * PWM 2 -- Blue LED + * PWM 3 -- on MIPI connector for backlight + */ + pinctrl-0 = <&pwm0_out &pwm1_out &pwm2_out &pwm3_out>; + pinctrl-names = "default"; + status = "okay"; +};