summaryrefslogtreecommitdiffstats
path: root/ARM-dts-bcm283x-Add-missing-properties-to-the-PWR-LED.patch
blob: 85580674e6c06dc1e8554d6a5ac974681e05bbcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
From patchwork Sun Feb 23 18:03:05 2020
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Stefan Wahren <stefan.wahren@i2se.com>
X-Patchwork-Id: 11398981
Return-Path: 
 <SRS0=9Ech=4L=lists.infradead.org=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@kernel.org>
Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
 [172.30.200.123])
	by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 296FC92A
	for <patchwork-linux-arm@patchwork.kernel.org>;
 Sun, 23 Feb 2020 18:03:36 +0000 (UTC)
Received: from bombadil.infradead.org (bombadil.infradead.org
 [198.137.202.133])
	(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 F0E5B208C3
	for <patchwork-linux-arm@patchwork.kernel.org>;
 Sun, 23 Feb 2020 18:03:35 +0000 (UTC)
Authentication-Results: mail.kernel.org;
	dkim=pass (2048-bit key) header.d=lists.infradead.org
 header.i=@lists.infradead.org header.b="bRk5XJsC"
DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F0E5B208C3
Authentication-Results: mail.kernel.org;
 dmarc=none (p=none dis=none) header.from=i2se.com
Authentication-Results: mail.kernel.org;
 spf=none
 smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
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: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:In-Reply-To:
	References:List-Owner; bh=ULtSpCa0j/0z49AokM9aEgHdKsCF2VM1c0X+N2EF1jg=; b=bRk
	5XJsCsqcpurZL2iB09AZWUgCE9ZOpMKR2WerQjiwTFvQo1ZBGve6Wg75kPp3vW37hrVG8sJlgAOwa
	2R3b1+QqvC9GKQ86o+yhvzom8OoNZIjNld8ifw4JUykrShKthSgTQl26WLfqklqWl1jiTDfBlSd8E
	zFkM2qpDfy0VtkUEMLbpSredSLZSqjOieR1mGcZnfteXS/M12axGR3cV6Vf1HgRK1r2jFW90c91Oy
	EpSCuLTlfpB5jw7MK2n50TiGV6KKS3dIaPzxetAXlj/nDTjXa9eM92KMznXR4htb23wEPZfD6gkzX
	W6FLOA9mR8piPeFENAHRxxWutV70fTA==;
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
	by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux))
	id 1j5vbL-00016l-3V; Sun, 23 Feb 2020 18:03:35 +0000
Received: from mout.kundenserver.de ([212.227.126.134])
 by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
 id 1j5vbI-00016P-Ae; Sun, 23 Feb 2020 18:03:33 +0000
Received: from localhost.localdomain ([37.4.249.121]) by
 mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis)
 id 1N8EdM-1jRo3d2MZk-014Eed; Sun, 23 Feb 2020 19:03:29 +0100
From: Stefan Wahren <stefan.wahren@i2se.com>
To: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
 Florian Fainelli <f.fainelli@gmail.com>, Ray Jui <rjui@broadcom.com>,
 Scott Branden <sbranden@broadcom.com>
Subject: [PATCH] ARM: dts: bcm283x: Add missing properties to the PWR LED
Date: Sun, 23 Feb 2020 19:03:05 +0100
Message-Id: <1582480985-6773-1-git-send-email-stefan.wahren@i2se.com>
X-Mailer: git-send-email 2.7.4
X-Provags-ID: V03:K1:XcNS9Ic/XYxQMTQVRGfFHMyCdVwa7jnl5/ZEYauO68lvf+tRpdP
 RG4lDH6u8NZ95HK7hjeqZscQmy/bYszpKWfZ/uHyy+neEAvAFQN4Oi7M8YuRrFFsWnwe4Qj
 IIsnv03fNNuVecjADqaz36u1EWxM8PF5rFFqTUsCXd3HjaLFOA29KRIFoPNoFgDdlILA210
 fUTVkGAFhc0eWswM5BeWA==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:FUS2MfPpk1Q=:Y8tGNSjK/6mAPT2ud3hm5B
 NvB1PT+wrqRcQETrjkr8Rkr1iSdJBdSmHvxqrpkl6MK6mkCa9On9DOvKrvpzjdoMf4Cl1+uL6
 imEugl63jZLPiDk3YCeLXhxSxhhHWdrgRrd8a9mGGTPgtDMczTlGJJbPVov1B1XigGT5gHNo6
 b0meEfJeDMdbTYJQRf5uaATuJNh1m99/YE0jxN3O7yvtMW27cznFtSL2K3+tQrietupGTB4lv
 ARF51pd6lVOGaC+N/HyGXufUUcQmnzuecC1OV5hz7MoKtBfGd+l4mdfOa2lf1MVL17a3e3as2
 gTNeuneOoPamVDXfo4et7HTw7xvRxchCftvE+Xq/92VuSgFNwtcyKOEJsLCq9lrpytBMNbb5F
 nkSzKRvg8WLDsSnAs+7yLADS18MKAS5TGCZllOvMldv3D5Re8f8Kh9d5cA0dRpVwfP5NHtDMY
 JxDhj8nZf1e3iFgvW76m5lbzSOtO9bWpueuy+68DBjAounpF2NHK2KmtFT3lNzu8QRf68SXu5
 t6dAuU2QGWnKyh4RLcoKB276Mwiy8cJOVgi2b+urOktt6EYBaYF19rmfDDzREweaybgAeHViP
 qlIDPDs4tuqaxStm1nIKbrYILPNS1JQHXjKG2n7WIt3f+bMP3LrAQtfQk/V7hvzBV0/Rr26hN
 DESJA6quAgDIba04/IRHSoTrYMm+z7er/5B/4+rWoIhA1PUNr1bpYdVjIWhnkOD4TZGoUoCIP
 2jFy/QH7DqrkVJeYz0NfVyxrDoLF2vIVWYZZS7vWH6JjBQrW/HxuUqpboXGze9RZbgOoKVoX6
 ylYECUTbjknv5T5/jI/8oU35z2e+B4B12l85NYr99Sz9t3nvfjtmWreZcgu9O5CTLgDNz7a
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
X-CRM114-CacheID: sfid-20200223_100332_657771_1CC27822 
X-CRM114-Status: GOOD (  11.21  )
X-Spam-Score: 0.0 (/)
X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.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 [212.227.126.134 listed in list.dnswl.org]
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
X-BeenThere: linux-arm-kernel@lists.infradead.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: <linux-arm-kernel.lists.infradead.org>
List-Unsubscribe: 
 <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
List-Subscribe: 
 <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
Cc: Stefan Wahren <stefan.wahren@i2se.com>, devicetree@vger.kernel.org,
 bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org,
 linux-arm-kernel@lists.infradead.org
MIME-Version: 1.0
Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
Errors-To: 
 linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org

This adds the missing properties to the PWR LED for the RPi 3 & 4 boards,
which are already set for the other boards. Without them we will lose
the LED state after suspend.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 arch/arm/boot/dts/bcm2711-rpi-4-b.dts      | 2 ++
 arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dts | 2 ++
 arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
index cb33852..f242834 100644
--- a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
+++ b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
@@ -31,6 +31,8 @@
 		pwr {
 			label = "PWR";
 			gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
+			default-state = "keep";
+			linux,default-trigger = "default-on";
 		};
 	};
 
diff --git a/arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dts b/arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dts
index 66ab35e..28be033 100644
--- a/arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dts
+++ b/arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dts
@@ -26,6 +26,8 @@
 		pwr {
 			label = "PWR";
 			gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
+			default-state = "keep";
+			linux,default-trigger = "default-on";
 		};
 	};
 };
diff --git a/arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts b/arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts
index 74ed6d0..3734314 100644
--- a/arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts
+++ b/arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts
@@ -27,6 +27,8 @@
 		pwr {
 			label = "PWR";
 			gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
+			default-state = "keep";
+			linux,default-trigger = "default-on";
 		};
 	};
 
pan class="hl opt">; typedef struct { const char * m_shengmu; } double_pinyin_scheme_shengmu_item_t; typedef struct { const char * m_yunmus[2]; } double_pinyin_scheme_yunmu_item_t; typedef struct { const char m_input; const char * m_chewing; } chewing_symbol_item_t; typedef struct { const char m_input; const char m_tone; } chewing_tone_item_t; typedef GArray * ChewingKeyVector; typedef GArray * ChewingKeyRestVector; typedef GArray * ParseValueVector; /** * @brief Class to translate string into ChewingKey. */ class PinyinParser2 { /* constructor/destructor */ public: virtual ~PinyinParser2() {} /* public method */ public: /** * @brief Translate only one ChewingKey from a string. * * @param options pinyin options from pinyin_custom2.h. * @param key stores result ChewingKey. * @param str snput string in UTF-8 encoding, in most case this string is just a plain ASCII string. * @param len the length of str, in number of chars rather than bytes. * * @return whether the entire string is parsed as one key. */ virtual bool parse_one_key(guint32 options, ChewingKey & key, ChewingKeyRest & key_rest, const char *str, int len) const = 0; /** * @brief Translate the source string into a set of ChewingKeys. * * @param options pinyin options from pinyin_custom2.h. * @param keys stores result ChewingKeys. * @param str input string in UTF-8 encoding, in most case this string is just a plain ASCII string. * @param len the length of str, in number of chars rather than bytes. * * @return the number of chars were actually used. */ /* Note: * the parse method will use dynamic programming to drive parse_one_key. */ virtual int parse(guint32 options, ChewingKeyVector & keys, ChewingKeyRestVector & key_rests, const char *str, int len) const = 0; }; /** * The Full Pinyin Parser which parses full pinyin string into ChewingKeys. */ class FullPinyinParser2 : public PinyinParser2 { /* Note: some internal pointers to full pinyin table. */ protected: ParseValueVector m_parse_steps; int final_step(size_t step_len, ChewingKeyVector & keys, ChewingKeyRestVector & key_rests) const; bool post_process(guint32 options, ChewingKeyVector & keys, ChewingKeyRestVector & key_rests) const; public: FullPinyinParser2(); virtual ~FullPinyinParser2() { g_array_free(m_parse_steps, TRUE); } virtual bool parse_one_key(guint32 options, ChewingKey & key, ChewingKeyRest & key_rest, const char *str, int len) const; virtual int parse(guint32 options, ChewingKeyVector & keys, ChewingKeyRestVector & key_rests, const char *str, int len) const; }; /* The valid input chars of ShuangPin is a-z and ';' */ class DoublePinyinParser2 : public PinyinParser2 { /* Note: two internal pointers to double pinyin scheme table. */ protected: const double_pinyin_scheme_shengmu_item_t * m_shengmu_table; const double_pinyin_scheme_yunmu_item_t * m_yunmu_table; public: DoublePinyinParser2() { m_shengmu_table = NULL; m_yunmu_table = NULL; set_scheme(DOUBLE_PINYIN_DEFAULT); } virtual ~DoublePinyinParser2() {} virtual bool parse_one_key(guint32 options, ChewingKey & key, ChewingKeyRest & key_rest, const char *str, int len) const; virtual int parse(guint32 options, ChewingKeyVector & keys, ChewingKeyRestVector & key_rests, const char *str, int len) const; public: bool set_scheme(DoublePinyinScheme scheme); }; /** * @brief Class to parse Chewing input string * * Several keyboard scheme are supported: * * Chewing_STANDARD Standard ZhuYin keyboard, which maps 1 to Bo(ㄅ), q to Po(ㄆ) etc. * * Chewing_HSU Hsu ZhuYin keyboard, which uses a-z (except q) chars. * * Chewing_IBM IBM ZhuYin keyboard, which maps 1 to Bo(ㄅ), 2 to Po(ㄆ) etc. * * Chewing_GIN_YIEH Gin-Yieh ZhuYin keyboard. * * Chewing_ET Eten (倚天) ZhuYin keyboard. * * Chewing_ET26 Eten (倚天) ZhuYin keyboard, which only uses a-z chars. */ /* Note: maybe yunmus shuffle will be supported later. * currently this feature is postponed. */ class ChewingParser2 : public PinyinParser2 { /* Note: some internal pointers to chewing scheme table. */ protected: const chewing_symbol_item_t * m_symbol_table; const chewing_tone_item_t * m_tone_table; public: ChewingParser2() { m_symbol_table = NULL; m_tone_table = NULL; set_scheme(CHEWING_DEFAULT); } virtual ~ChewingParser2() {} virtual bool parse_one_key(guint32 options, ChewingKey & key, ChewingKeyRest & key_rest, const char *str, int len) const; virtual int parse(guint32 options, ChewingKeyVector & keys, ChewingKeyRestVector & key_rests, const char *str, int len) const; public: bool set_scheme(ChewingScheme scheme); bool in_chewing_scheme(const char key); }; /* compare pinyins with chewing internal representations. */ inline int pinyin_compare_initial2(guint32 options, ChewingInitial lhs, ChewingInitial rhs) { if (lhs == rhs) return 0; if ((options & PINYIN_AMB_C_CH) && ((lhs == CHEWING_C && rhs == CHEWING_CH) || (lhs == CHEWING_CH && rhs == CHEWING_C))) return 0; if ((options & PINYIN_AMB_S_SH) && ((lhs == CHEWING_S && rhs == CHEWING_SH) || (lhs == CHEWING_SH && rhs == CHEWING_S))) return 0; if ((options & PINYIN_AMB_Z_ZH) && ((lhs == CHEWING_Z && rhs == CHEWING_ZH) || (lhs == CHEWING_ZH && rhs == CHEWING_Z))) return 0; if ((options & PINYIN_AMB_F_H) && ((lhs == CHEWING_F && rhs == CHEWING_H) || (lhs == CHEWING_H && rhs == CHEWING_F))) return 0; if ((options & PINYIN_AMB_L_N) && ((lhs == CHEWING_L && rhs == CHEWING_N) || (lhs == CHEWING_N && rhs == CHEWING_L))) return 0; if ((options & PINYIN_AMB_L_R) && ((lhs == CHEWING_L && rhs == CHEWING_R) || (lhs == CHEWING_R && rhs == CHEWING_L))) return 0; if ((options & PINYIN_AMB_G_K) && ((lhs == CHEWING_G && rhs == CHEWING_K) || (lhs == CHEWING_K && rhs == CHEWING_G))) return 0; return (lhs - rhs); } inline int pinyin_compare_middle_and_final2(guint32 options, ChewingMiddle middle_lhs, ChewingMiddle middle_rhs, ChewingFinal final_lhs, ChewingFinal final_rhs) { if (middle_lhs == middle_rhs && final_lhs == final_rhs) return 0; /* both pinyin and chewing incomplete options will enable this. */ if (options & (PINYIN_INCOMPLETE | CHEWING_INCOMPLETE)) { if (middle_lhs == CHEWING_ZERO_MIDDLE && final_lhs == CHEWING_ZERO_FINAL) return 0; if (middle_rhs == CHEWING_ZERO_MIDDLE && final_rhs == CHEWING_ZERO_FINAL) return 0; } /* compare chewing middle first. */ int middle_diff = middle_lhs - middle_rhs; if (middle_diff) return middle_diff; if ((options & PINYIN_AMB_AN_ANG) && ((final_lhs == CHEWING_AN && final_rhs == CHEWING_ANG) || (final_lhs == CHEWING_ANG && final_rhs == CHEWING_AN))) return 0; if ((options & PINYIN_AMB_EN_ENG) && ((final_lhs == CHEWING_EN && final_rhs == CHEWING_ENG) || (final_lhs == CHEWING_ENG && final_rhs == CHEWING_EN))) return 0; if ((options & PINYIN_AMB_IN_ING) && ((final_lhs == PINYIN_IN && final_rhs == PINYIN_ING) || (final_lhs == PINYIN_ING && final_rhs == PINYIN_IN))) return 0; return (final_lhs - final_rhs); } inline int pinyin_compare_tone2(guint32 options, ChewingTone lhs, ChewingTone rhs) { if (lhs == rhs) return 0; if (lhs == CHEWING_ZERO_TONE) return 0; if (rhs == CHEWING_ZERO_TONE) return 0; return (lhs - rhs); } }; #endif