* [PATCH v2 2/2] Extcon: MAX8997: Add support irq domain for MAX8997 muic
@ 2012-05-11 1:10 Chanwoo Choi
2012-05-14 16:13 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Chanwoo Choi @ 2012-05-11 1:10 UTC (permalink / raw)
To: gregkh, broonie, thomas.abraham
Cc: grant.likely, sameo, myungjoo.ham, kyungmin.park, jonghwa3.lee,
linux-kernel, Chanwoo Choi
This patch add support irq domain for Maxim MAX8997 muic
instead of irq_base in platform data and max8997 driver
private data are instead. It is tested on TRATS board.
v2
- Fix typo when free_irq() in max8997_muic_probe()
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/extcon/extcon-max8997.c | 28 +++++++++++++++++-----------
1 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c
index ab25c54..f21f6df 100644
--- a/drivers/extcon/extcon-max8997.c
+++ b/drivers/extcon/extcon-max8997.c
@@ -82,6 +82,7 @@
struct max8997_muic_irq {
unsigned int irq;
const char *name;
+ unsigned int virq;
};
static struct max8997_muic_irq muic_irqs[] = {
@@ -348,12 +349,10 @@ static void max8997_muic_irq_work(struct work_struct *work)
{
struct max8997_muic_info *info = container_of(work,
struct max8997_muic_info, irq_work);
- struct max8997_dev *max8997 = i2c_get_clientdata(info->muic);
u8 status[2];
u8 adc, chg_type;
-
- int irq_type = info->irq - max8997->irq_base;
- int ret;
+ int irq_type = 0;
+ int i, ret;
mutex_lock(&info->mutex);
@@ -368,6 +367,10 @@ static void max8997_muic_irq_work(struct work_struct *work)
dev_dbg(info->dev, "%s: STATUS1:0x%x, 2:0x%x\n", __func__,
status[0], status[1]);
+ for (i = 0 ; i < ARRAY_SIZE(muic_irqs) ; i++)
+ if (info->irq == muic_irqs[i].virq)
+ irq_type = muic_irqs[i].irq;
+
switch (irq_type) {
case MAX8997_MUICIRQ_ADC:
adc = status[0] & STATUS1_ADC_MASK;
@@ -453,11 +456,15 @@ static int __devinit max8997_muic_probe(struct platform_device *pdev)
for (i = 0; i < ARRAY_SIZE(muic_irqs); i++) {
struct max8997_muic_irq *muic_irq = &muic_irqs[i];
+ int virq = 0;
+
+ virq = irq_create_mapping(max8997->irq_domain, muic_irq->irq);
+ if (!virq)
+ goto err_irq;
+ muic_irq->virq = virq;
- ret = request_threaded_irq(pdata->irq_base + muic_irq->irq,
- NULL, max8997_muic_irq_handler,
- 0, muic_irq->name,
- info);
+ ret = request_threaded_irq(virq, NULL,max8997_muic_irq_handler,
+ 0, muic_irq->name, info);
if (ret) {
dev_err(&pdev->dev,
"failed: irq request (IRQ: %d,"
@@ -465,7 +472,7 @@ static int __devinit max8997_muic_probe(struct platform_device *pdev)
muic_irq->irq, ret);
for (i = i - 1; i >= 0; i--)
- free_irq(muic_irq->irq, info);
+ free_irq(muic_irq->virq, info);
goto err_irq;
}
@@ -512,11 +519,10 @@ err_kfree:
static int __devexit max8997_muic_remove(struct platform_device *pdev)
{
struct max8997_muic_info *info = platform_get_drvdata(pdev);
- struct max8997_dev *max8997 = i2c_get_clientdata(info->muic);
int i;
for (i = 0; i < ARRAY_SIZE(muic_irqs); i++)
- free_irq(max8997->irq_base + muic_irqs[i].irq, info);
+ free_irq(muic_irqs[i].virq, info);
cancel_work_sync(&info->irq_work);
extcon_dev_unregister(info->edev);
--
1.7.0.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v2 2/2] Extcon: MAX8997: Add support irq domain for MAX8997 muic
2012-05-11 1:10 [PATCH v2 2/2] Extcon: MAX8997: Add support irq domain for MAX8997 muic Chanwoo Choi
@ 2012-05-14 16:13 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2012-05-14 16:13 UTC (permalink / raw)
To: Chanwoo Choi
Cc: broonie, thomas.abraham, grant.likely, sameo, myungjoo.ham,
kyungmin.park, jonghwa3.lee, linux-kernel
On Fri, May 11, 2012 at 10:10:21AM +0900, Chanwoo Choi wrote:
> This patch add support irq domain for Maxim MAX8997 muic
> instead of irq_base in platform data and max8997 driver
> private data are instead. It is tested on TRATS board.
>
> v2
> - Fix typo when free_irq() in max8997_muic_probe()
>
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> drivers/extcon/extcon-max8997.c | 28 +++++++++++++++++-----------
> 1 files changed, 17 insertions(+), 11 deletions(-)
This patch breaks the build on my system:
CC [M] drivers/extcon/extcon-max8997.o
drivers/extcon/extcon-max8997.c: In function ‘max8997_muic_probe’:
drivers/extcon/extcon-max8997.c:456:3: error: implicit declaration of function ‘irq_create_mapping’ [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
So I can't accept these two patches, sorry. Please fix this up.
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-14 16:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-11 1:10 [PATCH v2 2/2] Extcon: MAX8997: Add support irq domain for MAX8997 muic Chanwoo Choi
2012-05-14 16:13 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome