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

Commit 31e00fd1 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Felipe Balbi
Browse files

usb: renesas_usbhs: disable attch irq after device attached



attch interrupt might happen infinitely on some USB hub (self power?).
This patch disable attch irq after device attached,
and enable it again when detach irq happen.

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 3edeee38
Loading
Loading
Loading
Loading
+14 −0
Original line number Original line Diff line number Diff line
@@ -1245,6 +1245,14 @@ static int usbhsh_irq_attch(struct usbhs_priv *priv,
	usbhsh_port_stat_set(hpriv, USB_PORT_STAT_CONNECTION);
	usbhsh_port_stat_set(hpriv, USB_PORT_STAT_CONNECTION);
	usbhsh_port_stat_set(hpriv, USB_PORT_STAT_C_CONNECTION << 16);
	usbhsh_port_stat_set(hpriv, USB_PORT_STAT_C_CONNECTION << 16);


	/*
	 * attch interrupt might happen infinitely on some device
	 * (on self power USB hub ?)
	 * disable it here.
	 */
	hpriv->mod.irq_attch = NULL;
	usbhs_irq_callback_update(priv, &hpriv->mod);

	return 0;
	return 0;
}
}


@@ -1259,6 +1267,12 @@ static int usbhsh_irq_dtch(struct usbhs_priv *priv,
	usbhsh_port_stat_clear(hpriv, USB_PORT_STAT_CONNECTION);
	usbhsh_port_stat_clear(hpriv, USB_PORT_STAT_CONNECTION);
	usbhsh_port_stat_set(hpriv, USB_PORT_STAT_C_CONNECTION << 16);
	usbhsh_port_stat_set(hpriv, USB_PORT_STAT_C_CONNECTION << 16);


	/*
	 * enable attch interrupt again
	 */
	hpriv->mod.irq_attch = usbhsh_irq_attch;
	usbhs_irq_callback_update(priv, &hpriv->mod);

	return 0;
	return 0;
}
}