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
6.0.4.4

Change-Id: Ia6a077ea71d9f03e90e039ce28eebe26d28a221f