Own kernel driver with usage of hwmon driver

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Own kernel driver with usage of hwmon driver

944件の閲覧回数
MicMoba
Contributor V

My board has two 4ch 8bit I2C-ADC devices for monitoring some board voltages. Now I set up the DT with the driver of my ADC and I have access to the values by sysfs. But sysfs only gives the raw digit values (0-254). I want to write a driver that have access to the ADC, convert the digit values to voltage values and write them to the sysfs.

Is it possible to organize that similar to the gpio-controller?

 

DT
 +-> I2C
  |      +-> ADC1
  |      +-> ADC2
 +-> MyDriver
            +-> Board Voltage (ADC1, ch2)
            +-> 5V0-Line (ADC1, ch4)
            +-> 3V3-Line (ADC2, ch0)
            ...

Are there other possibilities to do such things?

 

0 件の賞賛
返信
1 返信

884件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi Michael

 

one can look at description of adc driver in sect.4.1 ADC   i.MX Linux Reference Manual​

and try to change function vf610_read_raw() output to voltage values

https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/iio/adc/vf610_adc.c?h=lf-5.10.y

 

Best regards
igor

0 件の賞賛
返信