mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
thermal: tsens8960: Add platform detection
TSENS is not supported on the MSM8960 1.0 because of a HW bug. The driver used a platform detection mechanism through a flag. With the 8960PRO the CPU MAJOR version resets back to major version 1. The driver does not distinguish the PRO parts differently and disables the driver. Change the method to detect the CPU using the platform detection api instead of relying on the platform data. Change-Id: I446eb196cf81e6a29760530dfbce6910652e867c Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org> (cherry picked from commit 30447fec965309e30f1eb33c0d318ee4a5365026) (cherry picked from commit 25bb62fbbc050147ae298179d7abe4ad08f78371)
This commit is contained in:
parent
2da2505cab
commit
461b5c26ba
2 changed files with 10 additions and 19 deletions
|
@ -3102,13 +3102,22 @@ static void __init register_i2c_devices(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
static void __init msm8960_tsens_init(void)
|
||||
{
|
||||
if (cpu_is_msm8960())
|
||||
if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 1)
|
||||
return;
|
||||
|
||||
msm_tsens_early_init(&msm_tsens_pdata);
|
||||
}
|
||||
|
||||
static void __init msm8960_cdp_init(void)
|
||||
{
|
||||
if (meminfo_init(SYS_MEMORY, SZ_256M) < 0)
|
||||
pr_err("meminfo_init() failed!\n");
|
||||
|
||||
platform_device_register(&msm_gpio_device);
|
||||
msm_tsens_early_init(&msm_tsens_pdata);
|
||||
msm8960_tsens_init();
|
||||
msm_thermal_init(&msm_thermal_pdata);
|
||||
BUG_ON(msm_rpm_init(&msm8960_rpm_data));
|
||||
BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
|
||||
|
|
|
@ -907,17 +907,6 @@ static int tsens_calib_sensors8960(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int tsens_check_version_support(void)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (tmdev->hw_type == MSM_8960)
|
||||
if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 1)
|
||||
rc = -ENODEV;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int tsens_calib_sensors(void)
|
||||
{
|
||||
int rc = -ENODEV;
|
||||
|
@ -955,13 +944,6 @@ int msm_tsens_early_init(struct tsens_platform_data *pdata)
|
|||
tmdev->tsens_num_sensor = pdata->tsens_num_sensor;
|
||||
tmdev->hw_type = pdata->hw_type;
|
||||
|
||||
rc = tsens_check_version_support();
|
||||
if (rc < 0) {
|
||||
kfree(tmdev);
|
||||
tmdev = NULL;
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = tsens_calib_sensors();
|
||||
if (rc < 0) {
|
||||
kfree(tmdev);
|
||||
|
|
Loading…
Reference in a new issue