From patchwork Sat Mar 18 14:37:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 9632221 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 ADC8560249 for ; Sat, 18 Mar 2017 14:38:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F45E2807B for ; Sat, 18 Mar 2017 14:38:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93E6A28487; Sat, 18 Mar 2017 14:38:31 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 362A32807B for ; Sat, 18 Mar 2017 14:38:31 +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:References: In-Reply-To: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:List-Owner; bh=d0X8LqQ8qcqui9NZcZPRo1jyixwjSz8zv3HHGD5QrOs=; b=eH2IU/U6oS/pxBUdQFGlnuImbP TM8Hw7qa1eQE0GgHOYURnnU5alO0by/w2t7LHRdUTLalc1xs8cUCHIdFL+JKsDCDFkJPrshmYZ1kK Sly1ORHO55uK3udglhHeE26wZAZFg++N+BR4aDFtWR+LgtrijNM4lgcruQUjPTx/HoTYPvN/EWY5m 4HJSB4WjF61LmGmL1LKD3QS1k6jgz3T5wKLd3pn4nokMs1dA6bQxLOKrNaeL0fcU0FzXkRKOku1nG tRZmHehepKWptIqm6OCRmu/g/JC4rqDR3SSGQyBg8jht6dHeYPX+vpoRPvueKe+brQ6jTuN5mkwqY DHuoWKeQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cpFV0-0004GP-5S; Sat, 18 Mar 2017 14:38:30 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cpFUg-0003u1-GS; Sat, 18 Mar 2017 14:38:12 +0000 Received: by mail-wm0-x241.google.com with SMTP id x124so7505018wmf.3; Sat, 18 Mar 2017 07:37:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=To4kVDex8urE37nX4VTAZyAeV/DDOfhMlGIHChYP4og=; b=QgYqxzUFlIhxWbWQKZRqxq5c6Sip6nOTrNG+F7AsH8P3J5fCyLWRI43gHEftA90/Vg rSXDvMNP7jaRczFZAPOqx7OK82WHdda6aRQQjMDoCBq0Av1k6DN7xDPx0/oL/2P0zg18 yxL09S5nNI4G/5yllu07en9NHf3fjOu6AOZeBnVwl9AL1nqUlivLok+MvanqCW1U+7Xz LvxNvnNlC8Ki2PZuU6SOGOoEoYxdJnflvmbbZUgNJWagCWSunsu9o1wlSEB2fO68+mdl BtJvq75yWpTWMxYZ4QNCCxO5TcDYyIhU60ilPZqALdK6+sSo47bct+8ELPU7BeyeMOdW eFZA== 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:in-reply-to :references; bh=To4kVDex8urE37nX4VTAZyAeV/DDOfhMlGIHChYP4og=; b=tV0Af3Fz34ua2G0EmzPSJQAKWRr9k3fIcXXyaCpl3kJ0d91C2W4LPO42w2hhDCV6sd gxVKuu5dSirv8xj++f4V+KmZ+NyQzI+lRzNhOHAV7AYiaVTCL3dhHuQOuC/cqeXNTWFp 2DX8arNkb9FYREKzho6Cf1+Jcq8DI0jPa7i6mwL6/2hPyK3AR05qsyOs6F2nNyfp61Tq a+C5vSCs5zEghm3KTAIkyzRPAcG0QkSlnBfPeLH659yz84EY7gF/tXvwYCeM3tkufDzE Cmv9Y1CwFLgiFkKZ/F35YuXX3o4GA0gBNQ40438ZEkJxohaU5tEDBEDfVOxyNH1oLtgB v8eA== X-Gm-Message-State: AFeK/H3zMwdaYLz7oi1Ms8PySLv5HQQVxtGM9a8fqlvBBNe90nbLysbaAycGT9DaNLUKLw== X-Received: by 10.28.88.2 with SMTP id m2mr2960063wmb.12.1489847867331; Sat, 18 Mar 2017 07:37:47 -0700 (PDT) Received: from blackbox.darklights.net (p5DE38642.dip0.t-ipconnect.de. [93.227.134.66]) by smtp.googlemail.com with ESMTPSA id r2sm6443531wmb.26.2017.03.18.07.37.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Mar 2017 07:37:46 -0700 (PDT) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, khilman@baylibre.com, carlo@caione.org, narmstrong@baylibre.com Subject: [RFT PATCH 1/1] ARM64: dts: meson-gxbb: convert devices to use pwm-leds Date: Sat, 18 Mar 2017 15:37:28 +0100 Message-Id: <20170318143728.16535-2-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170318143728.16535-1-martin.blumenstingl@googlemail.com> References: <20170318143728.16535-1-martin.blumenstingl@googlemail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170318_073810_727910_7A81DC1E X-CRM114-Status: UNSURE ( 9.40 ) X-CRM114-Notice: Please train this message. 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, robh+dt@kernel.org, Martin Blumenstingl , linux-arm-kernel@lists.infradead.org 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 All supported GXBB devices have their system LED connected to GPIOAO_13. This pin can be driven by the PWM_AO controller (PWM_AO_B). Use the pwm-leds driver (instead of gpio-leds) for these LEDs instead to enable dimming (setting the brightness). Signed-off-by: Martin Blumenstingl --- .../boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts | 18 +++++++++++---- .../arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 16 ++++++++++--- .../boot/dts/amlogic/meson-gxbb-vega-s95.dtsi | 17 ++++++++++---- .../boot/dts/amlogic/meson-gxbb-wetek-hub.dts | 19 +++++++++++---- .../boot/dts/amlogic/meson-gxbb-wetek-play2.dts | 27 ++++++++++++++++------ 5 files changed, 74 insertions(+), 23 deletions(-) diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts index dbfa441f479e..283dad3b0be3 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts @@ -65,12 +65,14 @@ reg = <0x0 0x0 0x0 0x40000000>; }; - leds { - compatible = "gpio-leds"; + pwmleds { + compatible = "pwm-leds"; + blue { label = "a95x:system-status"; - gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_LOW>; - linux,default-trigger = "heartbeat"; + pwms = <&pwm_AO_ab 1 7812500 0>; + max-brightness = <255>; + linux,default-trigger = "default-on"; default-state = "off"; }; }; @@ -249,6 +251,14 @@ vqmmc-supply = <&vddio_boot>; }; +&pwm_AO_ab { + status = "okay"; + pinctrl-0 = <&pwm_ao_b_pins>; + pinctrl-names = "default"; + clocks = <&clkc CLKID_FCLK_DIV4>; + clock-names = "clkin0"; +}; + &pwm_ef { status = "okay"; pinctrl-0 = <&pwm_e_pins>; diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts index c80d3a913907..7f9de1b236ed 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts @@ -76,11 +76,13 @@ enable-active-high; }; - leds { - compatible = "gpio-leds"; + pwmleds { + compatible = "pwm-leds"; + blue { label = "c2:blue:alive"; - gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_LOW>; + pwms = <&pwm_AO_ab 1 7812500 0>; + max-brightness = <255>; linux,default-trigger = "heartbeat"; default-state = "off"; }; @@ -201,6 +203,14 @@ status = "okay"; }; +&pwm_AO_ab { + status = "okay"; + pinctrl-0 = <&pwm_ao_b_pins>; + pinctrl-names = "default"; + clocks = <&clkc CLKID_FCLK_DIV4>; + clock-names = "clkin0"; +}; + /* SD */ &sd_emmc_b { status = "okay"; diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi index aefa66dff72d..6b9608e5a488 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi @@ -53,13 +53,14 @@ stdout-path = "serial0:115200n8"; }; - leds { - compatible = "gpio-leds"; + pwmleds { + compatible = "pwm-leds"; blue { label = "vega-s95:blue:on"; - gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_HIGH>; - default-state = "on"; + pwms = <&pwm_AO_ab 1 7812500 0>; + max-brightness = <255>; + linux,default-trigger = "default-on"; panic-indicator; }; }; @@ -229,6 +230,14 @@ vmmcq-sumpply = <&vcc_1v8>; }; +&pwm_AO_ab { + status = "okay"; + pinctrl-0 = <&pwm_ao_b_pins>; + pinctrl-names = "default"; + clocks = <&clkc CLKID_FCLK_DIV4>; + clock-names = "clkin0"; +}; + &pwm_ef { status = "okay"; pinctrl-0 = <&pwm_e_pins>; diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-hub.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-hub.dts index f057fb48fee5..1d94e2d4c927 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-hub.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-hub.dts @@ -49,13 +49,14 @@ compatible = "wetek,hub", "amlogic,meson-gxbb"; model = "WeTek Hub"; - leds { - compatible = "gpio-leds"; + pwmleds { + compatible = "pwm-leds"; system { - label = "wetek-play:system-status"; - gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_HIGH>; - default-state = "on"; + label = "wetek-hub:system-status"; + pwms = <&pwm_AO_ab 1 7812500 0>; + max-brightness = <255>; + linux,default-trigger = "default-on"; panic-indicator; }; }; @@ -90,3 +91,11 @@ }; }; }; + +&pwm_AO_ab { + status = "okay"; + pinctrl-0 = <&pwm_ao_b_pins>; + pinctrl-names = "default"; + clocks = <&clkc CLKID_FCLK_DIV4>; + clock-names = "clkin0"; +}; diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts index 743acb5f5d06..5114d645d733 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts @@ -53,13 +53,6 @@ leds { compatible = "gpio-leds"; - system { - label = "wetek-play:system-status"; - gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_HIGH>; - default-state = "on"; - panic-indicator; - }; - wifi { label = "wetek-play:wifi-status"; gpios = <&gpio GPIODV_26 GPIO_ACTIVE_HIGH>; @@ -73,6 +66,18 @@ }; }; + pwmleds { + compatible = "pwm-leds"; + + system { + label = "wetek-play:system-status"; + pwms = <&pwm_AO_ab 1 7812500 0>; + max-brightness = <255>; + linux,default-trigger = "default-on"; + panic-indicator; + }; + }; + gpio-keys-polled { compatible = "gpio-keys-polled"; #address-cells = <1>; @@ -118,3 +123,11 @@ pinctrl-0 = <&i2c_a_pins>; pinctrl-names = "default"; }; + +&pwm_AO_ab { + status = "okay"; + pinctrl-0 = <&pwm_ao_b_pins>; + pinctrl-names = "default"; + clocks = <&clkc CLKID_FCLK_DIV4>; + clock-names = "clkin0"; +};