The DR40 has switchable mic or line in on the XLR and TRS inputs, but phantom power is on the XLRs only.
You can feed balanced or un-balanced into the TRS connector, but I have found that connecting a dynamic mic via an un-balanced cable into the TRS, produces a low level of digital noise on the recording. Using a balanced XLR cable it is fine.