Commit 2d4a2cf2 authored by Eric Ruei's avatar Eric Ruei Committed by Anand Balagopalakrishnan

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: default avatarEric Ruei <e-ruei1@ti.com>
parent 9855bcc2
......@@ -47,6 +47,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#endif
#endif
#include <linux/platform_data/sgx-omap.h>
#if defined(SUPPORT_DRI_DRM) && !defined(SUPPORT_DRI_DRM_PLUGIN)
#define PVR_MOD_STATIC
#else
......@@ -353,8 +355,17 @@ static int __devinit PVRSRVDriverProbe(LDM_DEV *pDevice, const struct pci_device
#endif
{
SYS_DATA *psSysData;
int ret;
struct device *dev = &pDevice->dev;
struct gfx_sgx_platform_data *pdata = dev->platform_data;
PVR_TRACE(("PVRSRVDriverProbe(pDevice=%p)", pDevice));
if (pdata && pdata->deassert_reset) {
ret = pdata->deassert_reset(pDevice, pdata->reset_name);
if (ret) {
dev_err(dev, "Unable to reset SGX!\n");
}
}
#if 0 /* INTEGRATION_POINT */
/* Some systems require device-specific system initialisation.
......@@ -380,7 +391,6 @@ static int __devinit PVRSRVDriverProbe(LDM_DEV *pDevice, const struct pci_device
return -ENODEV;
}
}
return 0;
}
......
......@@ -49,6 +49,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#endif
#endif
#include <linux/platform_data/sgx-omap.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
......@@ -665,8 +667,20 @@ static struct platform_driver sPVRPlatDriver =
static int
PVRSRVDrmProbe(struct platform_device *pDevice)
{
int ret;
struct device *dev = &pDevice->dev;
struct gfx_sgx_platform_data *pdata = dev->platform_data;
PVR_TRACE(("PVRSRVDrmProbe"));
if (pdata && pdata->deassert_reset) {
ret = pdata->deassert_reset(pDevice, pdata->reset_name);
if (ret) {
dev_err(dev, "Unable to reset SGX!\n");
}
}
#if defined(PVR_NEW_STYLE_DRM_PLATFORM_DEV)
gpsPVRLDMDev = pDevice;
......@@ -679,6 +693,10 @@ PVRSRVDrmProbe(struct platform_device *pDevice)
static int
PVRSRVDrmRemove(struct platform_device *pDevice)
{
int ret;
struct device *dev = &pDevice->dev;
struct gfx_sgx_platform_data *pdata = dev->platform_data;
PVR_TRACE(("PVRSRVDrmRemove"));
#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)
#else
drm_put_dev(gpsPVRDRMDev);
#endif
if (pdata && pdata->assert_reset) {
ret = pdata->assert_reset(pDevice, pdata->reset_name);
if (ret) {
dev_err(dev, "Unable to reset SGX!\n");
}
}
return 0;
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment