当前位置: 首页>>代码示例>>C++>>正文


C++ pm8xxx_gpio_config函数代码示例

本文整理汇总了C++中pm8xxx_gpio_config函数的典型用法代码示例。如果您正苦于以下问题:C++ pm8xxx_gpio_config函数的具体用法?C++ pm8xxx_gpio_config怎么用?C++ pm8xxx_gpio_config使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了pm8xxx_gpio_config函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: pm8921_gpio_mpp_init

void __init pm8921_gpio_mpp_init(struct pm8xxx_gpio_init *pm8921_gpios,
                                 unsigned gpio_size,
                                 struct pm8xxx_mpp_init *pm8921_mpps,
                                 unsigned mpp_size)
{
    int i, rc;

    for (i = 0; i < gpio_size; i++) {
        rc = pm8xxx_gpio_config(pm8921_gpios[i].gpio,
                                &pm8921_gpios[i].config);
        if (rc) {
            pr_err("%s: pm8xxx_gpio_config: rc=%d\n", __func__, rc);
            break;
        }
    }

    for (i = 0; i < mpp_size; i++) {
        rc = pm8xxx_mpp_config(pm8921_mpps[i].mpp,
                               &pm8921_mpps[i].config);
        if (rc) {
            pr_err("%s: pm8xxx_mpp_config: rc=%d\n", __func__, rc);
            break;
        }
    }
}
开发者ID:OUDhs,项目名称:android_kernel_motorola_asanti,代码行数:25,代码来源:board-mmi-pmic.c

示例2: sec_fg_gpio_init

static bool sec_fg_gpio_init(void)
{
	struct pm_gpio param = {
		.direction     = PM_GPIO_DIR_IN,
		.pull          = PM_GPIO_PULL_NO,
		.vin_sel       = PM_GPIO_VIN_S4,
		.function      = PM_GPIO_FUNC_NORMAL,
	};

	/* FUEL_ALERT Setting */
	if (system_rev == 0x0) {
		sec_battery_pdata.fg_irq = PM8921_GPIO_IRQ(PM8921_IRQ_BASE,
				GPIO_FUEL_INT_04A);
		pm8xxx_gpio_config(PM8921_GPIO_PM_TO_SYS(GPIO_FUEL_INT_04A),
						&param);
#if defined(CONFIG_MACH_JF_ATT) || defined(CONFIG_MACH_JF_TMO)
	} else if (system_rev >= 8) {
#else
	} else if (system_rev >= 9) {
#endif
		/* FUEL_ALERT Registration */
		struct pm8xxx_mpp_config_data fuel_alert_mppcfg = {
			.type = PM8XXX_MPP_TYPE_D_INPUT,
			.level = PM8921_MPP_DIG_LEVEL_S4,
			.control = PM8XXX_MPP_DOUT_CTRL_LOW,
		};

		sec_battery_pdata.fg_irq = PM8921_MPP_IRQ(PM8921_IRQ_BASE, 6);
		pm8xxx_mpp_config(PM8921_MPP_PM_TO_SYS(6),
				&fuel_alert_mppcfg);
	}
	else
开发者ID:Jonmhaney,项目名称:Googy-Max3-Kernel,代码行数:32,代码来源:board-fusion3-battery.c

示例3: msm_otg_pmic_gpio_config

static int msm_otg_pmic_gpio_config(
		int gpio, int direction, int pullup, int value)
{
	struct pm_gpio param;
	int rc = 0;
	int out_strength = 0;

	if (direction == PM_GPIO_DIR_IN)
		out_strength = PM_GPIO_STRENGTH_NO;
	else
		out_strength = PM_GPIO_STRENGTH_HIGH;

	param.direction = direction;
	param.output_buffer = PM_GPIO_OUT_BUF_CMOS;
	param.output_value = value;
	param.pull = pullup;
	param.vin_sel = PM_GPIO_VIN_S4;
	param.out_strength = out_strength;
	param.function = PM_GPIO_FUNC_NORMAL;
	param.inv_int_pol = 0;
	param.disable_pin = 0;

	rc = pm8xxx_gpio_config(
		PM8921_GPIO_PM_TO_SYS(gpio), &param);
	if (rc < 0) {
		pr_err("failed to configure vbus_in gpio\n");
		return rc;
	}

	return rc;
}
开发者ID:AnDr0id,项目名称:SGH-I747,代码行数:31,代码来源:board-comanche-battery.c

示例4: apq8064_init_mmc

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 (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;
			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;
		}
		apq8064_add_sdcc(3, apq8064_sdc3_pdata);
	}
开发者ID:El-Nath,项目名称:biji-find5-kernel,代码行数:59,代码来源:board-8064-storage.c

示例5: ncp6924_en

static int ncp6924_en(bool onoff)
{
	int ret = 0;

	if (onoff) {
		ncp6924_gpio_en.output_value = 1;
		ncp6924_gpio_en.pull = PM_GPIO_PULL_UP_30;
		ret = pm8xxx_gpio_config(en_gpio, &ncp6924_gpio_en);
	} else {
		ncp6924_gpio_en.output_value = 0;
		ncp6924_gpio_en.pull = PM_GPIO_PULL_DN;
		ret = pm8xxx_gpio_config(en_gpio, &ncp6924_gpio_en);
	}
	mdelay(10);

	return ret;
}
开发者ID:happyhere,项目名称:802Xtreem,代码行数:17,代码来源:ncp6924.c

示例6: elite_stereo_voice_put

static int elite_stereo_voice_put(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{
	int ret = 0;
	struct pm_gpio param = {
		.direction      = PM_GPIO_DIR_OUT,
		.output_buffer  = PM_GPIO_OUT_BUF_CMOS,
		.output_value   = 1,
		.pull      = PM_GPIO_PULL_NO,
		.vin_sel	= PM_GPIO_VIN_L17,
		.out_strength   = PM_GPIO_STRENGTH_MED,
		.function       = PM_GPIO_FUNC_NORMAL,
	};

	if (elite_stereo_control == ucontrol->value.integer.value[0])
		return 0;

	elite_stereo_control = ucontrol->value.integer.value[0];

	pr_aud_info("%s: elite_stereo_control = %d\n", __func__,
			elite_stereo_control);

	switch (ucontrol->value.integer.value[0]) {
	case 0:
		/* turn off selected pin of stereo mic to bypass A1028 */
		gpio_direction_output(ELITE_AUD_STEREO_REC, 1);
		gpio_free(ELITE_AUD_STEREO_REC);

		break;
	case 1:
		/* turn on selection of stereo mic to enable A1028 */
		ret = gpio_request(ELITE_AUD_STEREO_REC, "A1028_SWITCH");
		if (ret) {
			pr_aud_err("%s: Failed to request gpio %d\n", __func__,
					ELITE_AUD_STEREO_REC);
			return ret;
		}

		ret = pm8xxx_gpio_config(ELITE_AUD_STEREO_REC, &param);

		if (ret)
			pr_aud_err("%s: Failed to configure gpio %d\n", __func__,
					ELITE_AUD_STEREO_REC);
		else
			gpio_direction_output(ELITE_AUD_STEREO_REC, 0);
		break;
	}
	return ret;
}

static int msm8960_btsco_rate_get(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{
	pr_debug("%s: msm8960_btsco_rate  = %d", __func__,
					msm8960_btsco_rate);
	ucontrol->value.integer.value[0] = msm8960_btsco_rate;
	return 0;
}
开发者ID:Team-Blackout,项目名称:BeastMode-Evita,代码行数:58,代码来源:board-elite-audio.c

示例7: jet_stereo_voice_put

static int jet_stereo_voice_put(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{
	int ret = 0;
	struct pm_gpio param = {
		.direction      = PM_GPIO_DIR_OUT,
		.output_buffer  = PM_GPIO_OUT_BUF_CMOS,
		.output_value   = 1,
		.pull      = PM_GPIO_PULL_NO,
		.vin_sel	= PM_GPIO_VIN_L17,
		.out_strength   = PM_GPIO_STRENGTH_MED,
		.function       = PM_GPIO_FUNC_NORMAL,
	};

	if (jet_stereo_control == ucontrol->value.integer.value[0])
		return 0;

	jet_stereo_control = ucontrol->value.integer.value[0];

	pr_debug("%s: jet_stereo_control = %d\n", __func__,
			jet_stereo_control);

	switch (ucontrol->value.integer.value[0]) {
	case 0:
		
		gpio_direction_output(JET_AUD_STEREO_REC, 1);
		gpio_free(JET_AUD_STEREO_REC);

		break;
	case 1:
		
		ret = gpio_request(JET_AUD_STEREO_REC, "A1028_SWITCH");
		if (ret) {
			pr_err("%s: Failed to request gpio %d\n", __func__,
					JET_AUD_STEREO_REC);
			return ret;
		}

		ret = pm8xxx_gpio_config(JET_AUD_STEREO_REC, &param);

		if (ret)
			pr_err("%s: Failed to configure gpio %d\n", __func__,
					JET_AUD_STEREO_REC);
		else
			gpio_direction_output(JET_AUD_STEREO_REC, 0);
		break;
	}
	return ret;
}

static int msm_btsco_rate_get(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{
	pr_debug("%s: msm_btsco_rate  = %d", __func__, msm_btsco_rate);
	ucontrol->value.integer.value[0] = msm_btsco_rate;
	return 0;
}
开发者ID:DennisBold,项目名称:android_kernel_htc_pyramid,代码行数:57,代码来源:board-jet-audio.c

示例8: shooter_3Dpanel_on

static void shooter_3Dpanel_on(bool bLandscape)
{
	struct pm8058_pwm_period pwm_conf;
	int rc;

	led_brightness_switch("lcd-backlight", 255);

	if (system_rev >= 1) {
		pwm_gpio_config.output_value = 1;
		rc = pm8xxx_gpio_config(PM8058_GPIO_PM_TO_SYS(SHOOTER_3DLCM_PD), &pwm_gpio_config);
		if (rc < 0)
			pr_err("%s pmic gpio config gpio %d failed\n", __func__, PM8058_GPIO_PM_TO_SYS(SHOOTER_3DLCM_PD));
	}

	rc = pm8xxx_gpio_config(PM8058_GPIO_PM_TO_SYS(SHOOTER_3DCLK), &clk_gpio_config_on);
	if (rc < 0)
		pr_err("%s pmic gpio config gpio %d failed\n", __func__, SHOOTER_3DCLK);

	pwm_disable(pwm_3d);
	pwm_conf.pwm_size = 9;
	pwm_conf.clk = PM_PWM_CLK_19P2MHZ;
	pwm_conf.pre_div = PM_PWM_PREDIVIDE_3;
	pwm_conf.pre_div_exp = 6;
	rc = pwm_configure(pwm_3d, &pwm_conf, 1, 255);
	if (rc < 0)
		pr_err("%s pmic configure %d\n", __func__, rc);
	pwm_enable(pwm_3d);

	if (bLandscape) {
		mdp4_dsi_color_enhancement(mdp_sharp_barrier_on, ARRAY_SIZE(mdp_sharp_barrier_on));
		gpio_set_value(SHOOTER_CTL_3D_1, 1);
		gpio_set_value(SHOOTER_CTL_3D_2, 1);
		gpio_set_value(SHOOTER_CTL_3D_3, 1);
		gpio_set_value(SHOOTER_CTL_3D_4, 0);
	} else {
		mdp4_dsi_color_enhancement(mdp_sharp_barrier_on, ARRAY_SIZE(mdp_sharp_barrier_on));
		gpio_set_value(SHOOTER_CTL_3D_1, 1);
		gpio_set_value(SHOOTER_CTL_3D_2, 1);
		gpio_set_value(SHOOTER_CTL_3D_3, 0);
		gpio_set_value(SHOOTER_CTL_3D_4, 1);
	}
}
开发者ID:Snuzzo,项目名称:Kitten_Kernel,代码行数:42,代码来源:shooter-panel.c

示例9: deluxe_u_init_mmc

void __init deluxe_u_init_mmc(void)
{
	wifi_status_cb = NULL;

	printk(KERN_INFO "deluxe_u: %s\n", __func__);

	/* initial WL_REG_ON */
	wl_reg_on_gpio.config.output_value = 0;
	pm8xxx_gpio_config(wl_reg_on_gpio.gpio, &wl_reg_on_gpio.config);

	wl_dev_wake_gpio.config.output_value = 0;
	pm8xxx_gpio_config(wl_dev_wake_gpio.gpio, &wl_dev_wake_gpio.config);

	/* PM QoS for wifi*/
	deluxe_u_wifi_data.cpu_dma_latency = msm_rpm_get_swfi_latency();

	apq8064_add_sdcc(1, deluxe_u_sdc1_pdata);
	apq8064_add_sdcc(3, &deluxe_u_wifi_data);
	//reg_set_l7_optimum_mode();
}
开发者ID:bgcngm,项目名称:802Xtreem,代码行数:20,代码来源:board-deluxe_u-storage.c

示例10: config_gpio_table

static void config_gpio_table(struct pm8xxx_gpio_init *table, int len)
{
	int n, rc;
	for (n = 0; n < len; n++) {
		rc = pm8xxx_gpio_config(table[n].gpio, &table[n].config);
		if (rc) {
			pr_err("%s: pm8xxx_gpio_config(%u)=%d\n", __func__, table[n].gpio, rc);
			break;
		}
	}
}
开发者ID:jiangchao87,项目名称:HTL22_KK_4.4.4_GPE,代码行数:11,代码来源:board-m7wlj-storage.c

示例11: deluxe_ub1_init_mmc

void __init deluxe_ub1_init_mmc(void)
{
	wifi_status_cb = NULL;

	printk(KERN_INFO "deluxe_ub1: %s\n", __func__);

	
	wl_reg_on_gpio.config.output_value = 0;
	pm8xxx_gpio_config(wl_reg_on_gpio.gpio, &wl_reg_on_gpio.config);

	wl_dev_wake_gpio.config.output_value = 0;
	pm8xxx_gpio_config(wl_dev_wake_gpio.gpio, &wl_dev_wake_gpio.config);

	
	deluxe_ub1_wifi_data.cpu_dma_latency = msm_rpm_get_swfi_latency();

	apq8064_add_sdcc(1, deluxe_ub1_sdc1_pdata);
	apq8064_add_sdcc(3, deluxe_ub1_sdc3_pdata);
	apq8064_add_sdcc(4, &deluxe_ub1_wifi_data);
}
开发者ID:Backspace-Dev,项目名称:x920d-jp,代码行数:20,代码来源:board-deluxe_ub1-storage.c

示例12: m7wl_wifi_power

int m7wl_wifi_power(int on)
{
	const unsigned SDC3_HDRV_PULL_CTL_ADDR = (unsigned) MSM_TLMM_BASE + 0x20A4;

#ifdef ENABLE_4335BT_WAR
	int lock_cookie_wifi = 'W' | 'i'<<8 | 'F'<<16 | 'i'<<24;	

	printk("WiFi: trying to acquire BT lock\n");
	if (bcm_bt_lock(lock_cookie_wifi) != 0)
		printk("** WiFi: timeout in acquiring bt lock**\n");
	else
		printk("** WiFi: btlock acquired**\n");
#endif 
	printk(KERN_INFO "%s: %d\n", __func__, on);

	if (on) {
#if 0
		writel(0x1FDB, SDC3_HDRV_PULL_CTL_ADDR);
#else
		sdc_pad_gpio_config(SDC3_HDRV_PULL_CTL_ADDR,
				BIT_HDRIV_PULL_UP, BIT_HDRIV_PULL_UP,
				HDRIV_STR_14MA, HDRIV_STR_12MA, HDRIV_STR_12MA);
#endif
		config_gpio_table(wifi_on_gpio_table,
				  ARRAY_SIZE(wifi_on_gpio_table));
	} else {
#if 0
		writel(0x0BDB, SDC3_HDRV_PULL_CTL_ADDR);
#else
		sdc_pad_gpio_config(SDC3_HDRV_PULL_CTL_ADDR,
				BIT_HDRIV_PULL_UP, BIT_HDRIV_PULL_UP,
				HDRIV_STR_2MA, HDRIV_STR_2MA, HDRIV_STR_2MA);
#endif
		config_gpio_table(wifi_off_gpio_table,
				  ARRAY_SIZE(wifi_off_gpio_table));
	}

	mdelay(1); 
	
	
	htc_BCM4335_wl_reg_ctl((on)?BCM4335_WL_REG_ON:BCM4335_WL_REG_OFF, ID_WIFI); 

	mdelay(1); 
#if 0
	wl_dev_wake_gpio.config.output_value = on? 1: 0;
	pm8xxx_gpio_config(wl_dev_wake_gpio.gpio, &wl_dev_wake_gpio.config);
#endif
	mdelay(120);

#ifdef ENABLE_4335BT_WAR
	bcm_bt_unlock(lock_cookie_wifi);
#endif
	return 0;
}
开发者ID:jiangchao87,项目名称:HTL22_KK_4.4.4_GPE,代码行数:54,代码来源:board-m7wlj-storage.c

示例13: shooter_u_3Dpanel_off

static void shooter_u_3Dpanel_off(void)
{
	int rc;
	pwm_gpio_config.output_value = 0;
	rc = pm8xxx_gpio_config(PM8058_GPIO_PM_TO_SYS(SHOOTER_U_3DLCM_PD), &pwm_gpio_config);
	if (rc < 0)
		pr_err("%s pmic gpio config gpio %d failed\n", __func__, SHOOTER_U_3DLCM_PD);

	mdp4_dsi_color_enhancement(mdp_sharp_barrier_off, ARRAY_SIZE(mdp_sharp_barrier_off));
	pwm_disable(pwm_3d);

	rc = pm8xxx_gpio_config(PM8058_GPIO_PM_TO_SYS(SHOOTER_U_3DCLK), &clk_gpio_config_off);
	if (rc < 0)
		pr_err("%s pmic gpio config gpio %d failed\n", __func__, SHOOTER_U_3DCLK);
	gpio_set_value(SHOOTER_U_CTL_3D_1, 0);
	gpio_set_value(SHOOTER_U_CTL_3D_2, 0);
	gpio_set_value(SHOOTER_U_CTL_3D_3, 0);
	gpio_set_value(SHOOTER_U_CTL_3D_4, 0);
	led_brightness_switch("lcd-backlight", last_br_2d);
}
开发者ID:anryl,项目名称:shooteru_HTC,代码行数:20,代码来源:shooter_u-panel.c

示例14: apq8064_init_mmc

void __init apq8064_init_mmc(void)
{
	if (apq8064_sdc1_pdata) {
		apq8064_add_sdcc(1, apq8064_sdc1_pdata);
		apq8064_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;
			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;
		}
		apq8064_add_sdcc(3, apq8064_sdc3_pdata);
	}
开发者ID:CompassNeedles,项目名称:linux-lightsensord,代码行数:53,代码来源:board-8064-storage.c

示例15: doubleshot_setup_matrix_gpio

static void doubleshot_setup_matrix_gpio(void)
{
	int rc = 0, id = 0;
	int index = 0;

	for (index = 0; index < KEYMAP_NUM_COLS; index++) {
		id = doubleshot_sns_gpios[index];
		rc = pm8xxx_gpio_config(id, &matrix_sns_config);
			if (rc)
				KEY_LOGE("%s: pm8058_gpio_config(%d): rc=%d\n",
					__func__, id, rc);
	}
}
开发者ID:TeamSXL,项目名称:ds-kernel-3.4,代码行数:13,代码来源:board-doubleshot-keypad.c


注:本文中的pm8xxx_gpio_config函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。