mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 14:19:09 -04:00
enable elna in fmradio TCMD test
RF team add one elna for signal losing issue in sofia/Sofia_plus, we need to enable it before TCMD test, otherwise will get wrong RSSI. Change-Id: I0ac4d1f13fe4da7cbde14c331c4cd57eafad5b97 Reviewed-on: https://gerrit.mot.com/1382284 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Qiu Feng <fengqiu1@lenovo.com> Reviewed-by: Yuecai Liu <liuyc20@motorola.com> Reviewed-by: Tao Sun <suntao2@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
bc5a38e302
commit
dbaf6b20d1
1 changed files with 26 additions and 0 deletions
|
|
@ -23,6 +23,7 @@
|
|||
#include <linux/delay.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/of.h>
|
||||
|
||||
#define DRIVER_VERSION "0.0.1"
|
||||
|
||||
|
|
@ -32,8 +33,23 @@ struct fm_ctrl_drvdata {
|
|||
struct pinctrl_state *pstate_default;
|
||||
struct pinctrl_state *pstate_active;
|
||||
struct pinctrl_state *pstate_suspend;
|
||||
bool factory_mode;
|
||||
};
|
||||
|
||||
|
||||
static bool mmi_factory_check(void)
|
||||
{
|
||||
struct device_node *np = of_find_node_by_path("/chosen");
|
||||
bool factory = false;
|
||||
|
||||
if (np)
|
||||
factory = of_property_read_bool(np, "mmi,factory-cable");
|
||||
|
||||
of_node_put(np);
|
||||
|
||||
return factory;
|
||||
}
|
||||
|
||||
static ssize_t device_name_read(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
|
|
@ -155,6 +171,16 @@ static int fm_ctrl_probe(struct platform_device *pdev)
|
|||
pr_err("Can not lookup suspend pinstate %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
drvdata->factory_mode = mmi_factory_check();
|
||||
if(drvdata->factory_mode) {
|
||||
ret = pinctrl_select_state(drvdata->pinctrl, drvdata->pstate_active);
|
||||
if(ret) {
|
||||
pr_err("fm_ctrl failed to set pinctrl @factory mode!\n");
|
||||
}
|
||||
else {
|
||||
pr_info("fm_ctrl enable elan @ factory mode\n");
|
||||
}
|
||||
}
|
||||
|
||||
ret = sysfs_create_group(&dev->kobj, &fm_ctrl_sysfs_attr_grp);
|
||||
if (ret) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue