power: supply: xiaomi: Support WIRELESS_REVERSE_CLOSE

Change-Id: I1a4fe7cb54f943b778cb93fd666fe446379dd167
This commit is contained in:
Arian 2023-12-09 14:24:09 +01:00 committed by Jens Reidel
parent c875342573
commit 8b5f23c13a
No known key found for this signature in database
GPG Key ID: 23C1E5F512C12303
2 changed files with 12 additions and 0 deletions

View File

@ -833,6 +833,12 @@ config MI_WIRELESS
help
Say Y here to enable mi wireless
config WIRELESS_REVERSE_CLOSE
tristate "mi wirless reverse close config"
depends on MI_WIRELESS
help
Say Y here to disable mi wireless reverse function
config MI_PEN_WIRELESS
tristate "mi pen wirless config"
help

View File

@ -1065,6 +1065,7 @@ static ssize_t wlscharge_control_limit_show(struct class *c,
}
static CLASS_ATTR_RW(wlscharge_control_limit);
#if !defined(CONFIG_WIRELESS_REVERSE_CLOSE)
static ssize_t reverse_chg_mode_store(struct class *c,
struct class_attribute *attr,
const char *buf, size_t count)
@ -1131,6 +1132,7 @@ static ssize_t reverse_chg_state_show(struct class *c,
return scnprintf(buf, PAGE_SIZE, "%u", pst->prop[XM_PROP_REVERSE_CHG_STATE]);
}
static CLASS_ATTR_RO(reverse_chg_state);
#endif
static ssize_t rx_vout_show(struct class *c,
struct class_attribute *attr, char *buf)
@ -4765,8 +4767,10 @@ static struct attribute *xiaomi_battery_class_attrs[] = {
&class_attr_rx_cr.attr,
&class_attr_rx_cep.attr,
&class_attr_bt_state.attr,
#if !defined(CONFIG_WIRELESS_REVERSE_CLOSE)
&class_attr_reverse_chg_mode.attr,
&class_attr_reverse_chg_state.attr,
#endif
&class_attr_wireless_chip_fw.attr,
&class_attr_wls_bin.attr,
&class_attr_rx_vout.attr,
@ -5000,6 +5004,7 @@ static int add_xiaomi_uevent(struct device *dev, struct kobj_uevent_env *env)
return 0;
#if defined(CONFIG_MI_WIRELESS)
#if !defined(CONFIG_WIRELESS_REVERSE_CLOSE)
reverse_chg_state_show( &(bcdev->battery_class), NULL, prop_buf);
snprintf(uevent_string, MAX_UEVENT_LENGTH, "POWER_SUPPLY_REVERSE_CHG_STATE=%s", prop_buf);
add_uevent_var(env, uevent_string);
@ -5033,6 +5038,7 @@ static int add_xiaomi_uevent(struct device *dev, struct kobj_uevent_env *env)
reverse_chg_mode_show( &(bcdev->battery_class), NULL, prop_buf);
snprintf(uevent_string, MAX_UEVENT_LENGTH, "POWER_SUPPLY_REVERSE_CHG_MODE=%s", prop_buf);
add_uevent_var(env, uevent_string);
#endif
tx_mac_show( &(bcdev->battery_class), NULL, prop_buf);
snprintf(uevent_string, MAX_UEVENT_LENGTH, "POWER_SUPPLY_TX_MAC=%s", prop_buf);