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


C++ PM8921_GPIO_PM_TO_SYS函数代码示例

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


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

示例1: t6china_rawchip_vreg_on

static int t6china_rawchip_vreg_on(void)
{
	int rc = 0;
	pr_info("%s\n", __func__);

	rc = camera_sensor_power_enable("8921_lvs4", 1800000, &reg_8921_lvs4);
	if (rc < 0) {
		pr_err("sensor_power_enable(\"8921_lvs4\") FAILED %d\n", rc);
		goto RAW_FAIL_1V8;
	}
	mdelay(5);

	rc = gpio_set(PM8921_GPIO_PM_TO_SYS(V_RAW_1V2_EN), 1);
	if (rc < 0)
		goto RAW_FAIL_1V2;

	return rc;

RAW_FAIL_1V2:
	camera_sensor_power_disable(reg_8921_lvs4);

RAW_FAIL_1V8:
	return rc;
}
开发者ID:santod,项目名称:nuk3rn3l_htc_msm8960-revamped,代码行数:24,代码来源:board-t6china-camera.c

示例2: init_hw_setting

int init_hw_setting(struct device *dev)
{
    int rc =0;
    
    rc = hw_on_off(dev, true);
    if(rc<0) {
        dev_err(dev, "%s: fail to turn on power. rc=%d\n", __func__, rc);
        return rc;
    }

#if CONFIG_BOARD_VER == CONFIG_PT10 
    rc = gpio_request(PM8921_GPIO_PM_TO_SYS(GPIO_TOUCH_LDO1), "touch_ldo1");
    if (rc) {
        dev_err(dev, "%s: gpio_request GPIO_TOUCH_LDO1 failed, rc=%d\n",__func__, rc);
        return -EINVAL;
    }
    rc = gpio_direction_output(PM8921_GPIO_PM_TO_SYS(GPIO_TOUCH_LDO1), 1);
    if (rc) {
        dev_err(dev, "%s: gpio_direction_output GPIO_TOUCH_LDO1 failed, rc=%d\n", __func__, rc);
        return -EINVAL;
    }
    rc = gpio_request(PM8921_GPIO_PM_TO_SYS(GPIO_TOUCH_LDO2), "touch_ldo2");
    if (rc) {
        dev_err(dev, "%s: gpio_request GPIO_TOUCH_LDO2 failed, rc=%d\n", __func__, rc);
        return -EINVAL;
    }
    rc = gpio_direction_output(PM8921_GPIO_PM_TO_SYS(GPIO_TOUCH_LDO2), 1);
    if (rc) {
        dev_err(dev, "%s: gpio_direction_output GPIO_TOUCH_LDO2 failed, rc=%d\n",__func__, rc);
        return -EINVAL;
    }
#endif

    rc = gpio_request(GPIO_TOUCH_RST, "touch_rst");
    if (rc) {
        gpio_free(GPIO_TOUCH_RST);
        rc = gpio_request(GPIO_TOUCH_RST, "touch_rst");
        if (rc) {
            dev_err(dev, "%s: gpio_request GPIO_TOUCH_RST : %d failed, rc=%d\n",__func__, GPIO_TOUCH_RST, rc);
        }
    }

    rc = gpio_direction_output(GPIO_TOUCH_RST, 1);
    if (rc) {
        dev_err(dev, "%s: gpio_direction_output GPIO_TOUCH_RST : %d failed, rc=%d\n",__func__, GPIO_TOUCH_RST, rc);
    }

    rc = gpio_request(GPIO_TOUCH_CHG, "touch_chg");
    if (rc) {
        gpio_free(GPIO_TOUCH_CHG);
        rc = gpio_request(GPIO_TOUCH_CHG, "touch_chg");
        if (rc) {
            dev_err(dev, "%s: gpio_request GPIO_TOUCH_CHG : %d failed, rc=%d\n",__func__, GPIO_TOUCH_CHG, rc);
        }
    }  

    rc = gpio_direction_input(GPIO_TOUCH_CHG);
    if (rc) {
        dev_err(dev, "%s: gpio_direction_input gpio_chg : %d failed, rc=%d\n",__func__, GPIO_TOUCH_CHG, rc);
    }

    msleep(5);
    return 0;
}
开发者ID:DSMKexec,项目名称:kexec-kernel-a850s,代码行数:64,代码来源:cyttsp4_pm8921.c

示例3: msm8960_configure_headset_mic_gpios

static int msm8960_configure_headset_mic_gpios(void)
{
	int ret;
	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_S4,
		.out_strength   = PM_GPIO_STRENGTH_MED,
		.function       = PM_GPIO_FUNC_NORMAL,
	};

	ret = gpio_request(PM8921_GPIO_PM_TO_SYS(23), "AV_SWITCH");
	if (ret) {
		pr_err("%s: Failed to request gpio %d\n", __func__,
			PM8921_GPIO_PM_TO_SYS(23));
		return ret;
	}

	ret = pm8xxx_gpio_config(PM8921_GPIO_PM_TO_SYS(23), &param);
	if (ret)
		pr_err("%s: Failed to configure gpio %d\n", __func__,
			PM8921_GPIO_PM_TO_SYS(23));
	else
		gpio_direction_output(PM8921_GPIO_PM_TO_SYS(23), 0);

	ret = gpio_request(PM8921_GPIO_PM_TO_SYS(35), "US_EURO_SWITCH");
	if (ret) {
		pr_err("%s: Failed to request gpio %d\n", __func__,
			PM8921_GPIO_PM_TO_SYS(35));
		gpio_free(PM8921_GPIO_PM_TO_SYS(23));
		return ret;
	}
	ret = pm8xxx_gpio_config(PM8921_GPIO_PM_TO_SYS(35), &param);
	if (ret)
		pr_err("%s: Failed to configure gpio %d\n", __func__,
			PM8921_GPIO_PM_TO_SYS(35));
	else
		gpio_direction_output(PM8921_GPIO_PM_TO_SYS(35), 1);

	return 0;
}
static void msm8960_free_headset_mic_gpios(void)
{
	if (msm8960_headset_gpios_configured) {
		gpio_free(PM8921_GPIO_PM_TO_SYS(23));
		gpio_free(PM8921_GPIO_PM_TO_SYS(35));
	}
}

static int __init msm8960_audio_init(void)
{
	int ret;

	msm8960_snd_device = platform_device_alloc("soc-audio", 0);
	if (!msm8960_snd_device) {
		pr_err("Platform device allocation failed\n");
		return -ENOMEM;
	}

	platform_set_drvdata(msm8960_snd_device, &snd_soc_card_msm8960);
	ret = platform_device_add(msm8960_snd_device);
	if (ret) {
		platform_device_put(msm8960_snd_device);
		return ret;
	}

	if (msm8960_configure_headset_mic_gpios()) {
		pr_err("%s Fail to configure headset mic gpios\n", __func__);
		msm8960_headset_gpios_configured = 0;
	} else
		msm8960_headset_gpios_configured = 1;

	return ret;

}
开发者ID:Kra1o5,项目名称:android_kernel_huawei_u8815-gb,代码行数:77,代码来源:msm8960.c

示例4: msm_fb_register_device

	msm_fb_register_device("mipi_dsi", &mipi_dsi_pdata);

	platform_device_register(&hdmi_msm_device);
	msm_fb_register_device("dtv", &dtv_pdata);

}

#ifdef CONFIG_LGIT_VIDEO_WXGA_CABC
#define PWM_SIMPLE_EN 0xA0
#define PWM_BRIGHTNESS 0x20
#endif

#if defined (CONFIG_BACKLIGHT_LM3530)
static struct backlight_platform_data lm3530_data = {

	.gpio = PM8921_GPIO_PM_TO_SYS(24),
#ifdef CONFIG_LGIT_VIDEO_WXGA_CABC
	.max_current = 0x17 | PWM_BRIGHTNESS,
#else
	.max_current = 0x17,
#endif
	.min_brightness = 0x02,
	.max_brightness = 0x72,
	.default_brightness = 0x11,
	.blmap = NULL,
	.blmap_size = 0,
};
#endif

static struct i2c_board_info msm_i2c_backlight_info[] = {
	{
开发者ID:shorelinedev,项目名称:aosp_kernel_geeb,代码行数:31,代码来源:board-mako-display.c

示例5: mipi_dsi_panel_plf_init

static int mipi_dsi_panel_plf_init(void)
{
	int rc = 0;

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

	if (!dsi_power_on) {
		reg_l29 = regulator_get(&msm_mipi_dsi1_device.dev,
								"dsi1_vddio");
		if (IS_ERR_OR_NULL(reg_l29)) {
			pr_err("%s: could not get l29 dsi1_vddio, rc = %ld\n",
						__func__, PTR_ERR(reg_l29));
			return -ENODEV;
		}
		reg_l11 = regulator_get(&msm_mipi_dsi1_device.dev, "dsi1_avdd");
		if (IS_ERR_OR_NULL(reg_l11)) {
			pr_err("%s: could not get l11 dsi1_avdd, rc = %ld\n",
						__func__, PTR_ERR(reg_l11));
			rc = -ENODEV;
			goto put_l29;
		}
		rc = regulator_set_voltage(reg_l11, 2850000, 2850000);
		if (rc) {
			pr_err("%s: set_voltage l11 dsi1_avdd failed, rc=%d\n",
								__func__, rc);
			goto put_l29_l11;
		}

		reg_l2 = regulator_get(&msm_mipi_dsi1_device.dev,
							"dsi1_pll_vdda");
		if (IS_ERR_OR_NULL(reg_l2)) {
			pr_err("%s:could not get l2 dsi1_pll_vdda, rc = %ld\n",
						__func__, PTR_ERR(reg_l2));
			rc = -ENODEV;
			goto put_l29_l11;
		}

		rc = regulator_set_voltage(reg_l29, 1800000, 1800000);
		if (rc) {
			pr_err("%s: set_voltage l29 dsi1_vddio failed, rc=%d\n",
								__func__, rc);
			goto put_l29_l11_l2;
		}
		rc = regulator_set_voltage(reg_l2, 1200000, 1200000);
		if (rc) {
			pr_err("%s: set_voltage l2 dsi1_pll_vdda failed, rc=%d\n",
					__func__, rc);
			goto put_l29_l11_l2;
		}

		lcd_dcdc_en_gpio = PM8921_GPIO_PM_TO_SYS(LCD_DCDC_EN);
		rc = gpio_request(lcd_dcdc_en_gpio, "lcd_dcdc_en");
		if (rc) {
			pr_err("%s: request LCD_DCDC_EN (gpio %d) failed, rc=%d\n",
					__func__, LCD_DCDC_EN, rc);
			goto put_l29_l11_l2;
		}

		lcd_reset_gpio = PM8921_GPIO_PM_TO_SYS(MLCD_RESET_N);
		rc = gpio_request(lcd_reset_gpio, "mlcd_reset_n");
		if (rc) {
			pr_err("%s:request MLCD_RESET_N (gpio %d) failed, rc=%d\n",
					__func__, MLCD_RESET_N, rc);
			goto put_l29_l11_l2;
		}
		dsi_power_on = true;
	}

	return 0;
put_l29_l11_l2:
	regulator_put(reg_l2);
put_l29_l11:
	regulator_put(reg_l11);
put_l29:
	regulator_put(reg_l29);
	return rc;
}
开发者ID:BrateloSlava,项目名称:test-sez-cm-kernel,代码行数:77,代码来源:board-sony_dogo-display.c

示例6: msm8960_audrx_init

static int msm8960_audrx_init(struct snd_soc_pcm_runtime *rtd)
{
	int err;
#ifdef CONFIG_PANTECH_SND //kdkim
#if defined(T_STARQ) || defined(T_OSCAR) || defined(T_EF45K) || defined(T_EF46L) || defined(T_EF47S)
	int ret = 0; 
       int hw_rev;
#endif	
#endif	
	struct snd_soc_codec *codec = rtd->codec;
	struct snd_soc_dapm_context *dapm = &codec->dapm;
	
#ifndef CONFIG_PANTECH_SND //Qualcomm original...kdkim
	struct pm_gpio jack_gpio_cfg = {
		.direction = PM_GPIO_DIR_IN,
		.pull = PM_GPIO_PULL_UP_1P5,
		.function = PM_GPIO_FUNC_NORMAL,
		.vin_sel = 2,
		.inv_int_pol = 0,
	};
#endif
	pr_debug("%s()\n", __func__);

	if (machine_is_msm8960_liquid()) {
		top_spk_pamp_gpio = (PM8921_GPIO_PM_TO_SYS(19));
		bottom_spk_pamp_gpio = (PM8921_GPIO_PM_TO_SYS(18));
	}

	rtd->pmdown_time = 0;

	err = snd_soc_add_controls(codec, tabla_msm8960_controls,
				ARRAY_SIZE(tabla_msm8960_controls));
	if (err < 0)
		return err;

	snd_soc_dapm_new_controls(dapm, msm8960_dapm_widgets,
				ARRAY_SIZE(msm8960_dapm_widgets));

#ifdef CONFIG_PANTECH_SND
	if(wcd9310_tablaVersionStatusGet()) //Tabla CS Version
		snd_soc_dapm_add_routes(dapm, common_cs_audio_map,
			ARRAY_SIZE(common_cs_audio_map));
	else //Tabla ES Version
	snd_soc_dapm_add_routes(dapm, common_audio_map,
		ARRAY_SIZE(common_audio_map));
#else //Qualcomm Original Source
	snd_soc_dapm_add_routes(dapm, common_audio_map,
		ARRAY_SIZE(common_audio_map));
#endif

	snd_soc_dapm_enable_pin(dapm, "Ext Spk Bottom Pos");
	snd_soc_dapm_enable_pin(dapm, "Ext Spk Bottom Neg");
	snd_soc_dapm_enable_pin(dapm, "Ext Spk Top Pos");
	snd_soc_dapm_enable_pin(dapm, "Ext Spk Top Neg");

	snd_soc_dapm_sync(dapm);

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

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

#ifdef CONFIG_PANTECH_SND //kdkim
	hw_rev = get_hw_revision();
	pr_debug("########### msm8960 hw_rev : %d\n", hw_rev); 
	
#if defined(T_STARQ) 
       if(hw_rev < 5) {
		mbhc_cfg.gpio = 0;
		mbhc_cfg.gpio_irq = 0;
	}
#elif defined(T_OSCAR) 
	if(hw_rev < 4) { /*revision is checked by elecjang 20120326*/
		mbhc_cfg.gpio = 0;
		mbhc_cfg.gpio_irq = 0;
	}
#elif defined(T_EF47S) || defined(T_EF45K)
	if(hw_rev < 5) {
		mbhc_cfg.gpio = 0;
		mbhc_cfg.gpio_irq = 0;
	}
#elif defined(T_EF46L)
	if(hw_rev < 4) {
		mbhc_cfg.gpio = 0;
		mbhc_cfg.gpio_irq = 0;
	}
#endif
#endif

//.........这里部分代码省略.........
开发者ID:faux123,项目名称:pantech_vega_racer_2_kernel,代码行数:101,代码来源:msm8960.c

示例7: defined

#if defined(T_STARQ) 
#define JACK_DETECT_GPIO 50
#define JACK_DETECT_INT MSM_GPIO_TO_INT(JACK_DETECT_GPIO)
#define GPIO_DETECT_USED JACK_DETECT_INT
#elif defined(T_OSCAR) || defined(T_EF45K) || defined(T_EF46L) || defined(T_EF47S) 
#define JACK_DETECT_GPIO 35
#define JACK_DETECT_INT MSM_GPIO_TO_INT(JACK_DETECT_GPIO)
#define GPIO_DETECT_USED JACK_DETECT_INT
#else //Qualcomm original
#define JACK_DETECT_GPIO 38
#define JACK_DETECT_INT PM8921_GPIO_IRQ(PM8921_IRQ_BASE, JACK_DETECT_GPIO)
#define GPIO_DETECT_USED false
#endif
#endif

static u32 top_spk_pamp_gpio  = PM8921_GPIO_PM_TO_SYS(18);
static u32 bottom_spk_pamp_gpio = PM8921_GPIO_PM_TO_SYS(19);
static int msm8960_spk_control;
static int msm8960_ext_bottom_spk_pamp;
static int msm8960_ext_top_spk_pamp;
static int msm8960_slim_0_rx_ch = 1;
static int msm8960_slim_0_tx_ch = 1;

static int msm8960_btsco_rate = BTSCO_RATE_8KHZ;
static int msm8960_btsco_ch = 1;

static struct clk *codec_clk;
static int clk_users;

static int msm8960_headset_gpios_configured;
开发者ID:faux123,项目名称:pantech_vega_racer_2_kernel,代码行数:30,代码来源:msm8960.c

示例8: ARRAY_SIZE

static struct mmc_platform_data *apq8064_sdc2_pdata;
#endif

#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
static unsigned int sdc3_sup_clk_rates[] = {
	400000, 24000000, 48000000, 96000000, 192000000
};

static struct mmc_platform_data sdc3_data = {
	.ocr_mask       = MMC_VDD_27_28 | MMC_VDD_28_29,
	.mmc_bus_width  = MMC_CAP_4_BIT_DATA,
	.sup_clk_table	= sdc3_sup_clk_rates,
	.sup_clk_cnt	= ARRAY_SIZE(sdc3_sup_clk_rates),
	.pin_data	= &mmc_slot_pin_data[SDCC3],
	.vreg_data	= &mmc_slot_vreg_data[SDCC3],
	.wpswitch_gpio	= PM8921_GPIO_PM_TO_SYS(17),
	.is_wpswitch_active_low = true,
	.status_gpio	= 26,
	.status_irq	= MSM_GPIO_TO_INT(26),
	.irq_flags	= IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
	.is_status_gpio_active_low = 1,
	.xpc_cap	= 1,
	.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),
	.mpm_sdiowakeup_int = MSM_MPM_PIN_SDC3_DAT1,
	.msm_bus_voting_data = &sps_to_ddr_bus_voting_data,
};
static struct mmc_platform_data *apq8064_sdc3_pdata = &sdc3_data;
#else
static struct mmc_platform_data *apq8064_sdc3_pdata;
开发者ID:TheTypoMaster,项目名称:android_kernel_lg_awifi,代码行数:31,代码来源:board-j1-storage.c

示例9: MSM_GPIO_TO_INT

 * microphones operating at 1800 mV. Technically, all micbiases
 * can source from single cfilter since all microphones operate
 * at the same voltage level. The arrangement below is to make
 * sure all cfilters are exercised. LDO_H regulator ouput level
 * does not need to be as high as 2.85V. It is choosen for
 * microphone sensitivity purpose.
 */
static struct tabla_pdata apq8064_tabla_platform_data = {
	.slimbus_slave_device = {
		.name = "tabla-slave",
		.e_addr = {0, 0, 0x10, 0, 0x17, 2},
	},
	.irq = MSM_GPIO_TO_INT(62),
	.irq_base = TABLA_INTERRUPT_BASE,
	.num_irqs = NR_TABLA_IRQS,
	.reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
	.micbias = {
		.ldoh_v = TABLA_LDOH_2P85_V,
		.cfilt1_mv = 1800,
		.cfilt2_mv = 1800,
		.cfilt3_mv = 1800,
		.bias1_cfilt_sel = TABLA_CFILT1_SEL,
		.bias2_cfilt_sel = TABLA_CFILT2_SEL,
		.bias3_cfilt_sel = TABLA_CFILT3_SEL,
		.bias4_cfilt_sel = TABLA_CFILT3_SEL,
	}
};

static struct slim_device apq8064_slim_tabla = {
	.name = "tabla-slim",
	.e_addr = {0, 1, 0x10, 0, 0x17, 2},
开发者ID:XxXPachaXxX,项目名称:kernel_msm_3.0,代码行数:31,代码来源:board-8064.c

示例10: mipi_samsung_disp_probe

static int __devinit mipi_samsung_disp_probe(struct platform_device *pdev)
{
	int ret, rc;
	struct platform_device *msm_fb_added_dev;
	struct lcd_device *lcd_device;
	struct backlight_device *bd = NULL;

	printk(KERN_INFO "[lcd] mipi_samsung_disp_probe start\n");
	if (pdev->id == 0) {
		msd.mipi_samsung_disp_pdata = pdev->dev.platform_data;

		printk(KERN_INFO
		"[lcd] pdev->id =%d,  pdev-name = %s\n", pdev->id, pdev->name);
		sec_debug_mdp_init();
		printk(KERN_INFO "[lcd] mipi_samsung_disp_probe end since pdev-id is 0\n");

		return 0;
	}

	printk(KERN_INFO "[lcd] msm_fb_add_device : %s\n", pdev->name);

	msm_fb_added_dev = msm_fb_add_device(pdev);

	mutex_init(&dsi_tx_mutex);

#if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_LCD_CLASS_DEVICE)
	msd.msm_pdev = msm_fb_added_dev;
#endif

	pm_gpio8 = PM8921_GPIO_PM_TO_SYS(PMIC_GPIO_ERR_FG);

	rc = gpio_request(pm_gpio8, "err_fg");

	if (rc) {
		pr_err("request gpio err_fg failed, rc=%d\n", rc);
		return -ENODEV;
	}

	rc = pm8xxx_gpio_config(pm_gpio8, &gpio_get_param);

	if (rc) {
		pr_err("gpio_config mlcd_rst failed (3), rc=%d\n", rc);
		return -EINVAL;
	}

#if defined(CONFIG_HAS_EARLYSUSPEND)
	msd.early_suspend.suspend = mipi_samsung_disp_early_suspend;
	msd.early_suspend.resume = mipi_samsung_disp_late_resume;
	msd.early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN;
	register_early_suspend(&msd.early_suspend);
#endif

#if defined(CONFIG_LCD_CLASS_DEVICE)
	printk(KERN_INFO "[lcd] lcd_device_register for panel start\n");

	lcd_device = lcd_device_register("panel", &pdev->dev, NULL,
			&mipi_samsung_disp_props);

	if (IS_ERR(lcd_device)) {
		ret = PTR_ERR(lcd_device);
		printk(KERN_ERR "lcd : failed to register device\n");
		return ret;
	}

	sysfs_remove_file(&lcd_device->dev.kobj,
			&dev_attr_lcd_power.attr);

	ret = sysfs_create_file(&lcd_device->dev.kobj,
			&dev_attr_lcd_power.attr);
	if (ret) {
		pr_info("sysfs create fail-%s\n",
				dev_attr_lcd_power.attr.name);
	}

	ret = sysfs_create_file(&lcd_device->dev.kobj,
			&dev_attr_lcd_type.attr);
	if (ret) {
		pr_info("sysfs create fail-%s\n",
				dev_attr_lcd_type.attr.name);
	}

	ret = sysfs_create_file(&lcd_device->dev.kobj,
			&dev_attr_window_type.attr);
	if (ret) {
		pr_info("sysfs create fail-%s\n",
				dev_attr_window_type.attr.name);
	}

	ret = sysfs_create_file(&lcd_device->dev.kobj,
					&dev_attr_power_reduce.attr);
	if (ret) {
		pr_info("sysfs create fail-%s\n",
				dev_attr_power_reduce.attr.name);
	}

	ret = sysfs_create_file(&lcd_device->dev.kobj,
					&dev_attr_siop_enable.attr);
	if (ret) {
		pr_info("sysfs create fail-%s\n",
				dev_attr_siop_enable.attr.name);
//.........这里部分代码省略.........
开发者ID:TheDragonkeeper,项目名称:Ubuntu-Touch-i9505,代码行数:101,代码来源:mipi_samsung_octa.c

示例11: mipi_dsi_panel_pwm_cfg

static void mipi_dsi_panel_pwm_cfg(void)
{
	int rc;
	static int mipi_dsi_panel_gpio_configured;
	static struct pm_gpio pwm_enable = {
		.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_VPH,
		.out_strength     = PM_GPIO_STRENGTH_HIGH,
		.function         = PM_GPIO_FUNC_NORMAL,
		.inv_int_pol      = 0,
		.disable_pin      = 0,
	};
	static struct pm_gpio pwm_mode = {
		.direction        = PM_GPIO_DIR_OUT,
		.output_buffer    = PM_GPIO_OUT_BUF_CMOS,
		.output_value     = 0,
		.pull             = PM_GPIO_PULL_NO,
		.vin_sel          = PM_GPIO_VIN_S4,
		.out_strength     = PM_GPIO_STRENGTH_HIGH,
		.function         = PM_GPIO_FUNC_2,
		.inv_int_pol      = 0,
		.disable_pin      = 0,
	};

	if (mipi_dsi_panel_gpio_configured == 0) {
		/* pm8xxx: gpio-21, Backlight Enable */
		rc = pm8xxx_gpio_config(PM8921_GPIO_PM_TO_SYS(21),
					&pwm_enable);
		if (rc != 0)
			pr_err("%s: pwm_enabled failed\n", __func__);

		/* pm8xxx: gpio-24, Bl: Off, PWM mode */
		rc = pm8xxx_gpio_config(PM8921_GPIO_PM_TO_SYS(24),
					&pwm_mode);
		if (rc != 0)
			pr_err("%s: pwm_mode failed\n", __func__);

		mipi_dsi_panel_gpio_configured++;
	}
}
/**
 * LiQUID panel on/off
 *
 * @param on
 *
 * @return int
 */
static int mipi_dsi_liquid_panel_power(int on)
{
	static struct regulator *reg_l2, *reg_ext_3p3v;
	static int gpio21, gpio24, gpio43;
	int rc;

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

	gpio21 = PM8921_GPIO_PM_TO_SYS(21); /* disp power enable_n */
	gpio43 = PM8921_GPIO_PM_TO_SYS(43); /* Displays Enable (rst_n)*/
	gpio24 = PM8921_GPIO_PM_TO_SYS(24); /* Backlight PWM */

	if (!dsi_power_on) {

		reg_l2 = regulator_get(&msm_mipi_dsi1_device.dev,
				"dsi_vdda");
		if (IS_ERR(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_mipi_dsi1_device.dev,
			"vdd_lvds_3p3v");
		if (IS_ERR(reg_ext_3p3v)) {
			pr_err("could not get reg_ext_3p3v, rc = %ld\n",
			       PTR_ERR(reg_ext_3p3v));
		    return -ENODEV;
		}

		rc = gpio_request(gpio21, "disp_pwr_en_n");
		if (rc) {
			pr_err("request gpio 21 failed, rc=%d\n", rc);
			return -ENODEV;
		}

		rc = gpio_request(gpio43, "disp_rst_n");
		if (rc) {
			pr_err("request gpio 43 failed, rc=%d\n", rc);
			return -ENODEV;
		}

		rc = gpio_request(gpio24, "disp_backlight_pwm");
//.........这里部分代码省略.........
开发者ID:DrewC4,项目名称:Optimus-F7-fx1s,代码行数:101,代码来源:board-fx1-display.c

示例12: mipi_dsi_panel_power

static int mipi_dsi_panel_power(int on)
{
	static struct regulator *reg_lvs5, *reg_l2;
	static int gpio36, gpio37;
	int rc;

	PR_DISP_INFO("%s: on=%d\n", __func__, on);

	if (!dsi_power_on) {
		reg_lvs5 = regulator_get(&msm_mipi_dsi1_device.dev,
				"dsi1_vddio");
		if (IS_ERR_OR_NULL(reg_lvs5)) {
			pr_err("could not get 8921_lvs5, rc = %ld\n",
				PTR_ERR(reg_lvs5));
			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;
		}

		gpio36 = PM8921_GPIO_PM_TO_SYS(V_LCM_N5V_EN); 
		rc = gpio_request(gpio36, "lcd_5v-");
		if (rc) {
			pr_err("request lcd_5v- failed, rc=%d\n", rc);
			return -ENODEV;
		}
		gpio37 = PM8921_GPIO_PM_TO_SYS(V_LCM_P5V_EN); 
		rc = gpio_request(gpio37, "lcd_5v+");
		if (rc) {
			pr_err("request lcd_5v+ failed, rc=%d\n", rc);
			return -ENODEV;
		}
		gpio_tlmm_config(GPIO_CFG(LCD_RST, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE);

		dsi_power_on = true;
	}

	if (on) {
		if (!first_init) {
			rc = regulator_enable(reg_lvs5);
			if (rc) {
				pr_err("enable lvs5 failed, rc=%d\n", rc);
				return -ENODEV;
			}
			msleep(200);

			gpio_set_value_cansleep(gpio37, 1);
			msleep(10);
			gpio_set_value_cansleep(gpio36, 1);

			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;
			}
			
			msm_xo_mode_vote(wa_xo, MSM_XO_MODE_ON);

			gpio_set_value(LCD_RST, 0);
			msleep(10);
			gpio_set_value(LCD_RST, 1);
			
			msm_xo_mode_vote(wa_xo, MSM_XO_MODE_OFF);
		} else {
			
			rc = regulator_enable(reg_lvs5);
			if (rc) {
				pr_err("enable lvs5 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;
			}
			
			msm_xo_mode_vote(wa_xo, MSM_XO_MODE_ON);
			msleep(10);
			msm_xo_mode_vote(wa_xo, MSM_XO_MODE_OFF);
//.........这里部分代码省略.........
开发者ID:schqiushui,项目名称:HTL21-KitKat-3.4.X,代码行数:101,代码来源:board-deluxe_j-display.c

示例13: MSM_GPIO_TO_INT

	.pin_data       = &mmc_slot_pin_data[SDCC2],
	.sdiowakeup_irq = MSM_GPIO_TO_INT(90),
	.msm_bus_voting_data = &sps_to_ddr_bus_voting_data,
};
#endif

#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
static unsigned int fighter_sd_slot_type = MMC_TYPE_SD;
static struct mmc_platform_data msm8960_sdc3_data = {
	.ocr_mask       = MMC_VDD_27_28 | MMC_VDD_28_29,
	.mmc_bus_width  = MMC_CAP_4_BIT_DATA,
	.sup_clk_table	= sdc3_sup_clk_rates,
	.sup_clk_cnt	= ARRAY_SIZE(sdc3_sup_clk_rates),
	.slot_type = &fighter_sd_slot_type,
#ifdef CONFIG_MMC_MSM_SDC3_WP_SUPPORT
	.wpswitch_gpio	= PM8921_GPIO_PM_TO_SYS(16),
#endif
	.vreg_data	= &mmc_slot_vreg_data[SDCC3],
	.pin_data	= &mmc_slot_pin_data[SDCC3],
#ifdef CONFIG_MMC_MSM_CARD_HW_DETECTION
	.status_gpio	= PM8921_GPIO_PM_TO_SYS(FIGHTER_PMGPIO_SD_CDETz),
	.status_irq	= PM8921_GPIO_IRQ(PM8921_IRQ_BASE, FIGHTER_PMGPIO_SD_CDETz),
	.irq_flags	= IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
	.is_status_gpio_active_low = true,
#endif
#if 0
	.xpc_cap	= 1,
	.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_600),
#endif
开发者ID:BackupWildfireDEV,项目名称:ElementalX-Sense-5.0.2,代码行数:31,代码来源:board-fighter-storage.c

示例14: ARRAY_SIZE

#endif

#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
static unsigned int sdc3_sup_clk_rates[] = {
	400000, 24000000, 48000000, 96000000, 192000000
};

static struct mmc_platform_data sdc3_data = {
	.ocr_mask       = MMC_VDD_27_28 | MMC_VDD_28_29,
	.mmc_bus_width  = MMC_CAP_4_BIT_DATA,
	.sup_clk_table	= sdc3_sup_clk_rates,
	.sup_clk_cnt	= ARRAY_SIZE(sdc3_sup_clk_rates),
	.pin_data	= &mmc_slot_pin_data[SDCC3],
	.vreg_data	= &mmc_slot_vreg_data[SDCC3],
#ifdef CONFIG_PANTECH_EXTERNAL_SDCARD
	.status_gpio  = PM8921_GPIO_PM_TO_SYS(24),
	.status_irq = PM8921_GPIO_IRQ(PM8921_IRQ_BASE, 24),
#else
	.wpswitch_gpio	= PM8921_GPIO_PM_TO_SYS(17),
	.is_wpswitch_active_low = true,
	.status_gpio	= 26,
	.status_irq	= MSM_GPIO_TO_INT(26),
#endif
	.irq_flags	= IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
	.is_status_gpio_active_low = 1,
	.xpc_cap	= 1,
	.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),
	.mpm_sdiowakeup_int = MSM_MPM_PIN_SDC3_DAT1,
	.msm_bus_voting_data = &sps_to_ddr_bus_voting_data,
开发者ID:DSMKexec,项目名称:kexec-kernel-a850s,代码行数:31,代码来源:board-8064-storage.c

示例15: ARRAY_SIZE


#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
static unsigned int sdc3_sup_clk_rates[] = {
	400000, 24000000, 45176400, 96000000, 192000000
};

static unsigned int dlxj_sdc3_slot_type = MMC_TYPE_SD;
static struct mmc_platform_data sdc3_data = {
	.ocr_mask       = MMC_VDD_27_28 | MMC_VDD_28_29,
	.mmc_bus_width  = MMC_CAP_4_BIT_DATA,
	.sup_clk_table	= sdc3_sup_clk_rates,
	.sup_clk_cnt	= ARRAY_SIZE(sdc3_sup_clk_rates),
	.pin_data	= &mmc_slot_pin_data[SDCC3],
	.vreg_data	= &mmc_slot_vreg_data[SDCC3],
	.status_gpio	= PM8921_GPIO_PM_TO_SYS(SD_CDETz),
	.status_irq	= PM8921_GPIO_IRQ(PM8921_IRQ_BASE, SD_CDETz),
	.irq_flags	= IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
	.is_status_gpio_active_low = 1,
	.slot_type      = &dlxj_sdc3_slot_type,
#if 0
	.xpc_cap	= 1,
	.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),
#endif
	.msm_bus_voting_data = &sps_to_ddr_bus_voting_data,
};
static struct mmc_platform_data *deluxe_j_sdc3_pdata = &sdc3_data;
#else
static struct mmc_platform_data *deluxe_j_sdc3_pdata;
开发者ID:bgcngm,项目名称:802Xtreem,代码行数:29,代码来源:board-deluxe_j-storage.c


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