kernel icon indicating copy to clipboard operation
kernel copied to clipboard

Drivers for MAX34407 and MAX34417

Open qzed opened this issue 4 years ago • 4 comments

The Surface devices seem to use MAX34407 (up to Pro 6) and MAX34417 (later) to measure power consumption for various components / part of the system (see e.g. https://github.com/linux-surface/acpidumps/blob/master/surface_book_2/dsdt.dsl#L18219-L18226).

Datasheets:

  • https://www.maximintegrated.com/en/products/analog/amplifiers/MAX34407.html
  • https://www.maximintegrated.com/en/products/analog/amplifiers/MAX34417.html

The missing drivers don't impact system performance, so this is a low priority issue.

qzed avatar May 12 '20 21:05 qzed

Related upstream proposed patch: https://lists.sr.ht/~postmarketos/upstreaming/patches/10202 (regulator: max77826: Add MAX77826 support). There could be some commonalities to MAX34407 and MAX34417?

kasperk81 avatar Jul 25 '21 22:07 kasperk81

Maybe, that thing looks like a full-blown regulator, i.e. for controlling voltages, whereas (I think) the ones used on the Surface devices are for measuring only.

qzed avatar Jul 25 '21 22:07 qzed

Ah, I see. The regulator patch is upstream, maybe closer one is https://github.com/torvalds/linux/blob/master/drivers/hwmon/pmbus/max34440.c (pressed T in GitHub file list aka "go to file" and typed drivers/max to get these results).

kasperk81 avatar Jul 25 '21 22:07 kasperk81

Hmm. My search regarding MAX34417 revealed there appears to be a driver from Maxim https://github.com/MaximIntegratedAI/powermonitor/blob/main/max34417.c Also https://github.com/DanielJeongADI/LKD has one, and IMO a few more (Surface Duo has references to it, too). Searched in GitHub for MAX34417. Integration into max34440.c doesn't seem to fit to well. I have 3x MAX34417 in the Windows Dev Kit 2023, and I'd like to use hem to find ot which regulators are what power domain, to make the dts better, and get a handle on power management.

jglathe avatar Sep 12 '23 12:09 jglathe