As mentioned in the comments, the problem was resolved by correctly specifying pull-ups on the output.
Another thing that you should usually consider is pin-mux , that is, you need to check that this contact is configured as GPIO, and not some other functions.
A detailed description of the pin configuration,
specially for OMAP4 (multiplexer, pull, wakeup), available here .
source share