@@ -2025,12 +2025,6 @@ static int soctherm_interrupts_init(struct platform_device *pdev,
return 0;
}
- tegra->edp_irq = platform_get_irq(pdev, 1);
- if (tegra->edp_irq < 0) {
- dev_dbg(&pdev->dev, "get 'edp_irq' failed.\n");
- return 0;
- }
-
ret = devm_request_threaded_irq(&pdev->dev,
tegra->thermal_irq,
soctherm_thermal_isr,
@@ -2043,16 +2037,28 @@ static int soctherm_interrupts_init(struct platform_device *pdev,
return ret;
}
- ret = devm_request_threaded_irq(&pdev->dev,
- tegra->edp_irq,
- soctherm_edp_isr,
- soctherm_edp_isr_thread,
- IRQF_ONESHOT,
- "soctherm_edp",
- tegra);
- if (ret < 0) {
- dev_err(&pdev->dev, "request_irq 'edp_irq' failed.\n");
- return ret;
+ /* Initialize edp_irq when available */
+ if (tegra->soc->has_edp_irq) {
+ /* get IRQ */
+
+ tegra->edp_irq = platform_get_irq(pdev, 1);
+ if (tegra->edp_irq < 0) {
+ dev_dbg(&pdev->dev, "get 'edp_irq' failed.\n");
+ return 0;
+ }
+
+ /* request IRQ */
+ ret = devm_request_threaded_irq(&pdev->dev,
+ tegra->edp_irq,
+ soctherm_edp_isr,
+ soctherm_edp_isr_thread,
+ IRQF_ONESHOT,
+ "soctherm_edp",
+ tegra);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "request_irq 'edp_irq' failed.\n");
+ return ret;
+ }
}
return 0;
@@ -128,6 +128,7 @@ struct tegra_soctherm_soc {
const int thresh_grain;
const unsigned int bptt;
const bool use_ccroc;
+ const bool has_edp_irq;
struct tsensor_group_thermtrips *thermtrips;
};
@@ -216,4 +216,5 @@ const struct tegra_soctherm_soc tegra124_soctherm = {
.thresh_grain = TEGRA124_THRESH_GRAIN,
.bptt = TEGRA124_BPTT,
.use_ccroc = false,
+ .has_edp_irq = false,
};
@@ -216,4 +216,5 @@ const struct tegra_soctherm_soc tegra132_soctherm = {
.thresh_grain = TEGRA132_THRESH_GRAIN,
.bptt = TEGRA132_BPTT,
.use_ccroc = true,
+ .has_edp_irq = false,
};
@@ -224,5 +224,6 @@ const struct tegra_soctherm_soc tegra210_soctherm = {
.thresh_grain = TEGRA210_THRESH_GRAIN,
.bptt = TEGRA210_BPTT,
.use_ccroc = false,
+ .has_edp_irq = true,
.thermtrips = tegra210_tsensor_thermtrips,
};
According to the binding, the edp_irq is not available on tegra124/132 This commit moves the initialization of tegra->edp_irq after the introduced has_edp_irq condition. This will have the following effects: - soctherm_interrupts_init will not return prematurely with unfinished thermal_irq initialization on tegra124 and tegra132 - edp_irq initialization will be done only when relevant As a result, this will clear the following error on jetson-tk1 : kernel: tegra_soctherm 700e2000.thermal-sensor: IRQ index 1 not found v2: * Use .has_edp_irq boolean instead of of_compatible * Switch subject prefix to use thermal instead of ARM Fixes: 4a04beb1bf2e (thermal: tegra: add support for EDP IRQ) Cc: stable@vger.kernel.org Signed-off-by: Nicolas Chauvet <kwizart@gmail.com> --- drivers/thermal/tegra/soctherm.c | 38 +++++++++++++---------- drivers/thermal/tegra/soctherm.h | 1 + drivers/thermal/tegra/tegra124-soctherm.c | 1 + drivers/thermal/tegra/tegra132-soctherm.c | 1 + drivers/thermal/tegra/tegra210-soctherm.c | 1 + 5 files changed, 26 insertions(+), 16 deletions(-)