Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fa32154e authored by Eric Millbrandt's avatar Eric Millbrandt Committed by Grant Likely
Browse files

powerpc/5200: tighten up ac97 reset timing



Tighten up time timing around the gpio reset functionality.  Add a 200ns
delay before remuxing the pins back to ac97 to comply with the ac97 spec.

Signed-off-by: default avatarEric Millbrandt <emillbrandt@dekaresearch.com>
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent 915b9619
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -325,12 +325,16 @@ int mpc5200_psc_ac97_gpio_reset(int psc_number)
	clrbits32(&simple_gpio->simple_dvo, sync | out);
	clrbits32(&simple_gpio->simple_dvo, sync | out);
	clrbits8(&wkup_gpio->wkup_dvo, reset);
	clrbits8(&wkup_gpio->wkup_dvo, reset);


	/* wait at lease 1 us */
	/* wait for 1 us */
	udelay(2);
	udelay(1);


	/* Deassert reset */
	/* Deassert reset */
	setbits8(&wkup_gpio->wkup_dvo, reset);
	setbits8(&wkup_gpio->wkup_dvo, reset);


	/* wait at least 200ns */
	/* 7 ~= (200ns * timebase) / ns2sec */
	__delay(7);

	/* Restore pin-muxing */
	/* Restore pin-muxing */
	out_be32(&simple_gpio->port_config, mux);
	out_be32(&simple_gpio->port_config, mux);