This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

To disable Temperature sensor in the userspace in ti sdk 8

Dear TI E2E Community,

I need to disable the Temperature sensor TCN75A in the userspace (after bootup in the shell prompt) (preventing it from reporting the temperature values in the userspace) which is interfaced to i2c0 bus, but when I see the i2cdump as shown below, the register address 0x01 contents seems to be zero but when am still able to read the temperature readings, ie., current temp of the board using sysfs

root@lifeline:/# i2cdump -f -y 0 0x48
No size specified (using byte-data access)
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 1f 00 4b 50 XX 54 10 XX f0 95 3d 11 XX XX XX XX ?.KPXT?X??=?XXXX
10: 1e 00 4b 50 XX 54 10 XX f0 95 3d 11 XX XX XX XX ?.KPXT?X??=?XXXX
20: 1e 00 4b 50 XX 54 10 XX f0 95 3d 11 XX XX XX XX ?.KPXT?X??=?XXXX
30: 1f 00 4b 50 XX 54 10 XX f0 95 3d 11 XX XX XX XX ?.KPXT?X??=?XXXX
40: 1f 00 4b 50 XX 54 10 XX f0 95 3d 11 XX XX XX XX ?.KPXT?X??=?XXXX
50: 1f 00 4b 50 XX 54 10 XX f0 95 3d 11 XX XX XX XX ?.KPXT?X??=?XXXX
60: 1f 00 4b 50 XX 54 10 XX f0 95 3d 11 XX XX XX XX ?.KPXT?X??=?XXXX
70: 1e 00 4b 50 XX 54 10 XX f0 95 3d 11 XX XX XX XX ?.KPXT?X??=?XXXX
80: 1e 00 4b 50 XX 54 10 XX f0 95 3d 11 XX XX XX XX ?.KPXT?X??=?XXXX
90: 1e 00 4b 50 XX 54 10 XX f0 95 3d 11 XX XX XX XX ?.KPXT?X??=?XXXX
a0: 1f 00 4b 50 XX 54 10 XX f0 95 3d 11 XX XX XX XX ?.KPXT?X??=?XXXX
b0: 1f 00 4b 50 XX 54 10 XX f0 95 3d 11 XX XX XX XX ?.KPXT?X??=?XXXX
c0: 1e 00 4b 50 XX 54 10 XX f0 95 3d 11 XX XX XX XX ?.KPXT?X??=?XXXX
d0: 1e 00 4b 50 XX 54 10 XX f0 95 3d 11 XX XX XX XX ?.KPXT?X??=?XXXX
e0: 1e 00 4b 50 XX 54 10 XX f0 95 3d 11 XX XX XX XX ?.KPXT?X??=?XXXX
f0: 1f 00 4b 50 XX 54 10 XX f0 95 3d 11 XX XX XX XX ?.KPXT?X??=?XXXX
root@lifeline:/#

root@lifeline:/# cat /sys/bus/i2c/devices/0-0048/temp1_input
31000
root@lifeline:/# cat /sys/bus/i2c/devices/0-0048/temp1_input
30500
root@lifeline:/# cat /sys/bus/i2c/devices/0-0048/temp1_input
31000
root@lifeline:/# cat /sys/bus/i2c/devices/0-0048/temp1_input

Could you please let me know whether this is possible to disable temp. sensor thereby preventing it reporting the temperature values in the userspace

Kindly do the needful as early as possible

Awaiting for your replies

Many Thanks in advance

  • Forwarding this to the SW team.
  • Hello Srini,

    I am not sure if there is a command to disable the temperature readings from the user space. Why don't you change its node status to disabled in the device tree file.

    Best regards,
    Kemal

  • Dear Kemal

    Many thanks a lot for your quick responses,

    Could you please let me is there any options to disable the node status on the fly ie

    ,once after the bootup and we get the shell prompt

  • Dear Kemal,

    I tried converting i2c0_scl & i2c_sda pins to gpio & then I tried it worked

    Could you please kindly do me one favour ie., Could you please provide i2c-tools command to access 16 bit registers, I know the commands for accessing 8-bot registers, for ex,, here 0x84 is 8 bit register, but if it is 16 bit register could you please let me know how to access this register using i2cset, i2cget i2cdump

    i2cdump -f -y 0 0x50

    i2cset -f -y 0 0x50 0x84 0x72

    i2cget -f -y 0 0x50 0x84

    Kindly do the needful as early as possible

    many Thanks in advance

  • Add the word mode parameter to operate with 16 bits.

  • Dear Kemal,

    Many thanks a lot for your quick responses,

    Could you please provide me the full command with w argument for i2cset, i2cget, i2cdump

    As am struggling from many days to access 16 bit registers using i2c tools from many days

  • Check these manual pages.

    http://manpages.ubuntu.com/manpages/hardy/man8/i2cdump.8.html

    http://manpages.ubuntu.com/manpages/hardy/man8/i2cset.8.html

    http://manpages.ubuntu.com/manpages/hardy/man8/i2cget.8.html

    The mode parameter must be placed at the end.

    Srini said:

    i2cset, i2cget i2cdump w

    i2cdump -f -y 0 0x50 w

    i2cset -f -y 0 0x50 0x84 0x72 w

    i2cget -f -y 0 0x50 0x84 w

  • Dear Kemal,

    Sorry to raise some query w.r.t this thread after long time

    Am facing some issues, while writing 16 bit data using the above command ie., "i2cset -f -y 0 0x48 0x00 0x00 w" but I don't see the value being set, when I verify using i2cget -f -y 0 0x48 0x00 w

    root@xxxxx:/# i2cdump -f -y 0 0x48 w
    0,8 1,9 2,a 3,b 4,c 5,d 6,e 7,f
    00: 001b 0100 004b 0050 XXXX 0154 0210 XXXX
    08: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    10: 001b 0100 004b 0050 XXXX 0154 0210 XXXX
    18: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    20: 001b 0100 004b 0050 XXXX 0154 0210 XXXX
    28: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    30: 001b 0100 004b 0050 XXXX 0154 0210 XXXX
    38: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    40: 801a 0100 004b 0050 XXXX 0154 0210 XXXX
    48: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    50: 001b 0100 004b 0050 XXXX 0154 0210 XXXX
    58: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    60: 001b 0100 004b 0050 XXXX 0154 0210 XXXX
    68: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    70: 001b 0100 004b 0050 XXXX 0154 0210 XXXX
    78: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    80: 001b 0100 004b 0050 XXXX 0154 0210 XXXX
    88: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    90: 001b 0100 004b 0050 XXXX 0154 0210 XXXX
    98: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    a0: 001b 0100 004b 0050 XXXX 0154 0210 XXXX
    a8: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    b0: 001b 0100 004b 0050 XXXX 0154 0210 XXXX
    b8: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    c0: 001b 0100 004b 0050 XXXX 0154 0210 XXXX
    c8: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    d0: 801a 0100 004b 0050 XXXX 0154 0210 XXXX
    d8: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    e0: 001b 0100 004b 0050 XXXX 0154 0210 XXXX
    e8: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    f0: 001b 0100 004b 0050 XXXX 0154 0210 XXXX
    f8: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    root@xxxxx:/# i2cset -f -y 0 0x48 0x00 0x00 w
    root@xxxxx:/# i2cget -f -y 0 0x48 0x00 w
    0x001b

     

    Could you please let me know is there any other option needs to be enabled in the i2cset command???, Sorry to ask you.. could you please try from your end & just let me know how to verify 16 bit write & read operations using i2ctools

    Kindly do the needful as early as possible

    Many Thanks in adavnce

  • Dear Kemal,

    Could you please provide any updates w.r.t the above query



    Kindly do the needful as early as possible
    Many Thanks in advance
  • Dear Kemal,


    Am awaiting for your inputs, please provide any inputs w.r.t the above query


    Kindly do the needful as early as possible
    Many Thanks in advance
  • Hello Srini,

    Sorry for the delay in getting back to you.

    Have you tried to write these data from the U-Boot and compare the results. Could you also post the i2c part of dts which you have interfaced with the sensor.

    Moreover try to use the -r option with the i2c tools to read back the value right after writing it.

    Best regards,
    Kemal

  • Am Happy that you started replying for my queries, Many Thanks!!

    I verified using sysfs it is working fine but I need to get it work with i2c-tools, I have hereby attached the dts & the part datasheet

    2133.TCN75A.pdf

    DT configuration

    &i2c0 {
    pinctrl-names = "default";
    pinctrl-0 = <&i2c0_pins>;

    status = "okay";
    clock-frequency = <400000>;

    tps: tps@24 {
    reg = <0x24>;
    };

    lm75: tcn75@48 {
    compatible = "lm75,tcn75";
    reg = <0x48>;
    };

    Could you please provide me an example with i2c-tools  with option r (full comand)

    The problem is am unable to read & write the 16 bit data via i2c-tools 

    Kindly do the needful as early as possible

    Many Thanks in advance

  • Dear Kemal,

    Extremely sorry to push you hard..

    Please let me know if you have any inputs w.r.t the above query

    KIndly do the needful as early as possible

    Many Thanks in advance

  • Why do you use i2c0? Could you move it to i2c1/i2c2 and retry.

    The full command should look something like this:
    root@xxxxx:/# i2cset -f -y -r 1/2 0x48 0x00 0x00 w

    And according the data sheet, the Ta register is read-only. Why do you try to change its value?

  • Many Thanks a lot Kemal

    Finally it worked... Extremely sorry I was trying to write readly only register, I am posting the below information it would be useful for others

    root@xxxxx:/# i2cdump -f -y 0 0x48
    No size specified (using byte-data access)
    0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
    00: 19 00 4b 50 XX 54 10 XX f0 95 3c 10 XX XX XX XX ?.KPXT?X??<?XXXX
    10: 19 00 4b 50 XX 54 10 XX f0 95 3c 10 XX XX XX XX ?.KPXT?X??<?XXXX
    20: 19 00 4b 50 XX 54 10 XX f0 95 3c 10 XX XX XX XX ?.KPXT?X??<?XXXX
    30: 19 00 4b 50 XX 54 10 XX f0 95 3c 10 XX XX XX XX ?.KPXT?X??<?XXXX
    40: 19 00 4b 50 XX 54 10 XX f0 95 3c 10 XX XX XX XX ?.KPXT?X??<?XXXX
    50: 19 00 4b 50 XX 54 10 XX f0 95 3c 10 XX XX XX XX ?.KPXT?X??<?XXXX
    60: 19 00 4b 50 XX 54 10 XX f0 95 3c 10 XX XX XX XX ?.KPXT?X??<?XXXX
    70: 19 00 4b 50 XX 54 10 XX f0 95 3c 10 XX XX XX XX ?.KPXT?X??<?XXXX
    80: 19 00 4b 50 XX 54 10 XX f0 95 3c 10 XX XX XX XX ?.KPXT?X??<?XXXX
    90: 19 00 4b 50 XX 54 10 XX f0 95 3c 10 XX XX XX XX ?.KPXT?X??<?XXXX
    a0: 19 00 4b 50 XX 54 10 XX f0 95 3c 10 XX XX XX XX ?.KPXT?X??<?XXXX
    b0: 19 00 4b 50 XX 54 10 XX f0 95 3c 10 XX XX XX XX ?.KPXT?X??<?XXXX
    c0: 19 00 4b 50 XX 54 10 XX f0 95 3c 10 XX XX XX XX ?.KPXT?X??<?XXXX
    d0: 19 00 4b 50 XX 54 10 XX f0 95 3c 10 XX XX XX XX ?.KPXT?X??<?XXXX
    e0: 19 00 4b 50 XX 54 10 XX f0 95 3c 10 XX XX XX XX ?.KPXT?X??<?XXXX
    f0: 19 00 4b 50 XX 54 10 XX f0 95 3c 10 XX XX XX XX ?.KPXT?X??<?XXXX
    root@xxxxx:/# i2cdump -f -y 0 0x48 w
    0,8 1,9 2,a 3,b 4,c 5,d 6,e 7,f
    00: 001a 0100 004b 0050 XXXX 0154 0210 XXXX
    08: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    10: 8019 0100 004b 0050 XXXX 0154 0210 XXXX
    18: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    20: 8019 0100 004b 0050 XXXX 0154 0210 XXXX
    28: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    30: 8019 0100 004b 0050 XXXX 0154 0210 XXXX
    38: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    40: 8019 0100 004b 0050 XXXX 0154 0210 XXXX
    48: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    50: 8019 0100 004b 0050 XXXX 0154 0210 XXXX
    58: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    60: 8019 0100 004b 0050 XXXX 0154 0210 XXXX
    68: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    70: 8019 0100 004b 0050 XXXX 0154 0210 XXXX
    78: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    80: 8019 0100 004b 0050 XXXX 0154 0210 XXXX
    88: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    90: 8019 0100 004b 0050 XXXX 0154 0210 XXXX
    98: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    a0: 8019 0100 004b 0050 XXXX 0154 0210 XXXX
    a8: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    b0: 8019 0100 004b 0050 XXXX 0154 0210 XXXX
    b8: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    c0: 001a 0100 004b 0050 XXXX 0154 0210 XXXX
    c8: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    d0: 001a 0100 004b 0050 XXXX 0154 0210 XXXX
    d8: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    e0: 8019 0100 004b 0050 XXXX 0154 0210 XXXX
    e8: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    f0: 8019 0100 004b 0050 XXXX 0154 0210 XXXX
    f8: 01f0 0195 013c 0110 XXXX XXXX XXXX XXXX
    root@xxxxx:/#
    root@xxxxx:/#
    root@xxxxx:/# i2cset -f -y 0 0x48 0x03 0x40 w
    root@xxxxx:/#
    root@xxxxx:/# i2cget -f -y 0 0x48 0x03 w
    0x0040
    root@xxxxx:/# i2cset -f -y 0 0x48 0x03 0x80 w
    root@xxxxx:/# i2cget -f -y 0 0x48 0x03 w
    0x0080
    root@xxxxx:/# i2cset -f -y 0 0x48 0x02 0x80 w
    root@xxxxx:/# i2cget -f -y 0 0x48 0x02 w
    0x0080
    root@xxxxx:/#
    root@xxxxx:/#

    Many Many Thanks a lot for your support and would really appreciate the same..