From patchwork Tue May 12 00:29:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chubb X-Patchwork-Id: 6384921 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 565DCBEEE1 for ; Tue, 12 May 2015 01:55:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7270B203A5 for ; Tue, 12 May 2015 01:55:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C40C32038D for ; Tue, 12 May 2015 01:55:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752100AbbELBz0 (ORCPT ); Mon, 11 May 2015 21:55:26 -0400 Received: from crl-mxout1.it.nicta.com.au ([221.199.218.17]:49824 "EHLO crl-mxout1.it.nicta.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752032AbbELBzZ convert rfc822-to-8bit (ORCPT ); Mon, 11 May 2015 21:55:25 -0400 Received: from atp-exchmbx1.it.nicta.com.au ([221.199.216.119] helo=atp-exchmbx1.in.nicta.com.au) by crl-mxout1.it.nicta.com.au with esmtp (Exim 4.80) (envelope-from ) id 1YrzPh-0003C7-Eg; Tue, 12 May 2015 11:55:22 +1000 Received: from ATP-EXCHCAS1.in.nicta.com.au (221.199.216.118) by atp-exchmbx1.in.nicta.com.au (221.199.216.119) with Microsoft SMTP Server (TLS) id 14.3.158.1; Tue, 12 May 2015 11:55:14 +1000 Received: from Diprotodon.chubb.wattle.id.au (221.199.216.112) by atp-exchcas1.in.nicta.com.au (221.199.216.118) with Microsoft SMTP Server (TLS) id 14.3.158.1; Tue, 12 May 2015 11:55:14 +1000 Message-ID: <84pp66k1aa.wl-peter.chubb@nicta.com.au> From: Peter Chubb Date: Tue, 12 May 2015 10:29:57 +1000 Subject: [PATCH v2] ARM: dts: Odroid XU3 -- Hook up PWM and use it for LEDs To: Krzysztof Kozlowski CC: Peter Chubb , , In-Reply-To: References: <84vbfyk4w4.wl-peter.chubb@nicta.com.au> <84r3qmk2n6.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-TM-AS-Product-Ver: SMEX-11.0.0.1251-7.500.1018-21538.004 X-TM-AS-Result: No--2.129500-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No 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 Signed-off-by: Peter Chubb Acked-by: Krzysztof Kozlowski --- arch/arm/boot/dts/exynos5422-odroidxu3.dts | 58 +++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 17 deletions(-) -- 2.1.4 -- Dr Peter Chubb peter.chubb AT nicta.com.au http://www.ssrg.nicta.com.au Software Systems Research Group/NICTA diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm/boot/dts/exynos5422-odroidxu3.dts index 026f83e..095282b 100644 --- a/arch/arm/boot/dts/exynos5422-odroidxu3.dts +++ b/arch/arm/boot/dts/exynos5422-odroidxu3.dts @@ -13,6 +13,7 @@ /dts-v1/; #include #include "exynos5800.dtsi" +#include / { model = "Hardkernel Odroid XU3"; @@ -287,25 +288,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"; }; @@ -411,3 +422,16 @@ 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"; +}; +