factory: Add tx_mode_vout for factory testing

Add factory testing
Read vout of Tx mode

Change-Id: If33a0f3885b2b12ec6ab344f86593e0158eb4d45
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2284794
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Haichao Li <liuhc3@motorola.com>
Reviewed-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
xuwt2 2022-05-31 14:50:39 +08:00 • committed by Wentao Xu
commit 949e1838bc

View file

@ -1517,6 +1517,30 @@ static ssize_t tx_mode_show(struct device *dev,
}
static DEVICE_ATTR(tx_mode, S_IRUGO|S_IWUSR, tx_mode_show, tx_mode_store);
static ssize_t tx_mode_vout_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct qti_charger *chg = this_chip;
struct wls_dump wls_info;
u32 tx_vout = 0;
if (!chg) {
pr_err("QTI: chip not valid\n");
return -ENODEV;
}
qti_charger_read(chg, OEM_PROP_WLS_DUMP_INFO,
&wls_info,
sizeof(struct wls_dump));
tx_vout = wls_info.tx_vrect_mv;
return scnprintf(buf, CHG_SHOW_MAX_SIZE, "%d\n", tx_vout);
}
static DEVICE_ATTR(tx_mode_vout, S_IRUGO,
tx_mode_vout_show,
NULL);
static ssize_t wlc_light_ctl_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
@ -2008,6 +2032,11 @@ static void wireless_psy_init(struct qti_charger *chg)
if (rc)
pr_err("couldn't create wireless tx mode\n");
rc = device_create_file(chg->wls_psy->dev.parent,
&dev_attr_tx_mode_vout);
if (rc)
pr_err("couldn't create wireless tx mode vout\n");
rc = device_create_file(chg->wls_psy->dev.parent,
&dev_attr_rx_connected);
if (rc)
@ -2062,6 +2091,9 @@ static void wireless_psy_deinit(struct qti_charger *chg)
device_remove_file(chg->wls_psy->dev.parent,
&dev_attr_tx_mode);
device_remove_file(chg->wls_psy->dev.parent,
&dev_attr_tx_mode_vout);
device_remove_file(chg->wls_psy->dev.parent,
&dev_attr_rx_connected);