title: Freefall and shock detection algorithm in kernel
body: <p>I am implementing a bma220 accelerometer device to detect free fall and shock.I have two confusions regarding implementing these features,</p>
  
  <p>1) For freefall interrupt, the sensor should be in 2g mode</p>
  
  <p>2) For shock interrupt, the sensor should be in 8g mode</p>
  
  <p>this is the small code I am using to write on bma220 registers</p>
  
  <pre><code>    set_bma_data(REG_GMODE, 0x00);//REG GMODE 0x22
      set_bma_data(REG_FILTER, 0x00);
      set_bma_data(EN_LOW, 0x08);//for low g interrupt or free fall detection
      set_bma_data(LOW_HY, 0XFF);
      set_bma_data(LOW_TH, 0xF0);
  </code></pre>
  
  <p>If yes how can the sensor be configured in both modes as we can configure our sensor in only one g mode?</p>