1. Disconnect the negative battery cable..
2. Remove the front map light..
3. Verify that the continuity between the sunroof switch terminals is as indicated in the table.

If not as indicated in the table, replace the sunroof switch.

Sunroof Switch Removal/InstallationForced Ignition On
NOTE:
In order to perform a forced ignition ON, the M-MDS is necessary. If the
servicing is being done outside of an Authorized Mazda dealership, contact an
Authorized Mazda dealership for instructions.
The forced ignition ON procedure forces a power supply to each part when
...
Negative Battery Cable Disconnection/Connection [Skyactiv G 2.0]
WARNING:
Before removing the SRS air bag system-related parts, always disconnect the
negative battery cable and wait for 1 min. or more to allow the back-up power
supply to deplete its stored power..
Required procedure after negative battery cable disconnection/connection
...
Power Window Regulator
Purpose
The power window regulator moves the carrier plate up and down to open/close
the door glass using the rotation force transmitted from the power window motor.
Function
The power window regulator transmits the rotation force from the power window
motor to the inner wi ...