Hwmon not showing ADC inputs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Hwmon not showing ADC inputs

glennga
Hello All,

I have built and flashed the Yocto gumstix-console-image for the overo using the tutorial here in the yocto-manifest wiki, but the ADC inputs are not showing up in /sys/class/hwmon/hwmon0/device.

root@overo:~# ls /sys/class/hwmon/hwmon0/device
disable  driver  hwmon  input  modalias  pen_down  power  subsystem  uevent

There is no hwmon1 directory. I tried some of the solutions I've read here, but:
root@overo:~# insmod /lib/modules/3.18.18-custom/kernel/drivers/hwmon/twl4030-madc-hwmon.ko
[ 1357.749572] Error: Driver 'twl4030_madc_hwmon' is already registered, aborting...
insmod: ERROR: could not insert module /lib/modules/3.18.18-custom/kernel/drivers/hwmon/twl4030-madc-hwmon.ko: Device or resource busy

root@overo:~# modprobe twl4030_madc_hwmon
[  747.993743] industrialio: exports duplicate symbol iio_bus_type (owned by kernel)
modprobe: ERROR: could not insert 'twl4030_madc_hwmon': Exec format error

I also tried modifying the kernel, changing CONFIG_TWL4030_MADC and CONFIG_SENSORS_TWL4030_MADC from m to y, but this doesn't make a difference.

Where should I go from here?

Thanks,
Glenn
Reply | Threaded
Open this post in threaded view
|

Re: Hwmon not showing ADC inputs

glennga
Hello All,

I found a solution to this, and that was using the i2c-dev sysfs interface instead of the hwmon interface.

I found the values in the following directory (for me):
/sys/class/i2c-dev/i2c-0/device/0-0048/48070000.i2c\\:twl\\@48\\:madc/iio\\device0/

I'm not sure if this is relevant or not, but I also changed the following in my kernel:
CONFIG_IIO = Y, SENSORS_IIO_HWMON = Y, TWL4030_MADC = Y, SENSORS_TWL4030_MADC = Y, TOUCHSCREEN_ADS7846 = N.

Good luck to anyone else who runs into this problem!
Glenn
Reply | Threaded
Open this post in threaded view
|

Re: Hwmon not showing ADC inputs

Akram Hameed
Hi Glenn,

The MADC is now being organised under the industrial IO area of the kernel and from my perspective, the transition to this new bit of organisation is a bit half-assed (for kernel 3.18 anyway, there are a bunch of files left over from stuff being transitioned to the new way of doing things).  It should probably be generating a sysfs symlink somewhere easier to find but for my purposes, I have basically done the same thing you have.

Cheers,

Akram

On Tue, Jun 7, 2016 at 11:20 AM, glennga <[hidden email]> wrote:
Hello All,

I found a solution to this, and that was using the i2c-dev sysfs interface
instead of the hwmon interface.

I found the values in the following directory (for me):
/sys/class/i2c-dev/i2c-0/device/0-0048/48070000.i2c\\:twl\\@48\\:madc/iio\\device0/

I'm not sure if this is relevant or not, but I also changed the following in
my kernel:
CONFIG_IIO = Y, SENSORS_IIO_HWMON = Y, TWL4030_MADC = Y,
SENSORS_TWL4030_MADC = Y, TOUCHSCREEN_ADS7846 = N.

Good luck to anyone else who runs into this problem!
Glenn



--
View this message in context: http://gumstix.8.x6.nabble.com/Hwmon-not-showing-ADC-inputs-tp4970903p4970924.html
Sent from the Gumstix mailing list archive at Nabble.com.

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|

Re: Hwmon not showing ADC inputs

Scott Ellis
A slightly shorter symlink

  /sys/bus/iio/devices/iio:device0

A quick script to poll values

root@overo:~# cat polladc.sh
#!/bin/sh

while true; do
        for i in 2 3 4 5 6 7; do
                echo -n "in_voltage_input[${i}]: "
                cat /sys/bus/iio/devices/iio:device0/in_voltage${i}_input
        done

        echo ""
        sleep 5
done