Re: [PATCH] usb: typec: disable pm for typec class devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2/7/2023 3:34 PM, Heikki Krogerus wrote:
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?


thanks, will try.



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.


but even in the bus, there is power management,

struct bus_type typec_bus = {
    .name = "typec",
    .dev_groups = typec_groups,
    .match = typec_match,
    .uevent = typec_uevent,
    .probe = typec_probe,
    .remove = typec_remove,
};


we can disable it, right ?



thanks,




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux