forked from torvalds/linux
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drivers: thermal: tsens: Add support for combined interrupt
Despite using tsens v2.3 IP, IPQ8074 and IPQ6018 only have one IRQ for signaling both up/low and critical trips. Signed-off-by: Robert Marko <robimarko@gmail.com>
- Loading branch information
Showing
6 changed files
with
36 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -532,6 +532,26 @@ static irqreturn_t tsens_irq_thread(int irq, void *data) | |
return IRQ_HANDLED; | ||
} | ||
|
||
/** | ||
* tsens_combined_irq_thread - Threaded interrupt handler for combined interrupts | ||
* @irq: irq number | ||
* @data: tsens controller private data | ||
* | ||
* Handle the combined interrupt as if it were 2 separate interrupts, so call the | ||
* critical handler first and then the up/low one. | ||
* | ||
* Return: IRQ_HANDLED | ||
*/ | ||
static irqreturn_t tsens_combined_irq_thread(int irq, void *data) | ||
{ | ||
irqreturn_t ret; | ||
|
||
ret = tsens_critical_irq_thread(irq, data); | ||
ret = tsens_irq_thread(irq, data); | ||
|
||
return ret; | ||
} | ||
|
||
static int tsens_set_trips(void *_sensor, int low, int high) | ||
{ | ||
struct tsens_sensor *s = _sensor; | ||
|
@@ -1080,14 +1100,20 @@ static int tsens_register(struct tsens_priv *priv) | |
tsens_mC_to_hw(priv->sensor, 0)); | ||
} | ||
|
||
ret = tsens_register_irq(priv, "uplow", tsens_irq_thread); | ||
if (ret < 0) | ||
return ret; | ||
if (!priv->feat->combo_int) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
robimarko
Author
Owner
|
||
ret = tsens_register_irq(priv, "uplow", tsens_irq_thread); | ||
if (ret < 0) | ||
return ret; | ||
} | ||
|
||
if (priv->feat->crit_int) | ||
if (priv->feat->crit_int && !priv->feat->combo_int) | ||
ret = tsens_register_irq(priv, "critical", | ||
tsens_critical_irq_thread); | ||
|
||
if (priv->feat->combo_int) | ||
ret = tsens_register_irq(priv, "combined", | ||
tsens_combined_irq_thread); | ||
|
||
return ret; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mhhh can't we improve this? They will 99% complain about these 3 if
Something like
or even the opposite to make it clear the difference between split and combined irq