提交 ad49aee4 编写于 作者: H Hans de Goede 提交者: Chanwoo Choi

extcon: intel-cht-wc: Set direction and drv flags for V5 boost GPIO

Sometimes (firmware bug?) the V5 boost GPIO is not configured as output
by the BIOS, leading to the 5V boost convertor being permanently on,

Explicitly set the direction and drv flags rather then inheriting them
from the firmware to fix this.

Fixes: 585cb239 ("extcon: intel-cht-wc: Disable external 5v boost ...")
Cc: stable@vger.kernel.org
Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: NHans de Goede <hdegoede@redhat.com>
Signed-off-by: NChanwoo Choi <cw00.choi@samsung.com>
上级 4a3928c6
...@@ -66,6 +66,8 @@ ...@@ -66,6 +66,8 @@
#define CHT_WC_VBUS_GPIO_CTLO 0x6e2d #define CHT_WC_VBUS_GPIO_CTLO 0x6e2d
#define CHT_WC_VBUS_GPIO_CTLO_OUTPUT BIT(0) #define CHT_WC_VBUS_GPIO_CTLO_OUTPUT BIT(0)
#define CHT_WC_VBUS_GPIO_CTLO_DRV_OD BIT(4)
#define CHT_WC_VBUS_GPIO_CTLO_DIR_OUT BIT(5)
enum cht_wc_usb_id { enum cht_wc_usb_id {
USB_ID_OTG, USB_ID_OTG,
...@@ -183,14 +185,15 @@ static void cht_wc_extcon_set_5v_boost(struct cht_wc_extcon_data *ext, ...@@ -183,14 +185,15 @@ static void cht_wc_extcon_set_5v_boost(struct cht_wc_extcon_data *ext,
{ {
int ret, val; int ret, val;
val = enable ? CHT_WC_VBUS_GPIO_CTLO_OUTPUT : 0;
/* /*
* The 5V boost converter is enabled through a gpio on the PMIC, since * The 5V boost converter is enabled through a gpio on the PMIC, since
* there currently is no gpio driver we access the gpio reg directly. * there currently is no gpio driver we access the gpio reg directly.
*/ */
ret = regmap_update_bits(ext->regmap, CHT_WC_VBUS_GPIO_CTLO, val = CHT_WC_VBUS_GPIO_CTLO_DRV_OD | CHT_WC_VBUS_GPIO_CTLO_DIR_OUT;
CHT_WC_VBUS_GPIO_CTLO_OUTPUT, val); if (enable)
val |= CHT_WC_VBUS_GPIO_CTLO_OUTPUT;
ret = regmap_write(ext->regmap, CHT_WC_VBUS_GPIO_CTLO, val);
if (ret) if (ret)
dev_err(ext->dev, "Error writing Vbus GPIO CTLO: %d\n", ret); dev_err(ext->dev, "Error writing Vbus GPIO CTLO: %d\n", ret);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册