summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Ruei2016-02-04 17:20:39 -0600
committerAnand Balagopalakrishnan2016-02-11 03:41:07 -0600
commit2d4a2cf221a34a32dc71ab0e017f3b9a8e974a21 (patch)
treec3173eb876a87c7a32742fafb5585bf81ddc6cbc
parent9855bcc288b2c3ef715064705f727334439556d8 (diff)
downloadomap5-sgx-ddk-linux-2d4a2cf221a34a32dc71ab0e017f3b9a8e974a21.tar.gz
omap5-sgx-ddk-linux-2d4a2cf221a34a32dc71ab0e017f3b9a8e974a21.tar.xz
omap5-sgx-ddk-linux-2d4a2cf221a34a32dc71ab0e017f3b9a8e974a21.zip
KM: Invoke platform-specific reset API calls if available
Add API call pdata->deassert_reset and pdata->assert_reset to take SGX out or into reset if the platform-specific (pdata) APIs are available. Change-Id: Ib2dcb43eb8c4969b61d490c79640f13084aabb28 Signed-off-by: Eric Ruei <e-ruei1@ti.com>
-rw-r--r--eurasia_km/services4/srvkm/env/linux/module.c12
-rw-r--r--eurasia_km/services4/srvkm/env/linux/pvr_drm.c26
2 files changed, 37 insertions, 1 deletions
diff --git a/eurasia_km/services4/srvkm/env/linux/module.c b/eurasia_km/services4/srvkm/env/linux/module.c
index 7964141..006b4ce 100644
--- a/eurasia_km/services4/srvkm/env/linux/module.c
+++ b/eurasia_km/services4/srvkm/env/linux/module.c
@@ -47,6 +47,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
47#endif 47#endif
48#endif 48#endif
49 49
50#include <linux/platform_data/sgx-omap.h>
51
50#if defined(SUPPORT_DRI_DRM) && !defined(SUPPORT_DRI_DRM_PLUGIN) 52#if defined(SUPPORT_DRI_DRM) && !defined(SUPPORT_DRI_DRM_PLUGIN)
51#define PVR_MOD_STATIC 53#define PVR_MOD_STATIC
52#else 54#else
@@ -353,8 +355,17 @@ static int __devinit PVRSRVDriverProbe(LDM_DEV *pDevice, const struct pci_device
353#endif 355#endif
354{ 356{
355 SYS_DATA *psSysData; 357 SYS_DATA *psSysData;
358 int ret;
359 struct device *dev = &pDevice->dev;
360 struct gfx_sgx_platform_data *pdata = dev->platform_data;
356 361
357 PVR_TRACE(("PVRSRVDriverProbe(pDevice=%p)", pDevice)); 362 PVR_TRACE(("PVRSRVDriverProbe(pDevice=%p)", pDevice));
363 if (pdata && pdata->deassert_reset) {
364 ret = pdata->deassert_reset(pDevice, pdata->reset_name);
365 if (ret) {
366 dev_err(dev, "Unable to reset SGX!\n");
367 }
368 }
358 369
359#if 0 /* INTEGRATION_POINT */ 370#if 0 /* INTEGRATION_POINT */
360 /* Some systems require device-specific system initialisation. 371 /* Some systems require device-specific system initialisation.
@@ -380,7 +391,6 @@ static int __devinit PVRSRVDriverProbe(LDM_DEV *pDevice, const struct pci_device
380 return -ENODEV; 391 return -ENODEV;
381 } 392 }
382 } 393 }
383
384 return 0; 394 return 0;
385} 395}
386 396
diff --git a/eurasia_km/services4/srvkm/env/linux/pvr_drm.c b/eurasia_km/services4/srvkm/env/linux/pvr_drm.c
index 71471bc..83778b9 100644
--- a/eurasia_km/services4/srvkm/env/linux/pvr_drm.c
+++ b/eurasia_km/services4/srvkm/env/linux/pvr_drm.c
@@ -49,6 +49,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
49#endif 49#endif
50#endif 50#endif
51 51
52#include <linux/platform_data/sgx-omap.h>
53
52#include <linux/init.h> 54#include <linux/init.h>
53#include <linux/kernel.h> 55#include <linux/kernel.h>
54#include <linux/module.h> 56#include <linux/module.h>
@@ -665,8 +667,20 @@ static struct platform_driver sPVRPlatDriver =
665static int 667static int
666PVRSRVDrmProbe(struct platform_device *pDevice) 668PVRSRVDrmProbe(struct platform_device *pDevice)
667{ 669{
670
671 int ret;
672 struct device *dev = &pDevice->dev;
673 struct gfx_sgx_platform_data *pdata = dev->platform_data;
674
668 PVR_TRACE(("PVRSRVDrmProbe")); 675 PVR_TRACE(("PVRSRVDrmProbe"));
669 676
677 if (pdata && pdata->deassert_reset) {
678 ret = pdata->deassert_reset(pDevice, pdata->reset_name);
679 if (ret) {
680 dev_err(dev, "Unable to reset SGX!\n");
681 }
682 }
683
670#if defined(PVR_NEW_STYLE_DRM_PLATFORM_DEV) 684#if defined(PVR_NEW_STYLE_DRM_PLATFORM_DEV)
671 gpsPVRLDMDev = pDevice; 685 gpsPVRLDMDev = pDevice;
672 686
@@ -679,6 +693,10 @@ PVRSRVDrmProbe(struct platform_device *pDevice)
679static int 693static int
680PVRSRVDrmRemove(struct platform_device *pDevice) 694PVRSRVDrmRemove(struct platform_device *pDevice)
681{ 695{
696 int ret;
697 struct device *dev = &pDevice->dev;
698 struct gfx_sgx_platform_data *pdata = dev->platform_data;
699
682 PVR_TRACE(("PVRSRVDrmRemove")); 700 PVR_TRACE(("PVRSRVDrmRemove"));
683 701
684#if defined(PVR_NEW_STYLE_DRM_PLATFORM_DEV) && (LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0)) 702#if defined(PVR_NEW_STYLE_DRM_PLATFORM_DEV) && (LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0))
@@ -686,6 +704,14 @@ PVRSRVDrmRemove(struct platform_device *pDevice)
686#else 704#else
687 drm_put_dev(gpsPVRDRMDev); 705 drm_put_dev(gpsPVRDRMDev);
688#endif 706#endif
707
708 if (pdata && pdata->assert_reset) {
709 ret = pdata->assert_reset(pDevice, pdata->reset_name);
710 if (ret) {
711 dev_err(dev, "Unable to reset SGX!\n");
712 }
713 }
714
689 return 0; 715 return 0;
690} 716}
691#endif 717#endif