From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
To: Chanwoo Choi <cw00.choi@samsung.com>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>,
Samuel Ortiz <sameo@linux.intel.com>,
Lee Jones <lee.jones@linaro.org>,
linux-kernel@vger.kernel.org,
Kyungmin Park <kyungmin.park@samsung.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
stable@vger.kernel.org
Subject: Re: [PATCH fixes 2/2] extcon: max77693: Fix always masked MUIC interrupts
Date: Fri, 10 Oct 2014 12:10:50 +0200 [thread overview]
Message-ID: <1412935850.4143.4.camel@AMDC1943> (raw)
In-Reply-To: <5437AF78.3060602@samsung.com>
On pią, 2014-10-10 at 19:05 +0900, Chanwoo Choi wrote:
> On 10/10/2014 06:03 PM, Krzysztof Kozlowski wrote:
> > On pią, 2014-10-10 at 17:45 +0900, Chanwoo Choi wrote:
> >> On 10/10/2014 05:22 PM, Krzysztof Kozlowski wrote:
> >>> All interrupts coming from MUIC were ignored because interrupt source
> >>> register was masked.
> >>>
> >>> The Maxim 77693 has a "interrupt source" - a separate register and interrupts
> >>> which give information about PMIC block triggering the individual
> >>> interrupt (charger, topsys, MUIC, flash LED).
> >>>
> >>> By default bootloader could initialize this register to "mask all"
> >>> value. In such case (observed on Trats2 board) MUIC interrupts won't be
> >>> generated regardless of their mask status. Regmap irq chip was unmasking
> >>> individual MUIC interrupts but the source was masked
> >>>
> >>> Before introducing regmap irq chip this interrupt source was unmasked,
> >>> read and acked. Reading and acking is not necessary but unmasking is. Do
> >>> it in extcon driver.
> >>>
> >>> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> >>> Cc: <stable@vger.kernel.org>
> >>> Fixes: 342d669c1ee4 ("mfd: max77693: Handle IRQs using regmap")
> >>> ---
> >>> drivers/extcon/extcon-max77693.c | 16 ++++++++++++++++
> >>> include/linux/mfd/max77693-private.h | 5 +++++
> >>> 2 files changed, 21 insertions(+)
> >>>
> >>> diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
> >>> index 490e27475bac..d3adacf3187f 100644
> >>> --- a/drivers/extcon/extcon-max77693.c
> >>> +++ b/drivers/extcon/extcon-max77693.c
> >>> @@ -1176,6 +1176,22 @@ static int max77693_muic_probe(struct platform_device *pdev)
> >>> }
> >>> }
> >>>
> >>> + if (i) {
> >>> + /*
> >>> + * i>0, at least one MUIC interrupt requested so need to unmask
> >>> + * MUIC interrupt in INTSRC register. Without that MUIC
> >>> + * interrupts will not be reported.
> >>> + */
> >>> + ret = regmap_update_bits(max77693->regmap,
> >>> + MAX77693_PMIC_REG_INTSRC_MASK, SRC_IRQ_MUIC,
> >>> + ~SRC_IRQ_MUIC);
> >>> + if (ret < 0) {
> >>> + dev_err(&pdev->dev, "Could not unmask MUIC interrupt in INTSRC: %d\n",
> >>> + ret);
> >>> + return ret;
> >>> + }
> >>> + }
> >>> +
> >>
> >> No,
> >> The extcon-max77693 driver cannot enable IRQ_CHARGER/TOP/FLASH
> >> because MAX77693_PMIC_REG_INTSRC_MASK register is common register of MAX77693.
> >>
> >> The IRQ_CHARGER/TOP/FLASH of MAX77693_PMIC_REG_INTSRC_MASK register should be enabled
> >> in drivers/mfd/max77693.c.
> >
> > The code above unmasks only SRC_IRQ_MUIC. Other bits are not touched.
> > Why do you think that other IRQs will be enabled?
>
> I think that MAX77693_PMIC_REG_INTSRC_MASK common register better to be controlled
> in drivers/mfd/max77693.c. I prefer that MAX77693 extcon driver would read/write only MUIC registers.
>
> Also, MAX77693 extcon driver have to be always unmasked.
> If IRQ_MUIC is masked, MAX77693 extcon driver could not detect any external cables.
>
> For example,
> The max77836 enable MUIC_IRQ by un-masking MUIC_IRQ.
> You can check it on drivers/mfd/max14577.c (line 251~258)
Sure, I get it. I'll do it the same as in max14577 driver.
Thanks for feedback!
Krzysztof
next prev parent reply other threads:[~2014-10-10 10:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-10 8:22 [PATCH fixes 1/2] mfd: max77693: Use proper regmap for handling MUIC interrupts Krzysztof Kozlowski
2014-10-10 8:22 ` [PATCH fixes 2/2] extcon: max77693: Fix always masked " Krzysztof Kozlowski
2014-10-10 8:45 ` Chanwoo Choi
2014-10-10 9:03 ` Krzysztof Kozlowski
2014-10-10 10:05 ` Chanwoo Choi
2014-10-10 10:10 ` Krzysztof Kozlowski [this message]
2014-10-10 8:58 ` Lee Jones
2014-10-10 9:01 ` Krzysztof Kozlowski
2014-10-10 9:48 ` Lee Jones
2014-10-10 10:08 ` Krzysztof Kozlowski
2014-10-10 8:46 ` [PATCH fixes 1/2] mfd: max77693: Use proper regmap for handling " Chanwoo Choi
2014-10-10 8:55 ` Lee Jones
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=1412935850.4143.4.camel@AMDC1943 \
--to=k.kozlowski@samsung.com \
--cc=b.zolnierkie@samsung.com \
--cc=cw00.choi@samsung.com \
--cc=kyungmin.park@samsung.com \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=myungjoo.ham@samsung.com \
--cc=sameo@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).