Output from headphone plug to input into iPhone plug

Hello - I am building an iPhone multi-track recording app and had a question:

1. I want to be able to output from my mac/pc let's say a keyboard playing via the headphone port
2. I want to be able to input into my iphone via the headphone port
3. A stereo cable has two outputs (the two lines going around the tip)
4. An iPhone headset has three lines (I assume 1 is for the microphone)

Question: Is it possible to take a stereo cable (two lines), outputting from the pc/mac and plugged into an iphone, for the phone to receive the audio, or does the phone require a cable that will have the audio come in from the microphone channel?

Hope I explained the problem correctly. I am trying to see if the problem can be resolved programatically, or if there is a hardware limitation.photo (1).jpg