IRC #olimex 2019-05-09

[01:11:36] <Antitrack> ah
[02:09:58] <xcko> jo0nas: can your images adjust the backlight or report battery events?
[09:35:04] <jo0nas> xcko: no, not that I know of at least - any ideas what is missing would be quite helpful!
[09:36:53] <jo0nas> obviously I hope it is a simple matter of locating and loading appropriate kernel modules, but I fear the functionality might be missing from mainline linux and/or u-boot
[09:38:54] <jo0nas> ...and if missing from mainline, I hope at the source level it is a simple matter of locating and setting appropriate device-tree hints (not introducing/changing other code) as changes to device-tree is more likely to be adopted into Debian Buster which is now in deep freeze
[10:37:55] <leon-anavi> morning
[10:55:46] <jo0nas> morning
[11:19:54] <xcko> I can report that the 5.1.0 kernel boots! display, mmc, wifi (w/firmware) work!
[11:20:36] <xcko> and it looks like battery info works too
[11:20:54] <xcko> haven't figured out backlight yet
[11:22:15] <xcko> CONFIG_BATTERY_AXP20X=y is what's needed for battery info in 5.1.0
[11:30:38] <nedko> xcko: what soc?
[11:30:53] <nedko> /board
[11:31:29] <xcko> the teres laptop
[11:31:44] <nedko> nice :)
[11:32:24] <xcko> jo0nas: I believe CONFIG_BATTERY_AXP20X=m in the debian kernel, maybe try modprob'ing it manually and you'll get battery info /sys/power_supply
[11:34:16] <jo0nas> exciting!
[11:35:00] <xcko> using the 5.1.0 dtb and debian's patched uboot
[11:35:31] <xcko> yes it is, super excited to be able to use the mainline linux kernel
[11:42:00] <jo0nas> module name seems to be axp20x_battery
[11:43:03] <jo0nas> doesn''t give me /sys/power_supply on 4.19 kernel
[11:43:26] <jo0nas> ACTION tries with 5.0.0 kernel
[11:47:08] <jo0nas> nope - on linux 5.0.0 the axp20x_battery was already loaded, and /sys/power_supply is not there
[11:47:21] <jo0nas> ACTION tries install 5.1 kernel
[11:50:10] <jo0nas> oh, I remembered wrongly - 5.1 is not in Debian yet (newest is still 5.0.2, it was a 4.19.37 kernel that appeared the other day):
[12:08:05] <jo0nas> xcko: you think it is a bugfix so not working in older kernels - or can you check if perhaps other modules are needed as well, which might work on 5.0.2 kernel as well?
[14:03:36] <jo0nas> Mainline u-boot now supports Olimex Teres-I:;a=commit;h=504bf790da
[14:03:44] <jo0nas> Tsvetan: ^
[14:23:42] <Antitrack> xcko: very exciting! which olimex do you use? a20 lime2 emmc or somesuch ?
[14:29:28] <Antitrack> I just had a fone call from my stupid boss, with his 2 titles in his name. He complained that
[14:29:30] <Antitrack> "after I did some software changes" now his hardware "suddenly shuts down sometimes". I said: "impossibly my fault".
[14:29:32] <Antitrack> Later he double checked his hardware and he found it was accidentally running on batteries all the times, which were
[14:29:34] <Antitrack> low. HAHA HAHAHAHAHAHA
[14:49:05] <jo0nas> Antitrack: you might wanna tone down on mocking others - e.g. for a future job interview where this appears in a web search
[16:59:13] <Tsvetan> jo0nas: \m/
[18:37:01] <dddddd> nice jo0nas, thanks!!
[21:31:27] <xcko> jo0nas: I miss typed, it should be in /sys/class/power_supply, not /sys/power_supply. There are several config options related to axp20x so I can't be certain which is the correct one
[21:35:18] <xcko> nice work on mainline uboot too!
[22:03:50] <jo0nas> xcko: /sys/class/backlight is an empty directory - can you perhaps check with lsmod if any other modules depend on axp20x_battery?
[22:05:42] <xcko> I have axp20x_battery built into my kernel, though the kernel should autoload whatever modules it needs as deps :/
[22:07:21] <jo0nas> ...also, I meant /sys/class/power_supply (but .../backlight is empty too)
[22:07:40] <xcko> yeah, backlight is still empty for me too
[22:12:05] <jo0nas>
[22:12:12] <jo0nas> looks related
[22:27:00] <jo0nas> when still unsolved (last comments in above referenced thread is few hours ago) for the similar and more popular Pinebook, I doubt it is a matter of only loading a module for Teres-I
[22:27:21] <xcko> looks like it
[22:32:01] <dddddd> I remember adjusting the backlight level using the image from lambda, IIRC
[22:39:40] <jo0nas> "the image from lambda" - which is that? Is it based on mainline linux or the legacy sunxi kernel?
[22:39:46] <jo0nas> dddddd: ^
[22:40:40] <dddddd> just checked... writing to /sys/devices/platfrom/backlight/backlight/backlight/brightness
[22:41:19] <dddddd> no legacy, jo0nas... lambda is the username in the forum, let me search...
[22:45:41] <dddddd> see
[22:45:44] <dddddd> and
[22:47:32] <jo0nas> ACTION looking
[22:47:40] <dddddd> ^ that long path is shorter via /sys/class I think... there's some symlink
[22:49:17] <jo0nas> ahh, lambda is Harald - the person coming up with the backlight fix for U-boot in the fall :-)
[22:52:05] <dddddd> yes, sorry for using the nickname
[22:53:51] <jo0nas> oh well, I just happened to recognize the name better than the nick - could just as well have been the opposite :-)
[22:55:18] <dddddd> the backlight is turned on in ATF, in that image
[22:55:37] <dddddd> a bit hackish but worked
[22:56:30] <jo0nas> thanks, that is a great clue - now I know what to try (and need only compile u-boot to test, not linux)
[22:57:18] <jo0nas> hmm, no wait - backlight _is_ turned on - what is missing is tuing it
[22:57:23] <jo0nas> tuning*
[22:57:56] <jo0nas> there are several issues here:
[22:59:02] <jo0nas> a) unable to adjust backlight - e.g. the tool xbacklight says "No outputs have backlight property" and the entry in /sys is empty
[22:59:26] <jo0nas> b) screen is black
[22:59:57] <jo0nas> c) unable to read battery status - entry in /sys is empty
[23:01:04] <jo0nas> Issues a) and c) is both with linux 4.19 and 5.0 (and I guess, xcko can confirm, with 5.1)
[23:01:36] <jo0nas> issue b) is with linux 5.0 (and I guess with 5.1) but is *not* an issue with 4.19
[23:02:49] <jo0nas> so the core issue which Harald talked about in the fall being the last important one to get mainlined is now mainlined - in u-boot and ATF
[23:04:36] <dddddd> I guess, so... I'm setting up here to try the new u-boot, which I expect has everything. I don't know if it'll handle the turning on of the backlight without my patch, but I think icenowy fixed something related to it.
[23:05:54] <dddddd> *patch to ATF
[23:16:55] <dddddd> Do you know where's _mainline_ ATF?
[23:22:22] <dddddd> oh, sorry... I was thinking of some fork... but u-boot documents it:
[23:27:06] <xcko> issue b) does not apply to 5.1; screen works fine, and is on, just can't adjust brightness
[23:29:37] <dddddd> xcko, let me know if lsmod output (or something like that) would help
[23:30:40] <xcko> dddddd: which kernel are you using?
[23:32:16] <dddddd> 4.16.0-rc1+
[23:48:06] <dddddd> BTW, do you have the screen-high-pitch problem? Did you fixed it? I can workaround it by setting brightness at max... but I'd like a solution for all settings (it's too bright sometimes, but the noise is worse!)
[23:50:37] <dddddd> I remember that changing/adding some components to the board _usually_ fixes it, but I'd like to know a definitive fix if I'm going to mess with the hardware.
[23:52:38] <dddddd> ... because high chance of break something the first time... A second try feels too risky (;