Yes, you can use the same switch to wakeup your device from hibernate as well as a gpio for the motor, but you need to alter the functionalities dynamically.
To switch between the two functionalities you need to use the HSIOM. Please use this KBA for reference: Controlling UART Tx and Rx Pins through Firmware for PSoC 4 Devices - KBA 224950
In the device datasheet you can find the alternate functionalities for the pin. Use the Architecture TRM and Register TRM for more details as well.
Please let me know which device you are referring to, I can provide specific pointers. Please attach your project as well so that I can more insights into what's going wrong.