]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - rpmsg/rpmsg.git/commitdiff
ARM: OMAP2+: pdata-quirks: Add device_is_enabled ops for IOMMUs and rprocs
authorKeerthy <j-keerthy@ti.com>
Mon, 16 Sep 2019 20:13:36 +0000 (20:13 +0000)
committerSuman Anna <s-anna@ti.com>
Mon, 23 Sep 2019 01:47:30 +0000 (20:47 -0500)
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>
arch/arm/mach-omap2/pdata-quirks.c
include/linux/platform_data/iommu-omap.h
include/linux/platform_data/remoteproc-omap.h

index 9b6aec1fef88ac37300a6daf8226a0e019195a01..26695fa2c9b71980590e55b8d987fe0973e46c28 100644 (file)
@@ -49,7 +49,18 @@ struct pdata_init {
 static struct of_dev_auxdata omap_auxdata_lookup[];
 static struct twl4030_gpio_platform_data twl_gpio_auxdata;
 
+static bool __maybe_unused omap_device_is_enabled(struct platform_device *pdev)
+{
+       struct omap_device *od = to_omap_device(pdev);
+
+       if (od->_state == OMAP_DEVICE_STATE_ENABLED)
+               return true;
+       else
+               return false;
+}
+
 #if IS_ENABLED(CONFIG_OMAP_IOMMU)
+
 int omap_iommu_set_pwrdm_constraint(struct platform_device *pdev, bool request,
                                    u8 *pwrst);
 #else
@@ -436,6 +447,7 @@ static void __init omap3_pandora_legacy_init(void)
 static struct omap_rproc_pdata omap4_ipu_dsp_pdata = {
        .device_enable = omap_rproc_device_enable,
        .device_shutdown = omap_rproc_device_shutdown,
+       .device_is_enabled = omap_device_is_enabled,
 };
 #endif
 
@@ -447,6 +459,7 @@ static struct iommu_platform_data omap4_iommu_pdata = {
        .deassert_reset = omap_device_deassert_hardreset,
        .device_enable = omap_device_enable,
        .device_idle = omap_device_idle,
+       .device_is_enabled = omap_device_is_enabled,
 };
 #endif
 
@@ -476,6 +489,7 @@ static struct iommu_platform_data dra7_ipu1_dsp_iommu_pdata = {
        .assert_reset = omap_device_assert_hardreset,
        .deassert_reset = omap_device_deassert_hardreset,
        .device_enable = omap_device_enable,
+       .device_is_enabled = omap_device_is_enabled,
        .device_idle = omap_device_idle,
        .set_pwrdm_constraint = omap_iommu_set_pwrdm_constraint,
 };
index 6669dc9394daafd33547d2fcc4e4a750687630ac..1ce96b23c55d271292466f831649801fe24917d4 100644 (file)
@@ -17,6 +17,7 @@ struct iommu_platform_data {
        int (*assert_reset)(struct platform_device *pdev, const char *name);
        int (*deassert_reset)(struct platform_device *pdev, const char *name);
        int (*device_enable)(struct platform_device *pdev);
+       bool (*device_is_enabled)(struct platform_device *pdev);
        int (*device_idle)(struct platform_device *pdev);
        int (*set_pwrdm_constraint)(struct platform_device *pdev, bool request,
                                    u8 *pwrst);
index 55e3c007e264f2f3591283be422e6c54594e070a..e1b255ca350361e4d01d86b46e6067289b602f0e 100644 (file)
@@ -15,10 +15,12 @@ struct platform_device;
  * struct omap_rproc_pdata - omap remoteproc's platform data
  * @device_enable: omap-specific handler for enabling a device
  * @device_shutdown: omap-specific handler for shutting down a device
+ * @device_is_enabled: omap-specific handler to check if device is booted
  */
 struct omap_rproc_pdata {
        int (*device_enable)(struct platform_device *pdev);
        int (*device_shutdown)(struct platform_device *pdev);
+       bool (*device_is_enabled)(struct platform_device *pdev);
 };
 
 #endif /* _PLAT_REMOTEPROC_H */