From 85c675d0d09a45a135bddd15d7b385f8758c32fb Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 18 May 2024 19:35:05 +0200 Subject: Adding upstream version 6.7.7. Signed-off-by: Daniel Baumann --- drivers/usb/typec/pd.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'drivers/usb/typec/pd.c') diff --git a/drivers/usb/typec/pd.c b/drivers/usb/typec/pd.c index 8cc66e4467..85d015cdbe 100644 --- a/drivers/usb/typec/pd.c +++ b/drivers/usb/typec/pd.c @@ -83,14 +83,12 @@ unchunked_extended_messages_supported_show(struct device *dev, } static DEVICE_ATTR_RO(unchunked_extended_messages_supported); -/* - * REVISIT: Peak Current requires access also to the RDO. static ssize_t peak_current_show(struct device *dev, struct device_attribute *attr, char *buf) { - ... + return sysfs_emit(buf, "%u\n", (to_pdo(dev)->pdo >> PDO_FIXED_PEAK_CURR_SHIFT) & 3); } -*/ +static DEVICE_ATTR_RO(peak_current); static ssize_t fast_role_swap_current_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -135,7 +133,7 @@ static struct attribute *source_fixed_supply_attrs[] = { &dev_attr_usb_communication_capable.attr, &dev_attr_dual_role_data.attr, &dev_attr_unchunked_extended_messages_supported.attr, - /*&dev_attr_peak_current.attr,*/ + &dev_attr_peak_current.attr, &dev_attr_voltage.attr, &maximum_current_attr.attr, NULL @@ -144,7 +142,7 @@ static struct attribute *source_fixed_supply_attrs[] = { static umode_t fixed_attr_is_visible(struct kobject *kobj, struct attribute *attr, int n) { if (to_pdo(kobj_to_dev(kobj))->object_position && - /*attr != &dev_attr_peak_current.attr &&*/ + attr != &dev_attr_peak_current.attr && attr != &dev_attr_voltage.attr && attr != &maximum_current_attr.attr && attr != &operational_current_attr.attr) -- cgit v1.2.3