void __init msm8930_init_mmc(void)
{
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	/* SDC1 : eMMC card connected */
	msm_add_sdcc(1, &msm8930_sdc1_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
	/*
	 * All 8930 platform boards using the 1.2 SoC have been reworked so that
	 * the sd card detect line's esd circuit is no longer powered by the sd
	 * card's voltage regulator. So this means we can turn the regulator off
	 * to save power without affecting the sd card detect functionality.
	 * This change to the boards will be true for newer versions of the SoC
	 * as well.
	 */
	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 1 &&
			SOCINFO_VERSION_MINOR(socinfo_get_version()) >= 2) ||
			machine_is_msm8930_cdp()) {
		msm8930_sdc3_data.vreg_data->vdd_data->always_on = false;
		msm8930_sdc3_data.vreg_data->vdd_data->reset_at_init = false;
	}
	/* SDC3: External card slot */
	if (!machine_is_msm8930_cdp()) {
		msm8930_sdc3_data.wpswitch_gpio = 0;
		msm8930_sdc3_data.wpswitch_polarity = 0;
	}
	msm_add_sdcc(3, &msm8930_sdc3_data);
#endif
}
void __init msm8930_init_mmc(void)
{
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	/*
	 * When eMMC runs in DDR mode on CDP platform, we have
	 * seen instability due to DATA CRC errors. These errors are
	 * attributed to long physical path between MSM and eMMC on CDP.
	 * So let's not enable the DDR mode on CDP platform but let other
	 * platforms take advantage of eMMC DDR mode.
	 */
	if (!machine_is_msm8930_cdp())
		msm8960_sdc1_data.uhs_caps |= (MMC_CAP_1_8V_DDR |
					       MMC_CAP_UHS_DDR50);
	/* SDC1 : eMMC card connected */
	msm_add_sdcc(1, &msm8960_sdc1_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
	/*
	 * All 8930 platform boards using the 1.2 SoC have been reworked so that
	 * the sd card detect line's esd circuit is no longer powered by the sd
	 * card's voltage regulator. So this means we can turn the regulator off
	 * to save power without affecting the sd card detect functionality.
	 * This change to the boards will be true for newer versions of the SoC
	 * as well.
	 */
	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 1 &&
			SOCINFO_VERSION_MINOR(socinfo_get_version()) >= 2) ||
			machine_is_msm8930_cdp()) {
		msm8960_sdc3_data.vreg_data->vdd_data->always_on = false;
		msm8960_sdc3_data.vreg_data->vdd_data->reset_at_init = false;
	}

	/* SDC3: External card slot */
	if (!machine_is_msm8930_cdp()) {
		msm8960_sdc3_data.wpswitch_gpio = 0;
		msm8960_sdc3_data.is_wpswitch_active_low = false;
	}
	
	/* Emily Jiang, 20130326, modify clk rate from MMC_CAP_UHS_SDR104 to MMC_CAP_UHS_SDR25,in order to support UHS-1 SDR104 sd card. {*/  
	if ( msm_project_id <= SAPPORO && system_rev >= EVT0) {
		msm8960_sdc3_data.uhs_caps |= (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
			MMC_CAP_MAX_CURRENT_800);
	} else { 
		// unknown project
		msm8960_sdc3_data.uhs_caps |= (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
			MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_DDR50 |
			MMC_CAP_UHS_SDR104 | MMC_CAP_MAX_CURRENT_800);
	}
	/* } Emily Jiang, 20130326, modify clk rate from MMC_CAP_UHS_SDR104 to MMC_CAP_UHS_SDR25,in order to support UHS-1 SDR104 sd card. */
	msm_add_sdcc(3, &msm8960_sdc3_data);
#endif
}
void __init msm8930_init_mmc(void)
{
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	/*
	 * When eMMC runs in DDR mode on CDP platform, we have
	 * seen instability due to DATA CRC errors. These errors are
	 * attributed to long physical path between MSM and eMMC on CDP.
	 * So let's not enable the DDR mode on CDP platform but let other
	 * platforms take advantage of eMMC DDR mode.
	 */
	if (!machine_is_msm8930_cdp())
		msm8960_sdc1_data.uhs_caps |= (MMC_CAP_1_8V_DDR |
					       MMC_CAP_UHS_DDR50);
	/* SDC1 : eMMC card connected */
	msm_add_sdcc(1, &msm8960_sdc1_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
	/*
	 * All 8930 platform boards using the 1.2 SoC have been reworked so that
	 * the sd card detect line's esd circuit is no longer powered by the sd
	 * card's voltage regulator. So this means we can turn the regulator off
	 * to save power without affecting the sd card detect functionality.
	 * This change to the boards will be true for newer versions of the SoC
	 * as well.
	 */
	if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 1 &&
			SOCINFO_VERSION_MINOR(socinfo_get_version()) < 2) {
		msm8960_sdc3_data.vreg_data->vdd_data->always_on = true;
		msm8960_sdc3_data.vreg_data->vdd_data->reset_at_init = true;
	}
	/* SDC3: External card slot */
	if (!machine_is_msm8930_cdp()) {
		msm8960_sdc3_data.wpswitch_gpio = 0;
		msm8960_sdc3_data.is_wpswitch_active_low = false;
	}

	if (machine_is_msm8930_evt()) {
		msm8960_sdc3_data.status_gpio = 90;
		msm8960_sdc3_data.status_irq = MSM_GPIO_TO_INT(90);
	}

	msm_add_sdcc(3, &msm8960_sdc3_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	/* SDC4: WIFI BCM4334 */
	msm_add_sdcc(4, &msm8960_sdc4_data);
#endif
}
示例#4
0
static void msm8960_ext_spk_power_amp_off(u32 spk)
{
	if (spk & (SPK_AMP_POS | SPK_AMP_NEG)) {
		if (!msm8930_ext_spk_pamp)
			return;

		if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917) {
			gpio_free(LEFT_SPKR_AMPL_GPIO);
			msm8930_ext_spk_pamp = 0;
			return;
		}

		if (!machine_is_msm8930_cdp()) {
			pr_debug("%s: Free speaker boost gpio %u\n",
					__func__, SPKR_BOOST_GPIO);
			gpio_direction_output(SPKR_BOOST_GPIO, 0);
			gpio_free(SPKR_BOOST_GPIO);
		}

		pm8xxx_spk_enable(MSM8930_SPK_OFF);
		msm8930_ext_spk_pamp = 0;
		pr_debug("%s: slepping 10 ms after turning on external "
			" Left Speaker Ampl\n", __func__);
		usleep_range(10000, 10000);

	} else  {

		pr_err("%s: ERROR : Invalid External Speaker Ampl. spk = 0x%08x\n",
			__func__, spk);
		return;
	}
}
void __init msm8930_init_cam(void)
{
	msm_gpiomux_install(msm8930_cam_common_configs,
			ARRAY_SIZE(msm8930_cam_common_configs));

	if (machine_is_msm8930_cdp()) {
		struct msm_camera_sensor_info *s_info;
		s_info = &msm_camera_sensor_s5k3l1yx_data;
		s_info->sensor_platform_info->mount_angle = 0;
		msm_flash_src._fsrc.ext_driver_src.led_en =
			GPIO_CAM_GP_LED_EN1;
		msm_flash_src._fsrc.ext_driver_src.led_flash_en =
			GPIO_CAM_GP_LED_EN2;
#if defined(CONFIG_I2C) && (defined(CONFIG_GPIO_SX150X) || \
	defined(CONFIG_GPIO_SX150X_MODULE))
		msm_flash_src._fsrc.ext_driver_src.expander_info =
			cam_expander_info;
#endif
	}

	platform_device_register(&msm_camera_server);
	platform_device_register(&msm8960_device_csiphy0);
	platform_device_register(&msm8960_device_csiphy1);
	platform_device_register(&msm8960_device_csid0);
	platform_device_register(&msm8960_device_csid1);
	platform_device_register(&msm8960_device_ispif);
	platform_device_register(&msm8960_device_vfe);
	platform_device_register(&msm8960_device_vpe);
}
int __init msm8930_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 0
	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE)
		return sglte8930_init_gpiomux();
#endif

#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_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_mbhc_configs,
			ARRAY_SIZE(msm8960_audio_mbhc_configs));

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

	if (machine_is_msm8930_mtp() || machine_is_msm8930_fluid() ||
		machine_is_msm8930_cdp()) {
#ifdef MSM8930_PHASE_2
		msm_gpiomux_install(msm8930_hsusb_configs,
			ARRAY_SIZE(msm8930_hsusb_configs));
#endif
	}

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

#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
	msm_gpiomux_install(msm8960_hdmi_configs,
			ARRAY_SIZE(msm8960_hdmi_configs));
	if (machine_is_msm8930_fluid())
		msm_gpiomux_install(msm8930_mhl_configs,
				ARRAY_SIZE(msm8930_mhl_configs));
#endif

	msm_gpiomux_install(msm8960_mdp_vsync_configs,
			ARRAY_SIZE(msm8960_mdp_vsync_configs));

	msm_gpiomux_install(msm8930_sd_det_config,
			ARRAY_SIZE(msm8930_sd_det_config));
	return 0;
}
示例#7
0
static void msm8960_ext_spk_power_amp_on(u32 spk)
{
	int ret = 0;

	if (spk & (SPK_AMP_POS | SPK_AMP_NEG)) {
		if ((msm8930_ext_spk_pamp & SPK_AMP_POS) &&
			(msm8930_ext_spk_pamp & SPK_AMP_NEG)) {

			pr_debug("%s() External Bottom Speaker Ampl already "
				"turned on. spk = 0x%08x\n", __func__, spk);
			return;
		}

		msm8930_ext_spk_pamp |= spk;

		if ((msm8930_ext_spk_pamp & SPK_AMP_POS) &&
			(msm8930_ext_spk_pamp & SPK_AMP_NEG)) {

			if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917) {
				ret = msm8930_cfg_spkr_gpio(
						LEFT_SPKR_AMPL_GPIO,
						1, "LEFT_SPKR_AMPL");
				if (ret) {
					pr_err("%s: Failed to config ampl gpio %u\n",
						__func__, LEFT_SPKR_AMPL_GPIO);
					return;
				}
			} else {

				/*
				 * 8930 CDP does not have a 5V speaker boost,
				 * hence the GPIO enable for speaker boost is
				 * only required for platforms other than CDP
				 */
				if (!machine_is_msm8930_cdp()) {
					ret = msm8930_cfg_spkr_gpio(
					  SPKR_BOOST_GPIO, 1, "SPKR_BOOST");
					if (ret) {
						pr_err("%s: Failure: spkr boost gpio %u\n",
						  __func__, SPKR_BOOST_GPIO);
						return;
					}
				}
				pm8xxx_spk_enable(MSM8930_SPK_ON);
			}

			pr_debug("%s: sleeping 10 ms after turning on external "
				" Left Speaker Ampl\n", __func__);
			usleep_range(10000, 10000);
		}

	} else  {

		pr_err("%s: ERROR : Invalid External Speaker Ampl. spk = 0x%08x\n",
			__func__, spk);
		return;
	}
}
int __init msm8930_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;
	}

	msm_gpiomux_install(msm8960_gsbi_configs,
			ARRAY_SIZE(msm8960_gsbi_configs));

	msm_gpiomux_install(msm8960_atmel_configs,
			ARRAY_SIZE(msm8960_atmel_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));

	if (system_rev == 0) {
	
#if 0 
		msm_gpiomux_install(msm8960_i2s_tx_configs,
			ARRAY_SIZE(msm8960_i2s_tx_configs));
#endif
	} else {
	
#if 0 
		msm_gpiomux_install(msm8960_i2s_XB_tx_configs,
			ARRAY_SIZE(msm8960_i2s_XB_tx_configs));
#endif
		msm_gpiomux_install(msm8960_mi2s_configs,
			ARRAY_SIZE(msm8960_mi2s_configs));
	}
	msm_gpiomux_install(msm8960_wcd_reset_configs, ARRAY_SIZE(msm8960_wcd_reset_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));

	if (machine_is_msm8930_mtp() || machine_is_msm8930_fluid() ||
		machine_is_msm8930_cdp()) {
#ifdef MSM8930_PHASE_2
		msm_gpiomux_install(msm8930_hsusb_configs,
			ARRAY_SIZE(msm8930_hsusb_configs));
#endif
	}


	msm_gpiomux_install(msm8960_mdp_vsync_configs,
			ARRAY_SIZE(msm8960_mdp_vsync_configs));
	return 0;
}
示例#9
0
void __init msm8930_init_mmc(void)
{
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	
	msm_add_sdcc(1, &msm8930_sdc1_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 1 &&
			SOCINFO_VERSION_MINOR(socinfo_get_version()) >= 2) ||
			machine_is_msm8930_cdp()) {
		msm8930_sdc3_data.vreg_data->vdd_data->always_on = false;
		msm8930_sdc3_data.vreg_data->vdd_data->reset_at_init = false;
	}
	
	if (!machine_is_msm8930_cdp()) {
		msm8930_sdc3_data.wpswitch_gpio = 0;
	}
	msm_add_sdcc(3, &msm8930_sdc3_data);
#endif
}
示例#10
0
static void msm8960_ext_spk_power_amp_on(u32 spk)
{
	int ret = 0;

	if (spk & (SPK_AMP_POS | SPK_AMP_NEG)) {
		if ((msm8930_ext_spk_pamp & SPK_AMP_POS) &&
			(msm8930_ext_spk_pamp & SPK_AMP_NEG)) {

			pr_debug("%s() External Bottom Speaker Ampl already "
				"turned on. spk = 0x%08x\n", __func__, spk);
			return;
		}

		msm8930_ext_spk_pamp |= spk;

		if ((msm8930_ext_spk_pamp & SPK_AMP_POS) &&
			(msm8930_ext_spk_pamp & SPK_AMP_NEG)) {

			/*
			 * 8930 CDP does not have a 5V speaker boost,
			 * hence the GPIO enable for speaker boost is
			 * only required for platforms other than CDP
			 */
			if (!machine_is_msm8930_cdp()) {
				pr_debug("%s: Configure Speaker Boost GPIO %u",
						__func__, SPKR_BOOST_GPIO);
				ret = gpio_request(SPKR_BOOST_GPIO,
								   "SPKR_BOOST_EN");
				if (ret) {
					pr_err("%s: Failed to configure speaker boost "
					"gpio %u\n", __func__, SPKR_BOOST_GPIO);
					return;
				}

				pr_debug("%s: Enable Speaker boost gpio %u\n",
					__func__, SPKR_BOOST_GPIO);
				gpio_direction_output(SPKR_BOOST_GPIO, 1);
			}

			pm8xxx_spk_enable(MSM8930_SPK_ON);
			pr_debug("%s: slepping 4 ms after turning on external "
				" Left Speaker Ampl\n", __func__);
			usleep_range(4000, 4000);
		}

	} else  {

		pr_err("%s: ERROR : Invalid External Speaker Ampl. spk = 0x%08x\n",
			__func__, spk);
		return;
	}
}
示例#11
0
文件: msm8930.c 项目: manl/pubile
static void msm8960_ext_spk_power_amp_off(u32 spk)
{

	// int ret = 0; // chenjun

	if (spk & (SPK_AMP_POS | SPK_AMP_NEG)) {
		if (!msm8930_ext_spk_pamp)
			return;

#if 0
		if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917) {
			gpio_free(LEFT_SPKR_AMPL_GPIO);
			msm8930_ext_spk_pamp = 0;
			return;
		}

		if (!machine_is_msm8930_cdp()) {
			pr_debug("%s: Free speaker boost gpio %u\n",
					__func__, SPKR_BOOST_GPIO);
			gpio_direction_output(SPKR_BOOST_GPIO, 0);
			gpio_free(SPKR_BOOST_GPIO);
		}

		pm8xxx_spk_enable(MSM8930_SPK_OFF);
#else
// chenjun:gpio 14 and 19 are used for speaker amplifier

			gpio_direction_output(YDA_SPKR_EN0_GPIO, 0);
			gpio_free(YDA_SPKR_EN0_GPIO);
			pr_err("chenjun:%s:disable SPKR EN0(%d)\n",
			            __func__, YDA_SPKR_EN0_GPIO);

			gpio_direction_output(YDA_SPKR_EN1_GPIO, 0);
			gpio_free(YDA_SPKR_EN1_GPIO);
			pr_err("chenjun:%s:disable SPKR EN1(%d)\n",
			            __func__, YDA_SPKR_EN1_GPIO);
#endif

		msm8930_ext_spk_pamp = 0;
		pr_debug("%s: slepping 10 ms after turning on external "
			" Left Speaker Ampl\n", __func__);
		usleep_range(10000, 10000);

	} else  {

		pr_err("%s: ERROR : Invalid External Speaker Ampl. spk = 0x%08x\n",
			__func__, spk);
		return;
	}
}
示例#12
0
void __init msm8930_init_cam(void)
{
	msm_gpiomux_install(msm8930_cam_common_configs,
			ARRAY_SIZE(msm8930_cam_common_configs));

#ifndef CONFIG_FIH_CAMERA  
	if (machine_is_msm8930_evt() &&
			(socinfo_get_platform_subtype() ==
			 PLATFORM_SUBTYPE_SGLTE)) {
		msm_gpiomux_install(msm8930_evt_cam_configs,
				ARRAY_SIZE(msm8930_evt_cam_configs));

		/* Load ov8825 & ov9724 only for SGLTE device */
		msm8930_camera_board_info.board_info =
			msm8930_evt_camera_i2c_boardinfo;
		msm8930_camera_board_info.num_i2c_board_info =
			ARRAY_SIZE(msm8930_evt_camera_i2c_boardinfo);
	}
#endif     

	if (machine_is_msm8930_cdp()) {      
#ifndef CONFIG_FIH_CAMERA          
		struct msm_camera_sensor_info *s_info;
		s_info = &msm_camera_sensor_s5k3l1yx_data;
		s_info->sensor_platform_info->mount_angle = 0;
#endif        
#if defined(CONFIG_I2C) && (defined(CONFIG_GPIO_SX150X) || \
	defined(CONFIG_GPIO_SX150X_MODULE))
		msm_flash_src._fsrc.ext_driver_src.led_en =
			GPIO_CAM_GP_LED_EN1;
		msm_flash_src._fsrc.ext_driver_src.led_flash_en =
			GPIO_CAM_GP_LED_EN2;

		msm_flash_src._fsrc.ext_driver_src.expander_info =
			cam_expander_info;
#endif
	}

	platform_device_register(&msm_camera_server);
	platform_device_register(&msm8960_device_csiphy0);
	platform_device_register(&msm8960_device_csiphy1);
	platform_device_register(&msm8960_device_csid0);
	platform_device_register(&msm8960_device_csid1);
	platform_device_register(&msm8960_device_ispif);
	platform_device_register(&msm8960_device_vfe);
	platform_device_register(&msm8960_device_vpe);
}
int __init msm8930_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_atmel_configs,
			ARRAY_SIZE(msm8960_atmel_configs));

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

#ifdef CONFIG_SLIMBUS_MSM_CTRL
	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_mbhc_configs,
			ARRAY_SIZE(msm8960_audio_mbhc_configs));
#else

	if (system_rev < CLK_REVISION) {
	msm_gpiomux_install(msm8960_audio_i2s_rx_codec_configs_rev10,
			ARRAY_SIZE(msm8960_audio_i2s_rx_codec_configs_rev10));

	msm_gpiomux_install(msm8960_audio_i2s_tx_codec_configs_rev10,
			ARRAY_SIZE(msm8960_audio_i2s_tx_codec_configs_rev10));
	} else {
	msm_gpiomux_install(msm8960_audio_i2s_rx_codec_configs,
			ARRAY_SIZE(msm8960_audio_i2s_rx_codec_configs));

	msm_gpiomux_install(msm8960_audio_i2s_tx_codec_configs,
			ARRAY_SIZE(msm8960_audio_i2s_tx_codec_configs));
	}
#endif

	msm_gpiomux_install(msm8960_audio_spkr_configs,
			ARRAY_SIZE(msm8960_audio_spkr_configs));

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

	if (machine_is_msm8930_mtp() || machine_is_msm8930_fluid() ||
		machine_is_msm8930_cdp()) {
		msm_gpiomux_install(hap_lvl_shft_config,
			ARRAY_SIZE(hap_lvl_shft_config));
#ifdef MSM8930_PHASE_2
		msm_gpiomux_install(msm8930_hsusb_configs,
			ARRAY_SIZE(msm8930_hsusb_configs));
#endif
	}

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

#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
	msm_gpiomux_install(msm8960_hdmi_configs,
			ARRAY_SIZE(msm8960_hdmi_configs));
#endif
#if defined(CONFIG_VIDEO_MHL_V2)
		msm_gpiomux_install(msm8930_mhl_configs,
				ARRAY_SIZE(msm8930_mhl_configs));
#endif

	msm_gpiomux_install(msm8960_mdp_vsync_configs,
			ARRAY_SIZE(msm8960_mdp_vsync_configs));
	msm_gpiomux_install(gpio_keys_config_mux,
			ARRAY_SIZE(gpio_keys_config_mux));

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

	msm_gpiomux_install(msm8930_sd_det_config,
			ARRAY_SIZE(msm8930_sd_det_config));
	return 0;
}
int __init msm8930_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_atmel_configs,
			ARRAY_SIZE(msm8960_atmel_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_mbhc_configs,
			ARRAY_SIZE(msm8960_audio_mbhc_configs));

	msm_gpiomux_install(msm8960_audio_spkr_configs,
			ARRAY_SIZE(msm8960_audio_spkr_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));

	if (machine_is_msm8930_mtp() || machine_is_msm8930_fluid() ||
		machine_is_msm8930_cdp()) {
		msm_gpiomux_install(hap_lvl_shft_config,
			ARRAY_SIZE(hap_lvl_shft_config));
#ifdef MSM8930_PHASE_2
		msm_gpiomux_install(msm8930_hsusb_configs,
			ARRAY_SIZE(msm8930_hsusb_configs));
#endif
	}

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

	if (machine_is_msm8930_cdp() || machine_is_msm8930_mtp()
		|| machine_is_msm8930_fluid())
		msm_gpiomux_install(msm8930_haptics_configs,
			ARRAY_SIZE(msm8930_haptics_configs));

#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));

	msm_gpiomux_install(msm8930_sd_det_config,
			ARRAY_SIZE(msm8930_sd_det_config));

	return 0;
}
示例#15
0
static int msm8930_audrx_init(struct snd_soc_pcm_runtime *rtd)
{
	int err, ret;
	struct snd_soc_codec *codec = rtd->codec;
	struct snd_soc_dapm_context *dapm = &codec->dapm;
	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;

	pr_debug("%s()\n", __func__);

	snd_soc_dapm_new_controls(dapm, msm8930_dapm_widgets,
				ARRAY_SIZE(msm8930_dapm_widgets));

	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE)
		snd_soc_dapm_add_routes(dapm, common_audio_map_sglte,
			ARRAY_SIZE(common_audio_map_sglte));
	else
		snd_soc_dapm_add_routes(dapm, common_audio_map,
			ARRAY_SIZE(common_audio_map));

	snd_soc_dapm_enable_pin(dapm, "Ext Spk Left Pos");
	snd_soc_dapm_enable_pin(dapm, "Ext Spk Left Neg");

	snd_soc_dapm_sync(dapm);

	err = snd_soc_jack_new(codec, "Headset Jack",
		MSM8930_JACK_TYPES,
		&hs_jack);
	if (err) {
		pr_err("failed to create new jack\n");
		return err;
	}

	err = snd_soc_jack_new(codec, "Button Jack",
				SITAR_JACK_BUTTON_MASK, &button_jack);
	if (err) {
		pr_err("failed to create new jack\n");
		return err;
	}

	ret = snd_jack_set_key(button_jack.jack,
			       SND_JACK_BTN_0,
			       KEY_MEDIA);
	if (ret) {
		pr_err("%s: Failed to set code for btn-0\n", __func__);
		return err;
	}

	codec_clk = clk_get(cpu_dai->dev, "osr_clk");

	/*
	 * Switch is present only in 8930 CDP and SGLTE
	 */
	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE ||
		machine_is_msm8930_cdp())
		mbhc_cfg.swap_gnd_mic = msm8930_swap_gnd_mic;

	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) {
		mbhc_cfg.gpio = GPIO_HS_DET_SGLTE;
		mbhc_cfg.gpio_level_insert = 0;
	} else
		mbhc_cfg.gpio = GPIO_HS_DET;

	/*
	 * GPIO for headset detect is present in all devices
	 * MTP/Fluid/CDP/SGLTE
	 */
	err = gpio_request(mbhc_cfg.gpio, "HEADSET_DETECT");
	if (err) {
		pr_err("%s: Failed to request gpio %d\n",
				__func__, mbhc_cfg.gpio);
		return err;
	}

	mbhc_cfg.gpio_irq = gpio_to_irq(mbhc_cfg.gpio);
	sitar_hs_detect(codec, &mbhc_cfg);

	if (socinfo_get_pmic_model() != PMIC_MODEL_PM8917) {
		/* Initialize default PMIC speaker gain */
		pm8xxx_spk_gain(DEFAULT_PMIC_SPK_GAIN);
	}

	return 0;
}
int __init msm8930_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_atmel_configs,
			ARRAY_SIZE(msm8960_atmel_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));

//HTC_AUD ++
	if (system_rev == 0) {
	/* XA board */
		msm_gpiomux_install(msm8960_i2s_tx_configs,
			ARRAY_SIZE(msm8960_i2s_tx_configs));
	} else {
	/* XB board */
		msm_gpiomux_install(msm8960_i2s_XB_tx_configs,
			ARRAY_SIZE(msm8960_i2s_XB_tx_configs));
		msm_gpiomux_install(msm8960_mi2s_configs,
			ARRAY_SIZE(msm8960_mi2s_configs));
	}
	msm_gpiomux_install(msm8960_wcd_reset_configs, ARRAY_SIZE(msm8960_wcd_reset_configs));
//HTC_AUD --

	msm_gpiomux_install(msm8960_audio_auxpcm_configs,
			ARRAY_SIZE(msm8960_audio_auxpcm_configs));

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

	if (machine_is_msm8930_mtp() || machine_is_msm8930_fluid() ||
		machine_is_msm8930_cdp()) {
//HTC_AUD ++
// remove this part because GPIO 47 is used for AUD FM mI2S
//		msm_gpiomux_install(hap_lvl_shft_config,
//			ARRAY_SIZE(hap_lvl_shft_config));
//HTC_AUD --
#ifdef MSM8930_PHASE_2
		msm_gpiomux_install(msm8930_hsusb_configs,
			ARRAY_SIZE(msm8930_hsusb_configs));
#endif
	}
/*
	if (machine_is_msm8930_cdp() || machine_is_msm8930_mtp()
		|| machine_is_msm8930_fluid())
		msm_gpiomux_install(msm8930_haptics_configs,
			ARRAY_SIZE(msm8930_haptics_configs));
*/


	msm_gpiomux_install(msm8960_mdp_vsync_configs,
			ARRAY_SIZE(msm8960_mdp_vsync_configs));
	return 0;
}
int __init msm8930_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_MACH_MELIUS_CHN_CTC)
		msm_gpiomux_install(sensor_config,
				ARRAY_SIZE(sensor_config));
#endif

#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_RADIO_USE_MI2S
	msm_gpiomux_install(msm8960_mi2s_configs,
			ARRAY_SIZE(msm8960_mi2s_configs));
#endif
#if !defined(CONFIG_MACH_MELIUS_SKT) && !defined(CONFIG_MACH_MELIUS_KTT) && \
	!defined(CONFIG_MACH_MELIUS_LGT) && !defined(CONFIG_MACH_MELIUS_CHN_CTC) && \
    !defined(CONFIG_MACH_MELIUS_EUR_LTE) && !defined(CONFIG_MACH_MELIUS_EUR_OPEN) && !defined(CONFIG_MACH_CRATER_CHN_CTC)
	msm_gpiomux_install(msm8960_atmel_configs,
			ARRAY_SIZE(msm8960_atmel_configs));
#endif
#ifdef CONFIG_2MIC_ES305
	msm_gpiomux_install(audience_suspend_configs,
		ARRAY_SIZE(audience_suspend_configs));
#endif

#ifdef CONFIG_SLIMBUS_MSM_CTRL
	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_mbhc_configs,
			ARRAY_SIZE(msm8960_audio_mbhc_configs));
#else

	if (system_rev < CLK_REVISION) {
	msm_gpiomux_install(msm8960_audio_i2s_rx_codec_configs_rev10,
			ARRAY_SIZE(msm8960_audio_i2s_rx_codec_configs_rev10));

	msm_gpiomux_install(msm8960_audio_i2s_tx_codec_configs_rev10,
			ARRAY_SIZE(msm8960_audio_i2s_tx_codec_configs_rev10));
	} else {
	msm_gpiomux_install(msm8960_audio_i2s_rx_codec_configs,
			ARRAY_SIZE(msm8960_audio_i2s_rx_codec_configs));

	msm_gpiomux_install(msm8960_audio_i2s_tx_codec_configs,
			ARRAY_SIZE(msm8960_audio_i2s_tx_codec_configs));
	}
#endif

	msm_gpiomux_install(msm8960_audio_spkr_configs,
			ARRAY_SIZE(msm8960_audio_spkr_configs));

#ifdef CONFIG_AUXPCM_INTERFACE
	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_msm8930_mtp() || machine_is_msm8930_fluid() ||
		machine_is_msm8930_cdp()) {

#if !defined(CONFIG_RADIO_USE_MI2S) && !defined(CONFIG_TDMB)
		msm_gpiomux_install(hap_lvl_shft_config,
			ARRAY_SIZE(hap_lvl_shft_config));
#endif
#ifdef MSM8930_PHASE_2
		msm_gpiomux_install(msm8930_hsusb_configs,
			ARRAY_SIZE(msm8930_hsusb_configs));
#endif
	}

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

#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
	msm_gpiomux_install(msm8960_hdmi_configs,
			ARRAY_SIZE(msm8960_hdmi_configs));
#endif
#if defined(CONFIG_VIDEO_MHL_V2)
		msm_gpiomux_install(msm8930_mhl_configs,
				ARRAY_SIZE(msm8930_mhl_configs));
#endif
/* requested by HW team for IORA test */
#if (defined(CONFIG_MACH_MELIUS_SPR) ||  defined(CONFIG_MACH_MELIUS_USC))
	msm_gpiomux_install(msm8930_fgchg_configs,
			ARRAY_SIZE(msm8930_fgchg_configs));
#endif

	msm_gpiomux_install(msm8960_mdp_vsync_configs,
			ARRAY_SIZE(msm8960_mdp_vsync_configs));
	msm_gpiomux_install(gpio_keys_config_mux,
			ARRAY_SIZE(gpio_keys_config_mux));

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

#ifdef CONFIG_LEDS_AN30259A
	msm_gpiomux_install(msm8930_leds_configs,
			ARRAY_SIZE(msm8930_leds_configs));
#endif
#if defined(CONFIG_IR_REMOCON_FPGA)
	msm_gpiomux_install(msm8930_fpga_resetn_configs,
			ARRAY_SIZE(msm8930_fpga_resetn_configs));

	msm_gpiomux_install(msm8930_fpga_irq_configs,
			ARRAY_SIZE(msm8930_fpga_irq_configs));
#endif
	msm_gpiomux_install(msm8930_sd_det_config,
			ARRAY_SIZE(msm8930_sd_det_config));
#ifdef CONFIG_SAMSUNG_CMC624
	if (samsung_has_cmc624()) {
		msm_gpiomux_install(msm8x30_cmc624_configs,
		ARRAY_SIZE(msm8x30_cmc624_configs));
	}
#endif

#if defined(CONFIG_MACH_MELIUS_CHN_CTC)
	msm_gpiomux_install(msm8x30_uartsel_configs,
			ARRAY_SIZE(msm8x30_uartsel_configs));
#endif

#if defined(CONFIG_MACH_MELIUS_CHN_CTC) || defined(CONFIG_MACH_CRATER_CHN_CTC)
	msm_gpiomux_install(msm8x30_simsel_configs,
		ARRAY_SIZE(msm8x30_simsel_configs));
#endif
	msm_gpiomux_install(msm8930_suspend_melius_configs,
			ARRAY_SIZE(msm8930_suspend_melius_configs));
#if defined (CONFIG_MACH_MELIUS_SPR)
	msm_gpiomux_install(pmic_gpio_configs,
			ARRAY_SIZE(pmic_gpio_configs));
#endif

	config_melius_gpio_init_sleep_gpio();
	return 0;
}
int __init msm8930_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));
/* Emily Jiang, 20121105, Add for Focaltech FT5316 TouchScreen { */
#if defined(CONFIG_TOUCHSCREEN_FOCALTECH_FT5316) || defined(CONFIG_TOUCHSCREEN_SYNAPTICS_S3202)
	msm_gpiomux_install(msm8960_focaltech_ts_configs,
			ARRAY_SIZE(msm8960_focaltech_ts_configs));
#endif //CONFIG_TOUCHSCREEN_FOCALTECH_FT5316
/* } Emily Jiang, 20121105, Add for Focaltech FT5316 TouchScreen */
	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_mbhc_configs,
			ARRAY_SIZE(msm8960_audio_mbhc_configs));

/* Terry Cheng 20121211, Remove Audio speaker boost setting on Boston {*/
#if 0
	msm_gpiomux_install(msm8960_audio_spkr_configs,
			ARRAY_SIZE(msm8960_audio_spkr_configs));
#endif	
/* } Terry Cheng 20121211, Remove Audio speaker boost setting on Boston */

/* Terry Cheng, 20121207, Remove auxpcm config for Boston project {*/
#if 0
	msm_gpiomux_install(msm8960_audio_auxpcm_configs,
			ARRAY_SIZE(msm8960_audio_auxpcm_configs));
#endif
/* } Terry Cheng, 20121207, Remove auxpcm config for Boston project */

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

	if (machine_is_msm8930_mtp() || machine_is_msm8930_fluid() ||
		machine_is_msm8930_cdp()) {
/* Terry Cheng, 20121207, Remove hap lvl shft config for Boston project {*/
#if 0		
		msm_gpiomux_install(hap_lvl_shft_config,
			ARRAY_SIZE(hap_lvl_shft_config));
#endif
/* } Terry Cheng, 20121207, Remove hap lvl shft config for Boston project {*/

/* Terry Cheng, 201211, Add compiler option for USB OTG  { */
#if  defined(MSM8930_PHASE_2) && defined(CONFIG_USB_OTG)
		msm_gpiomux_install(msm8930_hsusb_configs,
			ARRAY_SIZE(msm8930_hsusb_configs));
#endif	//MSM8930_PHASE_2 && CONFIG_USB_OTG
/* } Terry Cheng, 201211, Add compiler option for USB OTG   */
	}

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

//Terry Cheng, 20121207, Add compiler option when porting Boston
#ifdef CONFIG_HAPTIC_ISA1200
	if (machine_is_msm8930_cdp() || machine_is_msm8930_mtp()
		|| machine_is_msm8930_fluid())
		msm_gpiomux_install(msm8930_haptics_configs,
			ARRAY_SIZE(msm8930_haptics_configs));
#endif	//CONFIG_HAPTIC_ISA1200

#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
	msm_gpiomux_install(msm8960_hdmi_configs,
			ARRAY_SIZE(msm8960_hdmi_configs));
	if (msm8930_mhl_display_enabled())
		msm_gpiomux_install(msm8930_mhl_configs,
				ARRAY_SIZE(msm8930_mhl_configs));
#endif

	msm_gpiomux_install(msm8960_mdp_vsync_configs,
			ARRAY_SIZE(msm8960_mdp_vsync_configs));

	msm_gpiomux_install(msm8930_sd_det_config,
			ARRAY_SIZE(msm8930_sd_det_config));

	if (machine_is_msm8930_fluid() || machine_is_msm8930_mtp())
		msm_gpiomux_install(msm8930_gyro_int_config,
			ARRAY_SIZE(msm8930_gyro_int_config));

	msm_gpiomux_install(msm_sitar_config, ARRAY_SIZE(msm_sitar_config));

	/* Boston CR #:XXX, WH Lee, 20121128 */
#ifdef CONFIG_SENSORS_TSL2772
	msm_gpiomux_install(tsl2772_int_configs,
			ARRAY_SIZE(tsl2772_int_configs));
#endif
	/* WH Lee, 20121128 */

//Eric Liu+
#ifdef CONFIG_BATTERY_27520
	msm_gpiomux_install(msm8960_battery_27520_configs,
			ARRAY_SIZE(msm8960_battery_27520_configs));
#endif
//Eric Liu-

/* Jen Chang add for pn544 nfc driver */
#ifdef CONFIG_PN544_NFC
	msm_gpiomux_install(msm8960_pn544_nfc_configs,
			ARRAY_SIZE(msm8960_pn544_nfc_configs));
#endif
/* Jen Chang, 20121217 */

/* Terry Cheng, 20130711, Add sapporo smart cover config { */
#ifdef CONFIG_SMART_COVER_DETECTION
	msm_gpiomux_install(msm8960_smart_cover_configs,
			ARRAY_SIZE(msm8960_smart_cover_configs));
#endif 	//CONFIG_SMART_COVER_DETECTION
/* } Terry Cheng, 20130711, Add sapporo smart cover config  */

	return 0;
}