int enable_dmp_features(int en)
{
    int res= -1;

    if (dmp_fw_loaded()) {
        /* Currently there's no info regarding DMP's supported features/capabilities
           An error in enabling features below could be an indication of the feature
           not supported in current loaded DMP firmware */

        if (write_sysfs_int(mpu.enable, 0) < 0) {
            printf("GT:ERR-can't write 'buffer/enable'");
            return -1;
        }

        enable_tap(en);
        enable_display_orientation(en);
        //enable_orientation(en); // not available

        res= 0;

        if (write_sysfs_int(mpu.enable, 1) < 0) {
            printf("GT:ERR-can't write 'buffer/enable'");
            return -1;
        }
    } else {
        printf("GT:ERR-No DMP firmware\n");
        res= -1;
    }

    return res;
}
int enableDMPFeatures(int en)
{
    int res= -1;

    if (DmpFWloaded())
    {
        /* Currently there's no info regarding DMP's supported features/capabilities */
        /* An error in enabling features below could be an indication of the feature */
        /* not supported in current loaded DMP firmware */

        enable_flick(en);
        enable_tap(en);
        enable_displ_orient(en);
        enable_orient(en);
        res= 0;
    }

    return res;
}