Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: renesas_usbhs: Assert/de-assert reset signals on suspend/resume

The Renesas RZ/G3S SoC supports a power-saving mode in which power to most
SoC components is turned off, including the USB subsystem.

To properly restore from such a state, the reset signal needs to be
asserted/de-asserted during suspend/resume. Add reset assert/de-assert on
suspend/resume.

The resume code has been moved into a separate function to allow reusing
it in case reset_control_assert() from suspend fails.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20251106143625.3050119-5-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Claudiu Beznea and committed by
Greg Kroah-Hartman
3578b1cd e4d9da32

+34 -17
+34 -17
drivers/usb/renesas_usbhs/common.c
··· 827 827 usbhs_pipe_remove(priv); 828 828 } 829 829 830 - static int usbhsc_suspend(struct device *dev) 831 - { 832 - struct usbhs_priv *priv = dev_get_drvdata(dev); 833 - struct usbhs_mod *mod = usbhs_mod_get_current(priv); 834 - 835 - if (mod) { 836 - usbhs_mod_call(priv, stop, priv); 837 - usbhs_mod_change(priv, -1); 838 - } 839 - 840 - if (mod || !usbhs_get_dparam(priv, runtime_pwctrl)) 841 - usbhsc_power_ctrl(priv, 0); 842 - 843 - return 0; 844 - } 845 - 846 - static int usbhsc_resume(struct device *dev) 830 + static void usbhsc_restore(struct device *dev) 847 831 { 848 832 struct usbhs_priv *priv = dev_get_drvdata(dev); 849 833 struct platform_device *pdev = usbhs_priv_to_pdev(priv); ··· 840 856 usbhs_platform_call(priv, phy_reset, pdev); 841 857 842 858 usbhsc_schedule_notify_hotplug(pdev); 859 + } 860 + 861 + static int usbhsc_suspend(struct device *dev) 862 + { 863 + struct usbhs_priv *priv = dev_get_drvdata(dev); 864 + struct usbhs_mod *mod = usbhs_mod_get_current(priv); 865 + int ret; 866 + 867 + if (mod) { 868 + usbhs_mod_call(priv, stop, priv); 869 + usbhs_mod_change(priv, -1); 870 + } 871 + 872 + if (mod || !usbhs_get_dparam(priv, runtime_pwctrl)) 873 + usbhsc_power_ctrl(priv, 0); 874 + 875 + ret = reset_control_assert(priv->rsts); 876 + if (ret) 877 + usbhsc_restore(dev); 878 + 879 + return ret; 880 + } 881 + 882 + static int usbhsc_resume(struct device *dev) 883 + { 884 + struct usbhs_priv *priv = dev_get_drvdata(dev); 885 + int ret; 886 + 887 + ret = reset_control_deassert(priv->rsts); 888 + if (ret) 889 + return ret; 890 + 891 + usbhsc_restore(dev); 843 892 844 893 return 0; 845 894 }