David E. Kelley is teaming with Robin Williams for a single-cam comedy from 20th Century Fox TV that is in the process of landing with a big commitment CBS.

Script dubbed “The Crazy Ones,” which Kelley wrote on spec, revolves around Williams playing a renowned advertising exec. Bill D’Elia, a longtime Kelley collaborator, is on board to exec produce with Kelley and Williams.

If deal comes together, “Crazy Ones” would mark Williams’ first stab at series TV since he became a star on the 1978-82 sitcom “Mork and Mindy.”

Kelley in May earned a series pickup from TNT for a medical drama “Monday Mornings,” though the timetable for the show’s preem remains unclear.

Kelley is the rare heavy-hitter showrunner who is a free agent without an overall studio pact after allowing his most recent Warner Bros. deal to expire in May. He had a 22-year run at 20th TV before shifting to the Warner Bros. lot in 2008, so the Williams project marks a reunion of for the showrunner and the studio.

Kelley and Williams are repped by WME.