Both are passive and both are idiomatic. The version with the gerund-participle is what Huddleston & Pullum (2002) call a concealed passive construction and the version with the infinitive an ordinary passive construction:
With a small number of catenative verbs, notably need, require, deserve and want, a gerund-participial may be passive while lacking the usual marking of the passive — we refer to this as a concealed passive construction.
i The house needs to be painted. [ordinary passive]
ii. The house needs painting. [concealed passive]
The catenative complement in [i] is overtly marked as a passive by the auxiliary be and the past participle form painted ... while [that] in [ii] lacks such marking although [it is] interpreted in the same way. (p. 1199-1200)
Note also that the version with the gerund-participle can freely take a by-phrase complement as in "the carpet needs cleaning by you".