From patchwork Sun Nov 15 13:59:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 11906427 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CE5EC55ABD for ; Sun, 15 Nov 2020 14:02:40 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F2DFB22447 for ; Sun, 15 Nov 2020 14:02:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tdPNs5cR"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="JQadbUTG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F2DFB22447 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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=ba9d9zaXBRRpolxx7RKhgBHDWn3bDF4Ajo9O0KbEtzQ=; b=tdPNs5cR2WeSRCLy+HriLpkpm Dzx7wXCFzrx0Z22qZW8N81CENT9z2rDmUMA0Zj0HiC/3//RcG/WAh05C9d2T8QQI40QUSO0/2f96n Idy9hG3XeVSiJOdFkgKHzEMr0LnU05JBX/k5m4GTPJPH5vPB3321CVHyT0fL3Q0ynbT5jUrGT+SpY AuOzrRtOH7wmIJvBTUHnLz4bpJKF0mIg+ShgmPaft3U1tSTeW/+FgHLreahzmgHy7VJ5Hagt0alNu lK0zS4HOdVd4tRupm++11spGuFO6X79yYMXIRWx0ygy1CmmggNV5Y9k/xdFTmfaat7itKHjNEXn5A 6F7WVDV8A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1keIZJ-0005TH-Bq; Sun, 15 Nov 2020 13:59:49 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1keIZ9-0005Rf-5n for linux-arm-kernel@lists.infradead.org; Sun, 15 Nov 2020 13:59:40 +0000 Received: from dellmb.labs.office.nic.cz (nat-1.nic.cz [217.31.205.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DFC19238E6; Sun, 15 Nov 2020 13:59:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605448778; bh=b5sBxRUYYZHEch3/KSjUj3KiOAu5ztSfcu4Gdrnjq2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JQadbUTG5OJD8msY8P0ZiETMFeNKmE+vFJx7DtGGHhCTOXPGNYasRSybYfxgRood6 6U9/N/AAu/eFT5mgWnOa7Oujyx7L/AXjAeWcOpgpO5N3/7tgdz7Dyr3U9P8PqvLtmq DYpBPBUSCtmhYXYOj8eXuKMFEJC0NvwcV7L+ORvU= From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Gregory CLEMENT Subject: [PATCH mvebu-dt v3 5/7] ARM: dts: turris-omnia: add LED controller node Date: Sun, 15 Nov 2020 14:59:21 +0100 Message-Id: <20201115135923.11523-6-kabel@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201115135923.11523-1-kabel@kernel.org> References: <20201115135923.11523-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201115_085939_425235_C3EBF971 X-CRM114-Status: GOOD ( 18.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marek_Beh=C3=BAn?= , devicetree@vger.kernel.org, Jason Cooper , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Rob Herring , arm@kernel.org, =?utf-8?q?Andreas_F=C3=A4?= =?utf-8?q?rber?= , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Linux now has incomplete support for the LED controller on Turris Omnia: it can set brightness and colors for each LED. The controller can also put these LEDs into HW controlled mode, in which the LEDs are controlled by HW: for example the WAN LED is connected via MCU to the WAN PHY LED pin. The driver does not support these HW controlled modes yet, and on probe puts the LEDs into SW controlled mode. Add node describing the LED controller, but disable it for now. Signed-off-by: Marek Behún Cc: linux-arm-kernel@lists.infradead.org Cc: Uwe Kleine-König Cc: Jason Cooper Cc: Gregory CLEMENT Cc: Andreas Färber Cc: Rob Herring Cc: devicetree@vger.kernel.org --- arch/arm/boot/dts/armada-385-turris-omnia.dts | 111 +++++++++++++++++- 1 file changed, 110 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/armada-385-turris-omnia.dts b/arch/arm/boot/dts/armada-385-turris-omnia.dts index f7498543c9ad..c442c5151cd4 100644 --- a/arch/arm/boot/dts/armada-385-turris-omnia.dts +++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts @@ -12,6 +12,7 @@ #include #include +#include #include "armada-385.dtsi" / { @@ -180,7 +181,115 @@ i2c@0 { reg = <0>; /* STM32F0 command interface at address 0x2a */ - /* leds device (in STM32F0) at address 0x2b */ + + led-controller@2b { + compatible = "cznic,turris-omnia-leds"; + reg = <0x2b>; + #address-cells = <1>; + #size-cells = <0>; + + /* + * LEDs are controlled by MCU (STM32F0) at + * address 0x2b. + * + * The driver does not support HW control mode + * for the LEDs yet. Disable the LEDs for now. + * + * Also LED functions are not stable yet: + * - there are 3 LEDs connected via MCU to PCIe + * ports. One of these ports supports mSATA. + * There is no mSATA nor PCIe function. + * For now we use LED_FUNCTION_WLAN, since + * in most cases users have wifi cards in + * these slots + * - there are 2 LEDs dedicated for user: A and + * B. Again there is no such function defined. + * For now we use LED_FUNCTION_INDICATOR + */ + status = "disabled"; + + multi-led@0 { + reg = <0x0>; + color = ; + function = LED_FUNCTION_INDICATOR; + function-enumerator = <2>; + }; + + multi-led@1 { + reg = <0x1>; + color = ; + function = LED_FUNCTION_INDICATOR; + function-enumerator = <1>; + }; + + multi-led@2 { + reg = <0x2>; + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <3>; + }; + + multi-led@3 { + reg = <0x3>; + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <2>; + }; + + multi-led@4 { + reg = <0x4>; + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <1>; + }; + + multi-led@5 { + reg = <0x5>; + color = ; + function = LED_FUNCTION_WAN; + }; + + multi-led@6 { + reg = <0x6>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <4>; + }; + + multi-led@7 { + reg = <0x7>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <3>; + }; + + multi-led@8 { + reg = <0x8>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <2>; + }; + + multi-led@9 { + reg = <0x9>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <1>; + }; + + multi-led@a { + reg = <0xa>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <0>; + }; + + multi-led@b { + reg = <0xb>; + color = ; + function = LED_FUNCTION_POWER; + }; + }; eeprom@54 { compatible = "atmel,24c64";