The Dark Knight star, who played a mentally-challenged sadomasochist in Secretary and a vibrator pioneer in Hysteria, has signed on to director David Simon's upcoming HBO drama about the rise of the porn industry in New York City.

In The Deuce, Gyllenhaal will play a Times Square prostitute called Candy.

The actress will also produce the project, alongside James Franco, who will portray twin porn kingpins.

Filming is scheduled to begin next month (Oct15).