My experience with the multipurpose switches... If you go to HomeDepot to purchase a 4-wire switch. Be sure NOT to try the switch that this labeled as a "3 or 4 Wire" fan switch. This switch did not work with my fan that had a broken 4-wire switch. I had to drive back to HomeDepot and purchase the dedicated "4-wire" replacement switch. I used ddavis's posting that includes the wiring specifications for Black to L, Grey to 1, Brown to 2, and Purple to 3.
A couple notes:
Don't cut the wires when replacing the switch. Extract the wires using a paper clip to spread the contacts and remove the wire. If you cut the wires, you'll have to re-tin the ends before installing them in the new switch.
Also, don't trust the wire colors of the pigtails that connect the wires from the fan to the switch. To determine the wire color for the switch schematic, follow the pigtails to where they connect to the fan wires, and check the color of these wires.