1054.5.
(a) No order requiring discovery shall be made in criminal cases except as provided in this chapter. This chapter shall be the only means by which the defendant may compel the disclosure or production of information from prosecuting attorneys, law enforcement agencies which investigated or prepared the case against the defendant, or any other persons or agencies which the prosecuting attorney or investigating agency may have employed to assist them in performing their duties.(b) Before a party may seek court enforcement of any of the disclosures required by this chapter, the party shall make an informal request of opposing counsel for the desired
materials and information. Except in a felony case in which the defendant has not waived the right to a preliminary hearing within 10 court days, if within 15 days the opposing counsel fails to provide the materials and information requested, the party may seek a court order. In a felony case in which the defendant has not waived the right to a preliminary hearing within 10 court days, if within 3 days the opposing counsel fails to provide the materials and information requested, the party may seek a court order. Upon a showing that a party has not complied with Section 1054.1 or 1054.3 and upon a showing that the moving party complied with the informal discovery procedure provided in this subdivision, a court may make any order necessary to enforce the provisions of this chapter, including, but not limited to, immediate disclosure, contempt proceedings, delaying or prohibiting the testimony of
a witness or the presentation of real evidence, continuance of the matter, or any other lawful order. Further, the court may advise the jury of any failure or refusal to disclose and of any untimely disclosure.
(c) (1) Except in a felony case in which the defendant has not waived the right to a preliminary hearing within 10 court days, the court may issue an order compelling discovery directed to any of the agencies and persons described in paragraph (a), provided the affected agency or person has received notice of the motion for an order compelling discovery at least 10 court days before the date set for hearing on the motion.
(2) In a felony case in which the defendant has not waived the right to a preliminary hearing within 10 court days, the court may issue
an order compelling discovery directed to the prosecutor, after notice of the motion presented at any time, including at the preliminary hearing. The court shall not take testimony at a preliminary hearing before hearing and deciding any outstanding motions to compel discovery.
(d) (1) In any case in which the court has issued an order compelling discovery, the court shall, upon motion of the defendant, continue the preliminary hearing until all of the court-ordered discovery has been produced to the defendant. The defendant may bring this motion to continue at any time. The defendant’s right to bring this motion is in addition to and does not vitiate the right to use any other available remedy for failure to produce court-ordered discovery. Any delay under this paragraph shall not toll the running of any statutory or
constitutional right to a speedy preliminary hearing or a speedy trial.
(2) If a continuance is requested by the prosecutor to comply with subdivision (b) of Section 1054.1 and the continuance will cause the preliminary hearing not to be held within 10 court days, and the defendant has not waived the right to a preliminary hearing within 10 court days, if the court finds good cause, the time for the preliminary hearing may be extended once for an additional five calendar days.
(3) If a continuance is requested by the prosecutor to comply with subdivision (b) of Section 1054.1 and the continuance will cause the preliminary hearing not to be held within 60 court days, and the defendant has not waived the right to a preliminary hearing within 60 court days, if the court finds
good cause, the time for the preliminary hearing may be extended once for an additional 10 calendar days.
(4) If a continuance is granted pursuant to this subdivision, the relief contained in Section 859b applies if the preliminary hearing does not commence within the timeframe approved by the court.
(5) Failure to comply with an order compelling discovery under this subdivision, by itself, shall not constitute good cause to continue a preliminary hearing beyond any time extended under this subdivision.
(e) The court may prohibit the testimony of a witness pursuant to subdivision (b) only if all other sanctions have been exhausted. The court shall not dismiss a charge pursuant to subdivision (b) unless required to do so
by the Constitution of the United States.