Home » Linux Kernel » Linux Device Drivers » Keypad/Touchscreen Driver » How to identify and change input device location in Android ?

How to identify and change input device location in Android ?

Identify what is the current location of the input device using getvent command as,

$ adb shell getevent -i | grep location

So, the output we may see it as,

$ adb shell getevent -i | grep location
  location: "touchinput"
  location: "gpio-keys/input0"

Now, lets say we want to change the location of “touchinput” to “touch/input0” , so we can have multiple touchscreens distinguished as “touch/input0” and “touch/input1” and so on…

To do this, change the following string in the input device driver of particular device as,

driver_proble {

struct input_dev *input_dev;

        input_dev = input_allocate_device();
        if (!input_dev) {
                err = -ENOMEM;
                return err;
        }

input_dev->name = "my device"
input_dev->phys = "my_new_location";

}

So, to change the location, modify driver and change “input_dev->phys ” to such as “touch/input0” .. compile and flash the new kernel and if you now check the location, you will see it as updated with new string.

$ adb shell getevent -i | grep location
  location: "touch/input0"
  location: "gpio-keys/input0"

Leave a Comment