Company P should be able to help you defend this subpoena. If you are not
represented by Company P's lawyers, you might provide information
detrimental to Company P. Since Company P is the main target, it is typical
for Company P's lawyers to represent you and have your cooperation.
Actually, if Company A knows your subpoena, it should be more anxious than
you are and would have no problem having its lawyers represent you in this
matter.
If you may also have civil or criminal liability, you should retain your own
lawyer. If you are sure that you do not have any liability, it is not
necessary for you to hire a lawyer to move to quash the subpoena (What is
the basis? The chance to prevail on such a motion is very slim.). Moreover,
why spend money on lawyers for a matter that is of no significance to you?
Just answer as much as you can to the subpoena.
In any event, you should contact Company P ASAP.
Good luck!