rellla changed the topic of #linux-sunxi to: Allwinner/sunxi /development discussion - did you try looking at our wiki? https://linux-sunxi.org - Don't ask to ask. Just ask and wait! - https://github.com/linux-sunxi/ - Logs at http://irclog.whitequark.org/linux-sunxi - *only registered users can talk*
yann has quit [Ping timeout: 240 seconds]
ChriChri_ has joined #linux-sunxi
ChriChri has quit [Ping timeout: 265 seconds]
ChriChri_ is now known as ChriChri
cmeerw has quit [Ping timeout: 244 seconds]
jbrown has quit [Ping timeout: 260 seconds]
_whitelogger has joined #linux-sunxi
cnxsoft has joined #linux-sunxi
_whitelogger has joined #linux-sunxi
TheSeven has quit [Disconnected by services]
[7] has joined #linux-sunxi
kaspter has joined #linux-sunxi
_whitelogger has joined #linux-sunxi
lurchi_ is now known as lurchi__
lurchi_ has joined #linux-sunxi
psydread has left #linux-sunxi [#linux-sunxi]
lurchi__ has quit [Ping timeout: 240 seconds]
psydread has joined #linux-sunxi
psydread has left #linux-sunxi [#linux-sunxi]
psydread has joined #linux-sunxi
psydread has left #linux-sunxi [#linux-sunxi]
psydread has joined #linux-sunxi
JohnDoe_71Rus has joined #linux-sunxi
psydread has left #linux-sunxi [#linux-sunxi]
psydread has joined #linux-sunxi
psydread has left #linux-sunxi [#linux-sunxi]
vorian45620 has joined #linux-sunxi
psydread has joined #linux-sunxi
<vorian45620> I am working on a custom carrier for the sopine SOM, and as part of that project attempting to configure the axp803. I am really struggling to determine where and how to change values within the axp registers, as well as configure my system to handle the interrupts from the device.
<smaeul> there are several drivers for the various functions of the AXP803 chip -- the first is that ATF (trusted firmware) enables and sets regulator voltages at boot. then Linux has drivers for the regulators, power key, GPIO, AC and USB inputs, and battery charger
<smaeul> however, there's a decent chunk of functionality still with no drivers
<vorian45620> Ok, so lets say for example I wanted to change the power ok short press time. Is that something done in the device tree? I have been reading through the mfd drivers in linux mainline but I cannot find a method for this.
<vorian45620> power ok short press interrupt*
<smaeul> the power key times are configurable via sysfs
<smaeul> (the driver is INPUT_AXP20X_PEK)
<smaeul> only the startup/shutdown times are there currently, because the driver doesn't use the long/short events, only falling/rising
<smaeul> but if you wanted to implement short/long presses, with some arbitrary keycode, that would be the driver to put them in
<smaeul> if you want to play with registers for testing, you can do that with a one line kernel patch, and the regmap debugfs interface
<smaeul> the parts that go in the device tree are the regulators and GPIOs
<smaeul> for the power supplies and the battery, enabling the device in the device tree exposes it to userspace, but that's not required for the PMIC to work -- it's pretty autonomous
<vorian45620> Ok, that helps a lot thank you. I have a rootfs I built using buildroot on the 5.8, and I am struggling to find anything under sys for power key times.
<smaeul> all of the subdevices will show up under /sys/bus/sunxi-rsb/devices/sunxi-rsb-3a3, so the two sysfs files for power key times are /sys/bus/sunxi-rsb/devices/sunxi-rsb-3a3/axp221-pek/{startup,shutdown}
<vorian45620> Are all of the axp803 interrupts available or do some of them fall under the decent chunk of functionality without drivers?
<smaeul> you mean the virtual interrupts that get multiplexed to the one IRQ pin?
<smaeul> they are all available at the MFD driver level -- you could write a driver that used any one of them without writing any plumbing
<smaeul> and any of them can be used to wake the system from deep sleep
<vorian45620> Yes, that was what I meant. Thanks a lot! That was more info than I got from hours of digging.
<smaeul> hmm, that's not quite accurate. see the "struct resource" arrays in drivers/mfd/axp20x.c. you'd need to add more DEFINE_RES_IRQ_NAMED to hook up an IRQ to your mfd cell
<smaeul> but all of the IRQs are at least enumerated for you in include/linux/mfd/axp20x.h
<smaeul> and all of the multiplexing is already handled for you
<vorian45620> I am a little new to this, so I don't follow exactly what you mean by "you'd need to add more DEFINE_RES_IRQ_NAMED to hook up an IRQ to your mfd cell" but is there a line you could point me at for an already existing example of one of those defines?
<smaeul> sure, take for example the power key. the driver is referenced by name ("axp221-pek") in axp803_cells on line 30, and it's given the resources in axp803_pek_resources defined on line 223
<smaeul> s/line 30/line 730/
<smaeul> the DEFINE_RES_IRQ_NAMED(AXP803_IRQ_PEK_RIS_EDGE, "PEK_DBR"), on line 224 maps the bit offset in the register to a name that the axp221-pek driver can use
<smaeul> which it does in drivers/input/misc/axp20x-pek.c:442: axp20x_pek->irq_dbr = platform_get_irq_byname(pdev, "PEK_DBR");
<smaeul> so when adding a new mfd cell, you would need to create a new array similar to axp803_pek_resources (or add to an existing array), and reference that from your entry in axp803_cells
<smaeul> or another example, here's a couple of commits that add charging start/stop detection: https://github.com/smaeul/linux/commit/e45816633e72652 https://github.com/smaeul/linux/commit/29af6e8dac502
netlynx has joined #linux-sunxi
netlynx has joined #linux-sunxi
netlynx has quit [Changing host]
<vorian45620> Sorry it took me a minute to realize the line 30 -> 730 correction and really follow along. Thanks again, this has been really helpful.
cnxsoft1 has joined #linux-sunxi
cnxsoft has quit [Ping timeout: 265 seconds]
ldevulder_ has quit [Ping timeout: 240 seconds]
<vorian45620> Is the fuel gauge functionality not implemented? I am not really sure where to search for that one
ldevulder has joined #linux-sunxi
cmeerw has joined #linux-sunxi
jbrown has joined #linux-sunxi
vorian456 has joined #linux-sunxi
dev1990 has joined #linux-sunxi
vorian456 has quit [Ping timeout: 265 seconds]
yann has joined #linux-sunxi
psydread has quit [Excess Flood]
psydread has joined #linux-sunxi
psydread has left #linux-sunxi [#linux-sunxi]
psydread has joined #linux-sunxi
_whitelogger has joined #linux-sunxi
niceplace has quit [Ping timeout: 260 seconds]
reinforce has joined #linux-sunxi
niceplace has joined #linux-sunxi
reinforce has quit [Quit: Leaving.]
Mangy_Dog has joined #linux-sunxi
JohnDoe1 has joined #linux-sunxi
JohnDoe_71Rus has quit [Ping timeout: 246 seconds]
[ElectricShit] has joined #linux-sunxi
ndufresne has quit [Quit: The Lounge - https://thelounge.chat]
cnxsoft1 has quit [Quit: cnxsoft1]
hlauer has joined #linux-sunxi
dev1990 has quit [Quit: Konversation terminated!]
dev1990 has joined #linux-sunxi
dev1990 has quit [Remote host closed the connection]
dev1990 has joined #linux-sunxi
ldevulder has quit [Ping timeout: 264 seconds]
DrFrankensteinUK has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
cnxsoft has joined #linux-sunxi
cnxsoft has quit [Quit: cnxsoft]
ldevulder has joined #linux-sunxi
deathsparton has joined #linux-sunxi
_whitelogger has joined #linux-sunxi
lurchi_ is now known as lurchi__
deathsparton has quit [Quit: Mutter: www.mutterirc.com]
lurchi__ is now known as lurchi_
DrFrankensteinUK has joined #linux-sunxi
dev1990 has quit [Quit: Konversation terminated!]
KotCzarny has quit [Ping timeout: 240 seconds]
dev1990 has joined #linux-sunxi
ldevulder has quit [Ping timeout: 256 seconds]
kaspter has quit [Quit: kaspter]
vorian456 has joined #linux-sunxi
vorian456 has quit [Remote host closed the connection]
dev1990 has quit [Quit: Konversation terminated!]
giomba has joined #linux-sunxi
lkcl has quit [Ping timeout: 265 seconds]
ldevulder has joined #linux-sunxi
dev1990 has joined #linux-sunxi
vorian456 has joined #linux-sunxi
lkcl has joined #linux-sunxi
vorian456 has quit [Remote host closed the connection]
The_Loko has joined #linux-sunxi
giomba has quit [Remote host closed the connection]
AneoX has quit [Quit: Textual IRC Client: www.textualapp.com]
[ElectricShit] is now known as [CrescendoIdent]
KotCzarny has joined #linux-sunxi
dddddd has quit [Ping timeout: 240 seconds]
deesix has quit [Ping timeout: 256 seconds]
dev1990 has quit [Quit: Konversation terminated!]
dev1990 has joined #linux-sunxi
giomba has joined #linux-sunxi
The_Loko has quit [Ping timeout: 260 seconds]
The_Loko has joined #linux-sunxi
JohnDoe1 has quit [Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/]
jbrown has quit [Remote host closed the connection]
dddddd has joined #linux-sunxi
vagrantc has joined #linux-sunxi
deesix has joined #linux-sunxi
popolon has joined #linux-sunxi
buZz has quit [Quit: Lost terminal]
buZz has joined #linux-sunxi
buZz is now known as Guest97042
Guest97042 has quit [Changing host]
Guest97042 has joined #linux-sunxi
Guest97042 is now known as buZz
lurchi_ is now known as lurchi__
DrFrankensteinUK has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
DrFrankensteinUK has joined #linux-sunxi
[CrescendoIdent] has quit [Quit: You need to know where you go, where you are and who your are.]
hlauer has quit [Ping timeout: 265 seconds]
[ElectricShit] has joined #linux-sunxi
lurchi__ is now known as lurchi_
cmeerw has quit [Ping timeout: 244 seconds]
qschulz has quit [Quit: qschulz]
qschulz has joined #linux-sunxi
The_Loko has quit [Read error: Connection reset by peer]
gaston1980 has joined #linux-sunxi
lurchi_ is now known as lurchi__
lurchi__ is now known as lurchi_
yann has quit [Ping timeout: 240 seconds]
popolon has quit [Quit: WeeChat 2.9]
shailangsa has quit [Ping timeout: 258 seconds]
shailangsa has joined #linux-sunxi
giomba has quit [Ping timeout: 240 seconds]