本文整理汇总了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;
}
}
}
示例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),
¶m);
#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
示例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), ¶m);
if (rc < 0) {
pr_err("failed to configure vbus_in gpio\n");
return rc;
}
return rc;
}
示例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);
}
示例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;
}
示例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, ¶m);
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;
}
示例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, ¶m);
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;
}
示例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);
}
}
示例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();
}
示例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;
}
}
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
}