This is not really a question. It's a bug report with patch.
I've noticed that if you call FXAS21002_Idle() when the gyro is not needed, you might be left with a stuck interrupt. FXAS21002_Idle() puts the sensor in Ready mode (vs Active) and then set a flag in the driver indicating it is no longer initialized. This is fine. However, there still might be data in the FIFO which will keep the interrupt from the sensor asserted (if you are using interrupts). Since the sensor has been marked as not initialized, a call to FXAS21002_Read() to empty the FIFO and clear the interrupt will return without doing anything. This will leave the interrupt hanging.
I believe the fix is to call FXAS21002_Read() in FXAS21002_Idle() after putting the sensor in Ready mode, but before setting isInitialized to 0. Because isInitialized is still true, FXAS21002_Read() will succeed, emptying the FIFO and clearing the interrupt. Since the sensor is now in Ready mode, it won't collect any more data in the FIFO either.
The diff looks something like this. The line offsets will be different since I've made other changes to the driver to enable FIFO watermark interrupts. A more complete solution will check the return status of FXAS21002_Read().