* [PATCH] extcon: max77843: Clear IRQ bits state before request IRQ
@ 2015-06-05 4:32 Jaewon Kim
2015-06-05 4:53 ` Chanwoo Choi
0 siblings, 1 reply; 4+ messages in thread
From: Jaewon Kim @ 2015-06-05 4:32 UTC (permalink / raw)
To: Chanwoo Choi; +Cc: MyungJoo Ham, linux-kernel, linux-samsung-soc, Jaewon Kim
IRQ signal before driver probe is needless because driver sends
current state after platform booting done.
So, this patch clears MUIC IRQ bits before request IRQ.
Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
---
drivers/extcon/extcon-max77843.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/extcon/extcon-max77843.c b/drivers/extcon/extcon-max77843.c
index d78a64d..11e09d1 100644
--- a/drivers/extcon/extcon-max77843.c
+++ b/drivers/extcon/extcon-max77843.c
@@ -781,6 +781,15 @@ static int max77843_muic_probe(struct platform_device *pdev)
/* Support virtual irq domain for max77843 MUIC device */
INIT_WORK(&info->irq_work, max77843_muic_irq_work);
+ /* Clear IRQ bits before request IRQs */
+ ret = regmap_bulk_read(max77843->regmap_muic,
+ MAX77843_MUIC_REG_INT1, info->status,
+ MAX77843_MUIC_IRQ_NUM);
+ if (ret) {
+ dev_err(&pdev->dev, "Failed to Clear IRQ bits\n");
+ goto err_muic_irq;
+ }
+
for (i = 0; i < ARRAY_SIZE(max77843_muic_irqs); i++) {
struct max77843_muic_irq *muic_irq = &max77843_muic_irqs[i];
unsigned int virq = 0;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] extcon: max77843: Clear IRQ bits state before request IRQ
2015-06-05 4:32 Jaewon Kim
@ 2015-06-05 4:53 ` Chanwoo Choi
0 siblings, 0 replies; 4+ messages in thread
From: Chanwoo Choi @ 2015-06-05 4:53 UTC (permalink / raw)
To: Jaewon Kim; +Cc: MyungJoo Ham, linux-kernel, linux-samsung-soc
Hi Jaewon,
On 06/05/2015 01:32 PM, Jaewon Kim wrote:
> IRQ signal before driver probe is needless because driver sends
> current state after platform booting done.
> So, this patch clears MUIC IRQ bits before request IRQ.
>
> Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
> ---
> drivers/extcon/extcon-max77843.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/extcon/extcon-max77843.c b/drivers/extcon/extcon-max77843.c
> index d78a64d..11e09d1 100644
> --- a/drivers/extcon/extcon-max77843.c
> +++ b/drivers/extcon/extcon-max77843.c
> @@ -781,6 +781,15 @@ static int max77843_muic_probe(struct platform_device *pdev)
> /* Support virtual irq domain for max77843 MUIC device */
> INIT_WORK(&info->irq_work, max77843_muic_irq_work);
>
> + /* Clear IRQ bits before request IRQs */
> + ret = regmap_bulk_read(max77843->regmap_muic,
> + MAX77843_MUIC_REG_INT1, info->status,
> + MAX77843_MUIC_IRQ_NUM);
> + if (ret) {
> + dev_err(&pdev->dev, "Failed to Clear IRQ bits\n");
> + goto err_muic_irq;
> + }
> +
> for (i = 0; i < ARRAY_SIZE(max77843_muic_irqs); i++) {
> struct max77843_muic_irq *muic_irq = &max77843_muic_irqs[i];
> unsigned int virq = 0;
>
Applied it.
Thanks,
Chanwoo Choi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] extcon: max77843: Clear IRQ bits state before request IRQ
@ 2015-06-05 4:54 MyungJoo Ham
2015-06-05 5:13 ` Chanwoo Choi
0 siblings, 1 reply; 4+ messages in thread
From: MyungJoo Ham @ 2015-06-05 4:54 UTC (permalink / raw)
To: 김재원, 최찬우
Cc: linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 1898 bytes --]
>
> IRQ signal before driver probe is needless because driver sends
> current state after platform booting done.
> So, this patch clears MUIC IRQ bits before request IRQ.
>
> Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
> ---
> drivers/extcon/extcon-max77843.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
Q1. Is this because the pending bits are USELESS?
or because the pendeing bits incurs INCORRECT behaviors?
Q2. Does clearing (by reading) INT1 do everything you need?
What about INT2 and INT3?
Q3. I presume that "driver sends current state after..." is
coming from the invokation of "queue_delayed_work()" at the end
of the probe function. It appears that you are only serving
the pending status of "cable detection" with it while INT1
seems to have more functionalities. Does that delayed work
do everything that are pending, really?
Cheers,
MyungJoo
>
> diff --git a/drivers/extcon/extcon-max77843.c b/drivers/extcon/extcon-max77843.c
> index d78a64d..11e09d1 100644
> --- a/drivers/extcon/extcon-max77843.c
> +++ b/drivers/extcon/extcon-max77843.c
> @@ -781,6 +781,15 @@ static int max77843_muic_probe(struct platform_device *pdev)
> /* Support virtual irq domain for max77843 MUIC device */
> INIT_WORK(&info->irq_work, max77843_muic_irq_work);
>
> + /* Clear IRQ bits before request IRQs */
> + ret = regmap_bulk_read(max77843->regmap_muic,
> + MAX77843_MUIC_REG_INT1, info->status,
> + MAX77843_MUIC_IRQ_NUM);
> + if (ret) {
> + dev_err(&pdev->dev, "Failed to Clear IRQ bits\n");
> + goto err_muic_irq;
> + }
> +
> for (i = 0; i < ARRAY_SIZE(max77843_muic_irqs); i++) {
> struct max77843_muic_irq *muic_irq = &max77843_muic_irqs[i];
> unsigned int virq = 0;
> --
> 1.7.9.5
>
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] extcon: max77843: Clear IRQ bits state before request IRQ
2015-06-05 4:54 [PATCH] extcon: max77843: Clear IRQ bits state before request IRQ MyungJoo Ham
@ 2015-06-05 5:13 ` Chanwoo Choi
0 siblings, 0 replies; 4+ messages in thread
From: Chanwoo Choi @ 2015-06-05 5:13 UTC (permalink / raw)
To: myungjoo.ham
Cc: 김재원, linux-kernel@vger.kernel.org,
linux-samsung-soc@vger.kernel.org
On 06/05/2015 01:54 PM, MyungJoo Ham wrote:
>>
>> IRQ signal before driver probe is needless because driver sends
>> current state after platform booting done.
>> So, this patch clears MUIC IRQ bits before request IRQ.
>>
>> Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
>> ---
>> drivers/extcon/extcon-max77843.c | 9 +++++++++
>> 1 file changed, 9 insertions(+)
>
> Q1. Is this because the pending bits are USELESS?
> or because the pendeing bits incurs INCORRECT behaviors?
The max77843 datasheet includes following sentence:
- "All bits are cleared after a read" about INT1/INT2/INT3 register.
There are no problem about interrupt handling.
>
> Q2. Does clearing (by reading) INT1 do everything you need?
> What about INT2 and INT3?
The MAXIM MAX77843 MUIC support the one more interrupts (e.g., ADC1K, VBVolt, ChgTyp ...).
The each interrupt is included in the one register among INT1/2/3.
This patch clear the all interrupts of MAX77843 before requesting the interrupts.
>
> Q3. I presume that "driver sends current state after..." is
> coming from the invokation of "queue_delayed_work()" at the end
> of the probe function. It appears that you are only serving
> the pending status of "cable detection" with it while INT1
> seems to have more functionalities. Does that delayed work
> do everything that are pending, really?
When completed kernel booting, the delayed work of extcon-max77843.c driver
use the MAX77843_MUIC_STATUSx register to detect the type of connected
external connectors. So, there are no problme about clearing all bits of INT1/2/3 interrupt register.
If user-space platform don't finish the initialization of all user-process daemons
and extcon driver send the uevent during only kernel booting, the uevent is not handled
on user-space daemons.
Thanks,
Chanwoo Choi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-06-05 5:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-05 4:54 [PATCH] extcon: max77843: Clear IRQ bits state before request IRQ MyungJoo Ham
2015-06-05 5:13 ` Chanwoo Choi
-- strict thread matches above, loose matches on Subject: below --
2015-06-05 4:32 Jaewon Kim
2015-06-05 4:53 ` Chanwoo Choi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox