aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeerthy2019-09-16 15:13:36 -0500
committerSuman Anna2019-09-22 20:47:30 -0500
commit4f55ca9de026aeec47b7589ba35bf7807a80ffc1 (patch)
treefadb9ac2baebe6fe104766ce8f052f9f9d4628bf
parentaca77713f8ee58bbff32303efc09a7f601841d8c (diff)
downloadrpmsg-4f55ca9de026aeec47b7589ba35bf7807a80ffc1.tar.gz
rpmsg-4f55ca9de026aeec47b7589ba35bf7807a80ffc1.tar.xz
rpmsg-4f55ca9de026aeec47b7589ba35bf7807a80ffc1.zip
ARM: OMAP2+: pdata-quirks: Add device_is_enabled ops for IOMMUs and rprocs
Add a new .device_is_enabled() platform data callback ops to both the OMAP IOMMU and remoteproc devices to check if the corresponding omap_device/hwmod is already enabled. This helps the OMAP IOMMU and remoteproc drivers to figure out if the corresponding processors have already been loaded and booted by bootloaders. Signed-off-by: Keerthy <j-keerthy@ti.com> [s-anna@ti.com: minor cleanups] Signed-off-by: Suman Anna <s-anna@ti.com>
-rw-r--r--arch/arm/mach-omap2/pdata-quirks.c14
-rw-r--r--include/linux/platform_data/iommu-omap.h1
-rw-r--r--include/linux/platform_data/remoteproc-omap.h2
3 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index 9b6aec1fef88..26695fa2c9b7 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -49,7 +49,18 @@ struct pdata_init {
49static struct of_dev_auxdata omap_auxdata_lookup[]; 49static struct of_dev_auxdata omap_auxdata_lookup[];
50static struct twl4030_gpio_platform_data twl_gpio_auxdata; 50static struct twl4030_gpio_platform_data twl_gpio_auxdata;
51 51
52static bool __maybe_unused omap_device_is_enabled(struct platform_device *pdev)
53{
54 struct omap_device *od = to_omap_device(pdev);
55
56 if (od->_state == OMAP_DEVICE_STATE_ENABLED)
57 return true;
58 else
59 return false;
60}
61
52#if IS_ENABLED(CONFIG_OMAP_IOMMU) 62#if IS_ENABLED(CONFIG_OMAP_IOMMU)
63
53int omap_iommu_set_pwrdm_constraint(struct platform_device *pdev, bool request, 64int omap_iommu_set_pwrdm_constraint(struct platform_device *pdev, bool request,
54 u8 *pwrst); 65 u8 *pwrst);
55#else 66#else
@@ -436,6 +447,7 @@ static void __init omap3_pandora_legacy_init(void)
436static struct omap_rproc_pdata omap4_ipu_dsp_pdata = { 447static struct omap_rproc_pdata omap4_ipu_dsp_pdata = {
437 .device_enable = omap_rproc_device_enable, 448 .device_enable = omap_rproc_device_enable,
438 .device_shutdown = omap_rproc_device_shutdown, 449 .device_shutdown = omap_rproc_device_shutdown,
450 .device_is_enabled = omap_device_is_enabled,
439}; 451};
440#endif 452#endif
441 453
@@ -447,6 +459,7 @@ static struct iommu_platform_data omap4_iommu_pdata = {
447 .deassert_reset = omap_device_deassert_hardreset, 459 .deassert_reset = omap_device_deassert_hardreset,
448 .device_enable = omap_device_enable, 460 .device_enable = omap_device_enable,
449 .device_idle = omap_device_idle, 461 .device_idle = omap_device_idle,
462 .device_is_enabled = omap_device_is_enabled,
450}; 463};
451#endif 464#endif
452 465
@@ -476,6 +489,7 @@ static struct iommu_platform_data dra7_ipu1_dsp_iommu_pdata = {
476 .assert_reset = omap_device_assert_hardreset, 489 .assert_reset = omap_device_assert_hardreset,
477 .deassert_reset = omap_device_deassert_hardreset, 490 .deassert_reset = omap_device_deassert_hardreset,
478 .device_enable = omap_device_enable, 491 .device_enable = omap_device_enable,
492 .device_is_enabled = omap_device_is_enabled,
479 .device_idle = omap_device_idle, 493 .device_idle = omap_device_idle,
480 .set_pwrdm_constraint = omap_iommu_set_pwrdm_constraint, 494 .set_pwrdm_constraint = omap_iommu_set_pwrdm_constraint,
481}; 495};
diff --git a/include/linux/platform_data/iommu-omap.h b/include/linux/platform_data/iommu-omap.h
index 6669dc9394da..1ce96b23c55d 100644
--- a/include/linux/platform_data/iommu-omap.h
+++ b/include/linux/platform_data/iommu-omap.h
@@ -17,6 +17,7 @@ struct iommu_platform_data {
17 int (*assert_reset)(struct platform_device *pdev, const char *name); 17 int (*assert_reset)(struct platform_device *pdev, const char *name);
18 int (*deassert_reset)(struct platform_device *pdev, const char *name); 18 int (*deassert_reset)(struct platform_device *pdev, const char *name);
19 int (*device_enable)(struct platform_device *pdev); 19 int (*device_enable)(struct platform_device *pdev);
20 bool (*device_is_enabled)(struct platform_device *pdev);
20 int (*device_idle)(struct platform_device *pdev); 21 int (*device_idle)(struct platform_device *pdev);
21 int (*set_pwrdm_constraint)(struct platform_device *pdev, bool request, 22 int (*set_pwrdm_constraint)(struct platform_device *pdev, bool request,
22 u8 *pwrst); 23 u8 *pwrst);
diff --git a/include/linux/platform_data/remoteproc-omap.h b/include/linux/platform_data/remoteproc-omap.h
index 55e3c007e264..e1b255ca3503 100644
--- a/include/linux/platform_data/remoteproc-omap.h
+++ b/include/linux/platform_data/remoteproc-omap.h
@@ -15,10 +15,12 @@ struct platform_device;
15 * struct omap_rproc_pdata - omap remoteproc's platform data 15 * struct omap_rproc_pdata - omap remoteproc's platform data
16 * @device_enable: omap-specific handler for enabling a device 16 * @device_enable: omap-specific handler for enabling a device
17 * @device_shutdown: omap-specific handler for shutting down a device 17 * @device_shutdown: omap-specific handler for shutting down a device
18 * @device_is_enabled: omap-specific handler to check if device is booted
18 */ 19 */
19struct omap_rproc_pdata { 20struct omap_rproc_pdata {
20 int (*device_enable)(struct platform_device *pdev); 21 int (*device_enable)(struct platform_device *pdev);
21 int (*device_shutdown)(struct platform_device *pdev); 22 int (*device_shutdown)(struct platform_device *pdev);
23 bool (*device_is_enabled)(struct platform_device *pdev);
22}; 24};
23 25
24#endif /* _PLAT_REMOTEPROC_H */ 26#endif /* _PLAT_REMOTEPROC_H */