auto up-down may need to be recalibrated if battery is disconnected. The owners manul shows how to do it.
Found this in a Mazda forum.
Power window system initialization procedure
If the battery was disconnected during vehicle maintenance, or for other reasons (such as a switch continues to be operated after the window is fully open/closed), the window will not fully open and close automatically.
Resetting of the automatic function can be performed using the master control switches or each passenger door switch.
The power window auto function reset procedure can be done on all door switches. The power window auto function will only resume on the power window that has been reset.
Switch the ignition ON.
Make sure that the power window lock switch located on the driver's door is not depressed.
Press the switch and fully open the window.
Pull up the switch to fully close the window and continue holding the switch for about 2 seconds after the window fully closed.
Repeat Steps 3-4 for the front passenger power window while seated in the front passenger seat.
Repeat Steps 3-4 for both the left and right rear power windows while seated in the rear seat.
Make sure that the power windows operate correctly using the door switches.
After the system has been re-initialized, each passenger window can be fully opened or closed automatically using the master control switches.