On Tue, Feb 07, 2023 at 02:42:02PM +0800, Linyu Yuan wrote: > as there is no pm operation, call device_set_pm_not_required() to disable > all typec class devices. > > Signed-off-by: Linyu Yuan <quic_linyyuan@xxxxxxxxxxx> > --- > drivers/usb/typec/class.c | 5 +++++ > drivers/usb/typec/mux.c | 2 ++ > drivers/usb/typec/pd.c | 3 +++ > drivers/usb/typec/retimer.c | 1 + > 4 files changed, 11 insertions(+) Now this is just boilerplate. Why not propose this to be done in core for every new device that doesn't have a bus, and that doesn't have the pm ops assigned in the device type? > diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c > index ed3d070..b75ec6d 100644 > --- a/drivers/usb/typec/class.c > +++ b/drivers/usb/typec/class.c > @@ -548,6 +548,7 @@ typec_register_altmode(struct device *parent, > alt->adev.dev.groups = alt->groups; > alt->adev.dev.type = &typec_altmode_dev_type; > dev_set_name(&alt->adev.dev, "%s.%u", dev_name(parent), id); > + device_set_pm_not_required(&alt->adev.dev); Note that for alt modes you can't do this. They can be bind to drivers - there is a bus for them. thanks, -- heikki