mfd add irq support in 88pm860x
PATCH 5/10 mfd add irq support in 88pm860x
PATCH 5/10 mfd add irq support in 88pm860x
Review
Quoted 4 lines · Haojian Zhuang
(quoted diff) +4
-0+int pm860x_request_irq(struct pm860x_chip *chip, int irq, + void (*handle_irq)(struct pm860x_chip *, int, void *), + void *data) +{
It might be nice to make the IRQ handler be an irq_handler_t - that way if you convert the driver to use the generic IRQ infrastructure in future it'll be straightforward to transition the drivers by providing stub functions that pass through to generic IRQ.
Given that Thomas did the work it'd be good if we could use it eventually :) .
Quoted 9 lines
(quoted diff) +9
-0+#if 0 + mask = PM8607_MISC1_INV_INT | PM8607_MISC1_INT_CLEAR + | PM8607_MISC1_INT_MASK; + data = PM8607_MISC1_INT_CLEAR; + chip->irq_mode = 1; + if (pdata) { + /* + * irq_mode defines the way of clearing interrupt. + * If it's 1, clear IRQ by write. Otherwise, clear it by read.
Review
Quoted 10 lines
(quoted diff) +10
-0+ * This control bit is valid from 88PM8607 B0 steping. + */ + if ((chip->chip_id >= PM8607_CHIP_B0) && (!pdata->irq_mode)) { + data = 0; + chip->irq_mode = 0; + } + } + ret = pm860x_set_bits(chip->parent, DESC_8607, PM8607_MISC1, + mask, data); +#else
The if 0 stuff should just be removed for mainline.
PATCH 5/10 mfd add irq support in 88pm860x
In reply to Haojian ZhuangReview
Quoted 4 lines · Haojian Zhuang
(quoted diff) +4
-0+ + mutex_lock(&chip->irq_lock); + memset(chip->irq, 0, sizeof(struct pm860x_irq) * PM860X_NUM_IRQ); + mutex_unlock(&chip->irq_lock);
Why do you take lock here? Can anyone else be touching chip->irq at this point?
Signature · 1 line
Dmitry
PATCH 5/10 mfd add irq support in 88pm860x
Quoted 6 lines · Dmitry Torokhov
Quoted 4 lines · Haojian Zhuang
+
+ ? ?mutex_lock(&chip->irq_lock);
+ ? ?memset(chip->irq, 0, sizeof(struct pm860x_irq) * PM860X_NUM_IRQ);
+ ? ?mutex_unlock(&chip->irq_lock);
Quoted 6 lines
Why do you take lock here? Can anyone else be touching
chip->irqat this point?--
Dmitry
Updated.
Haojian