@@ -1823,6 +1823,15 @@ static int dualshock4_get_calibration_data(struct sony_sc *sc)
acc_z_plus = get_unaligned_le16(&buf[31]);
acc_z_minus = get_unaligned_le16(&buf[33]);
+ if (gyro_pitch_plus == gyro_pitch_minus)
+ gyro_pitch_minus *= -1;
+
+ if (gyro_yaw_plus == gyro_yaw_minus)
+ gyro_yaw_minus *= -1;
+
+ if (gyro_roll_plus == gyro_roll_minus)
+ gyro_roll_minus *= -1;
+
/* Set gyroscope calibration and normalization parameters.
* Data values will be normalized to 1/DS4_GYRO_RES_PER_DEG_S degree/s.
*/