本文整理汇总了C++中PM8921_MPP_PM_TO_SYS函数的典型用法代码示例。如果您正苦于以下问题:C++ PM8921_MPP_PM_TO_SYS函数的具体用法?C++ PM8921_MPP_PM_TO_SYS怎么用?C++ PM8921_MPP_PM_TO_SYS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PM8921_MPP_PM_TO_SYS函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: msm_camera_8960_ext_power_ctrl
static int32_t msm_camera_8960_ext_power_ctrl(int enable)
{
int rc = 0;
if (enable) {
rc = pm8xxx_mpp_config(PM8921_MPP_PM_TO_SYS(12),
&privacy_light_on_config);
} else {
rc = pm8xxx_mpp_config(PM8921_MPP_PM_TO_SYS(12),
&privacy_light_off_config);
}
return rc;
}
开发者ID:84506232,项目名称:ef40s_jb_kernel,代码行数:12,代码来源:board-8960-camera.c
示例2: active_reset
void active_reset(int high)
{
if (high) {
pm8xxx_mpp_config(
PM8921_MPP_PM_TO_SYS(MLCD_RST_MPP2),
&MLCD_RESET_HIGH_CONFIG);
} else {
pm8xxx_mpp_config(
PM8921_MPP_PM_TO_SYS(MLCD_RST_MPP2),
&MLCD_RESET_LOW_CONFIG);
}
}
开发者ID:timmytim,项目名称:cm_kernel_jflteatt,代码行数:12,代码来源:board-8064-display.c
示例3: power_on_flash
void power_on_flash(void)
{
int temp = 0;
int ret = 0;
if(!isFlashCntlEn) {
temp = gpio_get_value(GPIO_MSM_FLASH_NOW);
if (isFlashCntlEn == 0 && temp == 0) {
/* FLASH_LED_UNLOCK*/
gpio_set_value_cansleep(PM8921_MPP_PM_TO_SYS
(PMIC_MPP_FLASH_LED_UNLOCK), 1);
/* GPIO_CAM_FLASH_SW : tourch */
gpio_set_value_cansleep(gpio_cam_flash_sw, 1);
temp = gpio_get_value(gpio_cam_flash_sw);
printk("[s5c73m3] check GPIO_CAM_FLASH_SW : %d\n", temp);
usleep(1*1000);
}
/* flash power 1.8V */
l28 = regulator_get(NULL, "8921_lvs4");
ret = regulator_enable(l28);
if (ret)
printk("error enabling regulator\n");
usleep(1*1000);
isFlashCntlEn = true;
}
}
开发者ID:LiquidSmooth-Devices,项目名称:Deathly_Kernel_D2,代码行数:29,代码来源:board-m2-camera.c
示例4: mipi_dsi_power_octa_request
static int mipi_dsi_power_octa_request(void)
{
int rc = 0;
reg_L30 = regulator_get(&msm_mipi_dsi1_device.dev,
"3000mV_LCD");
if (IS_ERR_OR_NULL(reg_L30)) {
pr_err("could not get 8917_L30, rc = %ld\n",
PTR_ERR(reg_L30));
return -ENODEV;
}
rc = regulator_set_voltage(reg_L30, 3000000, 3000000);
if (rc) {
pr_err("set_voltage L30 failed, rc=%d\n", rc);
return -EINVAL;
}
pm8xxx_mpp_config(PM8921_MPP_PM_TO_SYS(MLCD_RST_MPP2),
&MLCD_RESET_LOW_CONFIG);
msleep(100);
return rc;
}
开发者ID:ShinySide,项目名称:HispAsian_Kernel_NH7,代码行数:25,代码来源:board-8064-display.c
示例5: 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
开发者ID:ttimz1313,项目名称:kernel_samsung_jf,代码行数:32,代码来源:board-fusion3-battery.c
示例6: aat1290a_freeGpio
static int aat1290a_freeGpio(void)
{
int ret;
printk(KERN_DEBUG "[%s : %d]!!\n", __func__, __LINE__);
if (pmic_gpio_msm_flash_cntl_en)
gpio_set_value_cansleep(pmic_gpio_msm_flash_cntl_en, 0);
else
gpio_set_value_cansleep(GPIO_MSM_FLASH_CNTL_EN, 0);
isFlashCntlEn = false;
usleep(1*1000);
gpio_set_value_cansleep(GPIO_MSM_FLASH_NOW, 0);
usleep(1*1000);
/* flash power 1.8V */
if (l28) {
ret = regulator_disable(l28);
if (ret)
cam_err("error disabling regulator\n");
}
usleep(1*1000);
/* GPIO_CAM_FLASH_SW : tourch */
gpio_set_value_cansleep(gpio_cam_flash_sw, 0);
usleep(1*1000);
#if defined(CONFIG_S5C73M3) && defined(CONFIG_S5K6A3YX) /* D2 */
/* FLASH_LED_LOCK*/
gpio_set_value_cansleep(PM8921_MPP_PM_TO_SYS
(PMIC_MPP_FLASH_LED_UNLOCK), 0);
#endif
return 0;
}
开发者ID:LiquidSmooth-Devices,项目名称:Deathly_Kernel_D2,代码行数:34,代码来源:board-m2-camera.c
示例7: m7wl_audio_pmic_mpp_config
static void m7wl_audio_pmic_mpp_config(void)
{
unsigned ret;
struct pm8xxx_mpp_config_data m7wl_audio_pmic_mpp = {
.type = PM8XXX_MPP_TYPE_D_OUTPUT,
.level = PM8921_MPP_DIG_LEVEL_S4,
.control = PM8XXX_MPP_DOUT_CTRL_LOW,
};
ret = pm8xxx_mpp_config(PM8921_MPP_PM_TO_SYS(9),
&m7wl_audio_pmic_mpp);
if (ret < 0)
pr_err("%s:MPP_9 configuration failed\n", __func__);
}
开发者ID:KING000,项目名称:android_kernel_htc_m7wlj,代码行数:15,代码来源:board-m7wlj-audio.c
示例8: aat1290a_setGpio
static int aat1290a_setGpio(void)
{
int ret;
int temp = 0;
printk(KERN_DEBUG "[%s : %d]!!\n", __func__, __LINE__);
#if defined(CONFIG_S5C73M3) && defined(CONFIG_S5K6A3YX) /* D2 */
/* FLASH_LED_UNLOCK*/
gpio_set_value_cansleep(PM8921_MPP_PM_TO_SYS
(PMIC_MPP_FLASH_LED_UNLOCK), 1);
#endif
/* GPIO_CAM_FLASH_SW : tourch */
gpio_set_value_cansleep(gpio_cam_flash_sw, 0);
temp = gpio_get_value(gpio_cam_flash_sw);
printk(KERN_DEBUG "[s5c73m3] check GPIO_CAM_FLASH_SW : %d\n", temp);
usleep(1*1000);
/* flash power 1.8V */
l28 = regulator_get(NULL, "8921_lvs4");
ret = regulator_enable(l28);
if (ret)
cam_err("error enabling regulator\n");
usleep(1*1000);
if (pmic_gpio_msm_flash_cntl_en) {
gpio_set_value_cansleep(pmic_gpio_msm_flash_cntl_en, 1);
} else {
gpio_set_value_cansleep(GPIO_MSM_FLASH_CNTL_EN, 1);
temp = gpio_get_value(GPIO_MSM_FLASH_CNTL_EN);
printk(KERN_DEBUG "[s5c73m3] check Flash set GPIO : %d\n",
temp);
}
isFlashCntlEn = true;
usleep(1*1000);
gpio_set_value_cansleep(GPIO_MSM_FLASH_NOW, 1);
temp = gpio_get_value(GPIO_MSM_FLASH_NOW);
printk(KERN_DEBUG "[s5c73m3] check Flash enable GPIO : %d\n", temp);
usleep(1*1000);
return 0;
}
开发者ID:LiquidSmooth-Devices,项目名称:Deathly_Kernel_D2,代码行数:44,代码来源:board-m2-camera.c
示例9: GPIO_VREG
.consumer_supplies = vreg_consumers_##_id##_PC, \
.supply_regulator = _supply_regulator, \
}, \
.id = RPM_VREG_ID_PM8921_##_id##_PC, \
.pin_fn = RPM_VREG_PIN_FN_8960_##_pin_fn, \
.pin_ctrl = _pin_ctrl, \
}
/* GPIO regulator constraints.
* Must be in sync with corresponding platform_device structures in
* board_sony_fusion3.c
*/
struct gpio_regulator_platform_data
apq8064_gpio_regulator_pdata[] __devinitdata = {
/* ID vreg_name gpio_label gpio supply active_low*/
GPIO_VREG(EXT_5V, "ext_5v", "ext_5v_en", PM8921_MPP_PM_TO_SYS(7),
NULL, 0),
GPIO_VREG(EXT_SD_PWR, "ext_sd_pwr", "ext_sd_pwr_en",
PM8921_MPP_PM_TO_SYS(4), "8921_l6", 0),
GPIO_VREG(EXT_OTG_SW, "ext_otg_sw", "ext_otg_sw_en",
PM8921_GPIO_PM_TO_SYS(42), NULL, 1),
};
/* SAW regulator constraints */
struct regulator_init_data msm8064_saw_regulator_pdata_8921_s5 =
/* ID vreg_name min_uV max_uV */
SAW_VREG_INIT(S5, "8921_s5", 850000, 1300000);
struct regulator_init_data msm8064_saw_regulator_pdata_8921_s6 =
SAW_VREG_INIT(S6, "8921_s6", 850000, 1300000);
struct regulator_init_data msm8064_saw_regulator_pdata_8821_s0 =
开发者ID:EnJens,项目名称:android_kernel_sony_pollux_windy_stock,代码行数:31,代码来源:board-sony_odin-regulator.c
示例10: PM8921_MPP_PM_TO_SYS
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_spi_cs2_config,
},
},
{
.gpio = 54, /* GSBI5 QUP SPI_CLK */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
},
},
#endif
};
static struct pm8xxx_mpp_platform_data
apq8064_pm8921_mpp_pdata __devinitdata = {
.mpp_base = PM8921_MPP_PM_TO_SYS(1),
};
static struct pm8xxx_gpio_platform_data
apq8064_pm8921_gpio_pdata __devinitdata = {
.gpio_base = PM8921_GPIO_PM_TO_SYS(1),
};
static struct pm8xxx_irq_platform_data
apq8064_pm8921_irq_pdata __devinitdata = {
.irq_base = PM8921_IRQ_BASE,
.devirq = PM8921_USR_IRQ_N,
.irq_trigger_flag = IRQF_TRIGGER_HIGH,
.dev_id = 0,
};
开发者ID:XxXPachaXxX,项目名称:kernel_msm_3.0,代码行数:30,代码来源:board-8064.c
示例11: lvds_panel_power
static int lvds_panel_power(int on)
{
static struct regulator *reg_lvs7, *reg_l2, *reg_ext_3p3v;
static int gpio36, gpio26, mpp3;
int rc;
pr_debug("%s: on=%d\n", __func__, on);
if (!lvds_power_on) {
reg_lvs7 = regulator_get(&msm_lvds_device.dev,
"lvds_vdda");
if (IS_ERR_OR_NULL(reg_lvs7)) {
pr_err("could not get 8921_lvs7, rc = %ld\n",
PTR_ERR(reg_lvs7));
return -ENODEV;
}
reg_l2 = regulator_get(&msm_lvds_device.dev,
"lvds_pll_vdda");
if (IS_ERR_OR_NULL(reg_l2)) {
pr_err("could not get 8921_l2, rc = %ld\n",
PTR_ERR(reg_l2));
return -ENODEV;
}
rc = regulator_set_voltage(reg_l2, 1200000, 1200000);
if (rc) {
pr_err("set_voltage l2 failed, rc=%d\n", rc);
return -EINVAL;
}
reg_ext_3p3v = regulator_get(&msm_lvds_device.dev,
"lvds_vccs_3p3v");
if (IS_ERR_OR_NULL(reg_ext_3p3v)) {
pr_err("could not get reg_ext_3p3v, rc = %ld\n",
PTR_ERR(reg_ext_3p3v));
return -ENODEV;
}
gpio26 = PM8921_GPIO_PM_TO_SYS(26);
rc = gpio_request(gpio26, "pwm_backlight_ctrl");
if (rc) {
pr_err("request gpio 26 failed, rc=%d\n", rc);
return -ENODEV;
}
gpio36 = PM8921_GPIO_PM_TO_SYS(36); /* lcd1_pwr_en_n */
rc = gpio_request(gpio36, "lcd1_pwr_en_n");
if (rc) {
pr_err("request gpio 36 failed, rc=%d\n", rc);
return -ENODEV;
}
mpp3 = PM8921_MPP_PM_TO_SYS(3);
rc = gpio_request(mpp3, "backlight_en");
if (rc) {
pr_err("request mpp3 failed, rc=%d\n", rc);
return -ENODEV;
}
lvds_power_on = true;
}
if (on) {
rc = regulator_enable(reg_lvs7);
if (rc) {
pr_err("enable lvs7 failed, rc=%d\n", rc);
return -ENODEV;
}
rc = regulator_set_optimum_mode(reg_l2, 100000);
if (rc < 0) {
pr_err("set_optimum_mode l2 failed, rc=%d\n", rc);
return -EINVAL;
}
rc = regulator_enable(reg_l2);
if (rc) {
pr_err("enable l2 failed, rc=%d\n", rc);
return -ENODEV;
}
rc = regulator_enable(reg_ext_3p3v);
if (rc) {
pr_err("enable reg_ext_3p3v failed, rc=%d\n", rc);
return -ENODEV;
}
gpio_set_value_cansleep(gpio36, 0);
gpio_set_value_cansleep(mpp3, 1);
} else {
gpio_set_value_cansleep(mpp3, 0);
gpio_set_value_cansleep(gpio36, 1);
rc = regulator_disable(reg_lvs7);
if (rc) {
pr_err("disable reg_lvs7 failed, rc=%d\n", rc);
return -ENODEV;
}
rc = regulator_disable(reg_l2);
if (rc) {
//.........这里部分代码省略.........
开发者ID:ZigZiggo,项目名称:sam-tenderloin-kernel-3.4,代码行数:101,代码来源:board-8064-display.c
示例12: mipi_dsi_panel_power
/* OPPO 2013-07-4 Neal Modify begin for LCD */
int mipi_dsi_panel_power(int on)
{
/* OPPO 2012-08-31 zhengzk Modify begin for LCD */
static struct regulator *reg_lvs7, *reg_l2, *reg_l11, *reg_ext_3p3v;
static int gpio36, gpio25, mpp3;
#ifdef CONFIG_VENDOR_EDIT
static struct regulator *reg_l22;
#else
static int gpio26;
#endif
/* OPPO 2013-07-4 Neal Modify end*/
int rc;
pr_debug("%s: on=%d\n", __func__, on);
if (!dsi_power_on) {
reg_lvs7 = regulator_get(&msm_mipi_dsi1_device.dev,
"dsi1_vddio");
if (IS_ERR_OR_NULL(reg_lvs7)) {
pr_err("could not get 8921_lvs7, rc = %ld\n",
PTR_ERR(reg_lvs7));
return -ENODEV;
}
reg_l2 = regulator_get(&msm_mipi_dsi1_device.dev,
"dsi1_pll_vdda");
if (IS_ERR_OR_NULL(reg_l2)) {
pr_err("could not get 8921_l2, rc = %ld\n",
PTR_ERR(reg_l2));
return -ENODEV;
}
rc = regulator_set_voltage(reg_l2, 1200000, 1200000);
if (rc) {
pr_err("set_voltage l2 failed, rc=%d\n", rc);
return -EINVAL;
}
reg_l11 = regulator_get(&msm_mipi_dsi1_device.dev,
"dsi1_avdd");
if (IS_ERR(reg_l11)) {
pr_err("could not get 8921_l11, rc = %ld\n",
PTR_ERR(reg_l11));
return -ENODEV;
}
/* OPPO 2012-08-31 zhengzk Modify begin for LCD */
#ifndef CONFIG_VENDOR_EDIT
rc = regulator_set_voltage(reg_l11, 3000000, 3000000);
#else
rc = regulator_set_voltage(reg_l11, 3100000, 3100000);
#endif
/* OPPO 2012-08-31 zhengzk Modify end */
if (rc) {
pr_err("set_voltage l11 failed, rc=%d\n", rc);
return -EINVAL;
}
/* OPPO 2012-08-31 zhengzk Add begin for LCD */
#ifdef CONFIG_VENDOR_EDIT
reg_l22 = regulator_get(NULL, "8921_l22");
if (IS_ERR(reg_l22)) {
pr_err("could not get 8921_l22, rc = %ld\n",
PTR_ERR(reg_l22));
return -ENODEV;
}
rc = regulator_set_voltage(reg_l22, 1800000, 1800000);
if (rc) {
pr_err("set_voltage l22 failed, rc=%d\n", rc);
return -EINVAL;
}
#endif
/* OPPO 2012-08-31 zhengzk Modify end */
if (machine_is_apq8064_liquid()) {
reg_ext_3p3v = regulator_get(&msm_mipi_dsi1_device.dev,
"dsi1_vccs_3p3v");
if (IS_ERR_OR_NULL(reg_ext_3p3v)) {
pr_err("could not get reg_ext_3p3v, rc = %ld\n",
PTR_ERR(reg_ext_3p3v));
reg_ext_3p3v = NULL;
return -ENODEV;
}
mpp3 = PM8921_MPP_PM_TO_SYS(3);
rc = gpio_request(mpp3, "backlight_en");
if (rc) {
pr_err("request mpp3 failed, rc=%d\n", rc);
return -ENODEV;
}
}
gpio25 = PM8921_GPIO_PM_TO_SYS(25);
rc = gpio_request(gpio25, "disp_rst_n");
if (rc) {
pr_err("request gpio 25 failed, rc=%d\n", rc);
return -ENODEV;
}
#ifndef CONFIG_VENDOR_EDIT
gpio26 = PM8921_GPIO_PM_TO_SYS(26);
//.........这里部分代码省略.........
开发者ID:El-Nath,项目名称:biji-find5-kernel,代码行数:101,代码来源:board-8064-display.c
示例13: ARRAY_SIZE
.num_consumer_supplies = \
ARRAY_SIZE(vreg_consumers_##_id##_PC), \
.consumer_supplies = vreg_consumers_##_id##_PC, \
.supply_regulator = _supply_regulator, \
}, \
.id = RPM_VREG_ID_PM8921_##_id##_PC, \
.pin_fn = RPM_VREG_PIN_FN_8960_##_pin_fn, \
.pin_ctrl = _pin_ctrl, \
}
/* GPIO regulator constraints */
struct gpio_regulator_platform_data
apq8064_gpio_regulator_pdata[] __devinitdata = {
/* ID vreg_name gpio_label gpio supply active_low */
GPIO_VREG(EXT_5V, "ext_5v", "ext_5v_en",
PM8921_MPP_PM_TO_SYS(7), NULL, 0),
GPIO_VREG(EXT_3P3V, "ext_3p3v", "ext_3p3v_en",
APQ8064_EXT_3P3V_REG_EN_GPIO, NULL, 0),
GPIO_VREG(EXT_TS_SW, "ext_ts_sw", "ext_ts_sw_en",
PM8921_GPIO_PM_TO_SYS(23), "ext_3p3v", 0),
GPIO_VREG(EXT_MPP8, "ext_mpp8", "ext_mpp8_en",
PM8921_MPP_PM_TO_SYS(8), NULL, 0),
GPIO_VREG(EXT_SATA_PWR, "ext_sata_pwr", "ext_sata_pwr_en",
PM8921_MPP_PM_TO_SYS(4), "ext_3p3v", 1),
};
struct gpio_regulator_platform_data
mpq8064_gpio_regulator_pdata[] __devinitdata = {
GPIO_VREG(AVC_1P2V, "avc_1p2v", "avc_1p2v_en",
SX150X_GPIO(4, 2), NULL, 0),
GPIO_VREG(AVC_1P8V, "avc_1p8v", "avc_1p8v_en",
开发者ID:The-Nemesis-Project,项目名称:hltetmo_kernel,代码行数:31,代码来源:board-8064-regulator.c
示例14: mipi_panel_power_tft
static int mipi_panel_power_tft(int enable)
{
int rc = 0;
#if defined(CONFIG_MACH_JACTIVE_ATT)
if(first_boot < 2) {
first_boot++;
printk("<0> First init Occurred ..... Finished Successfully \n");
return 0;
}
#endif
pr_info("%s %d", __func__, enable);
if (enable) {
#if defined(CONFIG_MACH_JACTIVE_EUR)
rc = regulator_set_optimum_mode(reg_LVS1, 100000); /*IOVDD */
if (rc < 0) {
pr_err("set_optimum_mode LVS1 failed, rc=%d\n", rc);
return -EINVAL;
}
rc = regulator_enable(reg_LVS1);
if (rc) {
pr_err("enable LVS1 failed, rc=%d\n", rc);
return -ENODEV;
}
#elif defined(CONFIG_MACH_JACTIVE)
if (system_rev >= 11) {
rc = regulator_set_optimum_mode(reg_LVS1, 100000); /*IOVDD */
if (rc < 0) {
pr_err("set_optimum_mode LVS1 failed, rc=%d\n", rc);
return -EINVAL;
}
rc = regulator_enable(reg_LVS1);
if (rc) {
pr_err("enable LVS1 failed, rc=%d\n", rc);
return -ENODEV;
}
}
#endif
rc = regulator_set_optimum_mode(reg_L15, 100000); /*IOVDD */
if (rc < 0) {
pr_err("set_optimum_mode L15 failed, rc=%d\n", rc);
return -EINVAL;
}
rc = regulator_enable(reg_L15);
if (rc) {
pr_err("enable L15 failed, rc=%d\n", rc);
return -ENODEV;
}
#if defined(CONFIG_MACH_JACTIVE_ATT)
if(system_rev < 10)
gpio_direction_output(gpio33, 1);
else
gpio_direction_output(LCD_22V_EN, 1);
#else
gpio_direction_output(LCD_22V_EN, 1);
#if defined(CONFIG_FB_MSM_ENABLE_LCD_EN2)
if( system_rev >= 16 ) // rev0.6 + 10
{
mdelay(10);
gpio_direction_output(LCD_22V_EN_2, 1);
}
#endif
#endif
#if !defined(CONFIG_MACH_JACTIVE_ATT) && !defined(CONFIG_MACH_JACTIVE_EUR)
/*active_reset_ldi(gpio43);*/
if (system_rev == 0)
gpio_direction_output(gpio43, 1);
else
pm8xxx_mpp_config(
PM8921_MPP_PM_TO_SYS(MLCD_RST_MPP2),
&MLCD_RESET_HIGH_CONFIG);
msleep(20);
#endif
#if defined(CONFIG_MACH_JACTIVE_EUR)
if( system_rev >= 15 ) // rev0.5 + 10
{
rc = regulator_set_optimum_mode(reg_L16, 100000); /*IOVDD */
if (rc < 0) {
pr_err("set_optimum_mode L16 failed, rc=%d\n", rc);
return -EINVAL;
}
rc = regulator_enable(reg_L16);
if (rc) {
pr_err("enable L16 failed, rc=%d\n", rc);
return -ENODEV;
}
msleep ( 10 );
}
#elif defined(CONFIG_MACH_JACTIVE_ATT)
if( system_rev >= 11 ) // rev0.3 + 8
{
rc = regulator_set_optimum_mode(reg_L16, 100000); /*IOVDD */
if (rc < 0) {
pr_err("set_optimum_mode L16 failed, rc=%d\n", rc);
return -EINVAL;
//.........这里部分代码省略.........
开发者ID:ShinySide,项目名称:HispAsian_Kernel_NH7,代码行数:101,代码来源:board-8064-display.c
示例15: mipi_dsi_power_tft_request
//.........这里部分代码省略.........
gpio_free(LCD_22V_EN);
rc = gpio_request(LCD_22V_EN, "lcd_22v_en");
if(rc){
pr_err("request gpio lcd_22v_en failed, rc=%d\n", rc);
return -ENODEV;
}
}
pr_info("[lcd] configure LCD_22V_EN\n");
gpio_tlmm_config(GPIO_CFG(LCD_22V_EN, 0, GPIO_CFG_OUTPUT,
GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE);
}
#else
pr_info("[lcd] request gpio lcd_22v_en\n");
rc = gpio_request(LCD_22V_EN, "lcd_22v_en");
if (rc) {
pr_err("request gpio lcd_22v_en failed, rc=%d\n", rc);
return -ENODEV;
}
pr_info("[lcd] configure LCD_22V_EN\n");
gpio_tlmm_config(GPIO_CFG(LCD_22V_EN, 0, GPIO_CFG_OUTPUT,
GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE);
#if defined(CONFIG_FB_MSM_ENABLE_LCD_EN2)
if( system_rev >= 16 ) // rev0.6 + 10
{
pr_info("[lcd] request gpio lcd_22v_en_2\n");
rc = gpio_request(LCD_22V_EN_2, "lcd_22v_en_2");
if (rc) {
pr_err("request gpio lcd_22v_en_2 failed, rc=%d\n", rc);
return -ENODEV;
}
pr_info("[lcd] configure LCD_22V_EN_2\n");
gpio_tlmm_config(GPIO_CFG(LCD_22V_EN_2, 0, GPIO_CFG_OUTPUT,
GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE);
}
#endif
#endif
if (system_rev == 0) {
gpio43 = PM8921_GPIO_PM_TO_SYS(
PMIC_GPIO_LCD_RST);
rc = gpio_request(gpio43, "mlcd_rst");
if (rc) {
pr_err("request gpio mlcd_rst failed, rc=%d\n", rc);
return -ENODEV;
}
rc = pm8xxx_gpio_config(gpio43, &gpio43_param);
if (rc) {
pr_err("gpio_config mlcd_rst failed (3), rc=%d\n", rc);
return -EINVAL;
}
}
#if defined(CONFIG_MACH_JACTIVE_ATT)
if (system_rev < 10)
gpio27 = PM8921_GPIO_PM_TO_SYS(PMIC_GPIO_LED_DRIVER_REV00);
else
gpio27 = PM8921_GPIO_PM_TO_SYS(PMIC_GPIO_LED_DRIVER_REV10);
#else
gpio27 = PM8921_GPIO_PM_TO_SYS(PMIC_GPIO_LED_DRIVER);
#endif
rc = gpio_request(gpio27, "led_dirver");
if (rc) {
pr_err("request gpio led_dirver failed, rc=%d\n", rc);
return -ENODEV;
}
rc = pm8xxx_gpio_config(gpio27, &gpio43_param);
if (rc) {
pr_err("gpio_config led_dirver failed (3), rc=%d\n", rc);
return -EINVAL;
}
#if !defined(CONFIG_MACH_JACTIVE_ATT) && !defined(CONFIG_MACH_JACTIVE_EUR)
#if defined(CONFIG_MACH_JACTIVE_ATT)
if(system_rev < 10)
gpio_direction_output(gpio33, 0);
else
gpio_direction_output(LCD_22V_EN, 0);
#else
gpio_direction_output(LCD_22V_EN, 0);
#endif
if (system_rev == 0)
gpio_direction_output(gpio43, 0);
else
pm8xxx_mpp_config(
PM8921_MPP_PM_TO_SYS(MLCD_RST_MPP2),
&MLCD_RESET_LOW_CONFIG);
msleep(1000);
#endif
gpio_direction_output(gpio27, 0);
return rc;
}
开发者ID:ShinySide,项目名称:HispAsian_Kernel_NH7,代码行数:101,代码来源:board-8064-display.c
示例16: mipi_dsi_panel_power
static int mipi_dsi_panel_power(int on)
{
static struct regulator *reg_lvs7, *reg_l2, *reg_l11, *reg_ext_3p3v;
static int gpio36, gpio25, gpio26, mpp3;
int rc;
pr_debug("%s: on=%d\n", __func__, on);
if (!dsi_power_on) {
reg_lvs7 = regulator_get(&msm_mipi_dsi1_device.dev,
"dsi1_vddio");
if (IS_ERR_OR_NULL(reg_lvs7)) {
pr_err("could not get 8921_lvs7, rc = %ld\n",
PTR_ERR(reg_lvs7));
return -ENODEV;
}
reg_l2 = regulator_get(&msm_mipi_dsi1_device.dev,
"dsi1_pll_vdda");
if (IS_ERR_OR_NULL(reg_l2)) {
pr_err("could not get 8921_l2, rc = %ld\n",
PTR_ERR(reg_l2));
return -ENODEV;
}
rc = regulator_set_voltage(reg_l2, 1200000, 1200000);
if (rc) {
pr_err("set_voltage l2 failed, rc=%d\n", rc);
return -EINVAL;
}
reg_l11 = regulator_get(&msm_mipi_dsi1_device.dev,
"dsi1_avdd");
if (IS_ERR(reg_l11)) {
pr_err("could not get 8921_l11, rc = %ld\n",
PTR_ERR(reg_l11));
return -ENODEV;
}
rc = regulator_set_voltage(reg_l11, 3000000, 3000000);
if (rc) {
pr_err("set_voltage l11 failed, rc=%d\n", rc);
return -EINVAL;
}
if (machine_is_apq8064_liquid()) {
reg_ext_3p3v = regulator_get(&msm_mipi_dsi1_device.dev,
"dsi1_vccs_3p3v");
if (IS_ERR_OR_NULL(reg_ext_3p3v)) {
pr_err("could not get reg_ext_3p3v, rc = %ld\n",
PTR_ERR(reg_ext_3p3v));
reg_ext_3p3v = NULL;
return -ENODEV;
}
mpp3 = PM8921_MPP_PM_TO_SYS(3);
rc = gpio_request(mpp3, "backlight_en");
if (rc) {
pr_err("request mpp3 failed, rc=%d\n", rc);
return -ENODEV;
}
}
gpio25 = PM8921_GPIO_PM_TO_SYS(25);
rc = gpio_request(gpio25, "disp_rst_n");
if (rc) {
pr_err("request gpio 25 failed, rc=%d\n", rc);
return -ENODEV;
}
gpio26 = PM8921_GPIO_PM_TO_SYS(26);
rc = gpio_request(gpio26, "pwm_backlight_ctrl");
if (rc) {
pr_err("request gpio 26 failed, rc=%d\n", rc);
return -ENODEV;
}
gpio36 = PM8921_GPIO_PM_TO_SYS(36); /* lcd1_pwr_en_n */
rc = gpio_request(gpio36, "lcd1_pwr_en_n");
if (rc) {
pr_err("request gpio 36 failed, rc=%d\n", rc);
return -ENODEV;
}
dsi_power_on = true;
}
if (on) {
rc = regulator_enable(reg_lvs7);
if (rc) {
pr_err("enable lvs7 failed, rc=%d\n", rc);
return -ENODEV;
}
rc = regulator_set_optimum_mode(reg_l11, 110000);
if (rc < 0) {
pr_err("set_optimum_mode l11 failed, rc=%d\n", rc);
return -EINVAL;
}
rc = regulator_enable(reg_l11);
if (rc) {
pr_err("enable l11 failed, rc=%d\n", rc);
return -ENODEV;
//.........这里部分代码省略.........
开发者ID:ElAbbassi,项目名称:android_kernel_huawei_y301a2,代码行数:101,代码来源:board-8064-display.c
示例17: ARRAY_SIZE
.id = -1,
};
static struct persistent_ram_descriptor ram_console_pram_desc[] = {
{
.name = "ram_console",
.size = MSM_RAM_CONSOLE_SIZE,
}
};
struct persistent_ram mmi_ram_console_pram = {
.start = MSM_RAM_CONSOLE_START,
.size = MSM_RAM_CONSOLE_SIZE,
.num_descs = ARRAY_SIZE(ram_console_pram_desc),
.descs = ram_console_pram_desc,
};
#endif
struct platform_device mmi_device_ext_5v_vreg __devinitdata = {
.name = GPIO_REGULATOR_DEV_NAME,
.id = PM8921_MPP_PM_TO_SYS(7),
.dev = {
.platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
},
};
struct platform_device mmi_alsa_to_h2w_hs_device = {
.name = "alsa-to-h2w",
};
开发者ID:ReflexBow,项目名称:android_kernel_motorola_ghost,代码行数:30,代码来源:devices-mmi.c
示例18: ARRAY_SIZE
.num_consumer_supplies = \
ARRAY_SIZE(vreg_consumers_##_id##_PC), \
.consumer_supplies = vreg_consumers_##_id##_PC, \
.supply_regulator = _supply_regulator, \
}, \
.id = RPM_VREG_ID_PM8921_##_id##_PC, \
.pin_fn = RPM_VREG_PIN_FN_8960_##_pin_fn, \
.pin_ctrl = _pin_ctrl, \
}
/* GPIO regulator constraints */
struct gpio_regulator_platform_data
monarudo_gpio_regulator_pdata[] __devinitdata = {
/* ID vreg_name gpio_label gpio supply */
GPIO_VREG(EXT_5V, "ext_5v", "ext_5v_en",
PM8921_MPP_PM_TO_SYS(7), NULL),
GPIO_VREG(EXT_3P3V, "ext_3p3v", "ext_3p3v_en",
monarudo_EXT_3P3V_REG_EN_GPIO, NULL),
//GPIO_VREG(EXT_TS_SW, "ext_ts_sw", "ext_ts_sw_en",
// PM8921_GPIO_PM_TO_SYS(23), "ext_3p3v"),
GPIO_VREG(EXT_MPP8, "ext_mpp8", "ext_mpp8_en",
PM8921_MPP_PM_TO_SYS(8), NULL),
};
/* SAW regulator constraints */
struct regulator_init_data monarudo_saw_regulator_pdata_8921_s5 =
/* ID vreg_name min_uV max_uV */
#ifdef CONFIG_CPU_OVERCLOCK
SAW_VREG_INIT(S5, "8921_s5", 850000, 1450000);
#else
SAW_VREG_INIT(S5, "8921_s5", 850000, 1300000);
开发者ID:boa19861105,项目名称:DNA_JB_KERNEL_2,代码行数:31,代码来源:board-monarudo-regulator.c
示例19: cam_ldo_power_off
//.........这里部分代码省略.........
if (mode) { /* front camera */
/* VT_RESET */
#if defined(CONFIG_MACH_M2_DCM) || defined(CONFIG_MACH_K2_KDI)
gpio_set_value_cansleep(gpio_rev(CAM2_RST_N), 0);
usleep(1*1000);
#else
gpio_set_value_cansleep(CAM2_RST_N, 0);
usleep(1*1000);
#endif
/* ISP 8M MIPI 1.2V */
/* delete for unnecessary power */
/* ISP 8M HOST 1.8V */
if (l29) {
ret = regulator_disable(l29);
if (ret)
cam_err("error disabling regulator\n");
}
usleep(1*1000);
/* MCLK 24MHz*/
/* 8M AVDD 2.8V */
gpio_set_value_cansleep(GPIO_CAM_A_EN, 0);
usleep(1*1000);
/* ISP CORE 1.2V */
/* delete for unnecessary power */
} else { /* rear camera */
/* ISP_STANDBY */
gpio_set_value_cansleep(PM8921_GPIO_PM_TO_SYS(24), 0);
usleep(1*1000);
/* ISP_RESET */
gpio_set_value_cansleep(ISP_RESET, 0);
usleep(1*1000);
/* AF 2.8V */
gpio_set_value_cansleep(gpio_rev(CAM_AF_EN), 0);
usleep(1*1000);
/* ISP 8M MIPI 1.2V */
gpio_set_value_cansleep(CAM_MIPI_EN, 0);
usleep(1*1000);
/* ISP 8M HOST 1.8V */
if (l29) {
ret = regulator_disable(l29);
if (ret)
cam_err("error disabling regulator\n");
}
usleep(1*1000);
/* 8M DVDD 1.2V */
gpio_set_value_cansleep(GPIO_CAM_SENSOR_EN, 0);
usleep(1*1000);
/* 8M AVDD 2.8V */
gpio_set_value_cansleep(GPIO_CAM_A_EN, 0);
usleep(1*1000);
/* ISP CORE 1.2V */
#if defined(CONFIG_MACH_M2)
if (system_rev >= BOARD_REV08)
ret = regulator_disable(isp_core);
if (ret)
cam_err("error disabling regulator");
regulator_put(isp_core);
#elif defined(CONFIG_MACH_M2_DCM) || defined(CONFIG_MACH_K2_KDI)
gpio_set_value_cansleep(gpio_rev(CAM_CORE_EN), 0);
#else
gpio_set_value_cansleep(CAM_CORE_EN, 0);
#endif
usleep(1*1000);
/* flash power 1.8V */
if (l28) {
ret = regulator_disable(l28);
if (ret)
cam_err("error disabling regulator\n");
}
usleep(1*1000);
/* GPIO_CAM_FLASH_SW : tourch */
temp = gpio_get_value(GPIO_MSM_FLASH_NOW);
if (isFlashCntlEn == 0 && temp == 0) {
/* GPIO_CAM_FLASH_SW : tourch */
gpio_set_value_cansleep(gpio_cam_flash_sw, 0);
temp = gpio_get_value(gpio_cam_flash_sw);
printk(KERN_DEBUG "[s5c73m3] check"
" GPIO_CAM_FLASH_SW : %d\n", temp);
/* FLASH_LED_LOCK*/
gpio_set_value_cansleep(PM8921_MPP_PM_TO_SYS
(PMIC_MPP_FLASH_LED_UNLOCK), 0);
usleep(1*1000);
}
}
}
开发者ID:LiquidSmooth-Devices,项目名称:Deathly_Kernel_D2,代码行数:101,代码来源:board-m2-camera.c
示例20: cam_ldo_power_on
static void cam_ldo_power_on(int mode, int num)
{
int ret = 0;
int temp = 0;
printk(KERN_DEBUG "[%s : %d] %s CAMERA POWER ON!!\n",
__func__, __LINE__, mode ? "FRONT" : "REAR");
if (mode) { /* front camera */
if (num == 0) {
/* ISP CORE 1.2V */
/* delete for unnecessary power */
/* 8M AVDD 2.8V */
gpio_set_value_cansleep(GPIO_CAM_A_EN, 1);
temp = gpio_get_value(GPIO_CAM_A_EN);
printk(KERN_DEBUG "[s5k6a3yx] check GPIO_CAM_A_EN : %d\n",
temp);
usleep(1*1000);
} else {
/* VT_RESET */
#if defined(CONFIG_MACH_M2_DCM) || defined(CONFIG_MACH_K2_KDI)
gpio_set_value_cansleep(gpio_rev(CAM2_RST_N), 1);
temp = gpio_get_value(gpio_rev(CAM2_RST_N));
#else
gpio_set_value_cansleep(CAM2_RST_N, 1);
temp = gpio_get_value(CAM2_RST_N);
#endif
printk(KERN_DEBUG "[s5k6a3yx] check CAM2_RST_N : %d\n",
temp);
usleep(1*1000);
/* ISP 8M HOST 1.8V */
l29 = regulator_get(NULL, "8921_lvs5");
ret = regulator_enable(l29);
if (ret)
cam_err("error enabling regulator\n");
usleep(1*1000);
/* ISP 8M MIPI 1.2V */
/* delete for unnecessary power */
}
} else { /* rear camera */
if (num == 0) {
printk(KERN_DEBUG "[s5c73m3] rear camera on 1\n");
temp = gpio_get_value(GPIO_MSM_FLASH_NOW);
if (isFlashCntlEn == 0 && temp == 0) {
/* FLASH_LED_UNLOCK*/
gpio_set_value_cansleep(PM8921_MPP_PM_TO_SYS
(PMIC_MPP_FLASH_LED_UNLOCK), 1);
/* GPIO_CAM_FLASH_SW : tourch */
gpio_set_value_cansleep(gpio_cam_flash_sw, 1);
temp = gpio_get_value(gpio_cam_flash_sw);
printk(KERN_DEBUG "[s5c73m3] check"
" GPIO_CAM_FLASH_SW : %d\n", temp);
usleep(1*1000);
}
/* flash power 1.8V */
l28 = regulator_get(NULL, "8921_lvs4");
ret = regulator_enable(l28);
if (ret)
cam_err("error enabling regulator\n");
usleep(1*1000);
/* ISP CORE 1.2V */
#if defined(CONFIG_MACH_M2)
if (system_rev >= BOARD_REV08) {
printk(KERN_DEBUG "[s5c73m3] m2 check vddCore : %d\n",
vddCore);
isp_core = regulator_get(NULL, "cam_isp_core");
ret = regulator_set_voltage(isp_core,
vddCore, vddCore);
if (ret)
cam_err("error setting voltage\n");
ret = regulator_enable(isp_core);
if (ret)
cam_err("error enabling regulator.");
} else
gpio_set_value_cansleep(CAM_CORE_EN, 1);
#elif defined(CONFIG_MACH_M2_DCM) || defined(CONFIG_MACH_K2_KDI)
gpio_set_value_cansleep(gpio_rev(CAM_CORE_EN), 1);
#else
gpio_set_value_cansleep(CAM_CORE_EN, 1);
#endif
usleep(1200);
/* 8M AVDD 2.8V */
gpio_set_value_cansleep(GPIO_CAM_A_EN, 1);
temp = gpio_get_value(GPIO_CAM_A_EN);
printk(KERN_DEBUG "[s5c73m3] check GPIO_CAM_A_EN : %d\n",
temp);
usleep(1*1000);
/* 8M DVDD 1.2V */
gpio_set_value_cansleep(GPIO_CAM_SENSOR_EN, 1);
temp = gpio_get_value(GPIO_CAM_SENSOR_EN);
//.........这里部分代码省略.........
开发者ID:LiquidSmooth-Devices,项目名称:Deathly_Kernel_D2,代码行数:101,代码来源:board-m2-camera.c
注:本文中的PM8921_MPP_PM_TO_SYS函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论