示例#1
0
void __init apq8064_init_gpu(void)
{
	unsigned int version = socinfo_get_version();

	if (cpu_is_apq8064ab())
		kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 450000000;
	if (SOCINFO_VERSION_MAJOR(version) == 2) {
		kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 2, 0, 2);
	} else {
		if ((SOCINFO_VERSION_MAJOR(version) == 1) &&
				(SOCINFO_VERSION_MINOR(version) == 1))
			kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 2, 0, 1);
		else
			kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 2, 0, 0);
	}

	platform_device_register(&device_kgsl_3d0);
}
示例#2
0
void operaul_init_gpu(void)
{
    unsigned int version = socinfo_get_version();

    /* Set the turbo speed for the AA and AB respectively */

    if (cpu_is_msm8930aa())
        kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 450000000;

    /* Set up the chip ID based on the SoC version */

    if ((SOCINFO_VERSION_MAJOR(version) == 1) &&
            (SOCINFO_VERSION_MINOR(version) == 2))
        kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 0, 5, 2);
    else
        kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 0, 5, 0);

    platform_device_register(&device_kgsl_3d0);
}
/*
 * Version 1.0 parts can't reliably support more than 1 GHz, therefore truncate
 * the frequency table at that point if we're running on such parts.
 */
unsigned int __init msm_acpu_clock_fixup(void)
{
	unsigned int max;
	struct clkctl_acpu_speed *f;
	uint32_t version = socinfo_get_version();

	if (SOCINFO_VERSION_MINOR(version) == 0)
		max = 998400;
	else
		max = 1305600;

	for (f = acpu_freq_tbl; f->acpuclk_khz != 0; f++) {
		if (f->acpuclk_khz > max) {
			f->acpuclk_khz = 0;
			break;
		}
	}

	return (f - 1)->acpuclk_khz;
}
static int __init acpuclk_8064_probe(struct platform_device *pdev)
{
	int ret;
	if (cpu_is_apq8064ab() ||
		SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 2) {
		acpuclk_8064_params.hfpll_data->low_vdd_l_max = 37;
		acpuclk_8064_params.hfpll_data->nom_vdd_l_max = 74;
	}

	if (opt_bin == 1) {
		acpuclk_8064_params.l2_freq_tbl = l2_freq_tbl_ultra;
		acpuclk_8064_params.l2_freq_tbl_size = sizeof(l2_freq_tbl_ultra);
	}

	ret = acpuclk_krait_init(&pdev->dev, &acpuclk_8064_params);

#ifdef CONFIG_PERFLOCK
		if (!ret)
			perftable_fix_up();
#endif
	return ret;
}
示例#5
0
static int felica_rws_init(void)
{
  int rc = 0;

  #ifdef FEATURE_DEBUG_LOW
  FELICA_DEBUG_MSG("[FELICA_RWS] felica_rws_init - start \n");
  #endif

  /* register the device file */
  rc = misc_register(&felica_rws_device);
  if (rc)
  {
    FELICA_DEBUG_MSG("[FELICA_RWS] FAIL!! can not register felica_int \n");
    return rc;
  }

  if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 1)
  {
    FELICA_DEBUG_MSG("[FELICA_RWS] disable IMA_INT on MSM V1 Soc !!\n");
    return 0;
  }
  rc= request_irq(gpio_to_irq(GPIO_FELICA_INT), felica_int_low_isr, IRQF_TRIGGER_FALLING|IRQF_NO_SUSPEND, FELICA_RWS_NAME, NULL);

  if (rc)
  {
    FELICA_DEBUG_MSG("[FELICA_RWS] FAIL!! can not request_irq \n");
    return rc;
  }

  irq_set_irq_wake(gpio_to_irq(GPIO_FELICA_INT),1);

  #ifdef FEATURE_DEBUG_LOW
  FELICA_DEBUG_MSG("[FELICA_RWS] felica_rws_init - end \n");
  #endif

  return 0;
}
void __init msm8960_init_fb(void)
{
	uint32_t soc_platform_version = socinfo_get_version();


	if (SOCINFO_VERSION_MAJOR(soc_platform_version) >= 3)
		mdp_pdata.mdp_rev = MDP_REV_43;

	if (cpu_is_msm8960ab())
		mdp_pdata.mdp_rev = MDP_REV_44;

	platform_device_register(&msm_fb_device);

#ifdef CONFIG_FB_MSM_WRITEBACK_MSM_PANEL
	platform_device_register(&wfd_panel_device);
	platform_device_register(&wfd_device);
#endif

	platform_device_register(&mipi_dsi_novatek_panel_device);
	platform_device_register(&mipi_dsi_orise_panel_device);

#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
	platform_device_register(&hdmi_msm_device);
#endif

	if (machine_is_msm8960_liquid())
		platform_device_register(&mipi_dsi2lvds_bridge_device);
	else
		platform_device_register(&mipi_dsi_toshiba_panel_device);

	msm_fb_register_device("mdp", &mdp_pdata);
	msm_fb_register_device("mipi_dsi", &mipi_dsi_pdata);
#ifdef CONFIG_MSM_BUS_SCALING
	msm_fb_register_device("dtv", &dtv_pdata);
#endif
}
void __init msm_8974_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

	pr_err("%s:%d socinfo_get_version %x\n", __func__, __LINE__,
		socinfo_get_version());
	if (socinfo_get_version() >= 0x20000)
		msm_tlmm_misc_reg_write(TLMM_SPARE_REG, 0xf);

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	if (!(of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_install(msm_eth_configs, \
			ARRAY_SIZE(msm_eth_configs));
#endif
	msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));

#if !defined(CONFIG_BT_BCM4335) && !defined(CONFIG_BT_BCM4339)
	msm_gpiomux_install(msm_blsp2_uart7_configs,
			 ARRAY_SIZE(msm_blsp2_uart7_configs));
#endif
#if defined(CONFIG_BT_BCM4335) || defined(CONFIG_BT_BCM4339)
	msm_gpiomux_btuart_install();
#endif

	if (of_board_is_liquid())
		msm_gpiomux_install_nowrite(ath_gpio_configs,
					ARRAY_SIZE(ath_gpio_configs));
	msm_gpiomux_install(msm8974_slimbus_config,
			ARRAY_SIZE(msm8974_slimbus_config));
#ifdef CONFIG_SENSORS_GP2A_IIO_PROX
	msm_gpiomux_install(msm_proximity_configs, ARRAY_SIZE(msm_proximity_configs));
#endif
	msm_gpiomux_install(msm_mag_sensor_configs, ARRAY_SIZE(msm_mag_sensor_configs));

		msm_gpiomux_install(hap_lvl_shft_config,
				ARRAY_SIZE(hap_lvl_shft_config));

	if (of_board_is_dragonboard() && machine_is_apq8074())
		msm_gpiomux_install(msm_sensor_configs_dragonboard, \
				ARRAY_SIZE(msm_sensor_configs_dragonboard));
	else
		msm_gpiomux_install(msm_sensor_configs, \
				ARRAY_SIZE(msm_sensor_configs));

	msm_gpiomux_install(&sd_card_det, 1);

	msm_gpiomux_install(msm_disp_configs, ARRAY_SIZE(msm_disp_configs));

	if (machine_is_apq8074() && (of_board_is_liquid() || \
	    of_board_is_dragonboard()))
		msm_gpiomux_sdc3_install();

	if (!(of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_sdc4_install();

	msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config));
	msm_gpiomux_install(tx_gtr_thres_enable_config, ARRAY_SIZE(tx_gtr_thres_enable_config));
	msm_gpiomux_install(speaker_enable_config, ARRAY_SIZE(speaker_enable_config));
	msm_gpiomux_install(ear_send_end_config, ARRAY_SIZE(ear_send_end_config));
	msm_gpiomux_install(msm_hsic_hub_configs,
				ARRAY_SIZE(msm_hsic_hub_configs));

	msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs));

	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));

	if (of_board_is_liquid() ||
	    (of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_install(msm8974_pri_ter_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_ter_auxpcm_configs));
	else
		msm_gpiomux_install(msm8974_pri_pri_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_pri_auxpcm_configs));

	if (of_board_is_cdp()) {
#if 0 /* Not used at Mondrian */
		msm_gpiomux_install(msm8974_sec_auxpcm_configs,
				 ARRAY_SIZE(msm8974_sec_auxpcm_configs));
#endif
	} else if (of_board_is_liquid() || of_board_is_fluid() ||
						of_board_is_mtp())
		msm_gpiomux_install(msm_epm_configs,
				ARRAY_SIZE(msm_epm_configs));

	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));

#if !defined(CONFIG_BT_BCM4335) && !defined(CONFIG_BT_BCM4339)
	if (of_board_is_rumi())
		msm_gpiomux_install(msm_rumi_blsp_configs,
				    ARRAY_SIZE(msm_rumi_blsp_configs));
#endif

	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_MDM)
		msm_gpiomux_install(mdm_configs,
			ARRAY_SIZE(mdm_configs));

	if (of_board_is_dragonboard() && machine_is_apq8074())
		msm_gpiomux_install(apq8074_dragonboard_ts_config,
			ARRAY_SIZE(apq8074_dragonboard_ts_config));
			
	msm_gpiomux_install(gpio_nc_configs, ARRAY_SIZE(gpio_nc_configs));

}
void __init msm_8974_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

	pr_err("%s:%d socinfo_get_version %x\n", __func__, __LINE__,
	socinfo_get_version());
	msm_tlmm_misc_reg_write(TLMM_SPARE_REG, 0x5);

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	msm_gpiomux_install(msm_eth_configs, ARRAY_SIZE(msm_eth_configs));
#endif
	msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));

#if !defined(CONFIG_BT_BCM4335) && !defined(CONFIG_BT_BCM4339)
	msm_gpiomux_install(msm_blsp2_uart7_configs, ARRAY_SIZE(msm_blsp2_uart7_configs));
#endif

#if 0 //defined(CONFIG_BT_BCM4335) || defined(CONFIG_BT_BCM4339)
	msm_gpiomux_btuart_install();
#endif

	msm_gpiomux_install(msm8974_slimbus_config,
			ARRAY_SIZE(msm8974_slimbus_config));

	msm_gpiomux_install(ext_buck_configs, ARRAY_SIZE(ext_buck_configs));
	msm_gpiomux_install(hw_rev_configs, ARRAY_SIZE(hw_rev_configs));
	msm_gpiomux_install(gpio_nc_configs, ARRAY_SIZE(gpio_nc_configs));
#if !defined(CONFIG_SENSORS_SSP)
	msm_gpiomux_install(hap_lvl_shft_config,
				ARRAY_SIZE(hap_lvl_shft_config));
#endif

	msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));

	msm_gpiomux_install(&sd_card_det, 1);

#ifdef CONFIG_MACH_KS01
	if(system_rev < 3)
		msm_gpiomux_install(wcnss_5wire_interface,
					ARRAY_SIZE(wcnss_5wire_interface));
	else
		msm_gpiomux_sdc3_install();
#else
	msm_gpiomux_sdc3_install();
#endif

	msm_gpiomux_sdc4_install();

	msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config));
	msm_gpiomux_install(es325_config, ARRAY_SIZE(es325_config));
	msm_gpiomux_install(ear_send_end_config, ARRAY_SIZE(ear_send_end_config));

#if !defined(CONFIG_SENSORS_SSP)
	msm_gpiomux_install(msm_hsic_hub_configs,
				ARRAY_SIZE(msm_hsic_hub_configs));
#endif
#if defined(CONFIG_SENSORS_SSP)
	msm_gpiomux_install(ssp_configs,
				ARRAY_SIZE(ssp_configs));
#endif

	msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs));

	if (system_rev > 6)
		msm_gpiomux_install(msm_hdmi_ddc_configs,
				ARRAY_SIZE(msm_hdmi_ddc_configs));
#ifdef CONFIG_VIDEO_MHL_V2
	if(system_rev > 1)
		msm_gpiomux_install(mhl_configs, ARRAY_SIZE(mhl_configs));
#endif
#if defined(CONFIG_BCM2079X_NFC_I2C) || defined(CONFIG_NFC_PN547)
	msm_gpiomux_install(msm_nfc_configs,
	ARRAY_SIZE(msm_nfc_configs));
	if(system_rev == 9 || system_rev == 10) { // over-write I2C config, rev09,10 has no external Pull-up register.
		msm_gpiomux_install(msm_nfc_i2c_configs_rev09,
		ARRAY_SIZE(msm_nfc_i2c_configs_rev09));
	}
#endif

#if defined(CONFIG_BCM4335) || defined(CONFIG_BCM4335_MODULE) || defined(CONFIG_BCM4339) || defined(CONFIG_BCM4339_MODULE)
	msm_gpiomux_wlan_host_wakeup_install();
#endif /* defined(CONFIG_BCM4335) || defined(CONFIG_BCM4335_MODULE) || defined(CONFIG_BCM4339) || defined(CONFIG_BCM4339_MODULE) */

#if defined(CONFIG_LEDS_AN30259A)
#if defined(CONFIG_MACH_KS01SKT) || defined(CONFIG_MACH_KS01KTT)\
		|| defined(CONFIG_MACH_KS01LGT)

	if (system_rev < 7) {
		msm_gpiomux_install(an30259a_led_config,
				ARRAY_SIZE(an30259a_led_config));
	}
	else
	{
		msm_gpiomux_install(an30259a_led_config_rev7,
				ARRAY_SIZE(an30259a_led_config_rev7));
	}
#else
	msm_gpiomux_install(an30259a_led_config,
				ARRAY_SIZE(an30259a_led_config));
#endif
#endif

	msm_gpiomux_install(msm8974_pri_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_auxpcm_configs));

#if !defined(CONFIG_BT_BCM4335) && !defined(CONFIG_BT_BCM4339)
	if (of_board_is_rumi())
		msm_gpiomux_install(msm_rumi_blsp_configs,
				    ARRAY_SIZE(msm_rumi_blsp_configs));
#endif

#if defined(CONFIG_GSM_MODEM_SPRD6500)
	msm_gpiomux_sc6500_spi_install();
#endif

#ifdef CONFIG_SENSORS_HALL
	msm_gpiomux_install(msm8974_hall_configs, ARRAY_SIZE(msm8974_hall_configs));
#endif

#ifdef CONFIG_W1_SLAVE_DS28EL15
	msm_gpiomux_install(msm8974_cover_id_config, ARRAY_SIZE(msm8974_cover_id_config));
#endif

#ifdef CONFIG_SENSORS_VFS61XX
	msm_gpiomux_install(msm8974_fingerprint_configs,
		ARRAY_SIZE(msm8974_fingerprint_configs));
	if (system_rev > 2)
		msm_gpiomux_install(msm8974_fingerprint_rev03_configs,
			ARRAY_SIZE(msm8974_fingerprint_rev03_configs));
#endif

	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_MDM)
		msm_gpiomux_install(mdm_configs,
			ARRAY_SIZE(mdm_configs));

	if (of_board_is_dragonboard() && machine_is_apq8074())
		msm_gpiomux_install(apq8074_dragonboard_ts_config,
			ARRAY_SIZE(apq8074_dragonboard_ts_config));

#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI
	printk(KERN_INFO "%s:[TSP] touch config.\n",__func__);
	msm_gpiomux_install(msm8974_touch_config,
			ARRAY_SIZE(msm8974_touch_config));
#endif

	msm_gpiomux_install(msm8974_te_configs, ARRAY_SIZE(msm8974_te_configs));
	msm_gpiomux_install(msm8974_oled_id_configs, ARRAY_SIZE(msm8974_oled_id_configs));
	msm_gpiomux_install(msm8974_uart_config, ARRAY_SIZE(msm8974_uart_config));
	msm_gpiomux_install(msm8974_fpga_config, ARRAY_SIZE(msm8974_fpga_config));
}
void __init msm_8974_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

	pr_err("%s:%d socinfo_get_version %x\n", __func__, __LINE__,
	socinfo_get_version());
	msm_tlmm_misc_reg_write(TLMM_SPARE_REG, 0x5);

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	msm_gpiomux_install(msm_eth_configs, ARRAY_SIZE(msm_eth_configs));
#endif
	msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));

#if !defined(CONFIG_MACH_KS01SKT) && !defined(CONFIG_MACH_KS01KTT)\
	&& !defined(CONFIG_MACH_KS01LGT)
	msm_gpiomux_install(msm_blsp2_uart7_configs, ARRAY_SIZE(msm_blsp2_uart7_configs));
#endif

#if defined(CONFIG_MACH_KS01SKT) || defined(CONFIG_MACH_KS01KTT)\
	|| defined(CONFIG_MACH_KS01LGT)	&& defined(CONFIG_BT_BCM4335)
	msm_gpiomux_btuart_install();
#endif

	msm_gpiomux_install(msm8974_slimbus_config,
			ARRAY_SIZE(msm8974_slimbus_config));

	msm_gpiomux_install(msm_touch_configs, ARRAY_SIZE(msm_touch_configs));
#if !defined(CONFIG_SENSORS_SSP)
		msm_gpiomux_install(hap_lvl_shft_config,
				ARRAY_SIZE(hap_lvl_shft_config));
#endif

	msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));

#ifdef CONFIG_MACH_KS01
	msm_gpiomux_install(&sd_card_det, 1);

	if(system_rev < 3)
		msm_gpiomux_install(wcnss_5wire_interface,
					ARRAY_SIZE(wcnss_5wire_interface));
	else
		msm_gpiomux_sdc3_install();
#else
	msm_gpiomux_sdc3_install();
#endif

	msm_gpiomux_sdc4_install();

	msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config));

#if !defined(CONFIG_SENSORS_SSP)
	msm_gpiomux_install(msm_hsic_hub_configs,
				ARRAY_SIZE(msm_hsic_hub_configs));
#endif
#if defined(CONFIG_SENSORS_SSP)
	msm_gpiomux_install(ssp_configs,
				ARRAY_SIZE(ssp_configs));
#endif

	msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs));
#if defined(CONFIG_BCM2079X_NFC_I2C)
	msm_gpiomux_install(msm_nfc_configs,
	ARRAY_SIZE(msm_nfc_configs));
#endif

#if defined(CONFIG_BCM4335) || defined(CONFIG_BCM4335_MODULE)
	msm_gpiomux_wlan_host_wakeup_install();
#endif /* defined(CONFIG_BCM4335) || defined(CONFIG_BCM4335_MODULE) */

#if defined(CONFIG_LEDS_AN30259A)
#if defined(CONFIG_MACH_KS01SKT) || defined(CONFIG_MACH_KS01KTT)\
		|| defined(CONFIG_MACH_KS01LGT)

	if (system_rev < 7) {
		msm_gpiomux_install(an30259a_led_config,
				ARRAY_SIZE(an30259a_led_config));
	}
	else
	{
		msm_gpiomux_install(an30259a_led_config_rev7,
				ARRAY_SIZE(an30259a_led_config_rev7));
	}
#else
	msm_gpiomux_install(an30259a_led_config,
				ARRAY_SIZE(an30259a_led_config));
#endif
#endif

	msm_gpiomux_install(msm8974_pri_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_auxpcm_configs));

	if (of_board_is_rumi())
		msm_gpiomux_install(msm_rumi_blsp_configs,
				    ARRAY_SIZE(msm_rumi_blsp_configs));

	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_MDM)
		msm_gpiomux_install(mdm_configs,
			ARRAY_SIZE(mdm_configs));

	if (of_board_is_dragonboard() && machine_is_apq8074())
		msm_gpiomux_install(apq8074_dragonboard_ts_config,
			ARRAY_SIZE(apq8074_dragonboard_ts_config));

#ifdef CONFIG_SENSORS_HALL
	msm_gpiomux_install(msm8974_hall_configs, ARRAY_SIZE(msm8974_hall_configs));
#endif

#ifdef CONFIG_KEYBOARD_CYPRESS_TOUCH
	msm_gpiomux_install(cypress_touch_configs, ARRAY_SIZE(cypress_touch_configs));
#endif

	msm_gpiomux_install(fpga_tflash, ARRAY_SIZE(fpga_tflash));

	msm_gpiomux_install(nc_configs,
			ARRAY_SIZE(nc_configs));
}
void __init ursa_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

	/* shared with all board revisions P0 - EVT */
	msm_gpiomux_install(ursa_audio_configs_common, ARRAY_SIZE(ursa_audio_configs_common));
	msm_gpiomux_install(ursa_camera_configs_common, ARRAY_SIZE(ursa_camera_configs_common));
	msm_gpiomux_install(ursa_sensor_configs_common, ARRAY_SIZE(ursa_sensor_configs_common));
	msm_gpiomux_install_nowrite(ursa_display_configs, ARRAY_SIZE(ursa_display_configs));
	msm_gpiomux_install(ursa_nfc_configs, ARRAY_SIZE(ursa_nfc_configs));
	msm_gpiomux_install(ursa_system_configs_common, ARRAY_SIZE(ursa_system_configs_common));
	msm_gpiomux_install(ursa_touch_configs_common, ARRAY_SIZE(ursa_touch_configs_common));

	if (ursa_board_revision() == URSA_REVISION_P1)
	{
		msm_gpiomux_install(ursa_audio_configs_p1, ARRAY_SIZE(ursa_audio_configs_p1));
		msm_gpiomux_install(ursa_bt_wifi_configs_p1, ARRAY_SIZE(ursa_bt_wifi_configs_p1));
		msm_gpiomux_install(ursa_camera_configs_p1p2common, ARRAY_SIZE(ursa_camera_configs_p1p2common));
		msm_gpiomux_install(ursa_sensor_configs_p1_pre_evt, ARRAY_SIZE(ursa_sensor_configs_p1_pre_evt));
		msm_gpiomux_install(ursa_system_configs_p1, ARRAY_SIZE(ursa_system_configs_p1));
		msm_gpiomux_install(ursa_touch_configs_p1, ARRAY_SIZE(ursa_touch_configs_p1));
		/* before pre DVT */
		msm_gpiomux_install(ursa_camera_configs_p1p2evt_common, ARRAY_SIZE(ursa_camera_configs_p1p2evt_common));
	}
	else if (ursa_board_revision() == URSA_REVISION_P0_5)
	{
		/* shared with P1 family*/
		msm_gpiomux_install(ursa_audio_configs_p1, ARRAY_SIZE(ursa_audio_configs_p1));
		msm_gpiomux_install(ursa_bt_wifi_configs_p1, ARRAY_SIZE(ursa_bt_wifi_configs_p1));
		msm_gpiomux_install(ursa_camera_configs_p1p2common, ARRAY_SIZE(ursa_camera_configs_p1p2common));
		msm_gpiomux_install(ursa_sensor_configs_p1_pre_evt, ARRAY_SIZE(ursa_sensor_configs_p1_pre_evt));
		msm_gpiomux_install(ursa_system_configs_p1, ARRAY_SIZE(ursa_system_configs_p1));
		msm_gpiomux_install(ursa_touch_configs_p1, ARRAY_SIZE(ursa_touch_configs_p1));
		/* different for P0.5 */
		msm_gpiomux_install(ursa_configs_p0_5, ARRAY_SIZE(ursa_configs_p0_5));
		/* before pre DVT */
		msm_gpiomux_install(ursa_camera_configs_p1p2evt_common, ARRAY_SIZE(ursa_camera_configs_p1p2evt_common));
	}
	else if ((ursa_board_revision() == URSA_REVISION_P2) ||
		 (ursa_board_revision() == URSA_REVISION_PRE_EVT))
	{
		/* shared with P1 family */
		msm_gpiomux_install(ursa_audio_configs_p1, ARRAY_SIZE(ursa_audio_configs_p1));
		msm_gpiomux_install(ursa_bt_wifi_configs_p1, ARRAY_SIZE(ursa_bt_wifi_configs_p1));
		msm_gpiomux_install(ursa_camera_configs_p1p2common, ARRAY_SIZE(ursa_camera_configs_p1p2common));
		msm_gpiomux_install(ursa_sensor_configs_p1_pre_evt, ARRAY_SIZE(ursa_sensor_configs_p1_pre_evt));
		msm_gpiomux_install(ursa_system_configs_p1, ARRAY_SIZE(ursa_system_configs_p1));
		msm_gpiomux_install(ursa_touch_configs_p1, ARRAY_SIZE(ursa_touch_configs_p1));
		/* different for P2 */
		msm_gpiomux_install(ursa_camera_configs_p2, ARRAY_SIZE(ursa_camera_configs_p2));
		msm_gpiomux_install(ursa_nfc_configs_p2, ARRAY_SIZE(ursa_nfc_configs_p2));
		msm_gpiomux_install(ursa_system_configs_p2, ARRAY_SIZE(ursa_system_configs_p2));
		/* before pre DVT */
		msm_gpiomux_install(ursa_camera_configs_p1p2evt_common, ARRAY_SIZE(ursa_camera_configs_p1p2evt_common));
	}
	else if ((ursa_board_revision() == URSA_REVISION_EVT)  ||
		 (ursa_board_revision() == URSA_REVISION_P0_E))
	{
		/* shared with P1 family */
		msm_gpiomux_install(ursa_audio_configs_p1, ARRAY_SIZE(ursa_audio_configs_p1));
		msm_gpiomux_install(ursa_bt_wifi_configs_p1, ARRAY_SIZE(ursa_bt_wifi_configs_p1));
		msm_gpiomux_install(ursa_camera_configs_p1p2common, ARRAY_SIZE(ursa_camera_configs_p1p2common));
		msm_gpiomux_install(ursa_system_configs_p1, ARRAY_SIZE(ursa_system_configs_p1));
		msm_gpiomux_install(ursa_touch_configs_p1, ARRAY_SIZE(ursa_touch_configs_p1));
		/* shared with P2 */
		msm_gpiomux_install(ursa_camera_configs_p2, ARRAY_SIZE(ursa_camera_configs_p2));
		msm_gpiomux_install(ursa_nfc_configs_p2, ARRAY_SIZE(ursa_nfc_configs_p2));
		msm_gpiomux_install(ursa_system_configs_p2, ARRAY_SIZE(ursa_system_configs_p2));
		/* before pre DVT */
		msm_gpiomux_install(ursa_camera_configs_p1p2evt_common, ARRAY_SIZE(ursa_camera_configs_p1p2evt_common));
	}
	else if ((ursa_board_revision() == URSA_REVISION_PRE_DVT) )
	{
		/* shared with P1 family */
		msm_gpiomux_install(ursa_audio_configs_p1, ARRAY_SIZE(ursa_audio_configs_p1));
		msm_gpiomux_install(ursa_bt_wifi_configs_p1, ARRAY_SIZE(ursa_bt_wifi_configs_p1));
		msm_gpiomux_install(ursa_camera_configs_p1p2common, ARRAY_SIZE(ursa_camera_configs_p1p2common));
		msm_gpiomux_install(ursa_system_configs_p1, ARRAY_SIZE(ursa_system_configs_p1));
		msm_gpiomux_install(ursa_touch_configs_p1, ARRAY_SIZE(ursa_touch_configs_p1));
		/* shared with P2 */
		msm_gpiomux_install(ursa_nfc_configs_p2, ARRAY_SIZE(ursa_nfc_configs_p2));
		msm_gpiomux_install(ursa_system_configs_p2, ARRAY_SIZE(ursa_system_configs_p2));
		/* pre DVT */
		msm_gpiomux_install(ursa_camera_configs_pre_dvt, ARRAY_SIZE(ursa_camera_configs_pre_dvt));
	}
	else if ((ursa_board_revision() == URSA_REVISION_DVT) ||
		 (ursa_board_revision() == URSA_REVISION_DVT3GS) ||
		 (ursa_board_revision() == URSA_REVISION_PRE_DVT2) )
	{
		/* shared with P1 family */
		msm_gpiomux_install(ursa_audio_configs_p1, ARRAY_SIZE(ursa_audio_configs_p1));
		msm_gpiomux_install(ursa_bt_wifi_configs_p1, ARRAY_SIZE(ursa_bt_wifi_configs_p1));
		msm_gpiomux_install(ursa_camera_configs_p1p2common, ARRAY_SIZE(ursa_camera_configs_p1p2common));
		msm_gpiomux_install(ursa_system_configs_p1, ARRAY_SIZE(ursa_system_configs_p1));
		msm_gpiomux_install(ursa_touch_configs_p1, ARRAY_SIZE(ursa_touch_configs_p1));
		/* shared with P2 */
		msm_gpiomux_install(ursa_nfc_configs_p2, ARRAY_SIZE(ursa_nfc_configs_p2));
		msm_gpiomux_install(ursa_system_configs_p2, ARRAY_SIZE(ursa_system_configs_p2));
		/* DVT */
		msm_gpiomux_install(ursa_camera_configs_dvt, ARRAY_SIZE(ursa_camera_configs_dvt));
	}
	else if (ursa_board_revision() == URSA_REVISION_DVTHD)
	{
		/* shared with P1 family */
		msm_gpiomux_install(ursa_audio_configs_p1, ARRAY_SIZE(ursa_audio_configs_p1));
		msm_gpiomux_install(ursa_bt_wifi_configs_p1, ARRAY_SIZE(ursa_bt_wifi_configs_p1));
		msm_gpiomux_install(ursa_system_configs_p1, ARRAY_SIZE(ursa_system_configs_p1));
		msm_gpiomux_install(ursa_touch_configs_p1, ARRAY_SIZE(ursa_touch_configs_p1));
		/* shared with P2 */
		msm_gpiomux_install(ursa_nfc_configs_p2, ARRAY_SIZE(ursa_nfc_configs_p2));
		msm_gpiomux_install(ursa_system_configs_p2, ARRAY_SIZE(ursa_system_configs_p2));
		/* DVT */
		msm_gpiomux_install(ursa_camera_configs_dvt, ARRAY_SIZE(ursa_camera_configs_dvt));
		/* DVTHD */
		msm_gpiomux_install(ursa_camera_configs_dvthd, ARRAY_SIZE(ursa_camera_configs_dvthd));
		msm_gpiomux_install(ursa_hdmi_configs, ARRAY_SIZE(ursa_hdmi_configs));
	}
	else
	{
		pr_crit("%s - Invalid board revision\n", __func__);
		panic("ursa-gpiomux: Invalid board revision");
	}

	// Switch camera MCLK source to alternate clocks
	if (socinfo_get_version() >= 0x20000) {
		msm_tlmm_misc_reg_write(TLMM_SPARE_REG, 0x5);
	}
}
示例#11
0
int __init msm8960_init_gpiomux(void)
{
	int rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return rc;
	}

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	msm_gpiomux_install(msm8960_ethernet_configs,
			ARRAY_SIZE(msm8960_ethernet_configs));
#endif

	msm_gpiomux_install(msm8960_gsbi_configs,
			ARRAY_SIZE(msm8960_gsbi_configs));

#ifdef CONFIG_VP_A2220
		msm_gpiomux_install(audience_suspend_configs,
			ARRAY_SIZE(audience_suspend_configs));
#endif

	msm8960_gpio_key_configs[0].gpio = gpio_rev(VOLUME_UP);
	msm8960_gpio_key_configs[1].gpio = gpio_rev(VOLUME_DOWN);
	if (system_rev < BOARD_REV13)
		msm_gpiomux_install(msm8960_gpio_key_configs, 2);
	else
		msm_gpiomux_install(msm8960_gpio_key_configs,
			ARRAY_SIZE(msm8960_gpio_key_configs));

	msm_gpiomux_install(msm8960_sec_ts_configs,
			ARRAY_SIZE(msm8960_sec_ts_configs));

	msm_gpiomux_install(msm8960_sec_sensor_configs,
			ARRAY_SIZE(msm8960_sec_sensor_configs));

	msm_gpiomux_install(msm8960_audio_codec_configs,
			ARRAY_SIZE(msm8960_audio_codec_configs));

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	if (system_rev >= BOARD_REV09)
		msm_gpiomux_install(sdc4_interface, ARRAY_SIZE(sdc4_interface));
	else
#endif
		msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));

	msm_gpiomux_install(msm8960_audio_i2s_rx_codec_configs,
			ARRAY_SIZE(msm8960_audio_i2s_tx_codec_configs));

	msm_gpiomux_install(msm8960_audio_i2s_tx_codec_configs,
			ARRAY_SIZE(msm8960_audio_i2s_tx_codec_configs));

#ifdef CONFIG_USB_SWITCH_FSA9485
	msm_gpiomux_install(msm8960_fsa9485_configs,
			ARRAY_SIZE(msm8960_fsa9485_configs));
#endif

	if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() ||
		machine_is_msm8960_liquid() || machine_is_msm8960_cdp())
		msm_gpiomux_install(hap_lvl_shft_config,
			ARRAY_SIZE(hap_lvl_shft_config));

	if (PLATFORM_IS_CHARM25())
		msm_gpiomux_install(mdm_configs,
			ARRAY_SIZE(mdm_configs));

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
		(PLATFORM_IS_CHARM25() || machine_is_msm8960_liquid()))
		msm_gpiomux_install(msm8960_hsic_configs,
			ARRAY_SIZE(msm8960_hsic_configs));
#endif

#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
	msm_gpiomux_install(msm8960_hdmi_configs,
			ARRAY_SIZE(msm8960_hdmi_configs));
#endif

#if defined(CONFIG_VIDEO_MHL_V1) || defined(CONFIG_VIDEO_MHL_V2)
	msm_gpiomux_install(msm8960_mhl_configs,
			ARRAY_SIZE(msm8960_mhl_configs));
#endif

	msm_gpiomux_install(msm8960_mdp_vsync_configs,
			ARRAY_SIZE(msm8960_mdp_vsync_configs));

	return 0;
}
int __init msm8960_init_gpiomux(void)
{
	int rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return rc;
	}

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	if (socinfo_get_platform_subtype() != PLATFORM_SUBTYPE_SGLTE)
		msm_gpiomux_install(msm8960_ethernet_configs,
				ARRAY_SIZE(msm8960_ethernet_configs));
#endif

	msm_gpiomux_install(msm8960_gsbi_configs,
			ARRAY_SIZE(msm8960_gsbi_configs));

	msm_gpiomux_install(msm8960_cyts_configs,
			ARRAY_SIZE(msm8960_cyts_configs));

	msm_gpiomux_install(msm8960_slimbus_config,
			ARRAY_SIZE(msm8960_slimbus_config));

	msm_gpiomux_install(msm8960_audio_codec_configs,
			ARRAY_SIZE(msm8960_audio_codec_configs));

	msm_gpiomux_install(msm8960_audio_auxpcm_configs,
			ARRAY_SIZE(msm8960_audio_auxpcm_configs));

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	msm_gpiomux_install(msm8960_sdcc4_configs,
		ARRAY_SIZE(msm8960_sdcc4_configs));
#endif

	if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() ||
		machine_is_msm8960_liquid() || machine_is_msm8960_cdp()) {
		if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE)
			msm_gpiomux_install(hap_lvl_shft_config_sglte,
				ARRAY_SIZE(hap_lvl_shft_config_sglte));

		else
			msm_gpiomux_install(hap_lvl_shft_config,
				ARRAY_SIZE(hap_lvl_shft_config));
	}

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
		machine_is_msm8960_liquid())
		msm_gpiomux_install(msm8960_hsic_configs,
			ARRAY_SIZE(msm8960_hsic_configs));

	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
			machine_is_msm8960_liquid())
		msm_gpiomux_install(msm8960_hsic_hub_configs,
			ARRAY_SIZE(msm8960_hsic_hub_configs));
#endif

#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
	msm_gpiomux_install(msm8960_hdmi_configs,
			ARRAY_SIZE(msm8960_hdmi_configs));
#endif

	msm_gpiomux_install(msm8960_mdp_vsync_configs,
			ARRAY_SIZE(msm8960_mdp_vsync_configs));

	if (socinfo_get_platform_subtype() != PLATFORM_SUBTYPE_SGLTE)
		msm_gpiomux_install(msm8960_gsbi8_uartdm_configs,
			ARRAY_SIZE(msm8960_gsbi8_uartdm_configs));

	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE)
		msm_gpiomux_install(msm8960_gsbi8_uart_configs,
			ARRAY_SIZE(msm8960_gsbi8_uart_configs));
	else
		msm_gpiomux_install(msm8960_gsbi5_uart_configs,
			ARRAY_SIZE(msm8960_gsbi5_uart_configs));

	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) {
		/* For 8960 Fusion 2.2 Primary IPC */
		msm_gpiomux_install(msm8960_fusion_gsbi_configs,
			ARRAY_SIZE(msm8960_fusion_gsbi_configs));
		/* For SGLTE 8960 Fusion External VFR */
		msm_gpiomux_install(msm8960_external_vfr_configs,
			ARRAY_SIZE(msm8960_external_vfr_configs));
	}

#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	msm_gpiomux_install(msm8960_sdcc2_configs,
		ARRAY_SIZE(msm8960_sdcc2_configs));
#endif

	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE)
		msm_gpiomux_install(sglte_configs,
			ARRAY_SIZE(sglte_configs));

	return 0;
}
void __init msm_8974_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

	pr_err("%s:%d socinfo_get_version %x\n", __func__, __LINE__,
		socinfo_get_version());
	if (socinfo_get_version() >= 0x20000)
		msm_tlmm_misc_reg_write(TLMM_SPARE_REG, 0xf);

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	if (!(of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_install(msm_eth_configs, \
			ARRAY_SIZE(msm_eth_configs));
#endif
	msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));

#if !defined(CONFIG_BT_BCM4335) && !defined(CONFIG_BT_BCM4339)
	msm_gpiomux_install(msm_blsp2_uart7_configs,
			 ARRAY_SIZE(msm_blsp2_uart7_configs));
#endif
#if 0 //defined(CONFIG_BT_BCM4335) || defined(CONFIG_BT_BCM4339)
	msm_gpiomux_btuart_install();
#endif

	msm_gpiomux_install(msm8974_slimbus_config,
			ARRAY_SIZE(msm8974_slimbus_config));

	msm_gpiomux_install(msm_touch_configs, ARRAY_SIZE(msm_touch_configs));
#if !defined(CONFIG_SENSORS_SSP)
		msm_gpiomux_install(hap_lvl_shft_config,
				ARRAY_SIZE(hap_lvl_shft_config));
#endif

	msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));


	msm_gpiomux_install(&sd_card_det, 1);
	msm_gpiomux_sdc3_install();

	msm_gpiomux_sdc4_install();

	msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config));
	msm_gpiomux_install(fuel_i2c_config, ARRAY_SIZE(fuel_i2c_config));
#if !defined(CONFIG_SENSORS_SSP)
	msm_gpiomux_install(msm_hsic_hub_configs,
				ARRAY_SIZE(msm_hsic_hub_configs));
#endif
#if defined(CONFIG_SENSORS_SSP)
	msm_gpiomux_install(ssp_configs,
				ARRAY_SIZE(ssp_configs));
#endif

	msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs));
#if defined(CONFIG_BCM2079X_NFC_I2C) || defined(CONFIG_NFC_PN547)
	msm_gpiomux_install(msm_nfc_configs,
	ARRAY_SIZE(msm_nfc_configs));
#endif
	msm_gpiomux_install(msm8974_pri_pri_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_pri_auxpcm_configs));

#if defined(CONFIG_BCM4335) || defined(CONFIG_BCM4335_MODULE) || defined(CONFIG_BCM4339) || defined(CONFIG_BCM4339_MODULE)
	msm_gpiomux_wlan_host_wakeup_install();
#endif /* defined(CONFIG_BCM4335) || defined(CONFIG_BCM4335_MODULE) || defined(CONFIG_BCM4339) || defined(CONFIG_BCM4339_MODULE) */

#if defined(CONFIG_LEDS_AN30259A)
	if (system_rev < 7) {
		msm_gpiomux_install(an30259a_led_config,
				ARRAY_SIZE(an30259a_led_config));
	}
	else
	{
		msm_gpiomux_install(an30259a_led_config_rev7,
				ARRAY_SIZE(an30259a_led_config_rev7));
	}
#endif

	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));

#if !defined(CONFIG_BT_BCM4335) && !defined(CONFIG_BT_BCM4339)
	if (of_board_is_rumi())
		msm_gpiomux_install(msm_rumi_blsp_configs,
				    ARRAY_SIZE(msm_rumi_blsp_configs));
#endif

	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_MDM)
		msm_gpiomux_install(mdm_configs,
			ARRAY_SIZE(mdm_configs));

	if (of_board_is_dragonboard() && machine_is_apq8074())
		msm_gpiomux_install(apq8074_dragonboard_ts_config,
			ARRAY_SIZE(apq8074_dragonboard_ts_config));

#ifdef CONFIG_SENSORS_HALL
	msm_gpiomux_install(msm8974_hall_configs, ARRAY_SIZE(msm8974_hall_configs));
#endif

#if defined(CONFIG_KEYBOARD_CYPRESS_TOUCHKEY_KS01)
	msm_gpiomux_install(cypress_touch_configs, ARRAY_SIZE(cypress_touch_configs));
#endif

	msm_gpiomux_install(fpga_tflash, ARRAY_SIZE(fpga_tflash));

#if defined(CONFIG_TDMB) || defined(CONFIG_TDMB_MODULE)
	msm_gpiomux_install(tdmb_int_config, ARRAY_SIZE(tdmb_int_config));
#endif

#if defined(CONFIG_MACH_KS01EUR)
	msm_gpiomux_install(batt_rem_alarm_configs,
			ARRAY_SIZE(batt_rem_alarm_configs));
#endif

	msm_gpiomux_install(nc_configs,
			ARRAY_SIZE(nc_configs));
#if defined(CONFIG_MACH_KS01EUR)
	msm_gpiomux_install(wireless_charge_configs, ARRAY_SIZE(wireless_charge_configs));
#endif
}
示例#14
0
static void __init msm7x30_init(void)
{
	uint32_t soc_version = 0;

	if (socinfo_init() < 0)
		printk(KERN_ERR "%s: socinfo_init() failed!\n",
		       __func__);

	soc_version = socinfo_get_version();

	msm_clock_init(msm_clocks_7x30, msm_num_clocks_7x30);
#ifdef CONFIG_SERIAL_MSM_CONSOLE
	if (lge_get_uart_mode())
		msm7x30_init_uart2();
#endif
	msm_spm_init(&msm_spm_data, 1);
	msm_acpu_clock_init(&msm7x30_clock_data);

	msm_add_pmem_devices();
	msm_add_fb_device();
	msm_add_kgsl_device();

	msm_add_usb_devices();

	msm7x30_init_marimba();

#ifdef CONFIG_MSM7KV2_AUDIO
	lge_victor_audio_init();
	msm_snddev_init();
	aux_pcm_gpio_init();
#endif

	if (lge_get_uart_mode())
		platform_device_register(&msm_device_uart2);

	platform_add_devices(devices, ARRAY_SIZE(devices));

	msm_device_i2c_init();
	msm_device_i2c_2_init();
	qup_device_i2c_init();

    register_board_info();

#ifdef CONFIG_I2C_SSBI
	msm_device_ssbi6.dev.platform_data = &msm_i2c_ssbi6_pdata;
	msm_device_ssbi7.dev.platform_data = &msm_i2c_ssbi7_pdata;
#endif

	/* initialize pm */
	pmic8058_buses_init();
	pmic8058_leds_init();    // LGE_UPDATE [email protected]. PMIC LED Control Drv.
	lge_pm_set_platform_data();
	pm8058_special_clock0_setting();

	/* add lcd devices */
	lge_add_lcd_devices();

	/* add mmc devices */
	lge_add_mmc_devices();

	/* add misc devices */
	lge_add_misc_devices();

	/* add input devices */
	lge_add_input_devices();

	/* gpio i2c devices should be registered at latest point */
	lge_add_gpio_i2c_devices();

	/* add buletooth devices */
	lge_add_btpower_devices();

	/* add camera devices */
	lge_add_camera_devices();

	/* add ram console device */
#ifdef CONFIG_ANDROID_RAM_CONSOLE
	lge_add_ramconsole_devices();
#endif

#if defined(CONFIG_ANDROID_RAM_CONSOLE) && defined(CONFIG_LGE_HANDLE_PANIC)
	lge_add_panic_handler_devices();
#endif
}
int __init msm8960_init_gpiomux(void)
{
	int rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return rc;
	}

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	msm_gpiomux_install(msm8960_ethernet_configs,
			ARRAY_SIZE(msm8960_ethernet_configs));
#endif

	msm_gpiomux_install(msm8960_gsbi_configs,
			ARRAY_SIZE(msm8960_gsbi_configs));

	msm_gpiomux_install(msm8960_cyts_configs,
			ARRAY_SIZE(msm8960_cyts_configs));

	msm_gpiomux_install(msm8960_slimbus_config,
			ARRAY_SIZE(msm8960_slimbus_config));

	msm_gpiomux_install(msm8960_audio_codec_configs,
			ARRAY_SIZE(msm8960_audio_codec_configs));
#ifdef CONFIG_LGE_AUDIO
	/* LGE_CHANGE
	* 2012-01-30, [email protected]
	* do not configurate gpio of auxpcm
	* configurated in bootloader (sbl3)
	*/
	rc = (ARRAY_SIZE(msm8960_audio_auxpcm_configs))?rc:0;
#else
	msm_gpiomux_install(msm8960_audio_auxpcm_configs,
			ARRAY_SIZE(msm8960_audio_auxpcm_configs));
#endif
//20110725, [email protected], NFC GPIO Setting [START]
#if defined(CONFIG_NFC_DEVICES)
	msm_gpiomux_install(msm8960_nfc_configs,
			ARRAY_SIZE(msm8960_nfc_configs));
#endif
//20110725, [email protected], NFC GPIO Setting [END]

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	msm_gpiomux_install(msm8960_sdcc4_configs,
		ARRAY_SIZE(msm8960_sdcc4_configs));
#endif

	if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() ||
		machine_is_msm8960_liquid() || machine_is_msm8960_cdp())
		msm_gpiomux_install(hap_lvl_shft_config,
			ARRAY_SIZE(hap_lvl_shft_config));

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
		machine_is_msm8960_liquid())
		msm_gpiomux_install(msm8960_hsic_configs,
			ARRAY_SIZE(msm8960_hsic_configs));

	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
			machine_is_msm8960_liquid())
		msm_gpiomux_install(msm8960_hsic_hub_configs,
			ARRAY_SIZE(msm8960_hsic_hub_configs));
#endif

#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
	msm_gpiomux_install(msm8960_hdmi_configs,
			ARRAY_SIZE(msm8960_hdmi_configs));
#endif

	msm_gpiomux_install(msm8960_mdp_vsync_configs,
			ARRAY_SIZE(msm8960_mdp_vsync_configs));

	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE)
		msm_gpiomux_install(msm8960_gsbi8_uart_configs,
			ARRAY_SIZE(msm8960_gsbi8_uart_configs));
	else
		msm_gpiomux_install(msm8960_gsbi5_uart_configs,
			ARRAY_SIZE(msm8960_gsbi5_uart_configs));

	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) {
		/* For 8960 Fusion 2.2 Primary IPC */
		msm_gpiomux_install(msm8960_fusion_gsbi_configs,
			ARRAY_SIZE(msm8960_fusion_gsbi_configs));
		/* For SGLTE 8960 Fusion External VFR */
		msm_gpiomux_install(msm8960_external_vfr_configs,
			ARRAY_SIZE(msm8960_external_vfr_configs));
	}

#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	msm_gpiomux_install(msm8960_sdcc2_configs,
		ARRAY_SIZE(msm8960_sdcc2_configs));
#endif

	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE)
		msm_gpiomux_install(sglte_configs,
			ARRAY_SIZE(sglte_configs));

	return 0;
}
void __init apq8064_init_mmc(void)
{
	if (apq8064_sdc1_pdata) {
		/* 8064 v2 supports upto 200MHz clock on SDC1 slot */
		if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2) {
			apq8064_sdc1_pdata->sup_clk_table =
					sdc1_sup_clk_rates_all;
			apq8064_sdc1_pdata->sup_clk_cnt	=
					ARRAY_SIZE(sdc1_sup_clk_rates_all);
		}
		apq8064_add_sdcc(1, apq8064_sdc1_pdata);
	}
#if defined(CONFIG_MACH_JFVE_EUR)
	apq8064_sdc2_pdata = NULL;
	apq8064_sdc4_pdata = NULL;

	// SDC3 is used for External memory Card
	if (apq8064_sdc3_pdata)
   {  
		apq8064_sdc3_pdata->status_gpio = PM8921_GPIO_PM_TO_SYS(33);
		apq8064_sdc3_pdata->status_irq	= PM8921_GPIO_IRQ(PM8921_IRQ_BASE, 33);

		apq8064_add_sdcc(3, apq8064_sdc3_pdata);
   }
#else
/*
	if (apq8064_sdc2_pdata)
		apq8064_add_sdcc(2, apq8064_sdc2_pdata);
*/
/* system_rev 0x05 or more
 * SDC3 is used for WIFI
    SDC4 is used for External memory Card
 */
	if (apq8064_sdc3_pdata) {

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
		mmc_vdd_reg_data[SDCC3].high_vol_level = 1800000;
		mmc_vdd_reg_data[SDCC3].low_vol_level = 1800000;
		mmc_slot_vreg_data[SDCC3].vdd_io_data = NULL;
		apq8064_sdc3_pdata->status_irq = 0;
		apq8064_sdc3_pdata->status_gpio = 0;
#endif
#if !defined(CONFIG_BCM4335) && !defined(CONFIG_BCM4335_MODULE)
		if (!machine_is_apq8064_cdp()) {
			apq8064_sdc3_pdata->wpswitch_gpio = 0;
			apq8064_sdc3_pdata->is_wpswitch_active_low = false;
		}
		if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
			machine_is_mpq8064_dtv()) {
			int rc;
			struct pm_gpio sd_card_det_init_cfg = {
				.direction      = PM_GPIO_DIR_IN,
				.output_buffer  = PM_GPIO_OUT_BUF_CMOS,
				.pull           = PM_GPIO_PULL_UP_30,
				.vin_sel        = PM_GPIO_VIN_S4,
				.out_strength   = PM_GPIO_STRENGTH_NO,
				.function       = PM_GPIO_FUNC_NORMAL,
			};

			apq8064_sdc3_pdata->status_gpio =
				PM8921_GPIO_PM_TO_SYS(31);
			apq8064_sdc3_pdata->status_irq =
				PM8921_GPIO_IRQ(PM8921_IRQ_BASE, 31);
			rc = pm8xxx_gpio_config(apq8064_sdc3_pdata->status_gpio,
					&sd_card_det_init_cfg);
			if (rc) {
				pr_info("%s: SD_CARD_DET GPIO%d config "
					"failed(%d)\n", __func__,
					apq8064_sdc3_pdata->status_gpio, rc);
				apq8064_sdc3_pdata->status_gpio = 0;
				apq8064_sdc3_pdata->status_irq = 0;
			}
		}
		if (machine_is_apq8064_cdp()) {
			int i;

			for (i = 0;
			     i < apq8064_sdc3_pdata->pin_data->pad_data->\
				 drv->size;
			     i++)
				apq8064_sdc3_pdata->pin_data->pad_data->\
					drv->on[i].val = GPIO_CFG_10MA;
		}
#endif
		apq8064_add_sdcc(3, apq8064_sdc3_pdata);
	}
示例#17
0
static int __devinit gdsc_probe(struct platform_device *pdev)
{
    static atomic_t gdsc_count = ATOMIC_INIT(-1);
    struct regulator_init_data *init_data;
    struct resource *res;
    struct gdsc *sc;
    uint32_t regval;
    bool retain_mem, retain_periph;
    int i, ret;

    sc = devm_kzalloc(&pdev->dev, sizeof(struct gdsc), GFP_KERNEL);
    if (sc == NULL)
        return -ENOMEM;

    init_data = of_get_regulator_init_data(&pdev->dev, pdev->dev.of_node);
    if (init_data == NULL)
        return -ENOMEM;

    if (of_get_property(pdev->dev.of_node, "parent-supply", NULL))
        init_data->supply_regulator = "parent";

    ret = of_property_read_string(pdev->dev.of_node, "regulator-name",
                                  &sc->rdesc.name);
    if (ret)
        return ret;

    res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
    if (res == NULL)
        return -EINVAL;
    sc->gdscr = devm_ioremap(&pdev->dev, res->start, resource_size(res));
    if (sc->gdscr == NULL)
        return -ENOMEM;

    sc->clock_count = of_property_count_strings(pdev->dev.of_node,
                      "qcom,clock-names");
    if (sc->clock_count == -EINVAL) {
        sc->clock_count = 0;
    } else if (IS_ERR_VALUE(sc->clock_count)) {
        dev_err(&pdev->dev, "Failed to get clock names\n");
        return -EINVAL;
    }

    sc->clocks = devm_kzalloc(&pdev->dev,
                              sizeof(struct clk *) * sc->clock_count, GFP_KERNEL);
    if (!sc->clocks)
        return -ENOMEM;
    for (i = 0; i < sc->clock_count; i++) {
        const char *clock_name;
        of_property_read_string_index(pdev->dev.of_node,
                                      "qcom,clock-names", i,
                                      &clock_name);
        sc->clocks[i] = devm_clk_get(&pdev->dev, clock_name);
        if (IS_ERR(sc->clocks[i])) {
            int rc = PTR_ERR(sc->clocks[i]);
            if (rc != -EPROBE_DEFER)
                dev_err(&pdev->dev, "Failed to get %s\n",
                        clock_name);
            return rc;
        }
    }

    sc->rdesc.id = atomic_inc_return(&gdsc_count);
    sc->rdesc.ops = &gdsc_ops;
    sc->rdesc.type = REGULATOR_VOLTAGE;
    sc->rdesc.owner = THIS_MODULE;
    platform_set_drvdata(pdev, sc);

    /*
     * Disable HW trigger: collapse/restore occur based on registers writes.
     * Disable SW override: Use hardware state-machine for sequencing.
     */
    regval = readl_relaxed(sc->gdscr);
    regval &= ~(HW_CONTROL_MASK | SW_OVERRIDE_MASK);

    /* Configure wait time between states. */
    regval &= ~(EN_REST_WAIT_MASK | EN_FEW_WAIT_MASK | CLK_DIS_WAIT_MASK);
    regval |= EN_REST_WAIT_VAL | EN_FEW_WAIT_VAL | CLK_DIS_WAIT_VAL;
    writel_relaxed(regval, sc->gdscr);

    retain_mem = of_property_read_bool(pdev->dev.of_node,
                                       "qcom,retain-mem");
    sc->toggle_mem = !retain_mem;
    retain_periph = of_property_read_bool(pdev->dev.of_node,
                                          "qcom,retain-periph");
    sc->toggle_periph = !retain_periph;
    sc->toggle_logic = !of_property_read_bool(pdev->dev.of_node,
                       "qcom,skip-logic-collapse");

#if defined(CONFIG_MACH_TBS) && defined(CONFIG_ANDROID_ENGINEERING)
    {
        static sharp_smem_common_type *smemdata = NULL;
        unsigned long hw_revision = sh_boot_get_hw_revision();
        unsigned int version = socinfo_get_version();
        const char* target_names_collapse[] = {
            "gdsc_venus", "gdsc_mdss"
        };
        const char* target_names_retention[] = {
            "gdsc_venus", "gdsc_mdss", "gdsc_oxili_gx"
        };

        if( smemdata == NULL ) {
            smemdata = sh_smem_get_common_address();
        }

        if( (smemdata != NULL)
                && ((hw_revision == HW_VERSION_PP_1) || (hw_revision == HW_VERSION_PP_2)) ) {
            if (smemdata->shdiag_rvcflg != SHDIAG_RVCFLG_ON) {
                if ( (SOCINFO_VERSION_MAJOR(version) == 2) && (SOCINFO_VERSION_MINOR(version) == 2) ) {
                    int i = 0;
                    for(i=0; i<(sizeof(target_names_retention)/sizeof(target_names_retention[0])); i++) {
                        if( strcmp(sc->rdesc.name, target_names_retention[i]) == 0 ) {
                            break;
                        }
                    }
                    if( i != (sizeof(target_names_retention)/sizeof(target_names_retention[0])) ) {
                        if( retain_mem != true ) {
                            dev_err(&pdev->dev, "%s is forced to use retain_mem\n", sc->rdesc.name);
                            retain_mem = true;
                            sc->toggle_mem = !retain_mem;
                        }
                        if( retain_periph != true ) {
                            dev_err(&pdev->dev, "%s is forced to use retain_periph\n", sc->rdesc.name);
                            retain_periph = true;
                            sc->toggle_periph = !retain_periph;
                        }
                    }
                    for(i=0; i<(sizeof(target_names_collapse)/sizeof(target_names_collapse[0])); i++) {
                        if( strcmp(sc->rdesc.name, target_names_collapse[i]) == 0 ) {
                            break;
                        }
                    }
                    if( i != (sizeof(target_names_collapse)/sizeof(target_names_collapse[0])) ) {
                        if( sc->toggle_logic != false ) {
                            dev_err(&pdev->dev, "%s is forced to use skip_logic_collapse\n", sc->rdesc.name);
                            sc->toggle_logic = false;
                        }
                    }
                }
            }
        }
    }
#endif

    if (!sc->toggle_logic) {
        regval &= ~SW_COLLAPSE_MASK;
        writel_relaxed(regval, sc->gdscr);

        ret = readl_tight_poll_timeout(sc->gdscr, regval,
                                       regval & PWR_ON_MASK, TIMEOUT_US);
        if (ret) {
            dev_err(&pdev->dev, "%s enable timed out\n",
                    sc->rdesc.name);
            return ret;
        }
    }

    for (i = 0; i < sc->clock_count; i++) {
        if (retain_mem || (regval & PWR_ON_MASK))
            clk_set_flags(sc->clocks[i], CLKFLAG_RETAIN_MEM);
        else
            clk_set_flags(sc->clocks[i], CLKFLAG_NORETAIN_MEM);

        if (retain_periph || (regval & PWR_ON_MASK))
            clk_set_flags(sc->clocks[i], CLKFLAG_RETAIN_PERIPH);
        else
            clk_set_flags(sc->clocks[i], CLKFLAG_NORETAIN_PERIPH);
    }

    sc->rdev = regulator_register(&sc->rdesc, &pdev->dev, init_data, sc,
                                  pdev->dev.of_node);
    if (IS_ERR(sc->rdev)) {
        dev_err(&pdev->dev, "regulator_register(\"%s\") failed.\n",
                sc->rdesc.name);
        return PTR_ERR(sc->rdev);
    }

    return 0;
}
示例#18
0
static void __init chacha_init(void)
{
	int rc;
	char *cid = NULL;
	char *qwerty_color = NULL;
	struct kobject *properties_kobj;

	printk("chacha_init() revision = 0x%X\n", system_rev);
	msm_clock_init();
	board_get_cid_tag(&cid);
	board_get_qwerty_color_tag(&qwerty_color);

	if (qwerty_color && strcmp(qwerty_color, "white") == 0) {
		cm3628_pdata.levels[2] = 24;
		cm3628_pdata.levels[3] = 79;
		pr_info("[LS][CM3628] Update white table\n");
	} else
		pr_info("[LS][CM3628] Update %s table\n", qwerty_color);

	/* for bcm */
	bt_export_bd_address();

	/*
	 * Setup common MSM GPIOS
	 */
	config_gpios();

	/* We need to set this pin to 0 only once on power-up; we will
	 * not actually enable the chip until we apply power to it via
	 * vreg.
	 */
	gpio_request(CHACHA_GPIO_LS_EN, "ls_en");
	gpio_direction_output(CHACHA_GPIO_LS_EN, 0);


	msm_hw_reset_hook = chacha_reset;

	if (socinfo_init() < 0)
		BUG();

	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) > 1)
		|| ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 1)
		&& (SOCINFO_VERSION_MINOR(socinfo_get_version()) >= 3)))
		{
			msm_acpu_clock_init(&chacha_turbo_clock_data);
			perflock_init(&chacha_turbo_perflock_data);
		}else{
			msm_acpu_clock_init(&chacha_clock_data);
			perflock_init(&chacha_perflock_data);
		}

#if defined(CONFIG_MSM_SERIAL_DEBUGGER)
	if (!opt_disable_uart3)
		msm_serial_debug_init(MSM_UART3_PHYS, INT_UART3,
			&msm_device_uart3.dev, 1,
				MSM_GPIO_TO_INT(CHACHA_GPIO_UART3_RX));
#endif

	msm_add_devices();

#ifdef CONFIG_SERIAL_MSM_HS
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
	msm_device_uart_dm1.name = "msm_serial_hs_bcm";	/* for bcm */
	msm_add_serial_devices(3);
#else
	msm_add_serial_devices(0);
#endif

	msm_add_serial_devices(2);
	/*
	msm_change_usb_id(0x0bb4, 0x0c10);
	*/
#ifdef CONFIG_USB_FUNCTION
	msm_add_usb_id_pin_gpio(CHACHA_GPIO_USB_ID_PIN);
	msm_add_usb_devices(chacha_phy_reset, NULL);
#endif

#ifdef CONFIG_USB_ANDROID
	android_usb_pdata.products[0].product_id =
		android_usb_pdata.product_id;
	android_usb_pdata.serial_number = board_serialno();
	msm_hsusb_pdata.serial_number = board_serialno();
	msm_device_hsusb.dev.platform_data = &msm_hsusb_pdata;
	config_chacha_usb_id_gpios(0);
	platform_device_register(&msm_device_hsusb);
	platform_device_register(&usb_mass_storage_device);
	platform_device_register(&android_usb_device);
#endif
	msm_add_mem_devices(&pmem_setting);

#ifdef CONFIG_MICROP_COMMON
	chacha_microp_init();
#endif

	rc = chacha_init_mmc(system_rev);
	if (rc)
		printk(KERN_CRIT "%s: MMC init failure (%d)\n", __func__, rc);

	properties_kobj = kobject_create_and_add("board_properties", NULL);
	if (properties_kobj)
		rc = sysfs_create_group(properties_kobj,
						&chacha_properties_attr_group);
	if (!properties_kobj || rc)
		pr_err("failed to create board_properties\n");

	/* probe camera driver */
	i2c_register_board_info(0, i2c_camera_devices, ARRAY_SIZE(i2c_camera_devices));

	printk(KERN_INFO "[HS_BOARD] (%s) system_rev = %d\n", __func__,
	       system_rev);
	if (system_rev >= 2) {
		htc_headset_microp.dev.platform_data = &htc_headset_microp_data_xc;
		htc_headset_mgr_data.headset_config_num =
			ARRAY_SIZE(htc_headset_mgr_config);
		htc_headset_mgr_data.headset_config = htc_headset_mgr_config;
		printk(KERN_INFO "[HS_BOARD] (%s) Set MEMS config\n", __func__);
	}

	msm_device_i2c_init();
	platform_add_devices(devices, ARRAY_SIZE(devices));

	if (system_rev == 0)
		i2c_register_board_info(0, i2c_devices_XA,
			ARRAY_SIZE(i2c_devices_XA));
	else
		i2c_register_board_info(0, i2c_devices_XB,
			ARRAY_SIZE(i2c_devices_XB));

	chacha_init_panel();

	chacha_init_keypad();

	chacha_wifi_init();

	msm_init_pmic_vibrator(3100);
}
int __init msm8960_init_gpiomux(void)
{
	int rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return rc;
	}

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	msm_gpiomux_install(msm8960_ethernet_configs,
			ARRAY_SIZE(msm8960_ethernet_configs));
#endif

	msm_gpiomux_install(msm8960_gsbi_configs,
			ARRAY_SIZE(msm8960_gsbi_configs));

	msm8960_gpio_key_configs[0].gpio = gpio_rev(VOLUME_UP);
	msm8960_gpio_key_configs[1].gpio = gpio_rev(VOLUME_DOWN);
	msm8960_gpio_key_configs[2].gpio = gpio_rev(HALL_INT);
	if (system_rev < BOARD_REV02)
		msm_gpiomux_install(msm8960_gpio_key_configs, 3);
	else {
		msm8960_gpio_key_configs[3].gpio = gpio_rev(HOME_KEY);
		msm_gpiomux_install(msm8960_gpio_key_configs,
			ARRAY_SIZE(msm8960_gpio_key_configs));
	}

	msm_gpiomux_install(msm8960_sec_ts_configs,
			ARRAY_SIZE(msm8960_sec_ts_configs));

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

#ifndef CONFIG_SLIMBUS_MSM_CTRL
	msm_gpiomux_install(msm8960_audio_i2s_rx_codec_configs,
			ARRAY_SIZE(msm8960_audio_i2s_tx_codec_configs));

	msm_gpiomux_install(msm8960_audio_i2s_tx_codec_configs,
			ARRAY_SIZE(msm8960_audio_i2s_tx_codec_configs));
#else
	msm_gpiomux_install(msm8960_slimbus_config,
			ARRAY_SIZE(msm8960_slimbus_config));

	msm_gpiomux_install(msm8960_audio_codec_configs,
			ARRAY_SIZE(msm8960_audio_codec_configs));

#endif

	msm_gpiomux_install(nc_configs,
			ARRAY_SIZE(nc_configs));

#ifdef CONFIG_USB_SWITCH_FSA9485
	msm_gpiomux_install(msm8960_fsa9485_configs,
			ARRAY_SIZE(msm8960_fsa9485_configs));
#endif

	if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() ||
			machine_is_msm8960_liquid() || machine_is_msm8960_cdp())
		msm_gpiomux_install(hap_lvl_shft_config,
				ARRAY_SIZE(hap_lvl_shft_config));

	if (PLATFORM_IS_CHARM25())
		msm_gpiomux_install(mdm_configs,
				ARRAY_SIZE(mdm_configs));

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
			(PLATFORM_IS_CHARM25() || machine_is_msm8960_liquid()))
		msm_gpiomux_install(msm8960_hsic_configs,
				ARRAY_SIZE(msm8960_hsic_configs));
#endif

#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
	msm_gpiomux_install(msm8960_hdmi_configs,
			ARRAY_SIZE(msm8960_hdmi_configs));
#endif

#if defined(CONFIG_VIDEO_MHL_V1) || defined(CONFIG_VIDEO_MHL_V2)
			msm_gpiomux_install(msm8960_mhl_configs,
					ARRAY_SIZE(msm8960_mhl_configs));
#endif

	msm_gpiomux_install(msm8960_mdp_vsync_configs,
			ARRAY_SIZE(msm8960_mdp_vsync_configs));

	msm8960_keypad_slide_configs[0].gpio = gpio_rev(HALL_INT);
	msm_gpiomux_install(msm8960_keypad_slide_configs,
			ARRAY_SIZE(msm8960_keypad_slide_configs));
#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
	msm_gpiomux_install(msm8960_adp5588_configs,
			ARRAY_SIZE(msm8960_adp5588_configs));
#endif
	return 0;
}
示例#20
0
void __init msm_8974_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

	pr_err("%s:%d socinfo_get_version %x\n", __func__, __LINE__,
	socinfo_get_version());
	msm_tlmm_misc_reg_write(TLMM_SPARE_REG, 0x5);

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	msm_gpiomux_install(msm_eth_configs, ARRAY_SIZE(msm_eth_configs));
#endif

	msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));

#if !defined(CONFIG_BT_BCM4335) && !defined(CONFIG_BT_BCM4339)
	msm_gpiomux_install(msm_blsp2_uart7_configs, ARRAY_SIZE(msm_blsp2_uart7_configs));
#endif

#if defined(CONFIG_BT_BCM4335) || defined(CONFIG_BT_BCM4339)
	msm_gpiomux_btuart_install();
	if(system_rev < 5)
	{
		msm_gpiomux_install(msm8974_btwifi_ldo_en_configs, ARRAY_SIZE(msm8974_btwifi_ldo_en_configs));
	}
#endif

	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));

	msm_gpiomux_install(msm8974_slimbus_config,
			ARRAY_SIZE(msm8974_slimbus_config));

#if defined(CONFIG_MACH_LT03SKT) || defined(CONFIG_MACH_LT03KTT) ||defined(CONFIG_MACH_LT03LGT)
	msm_gpiomux_install(ext_buck_configs, ARRAY_SIZE(ext_buck_configs));
#endif
	msm_gpiomux_install(msm_grip_configs, ARRAY_SIZE(msm_grip_configs));
	msm_gpiomux_install(hw_rev_configs, ARRAY_SIZE(hw_rev_configs));
	msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));

	msm_gpiomux_install(&sd_card_det, 1);
	msm_gpiomux_sdc3_install();
	msm_gpiomux_sdc4_install();

	msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config));
	msm_gpiomux_install(ear_send_end_config, ARRAY_SIZE(ear_send_end_config));

	msm_gpiomux_install(msm_hsic_configs, ARRAY_SIZE(msm_hsic_configs));
	msm_gpiomux_install(msm_hsic_hub_configs,
				ARRAY_SIZE(msm_hsic_hub_configs));

	msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs));
#if defined(CONFIG_PN547_NFC)
	msm_gpiomux_install(msm_nfc_configs,
	ARRAY_SIZE(msm_nfc_configs));
#endif

#if defined(CONFIG_BCM4335) || defined(CONFIG_BCM4335_MODULE) || defined(CONFIG_BCM4339) || defined(CONFIG_BCM4339_MODULE)
	msm_gpiomux_wlan_host_wakeup_install();
#endif /* defined(CONFIG_BCM4335) || defined(CONFIG_BCM4335_MODULE) || defined(CONFIG_BCM4339) || defined(CONFIG_BCM4339_MODULE) */

#ifdef CONFIG_VIDEO_MHL_V2
	msm_gpiomux_install(mhl_configs, ARRAY_SIZE(mhl_configs));
#endif

	msm_gpiomux_install(msm8974_pri_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_auxpcm_configs));

	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));
#if !defined(CONFIG_BT_BCM4335) && !defined(CONFIG_BT_BCM4339)
	if (of_board_is_rumi())
		msm_gpiomux_install(msm_rumi_blsp_configs,
				    ARRAY_SIZE(msm_rumi_blsp_configs));
#endif

	msm_gpiomux_install(msm8974_audio_configs, ARRAY_SIZE(msm8974_audio_configs));
#ifdef CONFIG_INPUT_WACOM
		msm_gpiomux_install(msm8974_wacom_configs,
			ARRAY_SIZE(msm8974_wacom_configs));
#endif

	msm_gpiomux_install(msm_sensors_configs,
			ARRAY_SIZE(msm_sensors_configs));
	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_MDM)
		msm_gpiomux_install(mdm_configs,
			ARRAY_SIZE(mdm_configs));

#ifdef CONFIG_USB_SWITCH_FSA9485
	if (system_rev >= 7)
		msm_gpiomux_install(lt03_r04_muic_configs,
				ARRAY_SIZE(lt03_r04_muic_configs));
	else
		msm_gpiomux_install(lt03_muic_configs,
				ARRAY_SIZE(lt03_muic_configs));
#endif
	msm_gpiomux_install(gpio_nc_configs,ARRAY_SIZE(gpio_nc_configs));
#ifdef CONFIG_FB_MSM_EDP_SAMSUNG
	msm_gpiomux_install(msm8974_lcd_config,
			ARRAY_SIZE(msm8974_lcd_config));
#endif
}
示例#21
0
void __init msm_8974_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

	pr_debug("%s:%d socinfo_get_version %x\n", __func__, __LINE__,
		socinfo_get_version());
	if (socinfo_get_version() >= 0x20000)
		msm_tlmm_misc_reg_write(TLMM_SPARE_REG, 0xf);

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	if (!(of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_install(msm_eth_configs, \
			ARRAY_SIZE(msm_eth_configs));
#endif
	msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));
	msm_gpiomux_install(msm_blsp2_uart7_configs,
			 ARRAY_SIZE(msm_blsp2_uart7_configs));
	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));
	if (of_board_is_liquid())
		msm_gpiomux_install_nowrite(ath_gpio_configs,
					ARRAY_SIZE(ath_gpio_configs));
	msm_gpiomux_install(msm8974_slimbus_config,
			ARRAY_SIZE(msm8974_slimbus_config));

	msm_gpiomux_install(msm_touch_configs, ARRAY_SIZE(msm_touch_configs));
	if (of_board_is_liquid())
		msm_gpiomux_install(msm_touch_i2cmode_configs,
					ARRAY_SIZE(msm_touch_i2cmode_configs));
		msm_gpiomux_install(hap_lvl_shft_config,
				ARRAY_SIZE(hap_lvl_shft_config));

	if (of_board_is_dragonboard() && machine_is_apq8074())
		msm_gpiomux_install(msm_sensor_configs_dragonboard, \
				ARRAY_SIZE(msm_sensor_configs_dragonboard));
	else
		msm_gpiomux_install(msm_sensor_configs, \
				ARRAY_SIZE(msm_sensor_configs));

	msm_gpiomux_install(&sd_card_det, 1);

	if (machine_is_apq8074() && (of_board_is_liquid() || \
	    of_board_is_dragonboard()))
		msm_gpiomux_sdc3_install();

	if (!(of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_sdc4_install();

	msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config));

	msm_gpiomux_install(msm_hsic_configs, ARRAY_SIZE(msm_hsic_configs));
	msm_gpiomux_install(msm_hsic_hub_configs,
				ARRAY_SIZE(msm_hsic_hub_configs));

	msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs));
	if (of_board_is_fluid())
		msm_gpiomux_install(msm_mhl_configs,
				    ARRAY_SIZE(msm_mhl_configs));

	if (of_board_is_liquid() ||
	    (of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_install(msm8974_pri_ter_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_ter_auxpcm_configs));
	else
		msm_gpiomux_install(msm8974_pri_pri_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_pri_auxpcm_configs));

	if (of_board_is_cdp())
		msm_gpiomux_install(msm8974_sec_auxpcm_configs,
				 ARRAY_SIZE(msm8974_sec_auxpcm_configs));
	else if (of_board_is_liquid() || of_board_is_fluid() ||
						of_board_is_mtp())
		msm_gpiomux_install(msm_epm_configs,
				ARRAY_SIZE(msm_epm_configs));

	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));

	if (of_board_is_rumi())
		msm_gpiomux_install(msm_rumi_blsp_configs,
				    ARRAY_SIZE(msm_rumi_blsp_configs));

	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_MDM)
		msm_gpiomux_install(mdm_configs,
			ARRAY_SIZE(mdm_configs));

	if (of_board_is_dragonboard() && machine_is_apq8074())
		msm_gpiomux_install(apq8074_dragonboard_ts_config,
			ARRAY_SIZE(apq8074_dragonboard_ts_config));

	if ((socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_INTERPOSERV3)
		&& of_board_is_cdp())
		msm_gpiomux_install(apq8074_interposer_config,
			ARRAY_SIZE(apq8074_interposer_config));
}
void __init msm_8974_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

	pr_err("%s:%d socinfo_get_version %x\n", __func__, __LINE__,
		socinfo_get_version());
	if (socinfo_get_version() >= 0x20000)
		msm_tlmm_misc_reg_write(TLMM_SPARE_REG, 0xf);

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	if (!(of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_install(msm_eth_configs, \
			ARRAY_SIZE(msm_eth_configs));
#endif
	msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));

#ifdef CONFIG_MFD_MAX77888
#if 0 // MCU Pin
	msm_gpiomux_install(msm8974_muic_configs, ARRAY_SIZE(msm8974_muic_configs));
#endif
#endif

#ifdef CONFIG_W1_SLAVE_DS28EL15
	msm_gpiomux_install(msm8974_cover_id_config, ARRAY_SIZE(msm8974_cover_id_config));
#endif

#if !defined(CONFIG_BT_BCM4335) && !defined(CONFIG_BT_BCM4339)
	msm_gpiomux_install(msm_blsp2_uart7_configs,
			 ARRAY_SIZE(msm_blsp2_uart7_configs));
#endif
#if 0//defined(CONFIG_BT_BCM4335) || defined(CONFIG_BT_BCM4339)
	msm_gpiomux_btuart_install();
#endif

	if (of_board_is_liquid())
		msm_gpiomux_install_nowrite(ath_gpio_configs,
					ARRAY_SIZE(ath_gpio_configs));
	msm_gpiomux_install(msm8974_slimbus_config,
			ARRAY_SIZE(msm8974_slimbus_config));

	msm_gpiomux_install(hw_rev_configs, ARRAY_SIZE(hw_rev_configs));
	msm_gpiomux_install(gpio_nc_configs, ARRAY_SIZE(gpio_nc_configs));

#if 0//!defined(CONFIG_SENSORS_SSP)
		msm_gpiomux_install(hap_lvl_shft_config,
				ARRAY_SIZE(hap_lvl_shft_config));
#endif

	if (of_board_is_dragonboard() && machine_is_apq8074())
		msm_gpiomux_install(msm_sensor_configs_dragonboard, \
				ARRAY_SIZE(msm_sensor_configs_dragonboard));
	else
		msm_gpiomux_install(msm_sensor_configs, \
				ARRAY_SIZE(msm_sensor_configs));

	msm_gpiomux_install(&sd_card_det, 1);
	msm_gpiomux_sdc3_install();

	if (!(of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_sdc4_install();

	msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config));
	msm_gpiomux_install(es325_config, ARRAY_SIZE(es325_config));
	msm_gpiomux_install(msm8974_audio_configs, ARRAY_SIZE(msm8974_audio_configs));
	msm_gpiomux_install(msm8974_pri_pri_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_pri_auxpcm_configs));
#if 0 // MCU pin
	msm_gpiomux_install(msm_hsic_hub_configs,
				ARRAY_SIZE(msm_hsic_hub_configs));
#endif
#if defined(CONFIG_SENSORS_SSP)
	msm_gpiomux_install(ssp_configs,
				ARRAY_SIZE(ssp_configs));
#endif

#if defined(CONFIG_SENSORS)
	msm_gpiomux_install(msm_sensors_configs,
		ARRAY_SIZE(msm_sensors_configs));
#endif
	msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs));
	if (system_rev > 5)
		msm_gpiomux_install(msm_hdmi_ddc_configs,
				ARRAY_SIZE(msm_hdmi_ddc_configs));
#ifdef CONFIG_VIDEO_MHL_V2
	if(system_rev > 1)
		msm_gpiomux_install(mhl_configs, ARRAY_SIZE(mhl_configs));
#endif
#if 0
	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));
#endif
#if defined(CONFIG_SEC_NFC_I2C) || defined(CONFIG_NFC_PN547)
	msm_gpiomux_install(msm_nfc_configs,
	ARRAY_SIZE(msm_nfc_configs));
#endif
	if (of_board_is_liquid() ||
	    (of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_install(msm8974_pri_ter_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_ter_auxpcm_configs));
	else
		msm_gpiomux_install(msm8974_pri_pri_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_pri_auxpcm_configs));

#if defined(CONFIG_BCM4335) || defined(CONFIG_BCM4335_MODULE) || defined(CONFIG_BCM4339) || defined(CONFIG_BCM4339_MODULE)
	msm_gpiomux_wlan_host_wakeup_install();
#endif /* defined(CONFIG_BCM4335) || defined(CONFIG_BCM4335_MODULE) || defined(CONFIG_BCM4339) || defined(CONFIG_BCM4339_MODULE) */

#ifdef CONFIG_USB_SWITCH_FSA9485
	if (system_rev >= 10)
		msm_gpiomux_install(vienna_r10_muic_configs,
				ARRAY_SIZE(vienna_r10_muic_configs));
	else
		msm_gpiomux_install(vienna_muic_configs,
				ARRAY_SIZE(vienna_muic_configs));
#endif

	if (of_board_is_cdp()) {
#if 0 /* Not used at Mondrian */
		msm_gpiomux_install(msm8974_sec_auxpcm_configs,
				 ARRAY_SIZE(msm8974_sec_auxpcm_configs));
#endif
	} else if (of_board_is_liquid() || of_board_is_fluid() ||
						of_board_is_mtp())
		msm_gpiomux_install(msm_epm_configs,
				ARRAY_SIZE(msm_epm_configs));

	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));

#if !defined(CONFIG_BT_BCM4335) && !defined(CONFIG_BT_BCM4339)
	if (of_board_is_rumi())
		msm_gpiomux_install(msm_rumi_blsp_configs,
				    ARRAY_SIZE(msm_rumi_blsp_configs));
#endif

#if defined(CONFIG_LEDS_AN30259A)
	msm_gpiomux_install(an30259a_led_config,
			ARRAY_SIZE(an30259a_led_config));
#endif

#ifdef CONFIG_INPUT_WACOM_HL
	msm_gpiomux_install(msm8974_wacom_configs,
		ARRAY_SIZE(msm8974_wacom_configs));
#endif

	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_MDM)
		msm_gpiomux_install(mdm_configs,
			ARRAY_SIZE(mdm_configs));

	if (of_board_is_dragonboard() && machine_is_apq8074())
		msm_gpiomux_install(apq8074_dragonboard_ts_config,
			ARRAY_SIZE(apq8074_dragonboard_ts_config));
}
示例#23
0
int __init msm8960_init_gpiomux(void)
{
	int rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return rc;
	}

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	msm_gpiomux_install(msm8960_ethernet_configs,
			ARRAY_SIZE(msm8960_ethernet_configs));
#endif

	msm_gpiomux_install(msm8960_gsbi_configs,
			ARRAY_SIZE(msm8960_gsbi_configs));

	msm_gpiomux_install(msm8960_sec_ts_configs,
			ARRAY_SIZE(msm8960_sec_ts_configs));

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

#ifndef CONFIG_SLIMBUS_MSM_CTRL
	msm_gpiomux_install(msm8960_audio_i2s_rx_codec_configs,
			ARRAY_SIZE(msm8960_audio_i2s_tx_codec_configs));

	msm_gpiomux_install(msm8960_audio_i2s_tx_codec_configs,
			ARRAY_SIZE(msm8960_audio_i2s_tx_codec_configs));
#else
	msm_gpiomux_install(msm8960_slimbus_config,
			ARRAY_SIZE(msm8960_slimbus_config));

	msm_gpiomux_install(msm8960_audio_codec_configs,
			ARRAY_SIZE(msm8960_audio_codec_configs));

#endif

msm_gpiomux_install(nc_configs,
		ARRAY_SIZE(nc_configs));

#ifdef CONFIG_USB_SWITCH_FSA9485
	msm_gpiomux_install(msm8960_fsa9485_configs,
			ARRAY_SIZE(msm8960_fsa9485_configs));
#endif

	if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() ||
			machine_is_msm8960_liquid() || machine_is_msm8960_cdp())
		msm_gpiomux_install(hap_lvl_shft_config,
				ARRAY_SIZE(hap_lvl_shft_config));

	if (PLATFORM_IS_CHARM25())
		msm_gpiomux_install(mdm_configs,
				ARRAY_SIZE(mdm_configs));

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
			(PLATFORM_IS_CHARM25() || machine_is_msm8960_liquid()))
		msm_gpiomux_install(msm8960_hsic_configs,
				ARRAY_SIZE(msm8960_hsic_configs));
#endif

#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
	msm_gpiomux_install(msm8960_hdmi_configs,
			ARRAY_SIZE(msm8960_hdmi_configs));
#endif

	msm_gpiomux_install(msm8960_mdp_vsync_configs,
			ARRAY_SIZE(msm8960_mdp_vsync_configs));

	return 0;
}
示例#24
0
int __init msm8960_init_gpiomux(void)
{
	int rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return rc;
	}

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	msm_gpiomux_install(msm8960_ethernet_configs,
			ARRAY_SIZE(msm8960_ethernet_configs));
#endif

	msm_gpiomux_install(msm8960_gsbi_configs,
			ARRAY_SIZE(msm8960_gsbi_configs));
	msm_gpiomux_install(msm8960_cyts_configs,
			ARRAY_SIZE(msm8960_cyts_configs));
#ifdef CONFIG_TOUCHSCREEN_QT602240_MSM8960
  msm_gpiomux_install(msm8960_qt602240_configs,
			ARRAY_SIZE(msm8960_qt602240_configs));
#endif
#ifdef CONFIG_TOUCHSCREEN_MELFAS_TS //dhyang
  msm_gpiomux_install(msm8960_melfas_configs,
			ARRAY_SIZE(msm8960_melfas_configs));
#endif
	msm_gpiomux_install(msm8960_slimbus_config,
			ARRAY_SIZE(msm8960_slimbus_config));

	msm_gpiomux_install(msm8960_audio_codec_configs,
			ARRAY_SIZE(msm8960_audio_codec_configs));

#ifndef CONFIG_PN544
	msm_gpiomux_install(msm8960_audio_auxpcm_configs,
			ARRAY_SIZE(msm8960_audio_auxpcm_configs));
#endif

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

	if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() ||
		machine_is_msm8960_liquid() || machine_is_msm8960_cdp())
		msm_gpiomux_install(hap_lvl_shft_config,
			ARRAY_SIZE(hap_lvl_shft_config));

	if (PLATFORM_IS_CHARM25())
		msm_gpiomux_install(mdm_configs,
			ARRAY_SIZE(mdm_configs));

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
		(PLATFORM_IS_CHARM25() || machine_is_msm8960_liquid()))
		msm_gpiomux_install(msm8960_hsic_configs,
			ARRAY_SIZE(msm8960_hsic_configs));
#endif

#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
	msm_gpiomux_install(msm8960_hdmi_configs,
			ARRAY_SIZE(msm8960_hdmi_configs));
#endif

	msm_gpiomux_install(msm8960_mdp_vsync_configs,
			ARRAY_SIZE(msm8960_mdp_vsync_configs));

#ifdef CONFIG_PANTECH_CHARGER_WIRELESS
	msm_gpiomux_install(msm8960_wireless_charger_configs,
			ARRAY_SIZE(msm8960_wireless_charger_configs));
#endif

#ifdef CONFIG_PANTECH_PMIC // gpio-config for QC recommendation (pull-up) 
	msm_gpiomux_install(msm8960_pm_irq_configs,
			ARRAY_SIZE(msm8960_pm_irq_configs));
#endif

#ifdef CONFIG_PANTECH_SND //kdkim
#if defined(T_STARQ) || defined(T_OSCAR) || defined(T_EF45K) || defined(T_EF46L) || defined(T_EF47S) 
	msm_gpiomux_install(headset_detect_irq_configs,
			ARRAY_SIZE(headset_detect_irq_configs));
#endif
#endif

#ifdef CONFIG_CXD2235AGC_NFC_FELICA
	msm_gpiomux_install(nfcf_gpio_configs,
			ARRAY_SIZE(nfcf_gpio_configs));
#endif

#ifdef CONFIG_PANTECH_GPIO_SLEEP_CONFIG
#if (defined(CONFIG_MACH_MSM8960_STARQ) || defined(CONFIG_MACH_MSM8960_OSCAR))
	msm_gpiomux_install(msm8960_sleep_gpio_gpio_configs,
			ARRAY_SIZE(msm8960_sleep_gpio_gpio_configs));
#endif
#endif

	return 0;
}
示例#25
0
static int evb_backlight_control(int level, int mode)
{

	int i = 0;
	int remainder, ret = 0;
	u32 socinfo = socinfo_get_version();

	/* device address byte = 0x72 */
	if (!mode) {
		if (socinfo != 0x10000 && level == 0)
			level = 10;
		gpio_set_value(96, 0);
		udelay(67);
		gpio_set_value(96, 1);
		udelay(33);
		gpio_set_value(96, 0);
		udelay(33);
		gpio_set_value(96, 1);
		udelay(67);
		gpio_set_value(96, 0);
		udelay(33);
		gpio_set_value(96, 1);
		udelay(67);
		gpio_set_value(96, 0);
		udelay(33);
		gpio_set_value(96, 1);
		udelay(67);
		gpio_set_value(96, 0);
		udelay(67);
		gpio_set_value(96, 1);
		udelay(33);
		gpio_set_value(96, 0);
		udelay(67);
		gpio_set_value(96, 1);
		udelay(33);
		gpio_set_value(96, 0);
		udelay(33);
		gpio_set_value(96, 1);
		udelay(67);
		gpio_set_value(96, 0);
		udelay(67);
		gpio_set_value(96, 1);
		udelay(33);

		/* t-EOS and t-start */
		gpio_set_value(96, 0);
		ndelay(4200);
		gpio_set_value(96, 1);
		ndelay(9000);

		/* data byte */
		/* RFA = 0 */
		gpio_set_value(96, 0);
		udelay(67);
		gpio_set_value(96, 1);
		udelay(33);

		/* Address bits */
		gpio_set_value(96, 0);
		udelay(67);
		gpio_set_value(96, 1);
		udelay(33);
		gpio_set_value(96, 0);
		udelay(67);
		gpio_set_value(96, 1);
		udelay(33);

		/* Data bits */
		for (i = 0; i < 5; i++) {
			remainder = (level) & (16);
			if (remainder) {
				gpio_set_value(96, 0);
				udelay(33);
				gpio_set_value(96, 1);
				udelay(67);
			} else {
				gpio_set_value(96, 0);
				udelay(67);
				gpio_set_value(96, 1);
				udelay(33);
			}
			level = level << 1;
		}

		/* t-EOS */
		gpio_set_value(96, 0);
		ndelay(12000);
		gpio_set_value(96, 1);
	} else {
		ret = pmapp_disp_backlight_set_brightness(level);
		 if (ret)
			pr_err("%s: can't set lcd backlight!\n", __func__);
	}

	return ret;
}
示例#26
0
int __init msm8960_init_gpiomux(void)
{
	int rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return rc;
	}

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	msm_gpiomux_install(msm8960_ethernet_configs,
			ARRAY_SIZE(msm8960_ethernet_configs));
#endif

	msm_gpiomux_install(msm8960_gsbi_configs,
			ARRAY_SIZE(msm8960_gsbi_configs));

	/* LGE_CHANGE
	 * to suppply VDD3V touch power
	 * exactly according to board revision
	 * 2012-02-11, [email protected]
	 */
	if (lge_get_board_revno() >= HW_REV_B) {
		msm_gpiomux_install(msm8960_cyts_configs,
			ARRAY_SIZE(msm8960_cyts_configs));
	} else {
		msm_gpiomux_install(msm8960_cyts_configs_revA,
			ARRAY_SIZE(msm8960_cyts_configs_revA));
	}

	msm_gpiomux_install(msm8960_slimbus_config,
			ARRAY_SIZE(msm8960_slimbus_config));

	msm_gpiomux_install(msm8960_audio_codec_configs,
			ARRAY_SIZE(msm8960_audio_codec_configs));
#ifdef CONFIG_LGE_AUDIO
	/* LGE_CHANGE
	* 2012-01-30, [email protected]
	* do not configurate gpio of auxpcm
	* configurated in bootloader (sbl3)
	*/
	rc = (ARRAY_SIZE(msm8960_audio_auxpcm_configs))?rc:0;
#else
	msm_gpiomux_install(msm8960_audio_auxpcm_configs,
			ARRAY_SIZE(msm8960_audio_auxpcm_configs));
#endif
//20110725, [email protected], NFC GPIO Setting [START]
#if defined(CONFIG_LGE_NFC_PN544)
	msm_gpiomux_install(msm8960_nfc_configs,
			ARRAY_SIZE(msm8960_nfc_configs));
#endif
//20110725, [email protected], NFC GPIO Setting [END]
//
	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

/* 
 * QCT Original
 *
 * NOT USED
 *
 */
#if !defined(CONFIG_MACH_LGE)
	if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() ||
		machine_is_msm8960_liquid() || machine_is_msm8960_cdp())
		msm_gpiomux_install(hap_lvl_shft_config,
			ARRAY_SIZE(hap_lvl_shft_config));
#endif /* QCT Original */

	if (PLATFORM_IS_CHARM25())
		msm_gpiomux_install(mdm_configs,
			ARRAY_SIZE(mdm_configs));

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
		(PLATFORM_IS_CHARM25() || machine_is_msm8960_liquid()))
		msm_gpiomux_install(msm8960_hsic_configs,
			ARRAY_SIZE(msm8960_hsic_configs));
#endif

#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
	msm_gpiomux_install(msm8960_hdmi_configs,
			ARRAY_SIZE(msm8960_hdmi_configs));
#endif

	msm_gpiomux_install(msm8960_mdp_vsync_configs,
			ARRAY_SIZE(msm8960_mdp_vsync_configs));

	return 0;
}
void __init msm_8974_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

	pr_err("%s:%d socinfo_get_version %x\n", __func__, __LINE__,
		socinfo_get_version());
	if (socinfo_get_version() >= 0x20000)
		msm_tlmm_misc_reg_write(TLMM_SPARE_REG, 0xf);

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	if (!(of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_install(msm_eth_configs, \
			ARRAY_SIZE(msm_eth_configs));
#endif
	msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));

#ifdef CONFIG_MFD_MAX77888
	msm_gpiomux_install(msm8974_muic_configs, ARRAY_SIZE(msm8974_muic_configs));
#endif
	msm_gpiomux_install(msm_battery_configs, ARRAY_SIZE(msm_battery_configs));
#if !defined(CONFIG_MACH_LT03_LTE)	
	msm_gpiomux_install(msm_batteryotg_configs, ARRAY_SIZE(msm_batteryotg_configs));
#endif	

#if !defined(CONFIG_BT_BCM4335) && !defined(CONFIG_BT_BCM4339)
	msm_gpiomux_install(msm_blsp2_uart7_configs,
			 ARRAY_SIZE(msm_blsp2_uart7_configs));
#endif
#if defined(CONFIG_BT_BCM4335) || defined(CONFIG_BT_BCM4339)
	msm_gpiomux_btuart_install();
	msm_gpiomux_btwake_install();
#endif

	if (of_board_is_liquid())
		msm_gpiomux_install_nowrite(ath_gpio_configs,
					ARRAY_SIZE(ath_gpio_configs));
	msm_gpiomux_install(msm8974_slimbus_config,
			ARRAY_SIZE(msm8974_slimbus_config));

		msm_gpiomux_install(hap_lvl_shft_config,
				ARRAY_SIZE(hap_lvl_shft_config));

	if (of_board_is_dragonboard() && machine_is_apq8074())
		msm_gpiomux_install(msm_sensor_configs_dragonboard, \
				ARRAY_SIZE(msm_sensor_configs_dragonboard));
	else
		msm_gpiomux_install(msm_sensor_configs, \
				ARRAY_SIZE(msm_sensor_configs));

	msm_gpiomux_install(hw_rev_configs, ARRAY_SIZE(hw_rev_configs));
	msm_gpiomux_install(&sd_card_det, 1);
	msm_gpiomux_sdc3_install();

	if (!(of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_sdc4_install();

	msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config));
	msm_gpiomux_install(ear_send_end_config, ARRAY_SIZE(ear_send_end_config));
#if defined(CONFIG_MACH_LT03_VZW) || defined(CONFIG_MACH_LT03_EUR) || defined(CONFIG_MACH_LT03_TMO) \
|| defined(CONFIG_MACH_LT03SKT) || defined(CONFIG_MACH_LT03KTT) || defined(CONFIG_MACH_LT03LGT)
	msm_gpiomux_install(spk_ext_config, ARRAY_SIZE(spk_ext_config));
#endif

	msm_gpiomux_install(msm_hsic_hub_configs,
				ARRAY_SIZE(msm_hsic_hub_configs));

	msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs));
#ifdef CONFIG_VIDEO_MHL_V2
	msm_gpiomux_install(mhl_configs, ARRAY_SIZE(mhl_configs));
#endif

#if 0
	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));
#endif
	if (of_board_is_liquid() ||
	    (of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_install(msm8974_pri_ter_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_ter_auxpcm_configs));
	else
		msm_gpiomux_install(msm8974_pri_pri_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_pri_auxpcm_configs));

#if defined(CONFIG_BCM4335) || defined(CONFIG_BCM4335_MODULE) || defined(CONFIG_BCM4339) || defined(CONFIG_BCM4339_MODULE)
	msm_gpiomux_wlan_host_wakeup_install();
#endif /* defined(CONFIG_BCM4335) || defined(CONFIG_BCM4335_MODULE) || defined(CONFIG_BCM4339) || defined(CONFIG_BCM4339_MODULE) */

#ifdef CONFIG_USB_SWITCH_FSA9485
	if (system_rev >= 7)
		msm_gpiomux_install(lt03_r04_muic_configs,
				ARRAY_SIZE(lt03_r04_muic_configs));
	else
		msm_gpiomux_install(lt03_muic_configs,
				ARRAY_SIZE(lt03_muic_configs));
#endif

	if (of_board_is_cdp()) {
#if 0 /* Not used at Mondrian */
		msm_gpiomux_install(msm8974_sec_auxpcm_configs,
				 ARRAY_SIZE(msm8974_sec_auxpcm_configs));
#endif
	} else if (of_board_is_liquid() || of_board_is_fluid() ||
						of_board_is_mtp())
		msm_gpiomux_install(msm_epm_configs,
				ARRAY_SIZE(msm_epm_configs));

	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));

#if !defined(CONFIG_BT_BCM4335) && !defined(CONFIG_BT_BCM4339)
	if (of_board_is_rumi())
		msm_gpiomux_install(msm_rumi_blsp_configs,
				    ARRAY_SIZE(msm_rumi_blsp_configs));
#endif

	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_MDM)
		msm_gpiomux_install(mdm_configs,
			ARRAY_SIZE(mdm_configs));

	if (of_board_is_dragonboard() && machine_is_apq8074())
		msm_gpiomux_install(apq8074_dragonboard_ts_config,
			ARRAY_SIZE(apq8074_dragonboard_ts_config));

#ifdef CONFIG_FB_MSM_EDP_SAMSUNG
	msm_gpiomux_install(msm8974_lcd_config,
				ARRAY_SIZE(msm8974_lcd_config));
#endif
#ifdef CONFIG_INPUT_WACOM
	msm_gpiomux_install(msm8974_wacom_configs,
			ARRAY_SIZE(msm8974_wacom_configs));
#endif
	msm_gpiomux_install(msm_grip_configs, ARRAY_SIZE(msm_grip_configs));
	msm_gpiomux_install(msm_sensors_configs, ARRAY_SIZE(msm_sensors_configs));

#if defined(CONFIG_MACH_LT03_VZW) || defined(CONFIG_MACH_LT03SKT) || defined(CONFIG_MACH_LT03KTT) || defined(CONFIG_MACH_LT03LGT)
	msm_gpiomux_install(ext_buck_configs, ARRAY_SIZE(ext_buck_configs));
#endif

#if defined(CONFIG_MACH_LT03_LTE)
	msm_gpiomux_install(gpio_nc_configs,ARRAY_SIZE(gpio_nc_configs));
#endif

}
int __init msm8960_init_gpiomux(void)
{
	int rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return rc;
	}

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	msm_gpiomux_install(msm8960_ethernet_configs,
			ARRAY_SIZE(msm8960_ethernet_configs));
#endif

	msm_gpiomux_install(msm8960_gsbi_configs,
			ARRAY_SIZE(msm8960_gsbi_configs));

	msm_gpiomux_install(msm8960_mxt224E_configs,
			ARRAY_SIZE(msm8960_mxt224E_configs));

	msm_gpiomux_install(msm8960_slimbus_config,
			ARRAY_SIZE(msm8960_slimbus_config));

	msm_gpiomux_install(msm8960_audio_codec_configs,
			ARRAY_SIZE(msm8960_audio_codec_configs));

	msm_gpiomux_install(msm8960_audio_amp_configs,
			ARRAY_SIZE(msm8960_audio_amp_configs));

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

	msm_gpiomux_install(msm8960_sensors_configs,
			ARRAY_SIZE(msm8960_sensors_configs));

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	msm_gpiomux_install(msm8960_sdcc4_configs,
		ARRAY_SIZE(msm8960_sdcc4_configs));
#endif

	if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() ||
		machine_is_msm8960_liquid() || machine_is_msm8960_cdp())
		msm_gpiomux_install(hap_lvl_shft_config,
			ARRAY_SIZE(hap_lvl_shft_config));

	if (PLATFORM_IS_CHARM25())
		msm_gpiomux_install(mdm_configs,
			ARRAY_SIZE(mdm_configs));

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
		(PLATFORM_IS_CHARM25() || machine_is_msm8960_liquid()))
		msm_gpiomux_install(msm8960_hsic_configs,
			ARRAY_SIZE(msm8960_hsic_configs));
#endif

#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
	msm_gpiomux_install(msm8960_hdmi_configs,
			ARRAY_SIZE(msm8960_hdmi_configs));
#endif

	msm_gpiomux_install(msm8960_mdp_vsync_configs,
			ARRAY_SIZE(msm8960_mdp_vsync_configs));

#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	msm_gpiomux_install(msm8960_sdcc2_configs,
		ARRAY_SIZE(msm8960_sdcc2_configs));
#endif

	return 0;
}
void __init apq8064_init_mmc(void)
{
	if (apq8064_sdc1_pdata) {
		/* 8064 v2 supports upto 200MHz clock on SDC1 slot */
		if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2) {
			apq8064_sdc1_pdata->sup_clk_table =
					sdc1_sup_clk_rates_all;
			apq8064_sdc1_pdata->sup_clk_cnt	=
					ARRAY_SIZE(sdc1_sup_clk_rates_all);
		}
		apq8064_add_sdcc(1, apq8064_sdc1_pdata);
	}

	msm_add_uio();

	if (apq8064_sdc2_pdata)
		apq8064_add_sdcc(2, apq8064_sdc2_pdata);

	if (apq8064_sdc3_pdata) {
		if (!machine_is_apq8064_cdp()) {
			apq8064_sdc3_pdata->wpswitch_gpio = 0;
#if defined(CONFIG_MACH_LGE)
			//apq8064_sdc3_pdata->is_wpswitch_active_low = false;
#endif
		}
		if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
			machine_is_mpq8064_dtv()) {
			int rc;
			struct pm_gpio sd_card_det_init_cfg = {
				.direction      = PM_GPIO_DIR_IN,
				.output_buffer  = PM_GPIO_OUT_BUF_CMOS,
				.pull           = PM_GPIO_PULL_UP_30,
				.vin_sel        = PM_GPIO_VIN_S4,
				.out_strength   = PM_GPIO_STRENGTH_NO,
				.function       = PM_GPIO_FUNC_NORMAL,
			};

			apq8064_sdc3_pdata->status_gpio =
				PM8921_GPIO_PM_TO_SYS(31);
			apq8064_sdc3_pdata->status_irq =
				PM8921_GPIO_IRQ(PM8921_IRQ_BASE, 31);
			rc = pm8xxx_gpio_config(apq8064_sdc3_pdata->status_gpio,
					&sd_card_det_init_cfg);
			if (rc) {
				pr_info("%s: SD_CARD_DET GPIO%d config "
					"failed(%d)\n", __func__,
					apq8064_sdc3_pdata->status_gpio, rc);
				apq8064_sdc3_pdata->status_gpio = 0;
				apq8064_sdc3_pdata->status_irq = 0;
			}
		}
		if (machine_is_apq8064_cdp()) {
			int i;

			for (i = 0;
			     i < apq8064_sdc3_pdata->pin_data->pad_data->\
				 drv->size;
			     i++)
				apq8064_sdc3_pdata->pin_data->pad_data->\
					drv->on[i].val = GPIO_CFG_10MA;
		}
		apq8064_add_sdcc(3, apq8064_sdc3_pdata);
	}
示例#30
0
static void __init msm7x30_init(void)
{
	uint32_t soc_version = 0;

	if (socinfo_init() < 0)
		printk(KERN_ERR "%s: socinfo_init() failed!\n",
		       __func__);

	soc_version = socinfo_get_version();

	msm_clock_init(msm_clocks_7x30, msm_num_clocks_7x30);
#ifdef CONFIG_SERIAL_MSM_CONSOLE
	if (lge_get_uart_mode())
		msm7x30_init_uart2();
#endif
	msm_spm_init(&msm_spm_data, 1);
	msm_acpu_clock_init(&msm7x30_clock_data);

	msm_add_pmem_devices();
	msm_add_fb_device();
	msm_add_kgsl_device();

	msm_add_usb_devices();

#if defined(CONFIG_LGE_MODEL_E739)
	msm7x30_init_marimba();
#endif

#ifdef CONFIG_MSM7KV2_AUDIO
	lge_victor_audio_init();
	msm_snddev_init();
	aux_pcm_gpio_init();
#endif
	if (lge_get_uart_mode())
		platform_device_register(&msm_device_uart2);
//LGE_FW_TDMB [START]
#if defined(CONFIG_TSIF) || defined(CONFIG_TSIF_MODULE)
	msm_device_tsif.dev.platform_data = &tsif_platform_data;
#endif
//LGE_FW_TDMB [END]

	platform_add_devices(devices, ARRAY_SIZE(devices));

	msm_device_i2c_init();
	msm_device_i2c_2_init();
	qup_device_i2c_init();

#if defined(CONFIG_LGE_MODEL_E739)
    register_board_info();
#else
	msm7x30_init_marimba();

#endif


#ifdef CONFIG_I2C_SSBI
	msm_device_ssbi6.dev.platform_data = &msm_i2c_ssbi6_pdata;
	msm_device_ssbi7.dev.platform_data = &msm_i2c_ssbi7_pdata;
#endif

	/* initialize pm */
	pmic8058_buses_init();
	lge_pm_set_platform_data();

	/* add lcd devices */
	lge_add_lcd_devices();

	/* add mmc devices */
	lge_add_mmc_devices();

	/* add misc devices */
	lge_add_misc_devices();

	/* add input devices */
	lge_add_input_devices();
//LGE_FW_TDMB [START]
#ifdef CONFIG_LGE_BROADCAST	
	lge_add_broadcast_dmb_devices();
#endif
//LGE_FW_TDMB [END]

	/* gpio i2c devices should be registered at latest point */
	lge_add_gpio_i2c_devices();

	/* add buletooth devices */
	lge_add_btpower_devices();

	/* add camera devices */
	lge_add_camera_devices();

	/* add ram console device */
#ifdef CONFIG_ANDROID_RAM_CONSOLE
	lge_add_ramconsole_devices();
#endif

#if defined(CONFIG_ANDROID_RAM_CONSOLE) && defined(CONFIG_LGE_HANDLE_PANIC)
	lge_add_panic_handler_devices();
#endif
}