Update events.c

Array max is incorrectly calculated, can lead to missed events for ids > MAX_DEVICES
loki: Update to 2.0, Add support for LG G2 (and device trees in general)

Change-Id: I5bbd6bd7239680f20880ac6fdf7744e2e47b39ac
Merge remote-tracking branch 'upstream/cm-10.2' into cm-10.2