Commit b910a9ce authored by Hans de Goede's avatar Hans de Goede Committed by Sebastian Reichel

extcon: intel-cht-wc: Use new cht_wc_model intel_soc_pmic field

The CHT_WC_VBUS_GPIO_CTLO GPIO actually driving an external 5V Vboost
converter for Vbus depends on the board on which the Cherry Trail -
Whiskey Cove PMIC is actually used.

Since the information about the exact PMIC setup is necessary in other
places too, struct intel_soc_pmic now has a new cht_wc_model field
indicating the board model.

Only poke the CHT_WC_VBUS_GPIO_CTLO GPIO if this new field is set to
INTEL_CHT_WC_GPD_WIN_POCKET, which indicates the Type-C (with PD and
DP-altmode) setup used on the GPD pocket and GPD win; and on which
this GPIO actually controls an external 5V Vboost converter.
Acked-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 4b326491
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/mod_devicetable.h> #include <linux/mod_devicetable.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -358,6 +359,8 @@ static int cht_wc_extcon_probe(struct platform_device *pdev) ...@@ -358,6 +359,8 @@ static int cht_wc_extcon_probe(struct platform_device *pdev)
if (IS_ERR(ext->edev)) if (IS_ERR(ext->edev))
return PTR_ERR(ext->edev); return PTR_ERR(ext->edev);
switch (pmic->cht_wc_model) {
case INTEL_CHT_WC_GPD_WIN_POCKET:
/* /*
* When a host-cable is detected the BIOS enables an external 5v boost * When a host-cable is detected the BIOS enables an external 5v boost
* converter to power connected devices there are 2 problems with this: * converter to power connected devices there are 2 problems with this:
...@@ -372,6 +375,10 @@ static int cht_wc_extcon_probe(struct platform_device *pdev) ...@@ -372,6 +375,10 @@ static int cht_wc_extcon_probe(struct platform_device *pdev)
* external 5v boost converter off and leave it off entirely. * external 5v boost converter off and leave it off entirely.
*/ */
cht_wc_extcon_set_5v_boost(ext, false); cht_wc_extcon_set_5v_boost(ext, false);
break;
default:
break;
}
/* Enable sw control */ /* Enable sw control */
ret = cht_wc_extcon_sw_control(ext, true); ret = cht_wc_extcon_sw_control(ext, true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment