The PS3 version of Portal 2 comes with a code to link it to a Steam account. Apparently this allows you to play on both the PC and PS3 with one purchase.
Can this be used to play co-op between the two platforms?
According to EA, you can play Portal 2 Co-op cross-platform between the PS3 and PC versions.
However, I would assume the PS3 functions just like another PC with Steam, where you can't be logged in and online at two places at once (kicking one client off). If that holds, you would be unable to play co-op with yourself (your own account) if one's on a PC and the other on PS3.
I found the following on the Portal 2 and Steam on PlayStation®3 Support page.
Can two players play online co-op with each other using a single purchase of Portal 2 for PlayStation®3?
Only PlayStation®3 split-screen co-op can be played using a single copy of the game. When you purchase a new copy of Portal 2 for PlayStation®3, you will receive an in-box code which provides your linked Steam account with access to your copy of Portal 2 on your computer. The game is still owned by only a single Steam account--another copy will be required to play online co-op with a friend.
Yes, PS3 players can play co-op with PC players, but each person needs their own copy of the game. When the code that comes with the PS3 version is added to a Steam account, it ties the Steam account and your PSN account together and unlocks Portal 2 PC.
There's nothing stopping you from giving the code to a friend so they can play it on their PC. You'll have to set up a dummy PSN account on your PS3 for them (or their existing PSN account), start the game, and link their Steam account with the PSN account. However, this means you won't have access to Portal 2 PC on your own Steam account.