If the bathroom socket loses power when you do then your work is almost done. The gfci receptacle would be wired the same as it is now and the switch would be on the switch loop.
Another way to do it would be to run a switch loop from the lighting fixture down into the 2 gang.
Gfci and switch in same box.
In this special case wiring diagram both light and ordinary outlet is connected to the load terminals of gfci. Wiring a gfci combo switch outlet with protected light outlet receptacle. Take the white wire from the switch wire and terminate that to the siver terminal on the line side of the gfci. The stickers come in boxes with gfci devices and are also sold separately. One plan is to pigtail the switch and gfci outlet onto the supply line and then take the output of the switch out of the box up to the vanity light. This way both loads i e.
You would need to test further at that point. It s unlikely the current box for the switch is anywhere near large enough so you ll have to replace it with the deepest 2 gang box available. This method of wiring gfci outlets is described in detail complete with photos in the gfci outlet area of this website. If you establish that the bathroom or other plain outlets are downstream of another gfci device that outlet needs a sticker that says gfci protected. Multiple gfci outlets may be wired on the same circuit in such a way as you have described to protect each individual gfci outlet therefore in the event of a ground fault occurrence at one outlet the other gfci outlet locations will not be affected as well as other devices that are wired on the same circuit. This diagram illustrates wiring a gfci receptacle and light switch in the same outlet box a common arrangement in a bathroom with limited space.
The light and switch are not protected by the gfci receptacle. The light on off operation can be controlled through the gfci switch while the ordinary outlet is directly connected to the gfci load terminals. Light bulb and outlet and additional load connected to the ordinary load is gfci protected. Run a black jumper wire from the line side of the gfci and terminate that to the bottom terminal of the switch. This wiring provides single location gfci protection. Take the black wire from the light and terminate that to the top terminal of the switch.
The neutral and ground wires are spliced together and run to each device in the circuit. The neutral is spliced with a pigtail to the gfci and the white wire running to the light. This diagram illustrates wiring a gfci receptacle and light switch in the same outlet box a common arrangement in a bathroom with limited space. The light and switch are not protected by the gfci receptacle. The hot source is spliced with a pigtail to the line terminal on the receptacle and to on terminal on the light switch. Turn the circuit back on and use test to trip that gfci.
This wiring provides single location gfci protection. In answer to your question yes it s basically legal to put a switch in the same box as a receptacle but your problem is going to be the fill space of the box. The hot source is spliced to the line terminal on the receptacle and to one terminal on the light switch.