title: I2C write error, i2c_master_send returned -121
body: <blockquote>
    <p>[15995.562117] tsc2013 1-0048: tsc2013_i2c_write_register : I2C write error, i2c_master_send returned -121</p>
  </blockquote>
  
  <p>What could cause this?</p>
  
  <ul>
  <li>bbb img is : bone-debian-9.4-lxqt-armhf-2018-06-17-4gb.img</li>
  <li>slave address is : 0x48 in i2c-1</li>
  </ul>
  
  <p>__</p>
  
  <pre><code>debian@beaglebone:/sys/bus/i2c/devices$ ls -l
  total 0
  lrwxrwxrwx 1 root root 0 Aug  2 05:51 0-0024 -&gt; ../../../devices/platform/ocp/44e0b000.i2c/i2c-0/0-0024
  lrwxrwxrwx 1 root root 0 Aug  2 05:51 0-0050 -&gt; ../../../devices/platform/ocp/44e0b000.i2c/i2c-0/0-0050
  lrwxrwxrwx 1 root root 0 Aug  2 05:51 1-0048 -&gt; ../../../devices/platform/ocp/4802a000.i2c/i2c-1/1-0048
  lrwxrwxrwx 1 root root 0 Aug  2 05:51 2-0054 -&gt; ../../../devices/platform/ocp/4819c000.i2c/i2c-2/2-0054
  lrwxrwxrwx 1 root root 0 Aug  2 05:51 2-0055 -&gt; ../../../devices/platform/ocp/4819c000.i2c/i2c-2/2-0055
  lrwxrwxrwx 1 root root 0 Aug  2 05:51 2-0056 -&gt; ../../../devices/platform/ocp/4819c000.i2c/i2c-2/2-0056
  lrwxrwxrwx 1 root root 0 Aug  2 05:51 2-0057 -&gt; ../../../devices/platform/ocp/4819c000.i2c/i2c-2/2-0057
  lrwxrwxrwx 1 root root 0 Aug  2 05:51 i2c-0 -&gt; ../../../devices/platform/ocp/44e0b000.i2c/i2c-0
  lrwxrwxrwx 1 root root 0 Aug  2 05:51 i2c-1 -&gt; ../../../devices/platform/ocp/4802a000.i2c/i2c-1
  lrwxrwxrwx 1 root root 0 Aug  2 05:51 i2c-2 -&gt; ../../../devices/platform/ocp/4819c000.i2c/i2c-2
  
  debian@beaglebone:~$ uname -r
  4.14.49-ti-r54
  
  debian@beaglebone:~$ sudo insmod tsc2013.ko
  [15995.562117] tsc2013 1-0048: tsc2013_i2c_write_register : I2C write error, i2c_master_send returned -121
  [15995.586612] tsc2013 1-0048: tsc2013_i2c_write_register : I2C write error, i2c_master_send returned -121
  [15995.604143] tsc2013 1-0048: tsc2013_i2c_write_register : I2C write error, i2c_master_send returned -121
  [15995.617237] tsc2013 1-0048: tsc2013_i2c_write_byte : I2C write error, i2c_master_send returned -121
  
  
  debian@beaglebone:~$ dmesg
  [ 5071.263231] --&gt;tsc2013_init
  [ 5071.263247] tsc2013_init--&gt;i2c_add_driver
  [ 5071.263525] --&gt;tsc2013_probe
  [ 5071.263559] tsc2013_probe--&gt;tsc2013_hw_init
  [ 5071.263565] --&gt;tsc2013_hw_init
  [ 5071.263583] after gpio_request
  [ 5071.263589] after gpio_direction_input
  [ 5071.263687] after gpio_to_irq
  [ 5071.263786] tsc2013_probe--&gt;tsc2013_sw_init
  [ 5071.263791] --&gt;tsc2013_reset
  [ 5071.287503] tsc2013 1-0048: tsc2013_i2c_write_register : I2C write error, i2c_master_send returned -121
  [ 5071.300364] tsc2013_i2c_write_register : CFG[62] = 0xa38c
  [ 5071.300577] tsc2013 1-0048: tsc2013_i2c_write_register : I2C write error, i2c_master_send returned -121
  [ 5071.314459] tsc2013_i2c_write_register : CFG[6a] = 0x0
  [ 5071.314701] tsc2013 1-0048: tsc2013_i2c_write_register : I2C write error, i2c_master_send returned -121
  [ 5071.328085] tsc2013_i2c_write_register : CFG[72] = 0x381c
  [ 5071.328311] tsc2013 1-0048: tsc2013_i2c_write_byte : I2C write error, i2c_master_send returned -121
  [ 5071.347228] input: tsc2013 as /devices/virtual/input/input3
  
  debian@beaglebone:~$ ls /dev/input/
  by-path  event0  event1  event2  event3
  
  debian@beaglebone:~$ ls /dev/input/by-path/ -l
  total 0
  lrwxrwxrwx 1 root root 9 Aug  1 09:10 platform-44e0b000.i2c-platform-tps65217-pwrbutton-event -&gt; ../event1
  lrwxrwxrwx 1 root root 9 Aug  1 09:10 platform-gpio_keys-event -&gt; ../event2
  lrwxrwxrwx 1 root root 9 Aug  1 09:10 platform-TI-am335x-tsc-event -&gt; ../event0
  
  debian@beaglebone:~$ i2cdetect -y -r 1
       0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
  00:          -- -- -- -- -- -- -- -- -- -- -- -- --
  10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  40: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
  50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  70: -- -- -- -- -- -- -- --
  
  i2c@4802a000 {
              compatible = "ti,omap4-i2c";
              #address-cells = &lt;0x1&gt;;
              #size-cells = &lt;0x0&gt;;
              ti,hwmods = "i2c2";
              reg = &lt;0x4802a000 0x1000&gt;;
              interrupts = &lt;0x47&gt;;
              //status = "disabled";
              status = "okay";
              phandle = &lt;0xa9&gt;;
  
  
              tsc2013@48 {
                  compatible = "tsc2013";
                  reg = &lt;0x48&gt;;
                  //#address-cells = &lt;0x1&gt;;
                  //#size-cells = &lt;0x1&gt;;
                  //phandle = &lt;0xab&gt;;
              };
          };
  
  debian@beaglebone:/sys/bus/i2c/drivers/tsc2013$ ls -l
  total 0
  lrwxrwxrwx 1 root root    0 Aug  2 05:22 1-0048 -&gt; ../../../../devices/platform/ocp/4802a000.i2c/i2c-1/1-0048
  --w------- 1 root root 4096 Aug  2 05:22 bind
  lrwxrwxrwx 1 root root    0 Aug  2 05:22 module -&gt; ../../../../module/tsc2013
  --w------- 1 root root 4096 Aug  2 02:51 uevent
  --w------- 1 root root 4096 Aug  2 05:22 unbind
  
  
  debian@beaglebone:/sys/bus/i2c/devices/1-0048$ ls -l
  total 0
  lrwxrwxrwx 1 root root    0 Aug  2 05:23 driver -&gt; ../../../../../../bus/i2c/drivers/tsc2013
  -r--r--r-- 1 root root 4096 Aug  2 05:23 modalias
  -r--r--r-- 1 root root 4096 Aug  2 05:23 name
  lrwxrwxrwx 1 root root    0 Aug  2 05:23 of_node -&gt; ../../../../../../firmware/devicetree/base/ocp/i2c@4802a000/tsc2013@48
  drwxr-xr-x 2 root root    0 Aug  2 05:23 power
  lrwxrwxrwx 1 root root    0 Jan  1  2000 subsystem -&gt; ../../../../../../bus/i2c
  -rw-r--r-- 1 root root 4096 Jan  1  2000 uevent
  </code></pre>