static int __init htcleo_rfkill_init(void) { if (!machine_is_htcleo()) return 0; return platform_driver_register(&htcleo_rfkill_driver); }
// Initialize DEX registers int init_dex_comm() { unsigned long flags; printk(KERN_INFO "%s: WinCE DEX init.\n", __func__); printk(KERN_INFO "%s: WinCE DEX init.\n", __func__); if(machine_is_htcleo()) base = (unsigned)(MSM_SHARED_RAM_BASE + 0xefe00); else base = (unsigned)(MSM_SHARED_RAM_BASE + 0xfc100); setup_irq(INT_A9_M2A_4, &dex_callback_irq); spin_lock_irqsave(&dex_comm_lock, flags); writel(0, base + PC_DATA); writel(0, base + PC_DATA_RESULT); writel(0, base + PC_SERIAL); writel(0, base + PC_SERIAL_CHECK); writel(0, base + PC_STATUS); spin_unlock_irqrestore(&dex_comm_lock, flags); printk(KERN_INFO "%s: WinCE DEX initialized.\n", __func__); dump_debug_stuff(); return 0; }
// Dump useful debug stuff void dump_debug_stuff(void) { unsigned int pcb_xc, ver_base; char amss_ver[16]; if (machine_is_htcleo()) { ver_base = 0xef230; // Dump PLL params (for debug purposes, no relation to dex_comm) DUMP_PLL("PLL0", PLLn_BASE(0)); DUMP_PLL("PLL1", PLLn_BASE(1)); DUMP_PLL("PLL4", PLLn_BASE(4)); DUMP_PLL("PLL5", PLLn_BASE(5)); } else { ver_base = 0xfc030; // Dump PLL params (for debug purposes, no relation to dex_comm) DUMP_PLL("PLL0", PLLn_BASE(0)); DUMP_PLL("PLL1", PLLn_BASE(1)); DUMP_PLL("PLL2", PLLn_BASE(2)); DUMP_PLL("PLL3", PLLn_BASE(3)); } // Dump PCB XC pcb_xc = readl(MSM_SHARED_RAM_BASE + ver_base + 0x18); printk(KERN_INFO "PCB XC: %08x\n", pcb_xc); // Dump AMMS version *(unsigned int *) (amss_ver + 0x0) = readl(MSM_SHARED_RAM_BASE + ver_base + 0x0); *(unsigned int *) (amss_ver + 0x4) = readl(MSM_SHARED_RAM_BASE + ver_base + 0x4); *(unsigned int *) (amss_ver + 0x8) = readl(MSM_SHARED_RAM_BASE + ver_base + 0x8); *(unsigned int *) (amss_ver + 0xc) = readl(MSM_SHARED_RAM_BASE + ver_base + 0xc); amss_ver[15] = 0; printk(KERN_INFO "AMSS version: %s\n", amss_ver); }
static inline void notify_other_dex_comm(void) { uint8_t dex_irq; if(machine_is_htcleo()) dex_irq = 4; else dex_irq = 6; writel(1, MSM_A2M_INT(dex_irq)); }
static int __init htcleo_wifi_init(void) { int ret; if (!machine_is_htcleo()) return 0; printk("%s: start\n", __func__); // htcleo_wifi_update_nvs("sd_oobonly=1\n"); htcleo_init_wifi_mem(); ret = platform_device_register(&htcleo_wifi_device); return ret; }
static int __init htcleommc_dbg_init(void) { struct dentry *dent; if (!machine_is_htcleo() && !machine_is_htcleo()) return 0; dent = debugfs_create_dir("htcleo_mmc_dbg", 0); if (IS_ERR(dent)) return PTR_ERR(dent); debugfs_create_file("wifi_reset", 0644, dent, NULL, &htcleommc_dbg_wifi_reset_fops); debugfs_create_file("wifi_cd", 0644, dent, NULL, &htcleommc_dbg_wifi_cd_fops); debugfs_create_file("wifi_pwr", 0644, dent, NULL, &htcleommc_dbg_wifi_pwr_fops); debugfs_create_file("sd_pwr", 0644, dent, NULL, &htcleommc_dbg_sd_pwr_fops); debugfs_create_file("sd_cd", 0644, dent, NULL, &htcleommc_dbg_sd_cd_fops); return 0; }
// Get the short AMSS Version ( like 6120 ) unsigned int get_amss_version(void) { char amss_ver[20]; char amss_dump[20]; char *dot1, *dot2; int len = 0; uint32_t ver_base = 0; /* Detection doesn't work on 'old' CDMA, there's no * version string to be found anywhere in SHARED_RAM_BASE */ if (machine_is_htcdiamond_cdma() || machine_is_htcraphael_cdma() || machine_is_htcraphael_cdma500()) return 6150; else if (machine_is_htcleo()) ver_base = 0xef230; else ver_base = 0xfc030; // Dump AMMS version *(unsigned int *) (amss_dump + 0x0) = readl(MSM_SHARED_RAM_BASE + ver_base + 0x0); *(unsigned int *) (amss_dump + 0x4) = readl(MSM_SHARED_RAM_BASE + ver_base + 0x4); *(unsigned int *) (amss_dump + 0x8) = readl(MSM_SHARED_RAM_BASE + ver_base + 0x8); *(unsigned int *) (amss_dump + 0xc) = readl(MSM_SHARED_RAM_BASE + ver_base + 0xc); *(unsigned int *) (amss_dump + 0x10) = readl(MSM_SHARED_RAM_BASE + ver_base + 0x10); amss_dump[19] = '\0'; dot1 = strchr(amss_dump, '.'); if(dot1 == NULL) { // CDMA dot1 = strchr(amss_dump, '-'); if(dot1 == NULL) return 0; strncpy(amss_ver, dot1+1, 4); amss_ver[4] = '\0'; return simple_strtoul(amss_ver, NULL, 10); } else { // GSM len = (dot1-amss_dump); strncpy(amss_ver, amss_dump, len); dot1 = strchr(dot1+1, '.'); if(dot1 == NULL) return 0; dot2 = strchr(dot1+1, '.'); if(dot2 == NULL) return 0; strncpy(amss_ver+len, dot1+1, (dot2-dot1)-1); len+= (int)(dot2-dot1)-1; amss_ver[len] = '\0'; return simple_strtoul(amss_ver, NULL, 10); } }