static int IsTF200XorTF200XG(void) { if (!strncmp("TF200X",tegra3_get_project_name(),TEGRA3_PROJECT_NAME_MAX_LEN)) return 1; else if (!strncmp("TF200XG",tegra3_get_project_name(),TEGRA3_PROJECT_NAME_MAX_LEN)) return 1; else return 0; }
static ssize_t cardhu_projectname_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { char *s = buf; s += sprintf(s, "%s\n", tegra3_get_project_name()); return (s - buf); }
unsigned int tegra3_query_wifi_module_pcbid(void) { unsigned int wifi_pcbid = 0; unsigned int project = tegra3_get_project_id(); unsigned int ret = -1; /* Check if running target platform is valid */ if (project == TEGRA3_PROJECT_INVALID) { pr_err("[MISC]: %s is not supported on %s.\n", __func__, tegra3_get_project_name()); return ret; } wifi_pcbid = HW_DRF_VAL(TEGRA3_DEVKIT, MISC_HW, WIFI, cardhu_pcbid); ret = wifi_pcbid; return ret; }
bool tegra3_check_touch_module(unsigned vendor) { unsigned int touch_pcbid = 0; const char *project = tegra3_get_project_name(); bool ret = false; /* Fetch PCB_ID[2] and PCB_ID[6] and recompose it */ touch_pcbid = (HW_DRF_VAL(TEGRA3_DEVKIT, MISC_HW, TOUCHL, cardhu_pcbid)) + (HW_DRF_VAL(TEGRA3_DEVKIT, MISC_HW, TOUCHH, cardhu_pcbid) << 1); if (vendor < TOUCH_VENDOR_ELAN) { if (!strcmp(project, "TF201") || !strcmp(project, "TF201G")) ret = (vendor == touch_pcbid) ? true : false; } else { if (!strcmp(project, "TF201X") || !strcmp(project, "TF201XG")) ret = ((vendor % TOUCH_VENDOR_ELAN) == touch_pcbid) ? true : false; } return ret; }
unsigned int tegra3_query_audio_codec_pcbid(void) { unsigned int codec_pcbid = 0; unsigned int project = tegra3_get_project_id(); unsigned int ret = -1; /* Check if running target platform */ if ((project == TEGRA3_PROJECT_TF201) || (project == TEGRA3_PROJECT_TF700T)) { pr_err("[MISC]: %s is not supported on %s.\n", __func__, tegra3_get_project_name()); return ret; } codec_pcbid = HW_DRF_VAL(TEGRA3_DEVKIT, MISC_HW, ACODEC, cardhu_pcbid); if ((project == TEGRA3_PROJECT_TF300T) || (project == TEGRA3_PROJECT_TF300TG) || (project == TEGRA3_PROJECT_TF300TL)) { ret = codec_pcbid; } return ret; }
unsigned int tegra3_query_touch_module_pcbid(void) { unsigned int touch_pcbid = 0; unsigned int project = tegra3_get_project_id(); unsigned int ret = -1; /* Check if running target platform */ if ((project == TEGRA3_PROJECT_TF300T) || (project == TEGRA3_PROJECT_TF300TG) || (project == TEGRA3_PROJECT_TF300TL)) { pr_err("[MISC]: %s is not supported on %s.\n", __func__, tegra3_get_project_name()); return ret; } /* Fetch PCB_ID[2] and PCB_ID[6] and recompose it */ touch_pcbid = (HW_DRF_VAL(TEGRA3_DEVKIT, MISC_HW, TOUCHL, cardhu_pcbid)) + (HW_DRF_VAL(TEGRA3_DEVKIT, MISC_HW, TOUCHH, cardhu_pcbid) << 1); if ((project == TEGRA3_PROJECT_TF201) || (project == TEGRA3_PROJECT_TF700T)) ret = touch_pcbid; return ret; }