コード例 #1
0
ファイル: asustek-keypad.c プロジェクト: ChaOSChriS/ChaOS-flo
static void gpio_keys_remap(void)
{
	hw_rev ret = HW_REV_INVALID;

	ret = asustek_get_hw_rev();
	switch (ret) {
	case HW_REV_B:
		pr_info(
		"Reconfigure VOL_UP with GPIO%d and VOL_DOWN with GPIO%d\n",
				GPIO_KEY_VOLUMEUP, GPIO_KEY_VOLUMEDOWN);
		break;

	case HW_REV_C:
		pr_info(
		"Reconfigure VOL_UP(GPIO%d) and VOL_DOWN(GPIO%d) with PMIC\n",
					GPIO_PM8921_KEY_VOLUME_UP,
					GPIO_PM8921_KEY_VOLUME_DOWN);
		asustek_keys[1].gpio = GPIO_PM8921_KEY_VOLUME_UP;
		asustek_keys[2].gpio = GPIO_PM8921_KEY_VOLUME_DOWN;
		break;

	case HW_REV_D:
	case HW_REV_E:
		pr_info(
		"Reconfigure VOL_UP(GPIO%d) and VOL_DOWN(GPIO%d) with PMIC\n",
					GPIO_PM8921_KEY2_VOLUME_UP,
					GPIO_PM8921_KEY2_VOLUME_DOWN);
		asustek_keys[1].gpio = GPIO_PM8921_KEY2_VOLUME_UP;
		asustek_keys[2].gpio = GPIO_PM8921_KEY2_VOLUME_DOWN;
		break;

	default:
		break;
	}
}
コード例 #2
0
static int __devinit mipi_JDI_lcd_probe(struct platform_device *pdev)
{
	pr_info("%s+\n", __func__);

	hw_revision = asustek_get_hw_rev();
	pr_info("%s, hw_revision=%d\n", __func__, hw_revision);
	lcd_pwm = asustek_get_lcd_pwm_type();
	pr_info("%s, lcd_pwm_type=%d\n", __func__, lcd_pwm);

	if (pdev->id == 0) {
		mipi_JDI_pdata = pdev->dev.platform_data;
		return 0;
	}

	if (mipi_JDI_pdata == NULL) {
		pr_err("%s.invalid platform data.\n", __func__);
		return -ENODEV;
	}

	/* already request bl_lpm in leds_pm8xxx.c, pm8xxx_led_probe() */

	if (bl_lpm == NULL || IS_ERR(bl_lpm)) {
		pr_err("%s pwm_request() failed\n", __func__);
		bl_lpm = NULL;
	}
	pr_debug("bl_lpm = %p lpm = %d\n", bl_lpm,
		mipi_JDI_pdata->gpio[0]);

	msm_fb_add_device(pdev);

	register_syscore_ops(&panel_syscore_ops);

	if (lcd_pwm == LCD_PWM_TYPE_B) { /* set pwm frequency to 22K */
		backlight_control4[18] = 0x04;
		backlight_control4[19] = 0x00;
	}

	pr_info("%s-\n", __func__);
	return 0;
}
コード例 #3
0
void __init apq8064_init_gpiomux(void)
{
	int rc;
	int platform_version = socinfo_get_platform_version();
#ifdef CONFIG_MACH_ASUSTEK
	hw_rev revision = HW_REV_INVALID;
	revision = asustek_get_hw_rev();
#endif
	rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return;
	}

	msm_gpiomux_install(msm8960_mdp_vsync_configs,
			ARRAY_SIZE(msm8960_mdp_vsync_configs));

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		 machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
				ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
#ifdef CONFIG_MSM_VCAP
		msm_gpiomux_install(vcap_configs,
				ARRAY_SIZE(vcap_configs));
#endif
		msm_gpiomux_install(sx150x_int_configs,
				ARRAY_SIZE(sx150x_int_configs));
	} else {
		#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
		msm_gpiomux_install(apq8064_ethernet_configs,
				ARRAY_SIZE(apq8064_ethernet_configs));
		#endif

		msm_gpiomux_install(apq8064_gsbi_configs,
				ARRAY_SIZE(apq8064_gsbi_configs));
	}

#ifdef CONFIG_MACH_ASUSTEK
	if (machine_is_apq8064_flo() || machine_is_apq8064_deb()) {
		msm_gpiomux_install(asustek_pcbid_pins_configs,
			ARRAY_SIZE(asustek_pcbid_pins_configs));

		if (revision == HW_REV_B) {
			msm_gpiomux_install(asustek_gpio_keys_configs,
				ARRAY_SIZE(asustek_gpio_keys_configs));
		}

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

	msm_gpiomux_install(gpio_bat_low_configs,
			ARRAY_SIZE(gpio_bat_low_configs));


	msm_gpiomux_install(apq8064_slimbus_config,
			ARRAY_SIZE(apq8064_slimbus_config));

	msm_gpiomux_install(apq8064_audio_codec_configs,
			ARRAY_SIZE(apq8064_audio_codec_configs));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_spkr_i2s_config,
			ARRAY_SIZE(mpq8064_spkr_i2s_config));
	}

	pr_debug("%s(): audio-auxpcm: Include GPIO configs"
		" as audio is not the primary user"
		" for these GPIO Pins\n", __func__);

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv())
		msm_gpiomux_install(mpq8064_mi2s_configs,
			ARRAY_SIZE(mpq8064_mi2s_configs));
/*
	msm_gpiomux_install(apq8064_ext_regulator_configs,
			ARRAY_SIZE(apq8064_ext_regulator_configs));
*/
	if (machine_is_apq8064_flo() || machine_is_apq8064_deb()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1)
			msm_gpiomux_install(mdm_i2s_configs,
					ARRAY_SIZE(mdm_i2s_configs));
		else
			msm_gpiomux_install(mdm_configs,
					ARRAY_SIZE(mdm_configs));
	}

	if (machine_is_apq8064_flo() || machine_is_apq8064_deb()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
			msm_gpiomux_install(cyts_gpio_alt_config,
					ARRAY_SIZE(cyts_gpio_alt_config));
		} else {
			msm_gpiomux_install(cyts_gpio_configs,
					ARRAY_SIZE(cyts_gpio_configs));
		}
	}

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if (machine_is_apq8064_flo() || machine_is_apq8064_deb())
		msm_gpiomux_install(apq8064_hsic_configs,
				ARRAY_SIZE(apq8064_hsic_configs));
#endif

	if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
		msm_gpiomux_install(apq8064_mxt_configs,
			ARRAY_SIZE(apq8064_mxt_configs));

	msm_gpiomux_install(apq8064_hdmi_configs,
			ARRAY_SIZE(apq8064_hdmi_configs));

	 if (machine_is_mpq8064_cdp())
		msm_gpiomux_install(mpq8064_ir_configs,
				ARRAY_SIZE(mpq8064_ir_configs));

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

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

#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
	msm_gpiomux_install(apq8064_sdc3_configs,
			ARRAY_SIZE(apq8064_sdc3_configs));
#endif
	//add touch
	msm_gpiomux_install(msm8064_ts_gpio_config,
			ARRAY_SIZE(msm8064_ts_gpio_config));  

	msm_gpiomux_install(smb345_pin_configs,
			ARRAY_SIZE(smb345_pin_configs));

	switch (revision) {
	case HW_REV_B:
	case HW_REV_C:
	case HW_REV_D:
	case HW_REV_E:
		msm_gpiomux_install(wpc_pok_configs,
			ARRAY_SIZE(wpc_pok_configs));
		break;
	default:
		break;
	}

	if (machine_is_apq8064_flo() || machine_is_apq8064_deb())
		msm_gpiomux_install(apq8064_bcm2079x_nfc_configs,
			ARRAY_SIZE(apq8064_bcm2079x_nfc_configs));
#ifdef CONFIG_SLIMPORT_ANX7808
	msm_gpiomux_install(msm8064_sp_gpio_config,
			ARRAY_SIZE(msm8064_sp_gpio_config));
#endif
	msm_gpiomux_install(apq8064_headphone_configs,
			ARRAY_SIZE(apq8064_headphone_configs));

	msm_gpiomux_install(asustek_gsbi4_configs,
		ARRAY_SIZE(asustek_gsbi4_configs));

#ifdef CONFIG_INPUT_LID
	if (machine_is_apq8064_flo() || machine_is_apq8064_deb()) {
		if ((revision == HW_REV_C) || (revision == HW_REV_D) || (revision == HW_REV_E)) {
			msm_gpiomux_install(asustek_hall_sensor_configs,
			ARRAY_SIZE(asustek_hall_sensor_configs));
		}
	}
#endif

}