0

I have complied and installed a linux driver, but now I'm not sure how to actually use it from my code.

The driver is for the mcp9600 thermocouple amplifier, it's not in my kernel by default (kernel vers 6.6), but the source is available here: https://github.com/torvalds/linux/blob/master/drivers/iio/temperature/mcp9600.c

I have compiled and installed the driver successfully (I assume), as I can find files in /sys:

>ls /sys/module/mcp9600
coresize  holders   initstate  refcnt    taint
drivers   initsize  notes      sections  uevent
>ls /sys/bus/i2c/drivers/mcp9600
bind  module  uevent  unbind

However there is nothing under /dev

What do I need to do to read temperature data from this chip from c code or shell script?

This is on debian on an arm64 embedded device.

1
  • 1
    Have you loaded the module with modprobe? Is it listed with lsmod? Commented Oct 14, 2024 at 11:19

1 Answer 1

1

This is an IIO driver, so the device is now exposed via the IIO kernel framework.

You can use analog devices' libiio (which is about to get a 1.0 release!) to interface with it, or you can directly use the devices you find under /sys/bus/iio/devices/.

3
  • Thanks, there is nothing under /sys/bus/iio/devices/. I'll google iio to learn how this works. Commented Oct 14, 2024 at 10:46
  • have you bound the right I²C address to the driver? Commented Oct 14, 2024 at 11:33
  • 1
    Thanks Marcus. After tracking down a bus issue then figuring out what 'bind to the i2c address' means, I seem to be on track to getting this working. Commented Oct 15, 2024 at 4:13

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.