All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: Hans de Goede <hdegoede@redhat.com>,
	MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v2] extcon: intel-cht-wc: Also set direction and drv flags for V5 boost GPIO
Date: Tue, 20 Feb 2018 08:35:57 +0900	[thread overview]
Message-ID: <5A8B5F5D.8090208@samsung.com> (raw)
In-Reply-To: <20180219132046.13450-1-hdegoede@redhat.com>

Hi,

On 2018년 02월 19일 22:20, Hans de Goede wrote:
> 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: 585cb239f4de ("extcon: intel-cht-wc: Disable external 5v boost ...")
> Cc: stable@vger.kernel.org
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> Changes in v2:
> -Add Fixes tag and Cc: stable
> ---
>  drivers/extcon/extcon-intel-cht-wc.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/extcon/extcon-intel-cht-wc.c b/drivers/extcon/extcon-intel-cht-wc.c
> index 7c4bc8c44c3f..b7e9ea377d70 100644
> --- a/drivers/extcon/extcon-intel-cht-wc.c
> +++ b/drivers/extcon/extcon-intel-cht-wc.c
> @@ -66,6 +66,8 @@
>  
>  #define CHT_WC_VBUS_GPIO_CTLO		0x6e2d
>  #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 {
>  	USB_ID_OTG,
> @@ -183,14 +185,15 @@ static void cht_wc_extcon_set_5v_boost(struct cht_wc_extcon_data *ext,
>  {
>  	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
>  	 * there currently is no gpio driver we access the gpio reg directly.
>  	 */
> -	ret = regmap_update_bits(ext->regmap, CHT_WC_VBUS_GPIO_CTLO,
> -				 CHT_WC_VBUS_GPIO_CTLO_OUTPUT, val);
> +	val = CHT_WC_VBUS_GPIO_CTLO_DRV_OD | CHT_WC_VBUS_GPIO_CTLO_DIR_OUT;
> +	if (enable)
> +		val |= CHT_WC_VBUS_GPIO_CTLO_OUTPUT;
> +
> +	ret = regmap_write(ext->regmap, CHT_WC_VBUS_GPIO_CTLO, val);
>  	if (ret)
>  		dev_err(ext->dev, "Error writing Vbus GPIO CTLO: %d\n", ret);
>  }
> 

Applied it to extcon-fixes branch.

-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

      reply	other threads:[~2018-02-19 23:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180219132056epcas4p3e883323c9a91d1039dedd8a98806e85e@epcas4p3.samsung.com>
2018-02-19 13:20 ` [PATCH v2] extcon: intel-cht-wc: Also set direction and drv flags for V5 boost GPIO Hans de Goede
2018-02-19 23:35   ` Chanwoo Choi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5A8B5F5D.8090208@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.