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: 6384801 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 C6B099F506 for ; Tue, 12 May 2015 00:46:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DAAA82038A for ; Tue, 12 May 2015 00:46:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E34D0203AD for ; Tue, 12 May 2015 00:46:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750850AbbELAqf (ORCPT ); Mon, 11 May 2015 20:46:35 -0400 Received: from crl-mxout1.it.nicta.com.au ([221.199.218.17]:48756 "EHLO crl-mxout1.it.nicta.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752015AbbELAqb convert rfc822-to-8bit (ORCPT ); Mon, 11 May 2015 20:46:31 -0400 X-Greylist: delayed 541 seconds by postgrey-1.27 at vger.kernel.org; Mon, 11 May 2015 20:46:31 EDT 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 1YryCI-0000lf-Pu; Tue, 12 May 2015 10:37:27 +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 10:37:20 +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 10:37:19 +1000 Message-ID: <84vbfyk4w4.wl-peter.chubb@nicta.com.au> User-Agent: 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) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") From: Peter Chubb Date: Tue, 12 May 2015 10:29:57 +1000 Subject: [PATCH] Odroid XU3 DTS: Hook up PWM and use it for LEDs To: , 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 X-TM-AS-Product-Ver: SMEX-11.0.0.1251-7.500.1018-21538.003 X-TM-AS-Result: No--0.419200-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 on the XU3 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 The patch is against the for-next branch of the linux-samsung tree. Signed-off-by: Peter Chubb --- arch/arm/boot/dts/exynos5422-odroidxu3.dts | 55 +++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 16 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..84d71a1 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,47 @@ status = "okay"; }; - leds { - compatible = "gpio-leds"; - heartbeat { - label = "blue:heartbeart"; - gpios = <&gpb2 2 0>; - default-state = "off"; - linux,default-trigger = "heartbeat"; - }; + pwm: pwm@12dd0000 { + /* + * 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"; + }; - 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"; };