void api_platform_init(void) { // from target_init // Initialize PMIC driver spmi_init(PMIC_ARB_CHANNEL_NUM, PMIC_ARB_OWNER_ID); keys_init(); keys_add_source(&event_source); event_source.keymap[0].enable_longpress = true; }
void platform_init(void) { unsigned base_addr; unsigned char slot; unsigned platform_id = board_platform_id(); static pm8921_dev_t pmic; /* Initialize PMIC driver */ pmic.read = (pm8921_read_func) & pa1_ssbi2_read_bytes; pmic.write = (pm8921_write_func) & pa1_ssbi2_write_bytes; pm8921_init(&pmic); keys_add_source(&event_source); switch(platform_id) { case MSM8960: case MSM8960AB: case APQ8060AB: case MSM8260AB: case MSM8660AB: msm8960_keypad_init(); break; case MSM8130: case MSM8230: case MSM8630: case MSM8930: case MSM8130AA: case MSM8230AA: case MSM8630AA: case MSM8930AA: case MSM8930AB: case MSM8630AB: case MSM8230AB: case MSM8130AB: case APQ8030AB: case APQ8030: case APQ8030AA: msm8930_keypad_init(); break; case APQ8064: case MPQ8064: case APQ8064AA: case APQ8064AB: apq8064_keypad_init(); break; default: dprintf(CRITICAL,"Keyboard is not supported for platform: %d\n",platform_id); }; #ifdef QCOM_ENABLE_EMMC unsigned mmc_sdc_base[] = { MSM_SDC1_BASE, MSM_SDC2_BASE, MSM_SDC3_BASE, MSM_SDC4_BASE }; /* Trying Slot 1 first */ slot = 1; base_addr = mmc_sdc_base[slot - 1]; if (mmc_boot_main(slot, base_addr)) { /* Trying Slot 3 next */ slot = 3; base_addr = mmc_sdc_base[slot - 1]; if (mmc_boot_main(slot, base_addr)) { dprintf(CRITICAL, "mmc init failed!"); ASSERT(0); } } #endif }