From patchwork Wed Feb 17 19:52:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Kresin X-Patchwork-Id: 1441321 X-Patchwork-Delegate: openwrt@kresin.me Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=iu3MZc+N; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kresin-me.20150623.gappssmtp.com header.i=@kresin-me.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=a7AqcOpj; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DgpSh55DFz9sSC for ; Thu, 18 Feb 2021 06:54:12 +1100 (AEDT) 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:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=0k66ALZStoeOaN+AIadGLO+6iAIYZ3DuLBvqopj/5Jg=; b=iu3MZc+NFFcpkGHOON6tUSA2vR Keug6TmYqkLqYJ6YMWZbtKVkwWcI6y44AE8Jy47hC+S9G60mb0jNYAkPboM4KVybRKmlRB/nCQ64V EFnyqhW9BO3xCH9zahpCwNyTxnd/aBqgMgqNKjxwnLpdtViH77+tTiu/msEnTMpwUIxxYnGrH287y bPkJ8ptyc8RzLfXLy1jyXssORa8TF4Mg2ckuHidz2URI0LTqli381UiWTLooS9zH4BWEJuS7nwt+p BQ5qZFkmeOJXlz6I2/Rh66q/073K/alFIocm3hYIInv/6mImrvD1QYysD4j14yfcuw1Q9h1vFeVFO v5UkrD8Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lCSs7-0005jP-2i; Wed, 17 Feb 2021 19:52:27 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lCSs3-0005iE-G5 for openwrt-devel@lists.openwrt.org; Wed, 17 Feb 2021 19:52:24 +0000 Received: by mail-wr1-x42a.google.com with SMTP id n6so18625127wrv.8 for ; Wed, 17 Feb 2021 11:52:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kresin-me.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=vjZy+v/gVXT2Jv0TFlR6s8qUl0Uv7r+0NClBNqzFu4c=; b=a7AqcOpjxXCeJ9+7DOzmkEwCuhzi6/T7BKPLvpz8AQcfntrYRtf6ay9tdSaQYBVOPa NGQGf2cLfQOBwxO7C8aqIVwdp9gNnGtinogT/ngGbqCobuo4bJQN/0J2Sidl1W5Gkyjw sz+0UFBXfF3hgAwoFSdkZmQwcJAiqQQDPJ4sKVkCSeX6l2JBVvGn0X2NpidZhYKysCKX P8IINdZ5y1eQ9Ev6v0HAL4DEl14S5QFunQCja15QKrZjN8QhCn20b+XqeSR6SNjVVTPv sH1zjGAc3c8xFwPkDhsyYqkw14oE26QBoaPzZIf9268t5wpZxGxBNtMT24ugugJwylPg 8wJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=vjZy+v/gVXT2Jv0TFlR6s8qUl0Uv7r+0NClBNqzFu4c=; b=M6JfGX1BalL3AE14pOANPji9AOpwKtFr9HVzUyHQHsDibxdPRha93fh6VAF07/w7A6 kj9BtrwGQnOJ9JnIxs3zxI1sF/dEQTsJTQZiSEZrrwLIN6gPgGSXYE9vR76Qym2rboBz FCUw82uNorWRC4tAoDVRI194i2vT/YhyFDHrVuGpc7/HFgLPlqGQNviq6QIV8fj9Lcsj o50JS2SaxN39rJuM7YYc2VxHJ1eyNxlYU5ffhJOWTh4QBRjM18sCspSa2gB1vjIi6Mib YEsbjLZNamNZZllOFhwBb3R6vzVBlI9TkvGTmRKCSnhyS49Mpt0+VzP/WcFE+J6GU1wu riNw== X-Gm-Message-State: AOAM530bg+waNgWfQJ0cPm3l8C6Snt0xWMgdsSTRZohbBl99uGjoz/qs /QmUcmTMawA1DuLbqgvoyPfbNwDjsYgJ8rGG X-Google-Smtp-Source: ABdhPJwSaZ8uU/LtvEXtQlzbo1ata8Ih6mwAi1hO63DaSOBl6G/55PO7jipGjuu6CHD1uudhx4vYZw== X-Received: by 2002:adf:ea87:: with SMTP id s7mr751688wrm.217.1613591541810; Wed, 17 Feb 2021 11:52:21 -0800 (PST) Received: from desktop.wvd.kresin.me (p200300ec2f09ea008c4e3a5eb903e6ab.dip0.t-ipconnect.de. [2003:ec:2f09:ea00:8c4e:3a5e:b903:e6ab]) by smtp.gmail.com with ESMTPSA id x11sm5084709wrv.83.2021.02.17.11.52.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Feb 2021 11:52:21 -0800 (PST) From: Mathias Kresin To: openwrt-devel@lists.openwrt.org Subject: [PATCH v2] lantiq: vr9: set the usb led trigger via devicetree Date: Wed, 17 Feb 2021 20:52:12 +0100 Message-Id: <20210217195212.4145746-1-dev@kresin.me> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210217_145223_589440_0EE5FC0E X-CRM114-Status: GOOD ( 11.68 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:42a listed in] [list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Assign the usbdev trigger via devicetree and drop the userspace handling of the usb leds. Drop the now unused userspace helper code as well. Signed-off-by: Mathias Kresin Acked-by: Adrian Schmutzler --- Changes in v2: - drop the now unused userspace helper code .../files/arch/mips/boot/dts/lantiq/vr9.dtsi | 14 ++++++++++++++ .../mips/boot/dts/lantiq/vr9_lantiq_easy80920.dtsi | 12 +++++++----- .../mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi | 10 ++++++---- .../mips/boot/dts/lantiq/vr9_tplink_vr200.dtsi | 7 +++---- .../boot/dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts | 13 ++++++------- .../lantiq/xrx200/base-files/etc/board.d/01_leds | 6 ------ 6 files changed, 36 insertions(+), 26 deletions(-) diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9.dtsi index 60f7f7a4c0..85c584c1f1 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9.dtsi @@ -409,6 +409,8 @@ }; usb0: usb@e101000 { + #address-cells = <1>; + #size-cells = <0>; status = "disabled"; compatible = "lantiq,xrx200-usb"; reg = <0xe101000 0x1000 @@ -418,9 +420,16 @@ dr_mode = "host"; phys = <&usb_phy0>; phy-names = "usb2-phy"; + + ehci_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; }; usb1: usb@e106000 { + #address-cells = <1>; + #size-cells = <0>; status = "disabled"; compatible = "lantiq,xrx200-usb"; reg = <0xe106000 0x1000>; @@ -429,6 +438,11 @@ dr_mode = "host"; phys = <&usb_phy1>; phy-names = "usb2-phy"; + + ehci_port2: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; }; eth0: eth@e108000 { diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920.dtsi index f5b0b4f2a1..9cac3e6ec0 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920.dtsi @@ -15,9 +15,6 @@ led-failsafe = &power; led-running = &power; led-upgrade = &power; - - led-usb = &led_usb1; - led-usb2 = &led_usb2; }; memory@0 { @@ -64,13 +61,18 @@ label = "green:fxo"; gpios = <&stp 19 GPIO_ACTIVE_HIGH>; }; - led_usb1: usb1 { + usb1 { label = "green:usb1"; gpios = <&stp 18 GPIO_ACTIVE_HIGH>; + trigger-sources = <&ehci_port1>; + linux,default-trigger = "usbport"; }; - led_usb2: usb2 { + + usb2 { label = "green:usb2"; gpios = <&stp 15 GPIO_ACTIVE_HIGH>; + trigger-sources = <&ehci_port2>; + linux,default-trigger = "usbport"; }; sd { label = "green:sd"; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi index aa6c308ffe..d33b817f2d 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi @@ -18,8 +18,6 @@ led-dsl = &led_dsl; led-internet = &led_internet; led-wifi = &led_wifi; - led-usb = &led_usb0; - led-usb2 = &led_usb2; }; memory@0 { @@ -67,14 +65,18 @@ gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; }; - led_usb0: usb0 { + usb0 { label = "green:usb"; gpios = <&gpio 19 GPIO_ACTIVE_HIGH>; + trigger-sources = <&ehci_port1>; + linux,default-trigger = "usbport"; }; - led_usb2: usb2 { + usb2 { label = "green:usb2"; gpios = <&gpio 20 GPIO_ACTIVE_HIGH>; + trigger-sources = <&ehci_port2>; + linux,default-trigger = "usbport"; }; led_wps: wps { diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dtsi index 19cfb822eb..aa76f66267 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dtsi @@ -13,9 +13,6 @@ led-dsl = &led_dsl; led-internet = &led_internet; led-wifi = &led_wlan5g; - - led-usb = &led_usb; - led-usb2 = &led_usb; }; memory@0 { @@ -66,9 +63,11 @@ gpios = <&gpio 5 GPIO_ACTIVE_LOW>; }; - led_usb: usb { + usb { label = "blue:usb"; gpios = <&gpio 25 GPIO_ACTIVE_LOW>; + trigger-sources = <&ehci_port1>, <&ehci_port2>; + linux,default-trigger = "usbport"; }; eth { diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts index 2812df7e68..0e029d1995 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts @@ -4,19 +4,18 @@ compatible = "zyxel,p-2812hnu-f1", "zyxel,p-2812hnu", "lantiq,xway", "lantiq,vr9"; model = "ZyXEL P-2812HNU-F1"; - aliases { - led-usb = &led_usb1; - led-usb2 = &led_usb2; - }; - leds { - led_usb1: usb1 { + usb1 { label = "green:usb1"; gpios = <&gpio 38 GPIO_ACTIVE_LOW>; + trigger-sources = <&ehci_port1>; + linux,default-trigger = "usbport"; }; - led_usb2: usb2 { + usb2 { label = "green:usb2"; gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + trigger-sources = <&ehci_port2>; + linux,default-trigger = "usbport"; }; }; }; diff --git a/target/linux/lantiq/xrx200/base-files/etc/board.d/01_leds b/target/linux/lantiq/xrx200/base-files/etc/board.d/01_leds index 6a19f52a1e..6fd8151a4f 100755 --- a/target/linux/lantiq/xrx200/base-files/etc/board.d/01_leds +++ b/target/linux/lantiq/xrx200/base-files/etc/board.d/01_leds @@ -11,12 +11,6 @@ board_config_update led_wifi="$(get_dt_led wifi)" [ -n "$led_wifi" ] && ucidef_set_led_wlan "wifi" "wifi" "$led_wifi" "phy0tpt" -led_usb="$(get_dt_led usb)" -[ -n "$led_usb" ] && ucidef_set_led_usbdev "usb" "usb" "$led_usb" "1-1" - -led_usb2="$(get_dt_led usb2)" -[ -n "$led_usb2" ] && ucidef_set_led_usbdev "usb2" "usb2" "$led_usb2" "2-1" - led_dsl="$(get_dt_led dsl)" [ -n "$led_dsl" ] && { led_internet="$(get_dt_led internet)"