summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoy Cho <joy.cho@hardkernel.com>2020-10-20 12:17:46 +0900
committerJoy Cho <joy.cho@hardkernel.com>2020-12-02 16:31:27 +0900
commit29ddbd208f3cf8059967b2ee37f9c84be39aa3f1 (patch)
treec6bcf1466f9908e0eae89375652077c48a398e61
parenteb994d3c167307247967c61c6c317cd20a65dd14 (diff)
downloadu-boot-odroid-c1-29ddbd208f3cf8059967b2ee37f9c84be39aa3f1.tar.gz
ODROID-GO3: Change default backlight brightness
set default backlight (50% of max level) on booting and OGA auto test Change-Id: If38f6325a4b21124884c970806bc8e276841b53c
-rw-r--r--arch/arm/dts/odroidgo3-kernel.dts15
-rw-r--r--cmd/odroidtest.c17
2 files changed, 18 insertions, 14 deletions
diff --git a/arch/arm/dts/odroidgo3-kernel.dts b/arch/arm/dts/odroidgo3-kernel.dts
index 3d9d57d65d..b6f9165684 100644
--- a/arch/arm/dts/odroidgo3-kernel.dts
+++ b/arch/arm/dts/odroidgo3-kernel.dts
@@ -197,19 +197,8 @@
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 161 162 163 164 165 166 167
- 168 169 170 171 172 173 174 175
- 176 177 178 179 180 181 182 183
- 184 185 186 187 188 189 190 191
- 192 193 194 195 196 197 198 199
- 200 201 202 203 204 205 206 207
- 208 209 210 211 212 213 214 215
- 216 217 218 219 220 221 222 223
- 224 225 226 227 228 229 230 231
- 232 233 234 235 236 237 238 239
- 240 241 242 243 244 245 246 247
- 248 249 250 251 252 253 254 255>;
- default-brightness-level = <200>;
+ 160>;
+ default-brightness-level = <80>;
};
rk817-sound {
diff --git a/cmd/odroidtest.c b/cmd/odroidtest.c
index 581756ecd0..7e0055f9eb 100644
--- a/cmd/odroidtest.c
+++ b/cmd/odroidtest.c
@@ -520,6 +520,11 @@ static int do_odroidtest_adc(cmd_tbl_t * cmdtp, int flag,
}
#endif /* CONFIG_TARGET_ODROIDGO3 */
+#ifdef CONFIG_TARGET_ODROIDGO3
+#define BL_MAX_LEVEL 255
+#define BL_OGA_MAX_LEVEL 160
+#define BL_OGA_DEFAULT_LEVEL 80
+#endif
static int do_odroidtest_backlight(cmd_tbl_t * cmdtp, int flag,
int argc, char * const argv[])
{
@@ -549,7 +554,11 @@ static int do_odroidtest_backlight(cmd_tbl_t * cmdtp, int flag,
lcd_setfg_color("black");
while (1) {
period_ns = 25000;
- duty_ns = period_ns * active[loop] / 100;
+#ifdef CONFIG_TARGET_ODROIDGO3
+ duty_ns = period_ns * (active[loop] / 100) * (BL_OGA_MAX_LEVEL / BL_MAX_LEVEL);
+#else
+ duty_ns = period_ns * (active[loop] / 100);
+#endif
printf("active percentage %d, duty_ns %d\n", active[loop], duty_ns);
lcd_printf(0, 8 + yoffs, 1, "PERCENTAGE : %d %", active[loop]);
@@ -584,8 +593,14 @@ static int do_odroidtest_backlight(cmd_tbl_t * cmdtp, int flag,
mdelay(500);
}
+#ifdef CONFIG_TARGET_ODROIDGO3
+ /* set backlight as default */
+ duty_ns = period_ns * (BL_OGA_DEFAULT_LEVEL / BL_MAX_LEVEL);
+ pwm_set_config(dev, 1, period_ns, duty_ns);
+#else
/* set backlight as max */
pwm_set_config(dev, 1, period_ns, period_ns);
+#endif
lcd_setfg_color("black");
lcd_printf(0, 18 + yoffs, 1, "BACKLIGHT TEST TERMINATED!");