All doors lock automatically when the lock side is pressed. They unlock when the unlock side is pressed.
Driver's door

Front passenger's door

To lock all the doors from an open front door, press the lock side of the door lock switch and then close the door.
NOTE
When locking the doors this way, be careful not to leave the key inside the vehicle.
Locking, Unlocking with Transmitter
Auto Lock/Unlock FunctionMazda 6 Owners Manual: Climate control unit disassembly/assembly
1. Disassemble in the order indicated in the table.
2. Assemble in the reverse order of disassembly.
Wire Disassembly Note
Disassemble the wires in the shown in the figure.
Wire Assembly Note
Assemble the wires to the position as shown in the figure.
...
Mazda 6 Owners Manual: Front door glass removal/installation
1. Operate the front door glass so that the distance from the top of the
front door glass to the upper part of the rear beltline molding is 210 mm
{8.3 in}.
2. Disconnect the negative battery cable.
3. Remove the front door trim.
4. Remove the hole cover.
5. Remove the screws.
6. Insert ...