qti_glink_charger: Add wls tx capability

To be compatible with the next generation wireless charger
Add to support ask Tx Capability from wireless charger

Change-Id: Ib137027bfd5cbe9bbd6a9f44a44cfe67bbf06bf2
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2392470
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
xuwt2 2022-09-27 16:57:02 +08:00 • committed by fancy3
commit 3c9aa14a44
2 changed files with 34 additions and 0 deletions

View file

@ -235,6 +235,7 @@ struct qti_charger {
u32 wlc_status;
u32 wlc_tx_type;
u32 wlc_tx_power;
u32 wlc_tx_capability;
bool *debug_enabled;
u32 wls_curr_max;
u32 rx_connected;
@ -1711,6 +1712,30 @@ static DEVICE_ATTR(wlc_tx_power, S_IRUGO,
wlc_tx_power_show,
NULL);
static ssize_t wlc_tx_capability_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
u32 capability = 0;
struct qti_charger *chg = this_chip;
if (!chg) {
pr_err("QTI: chip not valid\n");
return -ENODEV;
}
qti_charger_read(chg, OEM_PROP_WLS_WLC_TX_CAPABILITY,
&capability,
sizeof(capability));
chg->wlc_tx_capability = capability;
return scnprintf(buf, CHG_SHOW_MAX_SIZE, "%d\n", capability);
}
static DEVICE_ATTR(wlc_tx_capability, S_IRUGO,
wlc_tx_capability_show,
NULL);
static ssize_t rx_connected_show(struct device *dev,
struct device_attribute *attr,
char *buf)
@ -2106,6 +2131,11 @@ static void wireless_psy_init(struct qti_charger *chg)
if (rc)
pr_err("couldn't create wireless wlc tx power capacity error\n");
rc = device_create_file(chg->wls_psy->dev.parent,
&dev_attr_wlc_tx_capability);
if (rc)
pr_err("couldn't create wireless wlc tx capability error\n");
rc = device_create_file(chg->wls_psy->dev.parent,
&dev_attr_wlc_st_changed);
if (rc)
@ -2149,6 +2179,9 @@ static void wireless_psy_deinit(struct qti_charger *chg)
device_remove_file(chg->wls_psy->dev.parent,
&dev_attr_wlc_tx_power);
device_remove_file(chg->wls_psy->dev.parent,
&dev_attr_wlc_tx_capability);
device_remove_file(chg->wls_psy->dev.parent,
&dev_attr_wlc_st_changed);

View file

@ -65,6 +65,7 @@ enum oem_property_type {
OEM_PROP_WLS_WLC_TX_POWER,
OEM_PROP_SKU_TYPE,
OEM_PROP_HW_REVISION,
OEM_PROP_WLS_WLC_TX_CAPABILITY,
OEM_PROP_MAX,
};