Skip to content

Commit 03ec41c

Browse files
jwrdegoedesre
authored andcommitted
power: supply: rt9467-charger: Remove "usb_type" property write support
The "usb_type" property must be read-only for charger power-supply devices, see: Documentation/ABI/testing/sysfs-class-power. But the rt9467 driver allows writing 0/1 to it to disable/enable charging. Other charger drivers use the "status" property for this and the rt9467 code also allows writing 0/1 to its "status" property and this does the exact same thing as writing 0/1 to its "usb_type" property. Drop write support for the "usb_type" property making it readonly to match the ABI documentation. If userspace wants to disable/enable charging it can use the "status" property for this. Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 83a4c42 commit 03ec41c

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

drivers/power/supply/rt9467-charger.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -745,8 +745,6 @@ static int rt9467_psy_set_property(struct power_supply *psy,
745745
RT9467_RANGE_IPREC, val->intval);
746746
case POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT:
747747
return rt9467_psy_set_ieoc(data, val->intval);
748-
case POWER_SUPPLY_PROP_USB_TYPE:
749-
return regmap_field_write(data->rm_field[F_USBCHGEN], val->intval);
750748
default:
751749
return -EINVAL;
752750
}
@@ -764,7 +762,6 @@ static int rt9467_chg_prop_is_writeable(struct power_supply *psy,
764762
case POWER_SUPPLY_PROP_INPUT_VOLTAGE_LIMIT:
765763
case POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT:
766764
case POWER_SUPPLY_PROP_PRECHARGE_CURRENT:
767-
case POWER_SUPPLY_PROP_USB_TYPE:
768765
return 1;
769766
default:
770767
return 0;

0 commit comments

Comments
 (0)