embedded linux - How to insert hwmon module (ARM) -


i fear specific question.

  • hardware: gumstix overo fire (arm cortex a8)
  • distro: poky (customized yocto project)
  • kernel: 3.5.7

i tried write program read hih6130 i2c sensor, using /dev/i2c-3 , < linux/i2c-dev.h>, despite works every other i2c device, not work one. happens because particularity of reading protocol, anyway, that's not topic.

i found this code implements driver sensor, , inside called "hwmon", seems collection of sensor drivers.

after compiled , inserted module expecting see entry humidity1_input somewhere under hwmon didn't find it.

 root@overo:/sys# find -name hum* root@overo:/sys# find -name hih* ./bus/i2c/drivers/hih6130 ./module/hih6130 root@overo:/sys# ls ./bus/i2c/drivers/hih6130 bind  module  uevent  unbind root@overo:/sys# ls ./module/hih6130 coresize  holders   initstate  refcnt    srcversion  uevent drivers   initsize  notes      sections  taint 

do have else enable reading of sensor? ideas?

i ended using i2cget read it:

$ i2cget -y 3 0x27 0x00 

later, author, iain paton, kindly showed me how bind driver:

$ insmod hih6130.ko $ echo hih6130 0x27 > /sys/bus/i2c/devices/i2c-3/new_device 

in device appeared in directory:

$ find /sys/ -name humidity* /sys/devices/platform/omap_i2c.3/i2c-3/3-0027/humidity1_input 

also there 'temp1_input' in same directory.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -