Codeine itself has low affinity for opioid receptors.  However, 10% of codeine is metabolised by the liver enzyme CYP2D6 to morphine, and morphine is responsible for the analgesic effect with morphine.

Polymorphisms in CYP2D6
lead to an inability to make morphine from codeine, and these polymorphisms affect 10% of Caucasians.  This 10% of Caucasians have an inadequate analgesia response to codeine.

Codeine is considered to be a weak opioid, and is used on the second step in the treatment of pain (Figure 20.8).
  It is used in mild-to-moderate pain.  Codeine is sometimes used in combination with the Non-Steroidal Anti-Inflammatory Drugs (NSAIDs) e.g. paracetamol.

Another use of codeine is as an anti-tussive (in cough).  The mechanism underlying this beneficial effect of codeine in cough is unknown but is unlikely to involve
μ-receptors, as it is not a property observed with the other μ-receptor agonists.