The guarante for electrical mirror was only for 1 year or 20000km.According to this Aliexpress offer it might be the 30 teeth gear:
"€ 4,96 | 1 piece 30 teeth car motor Automatic folding Rearview mirror Metal gear for 2013 year Mazda M6 M3 atlas CX-5 CX-7 car"
But don't you have a guarantee? If so, let the dealer fix it for free...
But yesterday I already corrected this problem by my self.
In an all pages that I found say that the problem begins when some one move the mirrors by his hands (breaking the gear inside of the motor mechanism) but:
I remove the mirror,
I remove the crystal,
I remove the back colored cover,
I remove the main metal support,
And finally I remove the mirror motor mechanism them:
I opened this mechanism looking for this special gear and I can see this gear in a perfect state!!!! After that I clean of gears and parts replacing old grace them I changing for a new one and finally resolved the problem.
Please note that my Mz6 is 2018 with 20500km. Is clear for me that is a factory problem.