Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XBMC: Show cpu temperature #3

Open
vDorst opened this issue Jun 14, 2013 · 5 comments
Open

XBMC: Show cpu temperature #3

vDorst opened this issue Jun 14, 2013 · 5 comments
Milestone

Comments

@vDorst
Copy link
Owner

vDorst commented Jun 14, 2013

Amlogic has adc channel to readout the temperature.

If temperature readout is enabled in the kernel, then /sys/class/saradc/temperature is available.
Temperature in Celsius.

# cat /sys/class/saradc/temperature
58
@davilla
Copy link

davilla commented Jun 14, 2013

ohhh, this one is of interest, details please.

@vDorst
Copy link
Owner Author

vDorst commented Jun 16, 2013

In the new kernel 3.0.50 the SARADC driver has this function.
https://github.com/nspierbundel/amlogic-common/blob/master/drivers/amlogic/input/saradc/saradc.c#L296

Your have to enable this option in the kernel https://github.com/nspierbundel/amlogic-common/blob/master/arch/arm/mach-meson6/Kconfig#L42

Also this is involved. https://github.com/nspierbundel/amlogic-common/blob/master/arch/arm/mach-meson6/cpu.c#L118

I tried to back ported to 2.6 kernel. But without success. I did something wrong.
The SARADC driver, compared to 2.6 and 3.0, did not changed that much. So it should be really easy.
I did not implement the option in Kconfig nor in cpu.c. Maybe that is the problem why it did not work so well for me.

To use it in XBMC:
See http://wiki.xbmc.org/?title=Advancedsettings.xml, cmd 3.58 .
A simple cat command could be sufficient.

@Stane1983
Copy link
Contributor

M3 temp reading:

cat /sys/class/saradc/saradc_ch6
Temp: 58 oC

@davilla
Copy link

davilla commented Jul 25, 2013

nice, got a patch ?

@Stane1983
Copy link
Contributor

Did not toy with xbmc, just enabled saradc in kernel.

See Stane1983/buildroot-linux-kernel-m3@bd33bda

Update:

Patch for m3 xbmc advancedsettings (tested on 12.2):
https://gist.github.com/Stane1983/6302201

Note: Not supported by every board, eg. does not work on G-Box and variants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants