From patchwork Wed May 13 04:01:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chubb X-Patchwork-Id: 6393551 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F12D89F1C2 for ; Wed, 13 May 2015 04:18:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1F23A20426 for ; Wed, 13 May 2015 04:18:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1EF722041C for ; Wed, 13 May 2015 04:18:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750777AbbEMESD (ORCPT ); Wed, 13 May 2015 00:18:03 -0400 Received: from mx3.chubb.wattle.id.au ([103.4.17.203]:59883 "EHLO mx3.chubb.wattle.id.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750704AbbEMESC (ORCPT ); Wed, 13 May 2015 00:18:02 -0400 X-Greylist: delayed 977 seconds by postgrey-1.27 at vger.kernel.org; Wed, 13 May 2015 00:18:02 EDT Received: from [2001:388:f000::27] (helo=wombat.chubb.wattle.id.au) by mx3.chubb.wattle.id.au with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1YsNr8-0003RZ-OF; Wed, 13 May 2015 14:01:15 +1000 Received: from vampire.ertos.nicta.com.au ([203.143.161.65] helo=Diprotodon.chubb.wattle.id.au) by wombat.chubb.wattle.id.au with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1YsNrP-0004HX-Ng; Wed, 13 May 2015 14:01:31 +1000 Date: Wed, 13 May 2015 14:01:26 +1000 Message-ID: <843831qg6h.wl-peter.chubb@nicta.com.au> To: Krzysztof Kozlowski , , From: Peter Chubb Subject: [PATCH v3] ARM: dts: exynos5422-odroidxu3: Hook up PWM and use it for LEDs In-Reply-To: <84pp66k1aa.wl-peter.chubb@nicta.com.au> References: <84vbfyk4w4.wl-peter.chubb@nicta.com.au> <84r3qmk2n6.wl-peter.chubb@nicta.com.au> <84pp66k1aa.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! MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") 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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 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 | 56 +++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm/boot/dts/exynos5422-odroidxu3.dts index f0ce60b..6f96b3d 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"; - }; - - eMMC { - label = "green:eMMC"; - gpios = <&gpb2 1 0>; - default-state = "off"; - linux,default-trigger = "mmc0"; - }; + 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"; + }; + + 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"; +};