mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: Stephan Gerhold <stephan@gerhold.net>,
	MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] extcon: sm5502: Reset registers during initialization
Date: Fri, 11 Oct 2019 10:44:34 +0900	[thread overview]
Message-ID: <7432858f-3a22-b7f6-ec02-4e44dc9e71b5@samsung.com> (raw)
In-Reply-To: <20191010154720.52330-1-stephan@gerhold.net>

On 19. 10. 11. 오전 12:47, Stephan Gerhold wrote:
> On some devices (e.g. Samsung Galaxy A5 (2015)), the bootloader
> seems to keep interrupts enabled for SM5502 when booting Linux.
> Changing the cable state (i.e. plugging in a cable) - until the driver
> is loaded - will therefore produce an interrupt that is never read.
> 
> In this situation, the cable state will be stuck forever on the
> initial state because SM5502 stops sending interrupts.
> This can be avoided by clearing those pending interrupts after
> the driver has been loaded.
> 
> One way to do this is to reset all registers to default state
> by writing to SM5502_REG_RESET. This ensures that we start from
> a clean state, with all interrupts disabled.
> 
> Suggested-by: Chanwoo Choi <cw00.choi@samsung.com>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
>  drivers/extcon/extcon-sm5502.c | 4 ++++
>  drivers/extcon/extcon-sm5502.h | 2 ++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/drivers/extcon/extcon-sm5502.c b/drivers/extcon/extcon-sm5502.c
> index dc43847ad2b0..b3d93baf4fc5 100644
> --- a/drivers/extcon/extcon-sm5502.c
> +++ b/drivers/extcon/extcon-sm5502.c
> @@ -65,6 +65,10 @@ struct sm5502_muic_info {
>  /* Default value of SM5502 register to bring up MUIC device. */
>  static struct reg_data sm5502_reg_data[] = {
>  	{
> +		.reg = SM5502_REG_RESET,
> +		.val = SM5502_REG_RESET_MASK,
> +		.invert = true,
> +	}, {
>  		.reg = SM5502_REG_CONTROL,
>  		.val = SM5502_REG_CONTROL_MASK_INT_MASK,
>  		.invert = false,
> diff --git a/drivers/extcon/extcon-sm5502.h b/drivers/extcon/extcon-sm5502.h
> index 9dbb634d213b..ce1f1ec310c4 100644
> --- a/drivers/extcon/extcon-sm5502.h
> +++ b/drivers/extcon/extcon-sm5502.h
> @@ -237,6 +237,8 @@ enum sm5502_reg {
>  #define DM_DP_SWITCH_UART			((DM_DP_CON_SWITCH_UART <<SM5502_REG_MANUAL_SW1_DP_SHIFT) \
>  						| (DM_DP_CON_SWITCH_UART <<SM5502_REG_MANUAL_SW1_DM_SHIFT))
>  
> +#define SM5502_REG_RESET_MASK			(0x1)
> +
>  /* SM5502 Interrupts */
>  enum sm5502_irq {
>  	/* INT1 */
> 

Applied it. Thanks.

When you send the patch on later, you better to specify the version
on patch title as following:
	[PATCH v2] extcon: sm5502: Reset registers during initialization

-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

      reply	other threads:[~2019-10-11  1:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20191010154845epcas4p2c3aa5f0afd9fad05c0ab88d99792415a@epcas4p2.samsung.com>
2019-10-10 15:47 ` Stephan Gerhold
2019-10-11  1:44   ` 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=7432858f-3a22-b7f6-ec02-4e44dc9e71b5@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=stephan@gerhold.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®