Bill Cosby's deposition on sex, drugs OK for criminal case, judge says