• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ s3c_gpio_setpull函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: modem_link_pm_config_gpio

static void modem_link_pm_config_gpio(void)
{
	int err = 0;

	unsigned gpio_link_enable = modem_link_pm_data.gpio_link_enable;
	unsigned gpio_link_active = modem_link_pm_data.gpio_link_active;
	unsigned gpio_link_hostwake = modem_link_pm_data.gpio_link_hostwake;
	unsigned gpio_link_slavewake = modem_link_pm_data.gpio_link_slavewake;
	/* unsigned irq_link_hostwake = umts_modem_res[1].start; */

	if (gpio_link_enable) {
		err = gpio_request(gpio_link_enable, "LINK_EN");
		if (err) {
			printk(KERN_ERR "fail to request gpio %s : %d\n",
			       "LINK_EN", err);
		}
		gpio_direction_output(gpio_link_enable, 0);
	}

	if (gpio_link_active) {
		err = gpio_request(gpio_link_active, "LINK_ACTIVE");
		if (err) {
			printk(KERN_ERR "fail to request gpio %s : %d\n",
			       "LINK_ACTIVE", err);
		}
		gpio_direction_output(gpio_link_active, 0);
	}

	if (gpio_link_hostwake) {
		err = gpio_request(gpio_link_hostwake, "HOSTWAKE");
		if (err) {
			printk(KERN_ERR "fail to request gpio %s : %d\n",
			       "HOSTWAKE", err);
		}
		gpio_direction_input(gpio_link_hostwake);
		s3c_gpio_cfgpin(gpio_link_hostwake, S3C_GPIO_SFN(0xF));
		s3c_gpio_setpull(gpio_link_hostwake, S3C_GPIO_PULL_NONE);
	}

	if (gpio_link_slavewake) {
		err = gpio_request(gpio_link_slavewake, "SLAVEWAKE");
		if (err) {
			printk(KERN_ERR "fail to request gpio %s : %d\n",
			       "SLAVEWAKE", err);
		}
		gpio_direction_output(gpio_link_slavewake, 0);
		s3c_gpio_setpull(gpio_link_slavewake, S3C_GPIO_PULL_NONE);
	}

	if (gpio_link_hostwake)
		irq_set_irq_type(gpio_to_irq(gpio_link_hostwake),
				IRQ_TYPE_EDGE_BOTH);

	active_ctl.gpio_initialized = 1;
	if (active_ctl.gpio_request_host_active) {
		pr_err(" [MODEM_IF] Active States = 1, %s\n", __func__);
		gpio_direction_output(modem_link_pm_data.gpio_link_active, 1);
	}

	printk(KERN_INFO "modem_link_pm_config_gpio done\n");
}
开发者ID:HAXTC,项目名称:android_kernel_samsung_n7000,代码行数:61,代码来源:board-u1-modems.c


示例2: max8997_motor_init

static void max8997_motor_init(void)
{
	gpio_request(GPIO_VIBTONE_EN, "VIBTONE_EN");
	s3c_gpio_cfgpin(GPIO_VIBTONE_EN, S3C_GPIO_OUTPUT);
	s3c_gpio_setpull(GPIO_VIBTONE_EN, S3C_GPIO_PULL_NONE);
}
开发者ID:anewkirk,项目名称:AJK,代码行数:6,代码来源:midas-power.c


示例3: modemctl_cfg_gpio

static void modemctl_cfg_gpio(void)
{
	int err = 0;
	
	unsigned gpio_phone_on = mdmctl_data.gpio_phone_on;
	unsigned gpio_phone_active = mdmctl_data.gpio_phone_active;
	unsigned gpio_cp_rst = mdmctl_data.gpio_cp_reset;
	unsigned gpio_pda_active = mdmctl_data.gpio_pda_active;
	unsigned gpio_sim_ndetect = mdmctl_data.gpio_sim_ndetect;
#if defined(CONFIG_ARIES_NTT)
	unsigned gpio_flm_sel = mdmctl_data.gpio_flm_sel;
	unsigned gpio_usim_boot = mdmctl_data.gpio_usim_boot;
	
    	err = gpio_request(gpio_phone_on, "PHONE_ON");
    	if (err) {
    	    printk("fail to request gpio %s\n","PHONE_ON");
	} else {
		gpio_direction_output(gpio_phone_on, GPIO_LEVEL_LOW);
		s3c_gpio_setpull(gpio_phone_on, S3C_GPIO_PULL_NONE);
	}
#endif
	err = gpio_request(gpio_cp_rst, "CP_RST");
	if (err) {
		printk("fail to request gpio %s\n","CP_RST");
	} else {
		gpio_direction_output(gpio_cp_rst, GPIO_LEVEL_LOW);
		s3c_gpio_setpull(gpio_cp_rst, S3C_GPIO_PULL_NONE);
	}
	err = gpio_request(gpio_pda_active, "PDA_ACTIVE");
	if (err) {
		printk("fail to request gpio %s\n","PDA_ACTIVE");
	} else {
		gpio_direction_output(gpio_pda_active, GPIO_LEVEL_HIGH);
		s3c_gpio_setpull(gpio_pda_active, S3C_GPIO_PULL_NONE);
	}

	if (mdmctl_data.gpio_reset_req_n) {
		err = gpio_request(mdmctl_data.gpio_reset_req_n, "RST_REQN");
		if (err) {
			printk("fail to request gpio %s\n","RST_REQN");
		}
	}

#if defined(CONFIG_ARIES_NTT)
	err = gpio_request(gpio_flm_sel, "FLM_SEL");
	if (err) {
		printk("fail to request gpio %s\n","FLM_SEL");
	} else {
		gpio_direction_output(gpio_flm_sel, GPIO_LEVEL_LOW);
		s3c_gpio_setpull(gpio_flm_sel, S3C_GPIO_PULL_NONE);
	}
	err = gpio_request(gpio_usim_boot, "USIM_BOOT");
	if (err) {
		printk("fail to request gpio %s\n","USIM_BOOT");
	} else {
		gpio_direction_output(gpio_usim_boot, GPIO_LEVEL_LOW);
		s3c_gpio_setpull(gpio_usim_boot, S3C_GPIO_PULL_NONE);
	}
#endif

	s3c_gpio_cfgpin(gpio_phone_active, S3C_GPIO_SFN(0xF));
	s3c_gpio_setpull(gpio_phone_active, S3C_GPIO_PULL_NONE);
	set_irq_type(gpio_phone_active, IRQ_TYPE_EDGE_BOTH);

	s3c_gpio_cfgpin(gpio_sim_ndetect, S3C_GPIO_SFN(0xF));
	s3c_gpio_setpull(gpio_sim_ndetect, S3C_GPIO_PULL_NONE);
	set_irq_type(gpio_sim_ndetect, IRQ_TYPE_EDGE_BOTH);
}
开发者ID:Benz0X,项目名称:bdroid,代码行数:68,代码来源:dev-s1-phone.c


示例4: wacom_init

void __init wacom_init(void)
{
	int gpio;
	int ret;

#ifdef GPIO_PEN_RESET_N_18V
	/*Reset*/
	gpio = GPIO_PEN_RESET_N_18V;
	ret = gpio_request(gpio, "PEN_RESET_N");
	if (ret) {
		printk(KERN_ERR "epen:failed to request PEN_RESET_N.(%d)\n",
			ret);
		return ;
	}
	s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0x1));
	s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
	gpio_direction_output(gpio, 0);
#endif

	/*SLP & FWE1*/
	gpio = GPIO_PEN_FWE1_18V;
	ret = gpio_request(gpio, "PEN_FWE1");
	if (ret) {
		printk(KERN_ERR "epen:failed to request PEN_FWE1.(%d)\n",
			ret);
		return ;
	}
	s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0x1));
	s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
	gpio_direction_output(gpio, 0);

	/*PDCT*/
	gpio = GPIO_PEN_PDCT_18V;
	ret = gpio_request(gpio, "PEN_PDCT");
	if (ret) {
		printk(KERN_ERR "epen:failed to request PEN_PDCT.(%d)\n",
			ret);
		return ;
	}
	s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
	s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
	s5p_register_gpio_interrupt(gpio);
	gpio_direction_input(gpio);

	irq_set_irq_type(gpio_to_irq(gpio), IRQ_TYPE_EDGE_BOTH);

	/*IRQ*/
	gpio = GPIO_PEN_IRQ_18V;
	ret = gpio_request(gpio, "PEN_IRQ");
	if (ret) {
		printk(KERN_ERR "epen:failed to request PEN_IRQ.(%d)\n",
			ret);
		return ;
	}
	s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
	s5p_register_gpio_interrupt(gpio);
	gpio_direction_input(gpio);

	wacom_i2c_devs[0].irq = gpio_to_irq(gpio);
	irq_set_irq_type(wacom_i2c_devs[0].irq, IRQ_TYPE_EDGE_RISING);
	s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));

	/*LDO_EN*/
#ifdef GPIO_PEN_LDO_EN
	gpio = GPIO_PEN_LDO_EN;
	ret = gpio_request(gpio, "PEN_LDO_EN");
	if (ret) {
		printk(KERN_ERR "epen:failed to request PEN_LDO_EN.(%d)\n",
			ret);
		return ;
	}
	s3c_gpio_cfgpin(gpio, S3C_GPIO_OUTPUT);
	gpio_direction_output(gpio, 0);
#else
	wacom_power(0);
#endif

	/*WACOM_SET_I2C(3, NULL, wacom_i2c_devs);*/
	exynos5_hs_i2c4_set_platdata(NULL);
	i2c_register_board_info(8, wacom_i2c_devs, ARRAY_SIZE(wacom_i2c_devs));

	printk(KERN_INFO "epen:: wacom IC initialized.\n");
}
开发者ID:davidmueller13,项目名称:universal5420-device-tree,代码行数:83,代码来源:board-n1-input.c


示例5: setup_sdhci0_gpio_wp

static void setup_sdhci0_gpio_wp(void)
{
	s3c_gpio_cfgpin(S5PV210_GPH0(7), S3C_GPIO_INPUT);
	s3c_gpio_setpull(S5PV210_GPH0(7), S3C_GPIO_PULL_DOWN);
}
开发者ID:makarabelong,项目名称:shw-m110s-kernel,代码行数:5,代码来源:setup-sdhci.c


示例6: sr200pc20_power

/* add by cym 20121121 */
static int sr200pc20_power(int flag)
{
	int err;
	printk("cym: sensor is power %s\n",flag == 1 ?"on":"off");
	//Attention: Power On the all the camera module when system turn on
	//Here only control the reset&&powerdown pin
  
	/* Camera A */
	if(flag == 1)
	{	
		//poweron

		// for TC4 zhuxuezhen
		//poweron
#ifndef CONFIG_TC4_EVT
       	regulator_enable(vdd18_cam_regulator); 
	       udelay(10);
		regulator_enable(vdd28_cam_regulator); 
	       udelay(10);

		regulator_enable(VDD28_AF); 
	       udelay(10);
		regulator_enable(VDD28_CAM); 
	       udelay(10);
		regulator_enable(VDD18_CAM); 
	       udelay(10);
#endif
		err = gpio_request(EXYNOS4_GPL0(3), "GPL0_3");
		if (err)
			printk(KERN_ERR "#### failed to request GPL0_3 ####\n");
		s3c_gpio_setpull(EXYNOS4_GPL0(3), S3C_GPIO_PULL_NONE);
		gpio_direction_output(EXYNOS4_GPL0(3), 0);
		gpio_free(EXYNOS4_GPL0(3));
		
		//VDD
		//PMIC_Control_Set(PMIC_CONTROL_VDD18_CAM,POWERON);

		//reset
		err = gpio_request(EXYNOS4_GPL0(1), "GPL0_1");
		if (err)
			printk(KERN_ERR "#### failed to request GPL0_1 ####\n");
		s3c_gpio_setpull(EXYNOS4_GPL0(1), S3C_GPIO_PULL_NONE);
		gpio_direction_output(EXYNOS4_GPL0(1), 1);
		msleep(5);
		gpio_direction_output(EXYNOS4_GPL0(1), 0);
		msleep(5);
		gpio_direction_output(EXYNOS4_GPL0(1), 1);
		
		gpio_free(EXYNOS4_GPL0(1));
		msleep(1);
		//VDD_PLL
		//PMIC_Control_Set(PMIC_CONTROL_VDD28_CAM,POWERON);
		
	}
	else
	{		
		// for TC4 zhuxuezhen
		//PMIC_Control_Set(PMIC_CONTROL_VDD28_CAM,POWEROFF);

		err = gpio_request(EXYNOS4_GPL0(1), "GPL0_1");
		if (err)
			printk(KERN_ERR "#### failed to request GPL0_1 ####\n");
		s3c_gpio_setpull(EXYNOS4_GPL0(1), S3C_GPIO_PULL_NONE);
		gpio_direction_output(EXYNOS4_GPL0(1), 0);
		gpio_free(EXYNOS4_GPL0(1));

		//powerdown
		err = gpio_request(EXYNOS4_GPL0(3), "GPL0_3");
		if (err)
			printk(KERN_ERR "#### failed to request GPL0_3 ####\n");
		s3c_gpio_setpull(EXYNOS4_GPL0(3), S3C_GPIO_PULL_NONE);
		gpio_direction_output(EXYNOS4_GPL0(3), 1);
		gpio_free(EXYNOS4_GPL0(3));
#ifndef CONFIG_TC4_EVT
       	regulator_disable(vdd18_cam_regulator); 
	       udelay(10);
		regulator_disable(vdd28_cam_regulator); 
	       udelay(10);

		regulator_disable(VDD28_AF);
		udelay(10);
		regulator_disable(VDD28_CAM);
		udelay(10);
		regulator_disable(VDD18_CAM);
		udelay(10);
#endif	   
		
		//PMIC_Control_Set(PMIC_CONTROL_VDD18_CAM,POWEROFF);
		
	}

	return 0;

}
开发者ID:Android-Dongyf,项目名称:itop-kernel,代码行数:95,代码来源:sr200pc20.c


示例7: fpga_open

static int fpga_open(struct inode *inode, struct file *file)
{
	int r = 0;
	unsigned n;
	unsigned long timeout;

	pr_info("%s:\n", __func__);

	mutex_lock(&fpga_mutex);

	if (fpga_open_count) {
		mutex_unlock(&fpga_mutex);
		return -EBUSY;
	}
	fpga_open_count++;

	for (n = 0; n < ARRAY_SIZE(fpga_pins); n++) {
		r = gpio_request(fpga_pins[n].pin, fpga_pins[n].name);
		if (r) {
			pr_warning("%s: failed to allocate gpio %s (%u)\n",
				   __func__,
				   fpga_pins[n].name,
				   fpga_pins[n].pin);
		}
		else
			fpga_pin_requested[n] = 1;
	}

	s3c_gpio_setpull(FPGA_INIT_B, S3C_GPIO_PULL_UP);
	s3c_gpio_setpull(FPGA_DONE, S3C_GPIO_PULL_UP);
	s3c_gpio_setpull(FPGA_DIN, S3C_GPIO_PULL_UP);

	gpio_direction_output(FPGA_PROG_B, 0);
	gpio_direction_input(FPGA_INIT_B);
	gpio_direction_input(FPGA_DONE);
	gpio_direction_output(FPGA_CCLK, 0);
	gpio_direction_output(FPGA_DIN, 1);

	msleep(1);

	printk("INIT_B %u\n", gpio_get_value(FPGA_INIT_B));

	gpio_set_value(FPGA_PROG_B, 1);

	printk("INIT_B %u\n", gpio_get_value(FPGA_INIT_B));

	timeout = jiffies + HZ;
	while (!gpio_get_value(FPGA_INIT_B)) {
		if (time_after(jiffies, timeout)) {
			pr_err("%s: timeout waiting for INIT_B to go high\n",
			       __func__);
			r = -ETIMEDOUT;
			goto err;
		}
		msleep(1);
	}

	printk("INIT_B %u\n", gpio_get_value(FPGA_INIT_B));
	printk("DONE %u\n", gpio_get_value(FPGA_DONE));

	msleep(1);

	mutex_unlock(&fpga_mutex);
	return 0;

err:
	for (n = 0; n < ARRAY_SIZE(fpga_pins); n++) {
		if (fpga_pin_requested[n]) {
			gpio_free(fpga_pins[n].pin);
			fpga_pin_requested[n] = 0;
		}
	}
	fpga_open_count--;

	mutex_unlock(&fpga_mutex);
	return r;
}
开发者ID:trigrass2,项目名称:sds7102,代码行数:77,代码来源:fpga.c


示例8: smm6260_cfg

void smm6260_cfg(void)
{
	static int smm6260_initialed=0;
	int err = 0;

        if(smm6260_initialed)
		return;
	/*TODO: check uart init func AP FLM BOOT RX -- */
	//printk("\n---%s()Start\n",__FUNCTION__);
      
	// USB_SEL
	err = gpio_request(EXYNOS4_GPK3(2), "USB_SEL");
	if(err){
		printk(KERN_ERR "fail to request gpio %s\n", "USB_SEL");
	}else{
		gpio_direction_output(EXYNOS4_GPK3(2), 0);
		s3c_gpio_setpull(EXYNOS4_GPK3(2), S3C_GPIO_PULL_NONE);
		gpio_free(EXYNOS4_GPK3(2));
	}
	msleep(100);

	// Reset_BB
	err = gpio_request(GPIO_CP_RST, "CP_RST");
	if (err) {
		printk(KERN_ERR "fail to request gpio %s\n", "CP_RST");
	} else {
		gpio_direction_output(GPIO_CP_RST, 0);
		s3c_gpio_cfgpin(GPIO_CP_RST, S3C_GPIO_INPUT);
		s3c_gpio_setpull(GPIO_CP_RST, S3C_GPIO_PULL_NONE);
		gpio_free(GPIO_CP_RST);
	}

	// ResetN
	err = gpio_request(GPIO_CP_PMU_RST, "CP_PMU_RST");
	if (err) {
		printk(KERN_ERR "fail to request gpio %s\n", "CP_PMU_RST");
	} else {
		gpio_direction_output(GPIO_CP_PMU_RST, 1);
		s3c_gpio_setpull(GPIO_CP_PMU_RST, S3C_GPIO_PULL_NONE);
		//gpio_free(GPIO_CP_PMU_RST);
	}
	
	msleep(100);

	err = gpio_request(GPIO_PHONE_ON, "PHONE_ON");
	if (err) {
		printk(KERN_ERR "fail to request gpio %s\n", "PHONE_ON");
	} else {
		gpio_direction_output(GPIO_PHONE_ON, 0);//[email protected] modify for ON1/2 compatible  gpio_direction_output(GPIO_PHONE_ON, 0);
		s3c_gpio_setpull(GPIO_PHONE_ON, S3C_GPIO_PULL_NONE);
		gpio_free(GPIO_PHONE_ON);
	}
	msleep(100);

#if 0
	err = gpio_request(GPIO_PHONE_ON, "PHONE_ON");
	if (err) {
		printk(KERN_ERR "fail to request gpio %s\n", "PHONE_ON");
	} else {
		gpio_direction_output(GPIO_PHONE_ON, 0);
		s3c_gpio_setpull(GPIO_PHONE_ON, S3C_GPIO_PULL_NONE);
		gpio_free(GPIO_PHONE_ON);
	}
#endif
	udelay(80);

	err = gpio_request(GPIO_IPC_SLAVE_WAKEUP, "IPC_SLAVE_WAKEUP");
	if (err) {
		printk(KERN_ERR "fail to request gpio %s\n",
			"IPC_SLAVE_WAKEUP");
	} else {
		gpio_direction_output(GPIO_IPC_SLAVE_WAKEUP, 0);
		s3c_gpio_setpull(GPIO_IPC_SLAVE_WAKEUP, S3C_GPIO_PULL_NONE);
		gpio_free(GPIO_IPC_SLAVE_WAKEUP);
	}

	err = gpio_request(GPIO_IPC_HOST_WAKEUP, "IPC_HOST_WAKEUP");
	if (err) {
		printk(KERN_ERR "fail to request gpio %s\n", "IPC_HOST_WAKEUP");
	} else {
		gpio_direction_output(GPIO_IPC_HOST_WAKEUP, 0);
		s3c_gpio_cfgpin(GPIO_IPC_HOST_WAKEUP, S3C_GPIO_INPUT);
		s3c_gpio_setpull(GPIO_IPC_HOST_WAKEUP, S3C_GPIO_PULL_NONE);
		gpio_free(GPIO_IPC_HOST_WAKEUP);
	}
	
	err = gpio_request(GPIO_SUSPEND_REQUEST, "IPC_SUSPEND_REQUEST");
	if (err) {
		printk(KERN_ERR "fail to request gpio %s\n", "IPC_SUSPEND_REQUEST");
	} else {
		gpio_direction_output(GPIO_SUSPEND_REQUEST, 0);
		s3c_gpio_cfgpin(GPIO_SUSPEND_REQUEST, S3C_GPIO_INPUT);
		s3c_gpio_setpull(GPIO_SUSPEND_REQUEST, S3C_GPIO_PULL_NONE);
		gpio_free(GPIO_SUSPEND_REQUEST);
	}	
	
	err = gpio_request(GPIO_ACTIVE_STATE, "ACTIVE_STATE");
	if (err) {
		printk(KERN_ERR "fail to request gpio %s\n", "ACTIVE_STATE");
	} else {
//.........这里部分代码省略.........
开发者ID:GeekOnTrip,项目名称:android_kernel_c8690,代码行数:101,代码来源:setup-modem.c


示例9: s6evr01_probe


//.........这里部分代码省略.........

	ret = device_create_file(&lcd->ld->dev, &dev_attr_window_type);
	if (ret < 0)
		dev_err(&lcd->ld->dev, "failed to add sysfs entries, %d\n", __LINE__);

	ret = device_create_file(&lcd->ld->dev, &dev_attr_gamma_table);
	if (ret < 0)
		dev_err(&lcd->ld->dev, "failed to add sysfs entries, %d\n", __LINE__);

	ret = device_create_file(&lcd->bd->dev, &dev_attr_auto_brightness);
	if (ret < 0)
		dev_err(&lcd->ld->dev, "failed to add sysfs entries, %d\n", __LINE__);

	dev_set_drvdata(dev, lcd);

	mutex_init(&lcd->lock);
	mutex_init(&lcd->bl_lock);

	s6evr01_read_id(lcd, lcd->id);

	dev_info(&lcd->ld->dev, "ID: %x, %x, %x\n", lcd->id[0], lcd->id[1], lcd->id[2]);

	dev_info(&lcd->ld->dev, "%s lcd panel driver has been probed.\n", dev_name(dev));

#ifdef SMART_DIMMING
	for (i = 0; i < LDI_ID_LEN; i++) {
		lcd->smart.panelid[i] = lcd->id[i];
	}

	init_table_info(&lcd->smart);

	ret = s6evr01_read_mtp(lcd, mtp_data);
/*
	for (i = 0; i < LDI_MTP_LENGTH ; i++)
		printk(" %dth mtp value is %x\n", i, mtp_data[i]);
*/
	if (!ret) {
		printk(KERN_ERR "[LCD:ERROR] : %s read mtp failed\n", __func__);
		/*return -EPERM;*/
	}

	calc_voltage_table(&lcd->smart, mtp_data);

	ret = init_elvss_table(lcd);
	ret += init_gamma_table(lcd, mtp_data);
	ret += init_aid_dimming_table(lcd);

	if (ret)
		printk(KERN_ERR "gamma table generation is failed\n");


	update_brightness(lcd, 1);
#endif

#if defined(GPIO_ERR_FG)
	if (lcd->connected) {
		INIT_DELAYED_WORK(&lcd->err_fg_detection, err_fg_detection_work);

		lcd->irq = gpio_to_irq(GPIO_ERR_FG);

		irq_set_irq_type(lcd->irq, IRQ_TYPE_EDGE_RISING);

		s3c_gpio_cfgpin(GPIO_ERR_FG, S3C_GPIO_SFN(0xf));
		s3c_gpio_setpull(GPIO_ERR_FG, S3C_GPIO_PULL_NONE);

		if (request_irq(lcd->irq, err_fg_detection_int,
			IRQF_TRIGGER_RISING, "err_fg_detection", lcd))
			pr_err("failed to reqeust irq. %d\n", lcd->irq);
	}
#endif
#if defined(GPIO_OLED_DET)
	if (lcd->connected) {
		INIT_DELAYED_WORK(&lcd->oled_detection, oled_detection_work);

		s3c_gpio_cfgpin(GPIO_OLED_DET, S3C_GPIO_SFN(0xf));
		s3c_gpio_setpull(GPIO_OLED_DET, S3C_GPIO_PULL_NONE);

		if (request_irq(gpio_to_irq(GPIO_OLED_DET), oled_detection_int,
			IRQF_TRIGGER_FALLING, "oled_detection", lcd))
			pr_err("failed to reqeust irq. %d\n", gpio_to_irq(GPIO_OLED_DET));
	}
#endif

	lcd_early_suspend = s6evr01_early_suspend;
	lcd_late_resume = s6evr01_late_resume;

	return 0;

out_free_backlight:
	lcd_device_unregister(lcd->ld);
	kfree(lcd);
	return ret;

out_free_lcd:
	kfree(lcd);
	return ret;

err_alloc:
	return ret;
}
开发者ID:LuckJC,项目名称:Adam-Kernel-GS3,代码行数:101,代码来源:s3cfb_s6evr01.c


示例10: p4_tsp_init

void __init p4_tsp_init(u32 system_rev)
{
	int gpio = 0, irq = 0;
	hw_rev = system_rev;

	printk(KERN_DEBUG "[TSP] %s rev : %u\n",
		__func__, hw_rev);

	printk(KERN_DEBUG "[TSP] TSP IC : %s\n",
		(5 <= hw_rev) ? "Atmel" : "Synaptics");

	if (5 <= hw_rev) {
		gpio = GPIO_TSP_LDO_ON2;
		gpio_request(gpio, "TSP_LDO_ON2");
		gpio_direction_output(gpio, 0);
		gpio_export(gpio, 0);

		gpio = GPIO_TSP_LDO_ON1;
		gpio_request(gpio, "TSP_LDO_ON1");
		gpio_direction_output(gpio, 0);
		gpio_export(gpio, 0);

		gpio = GPIO_TSP_LDO_ON;
		gpio_request(gpio, "TSP_LDO_ON");
		gpio_direction_output(gpio, 0);
		gpio_export(gpio, 0);

		gpio = GPIO_TSP_RST;
		gpio_request(gpio, "TSP_RST");
		gpio_direction_output(gpio, 0);
		gpio_export(gpio, 0);

		switch_config(hw_rev);
	} else {
		gpio = GPIO_TSP_RST;
		gpio_request(gpio, "TSP_RST");
		gpio_direction_output(gpio, 1);
		gpio_export(gpio, 0);

		gpio = GPIO_TSP_LDO_ON;
		gpio_request(gpio, "TSP_LDO_ON");
		gpio_direction_output(gpio, 1);
		gpio_export(gpio, 0);

		if (1 <= hw_rev)
			have_tsp_ldo = true;
	}

	gpio = GPIO_TSP_INT;
	gpio_request(gpio, "TSP_INT");
	s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
	s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);
	s5p_register_gpio_interrupt(gpio);
	irq = gpio_to_irq(gpio);

#ifdef CONFIG_S3C_DEV_I2C3
	s3c_i2c3_set_platdata(NULL);

#if defined(CONFIG_TOUCHSCREEN_ATMEL_MXT1664S) && \
	defined(CONFIG_TOUCHSCREEN_SYNAPTICS_S7301)
	if (5 <= system_rev) {
		i2c_mxt1664s[0].irq = irq;
		i2c_register_board_info(3, i2c_mxt1664s,
			ARRAY_SIZE(i2c_mxt1664s));
	} else {
		i2c_synaptics[0].irq = irq;
		i2c_register_board_info(3, i2c_synaptics,
			ARRAY_SIZE(i2c_synaptics));
	}
#endif
#endif	/* CONFIG_S3C_DEV_I2C3 */

}
开发者ID:Mattix724,项目名称:android_kernel_samsung_d710,代码行数:73,代码来源:p4-input.c


示例11: EXT_LED_Init

void EXT_LED_Init(void){
	//GPB_0,1,4,5,6,7 : Output
	//Outp32(GPBCON,(Inp32(GPBCON)  &= (~0xFFFF00FF)));
	//Outp32(GPBCON,(Inp32(GPBCON)  |= 0x11110011));
	//GPB_0,1,4,5,6,7 : Pull-up
	//Outp32(GPBPUD,(Inp32(GPBPUD)  &= (~0x0000FF0F)));
	//Outp32(GPBPUD,(Inp32(GPBPUD)  |= 0x0000AA0A));
	s3c_gpio_cfgpin(LED_D0, S3C_GPIO_SFN(MODE_OUT));
	s3c_gpio_setpull(LED_D0, S3C_GPIO_PULL_NONE);
	s3c_gpio_cfgpin(LED_D1, S3C_GPIO_SFN(MODE_OUT));
	s3c_gpio_setpull(LED_D1, S3C_GPIO_PULL_NONE);
	s3c_gpio_cfgpin(LED_D2, S3C_GPIO_SFN(MODE_OUT));
	s3c_gpio_setpull(LED_D2, S3C_GPIO_PULL_NONE);
	s3c_gpio_cfgpin(LED_D3, S3C_GPIO_SFN(MODE_OUT));
	s3c_gpio_setpull(LED_D3, S3C_GPIO_PULL_NONE);

	s3c_gpio_cfgpin(LED_C0, S3C_GPIO_SFN(MODE_OUT));
	s3c_gpio_setpull(LED_C0, S3C_GPIO_PULL_NONE);


	//GPA0_2 : Output
	//Outp32(GPA0CON,(Inp32(GPA0CON) &= (~0x00000F00)));
	//Outp32(GPA0CON,(Inp32(GPA0CON) |= 0x00000100 ));
	//GPA0_2 : Pull-up
	//Outp32(GPA0PUD,(Inp32(GPA0PUD) &= (~0x00000030)));
	//Outp32(GPA0PUD,(Inp32(GPA0PUD) |= 0x00000020));
	s3c_gpio_cfgpin(LED_C1, S3C_GPIO_SFN(MODE_OUT));
	s3c_gpio_setpull(LED_C1, S3C_GPIO_PULL_NONE);

	//GPB_4,5,6,7 : 0 -> 1
	//Outp32(GPBDAT,(Inp32(GPBDAT)  &= (~0x000000F0)));
	//Outp32(GPBDAT,(Inp32(GPBDAT)  |= 0x000000F0));
	s3c_gpio_setpin(LED_D0, 1);
	s3c_gpio_setpin(LED_D1, 1);
	s3c_gpio_setpin(LED_D2, 1);
	s3c_gpio_setpin(LED_D3, 1);

#if 1
	//GPB_1 : 0 -> 1 -> 0
	//Outp32(GPBDAT,(Inp32(GPBDAT)  &= (~0x00000002)));
	//Outp32(GPBDAT,(Inp32(GPBDAT)  |= (0x00000002)));
	//Outp32(GPBDAT,(Inp32(GPBDAT)  &= (~0x00000002)));
	s3c_gpio_setpin(LED_C0, 0);
	s3c_gpio_setpin(LED_C0, 1);
	s3c_gpio_setpin(LED_C0, 0);

	//GPA0_2 : 0 -> 1 -> 0
	//Outp32(GPA0DAT,(Inp32(GPBDAT)  &= (~0x00000004)));
	//Outp32(GPA0DAT,(Inp32(GPBDAT)  |= (0x00000004)));
	//Outp32(GPA0DAT,(Inp32(GPBDAT)  &= (~0x00000004)));
	s3c_gpio_setpin(LED_C1, 0);
	s3c_gpio_setpin(LED_C1, 1);
	s3c_gpio_setpin(LED_C1, 0);
#endif

#if 1
	//GPB_0 : 1
	//Outp32(GPBDAT,(Inp32(GPBDAT)  |= 0x00000001));
	s3c_gpio_setpin(KEY_CTL, 1);
#endif
}
开发者ID:Sangil-Lee,项目名称:Work,代码行数:61,代码来源:led_drv.c


示例12: smdk5410_drd1_init

static void __init __maybe_unused smdk5410_drd1_init(void)
{
	/* Initialize DRD1 gpio */
	if (gpio_request(EXYNOS5410_GPK2(4), "UDRD3_1_OVERCUR_U2")) {
		pr_err("failed to request UDRD3_1_OVERCUR_U2\n");
	} else {
		s3c_gpio_cfgpin(EXYNOS5410_GPK2(4), (0x2 << 16));
		s3c_gpio_setpull(EXYNOS5410_GPK2(4), S3C_GPIO_PULL_NONE);
		gpio_free(EXYNOS5410_GPK2(4));
	}

	if (gpio_request(EXYNOS5410_GPK2(5), "UDRD3_1_OVERCUR_U3")) {
		pr_err("failed to request UDRD3_1_OVERCUR_U3\n");
	} else {
		s3c_gpio_cfgpin(EXYNOS5410_GPK2(5), (0x2 << 20));
		s3c_gpio_setpull(EXYNOS5410_GPK2(5), S3C_GPIO_PULL_NONE);
		gpio_free(EXYNOS5410_GPK2(5));
	}

	if (gpio_request_one(EXYNOS5410_GPK2(6), GPIOF_OUT_INIT_LOW,
				"UDRD3_1_VBUSCTRL_U2")) {
		pr_err("failed to request UDRD3_1_VBUSCTRL_U2\n");
	} else {
		s3c_gpio_setpull(EXYNOS5410_GPK2(6), S3C_GPIO_PULL_NONE);
		gpio_free(EXYNOS5410_GPK2(6));
	}

	if (gpio_request_one(EXYNOS5410_GPK2(7), GPIOF_OUT_INIT_LOW,
				"UDRD3_1_VBUSCTRL_U3")) {
		pr_err("failed to request UDRD3_1_VBUSCTRL_U3\n");
	} else {
		s3c_gpio_setpull(EXYNOS5410_GPK2(7), S3C_GPIO_PULL_NONE);
		gpio_free(EXYNOS5410_GPK2(7));
	}

#if defined(CONFIG_USB_EXYNOS5_USB3_DRD_CH1)
	if (gpio_request_one(SMDK5410_ID1_GPIO, GPIOF_IN, "UDRD3_1_ID")) {
		pr_err("failed to request UDRD3_1_ID\n");
		smdk5410_drd_pdata.id_irq = -1;
	} else {
		s3c_gpio_cfgpin(SMDK5410_ID1_GPIO, S3C_GPIO_SFN(0xF));
		s3c_gpio_setpull(SMDK5410_ID1_GPIO, S3C_GPIO_PULL_NONE);
		gpio_free(SMDK5410_ID1_GPIO);

		smdk5410_drd_pdata.id_irq = gpio_to_irq(SMDK5410_ID1_GPIO);
	}

	if (gpio_request_one(SMDK5410_VBUS1_GPIO, GPIOF_IN, "UDRD3_1_VBUS")) {
		pr_err("failed to request UDRD3_1_VBUS\n");
		smdk5410_drd_pdata.vbus_irq = -1;
	} else {
		s3c_gpio_cfgpin(SMDK5410_VBUS1_GPIO, S3C_GPIO_SFN(0xF));
		s3c_gpio_setpull(SMDK5410_VBUS1_GPIO, S3C_GPIO_PULL_NONE);
		gpio_free(SMDK5410_VBUS1_GPIO);

		smdk5410_drd_pdata.vbus_irq = gpio_to_irq(SMDK5410_VBUS1_GPIO);
	}

	smdk5410_drd_pdata.quirks = 0;
#if !defined(CONFIG_USB_XHCI_EXYNOS)
	smdk5410_drd_pdata.quirks |= FORCE_RUN_PERIPHERAL;
#endif
#else
	smdk5410_drd_pdata.id_irq = -1;
	smdk5410_drd_pdata.vbus_irq = -1;
	smdk5410_drd_pdata.quirks = DUMMY_DRD;
#endif

	exynos5_usb3_drd1_set_platdata(&smdk5410_drd_pdata);
}
开发者ID:619619,项目名称:T805-Basicrom-Kernel,代码行数:70,代码来源:board-smdk5410-usb.c


示例13: midas_power_set_muic_pdata

void midas_power_set_muic_pdata(void *pdata, int gpio)
{
	gpio_request(gpio, "AP_PMIC_IRQ");
	s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
	s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
}
开发者ID:Entropy512,项目名称:n7000_erasetest_kernel,代码行数:6,代码来源:gc1-power.c


示例14: universal5410_gpio_keys_config_setup

static void universal5410_gpio_keys_config_setup(void)
{
	s3c_gpio_setpull(EXYNOS5410_GPX0(2), S3C_GPIO_PULL_UP);
	s3c_gpio_setpull(EXYNOS5410_GPX0(3), S3C_GPIO_PULL_UP);
}
开发者ID:619619,项目名称:T805-Basicrom-Kernel,代码行数:5,代码来源:board-universal5410-input.c


示例15: smdk5250_usbswitch_init

static void __init smdk5250_usbswitch_init(void)
{
	struct s5p_usbswitch_platdata *pdata = &smdk5250_usbswitch_pdata;
	int err;

	/* USB 2.0 detect GPIO */
	if (samsung_rev() < EXYNOS5250_REV_1_0) {
		pdata->gpio_device_detect = 0;
		pdata->gpio_host_vbus = 0;
	} else {
		pdata->gpio_host_detect = EXYNOS5_GPX1(6);
		err = gpio_request_one(pdata->gpio_host_detect, GPIOF_IN,
			"HOST_DETECT");
		if (err) {
			printk(KERN_ERR "failed to request host gpio\n");
			return;
		}

		s3c_gpio_cfgpin(pdata->gpio_host_detect, S3C_GPIO_SFN(0xF));
		s3c_gpio_setpull(pdata->gpio_host_detect, S3C_GPIO_PULL_NONE);
		gpio_free(pdata->gpio_host_detect);

		pdata->gpio_device_detect = EXYNOS5_GPX3(4);
		err = gpio_request_one(pdata->gpio_device_detect, GPIOF_IN,
			"DEVICE_DETECT");
		if (err) {
			printk(KERN_ERR "failed to request device gpio\n");
			return;
		}

		s3c_gpio_cfgpin(pdata->gpio_device_detect, S3C_GPIO_SFN(0xF));
		s3c_gpio_setpull(pdata->gpio_device_detect, S3C_GPIO_PULL_NONE);
		gpio_free(pdata->gpio_device_detect);

		pdata->gpio_host_vbus = EXYNOS5_GPX2(6);
		err = gpio_request_one(pdata->gpio_host_vbus,
			GPIOF_OUT_INIT_LOW,
			"HOST_VBUS_CONTROL");
		if (err) {
			printk(KERN_ERR "failed to request host_vbus gpio\n");
			return;
		}

		s3c_gpio_setpull(pdata->gpio_host_vbus, S3C_GPIO_PULL_NONE);
		gpio_free(pdata->gpio_host_vbus);
	}

	/* USB 3.0 DRD detect GPIO */
	if (samsung_rev() < EXYNOS5250_REV_1_0) {
		pdata->gpio_drd_host_detect = 0;
		pdata->gpio_drd_device_detect = 0;
	} else {
		pdata->gpio_drd_host_detect = EXYNOS5_GPX1(7);
		err = gpio_request_one(pdata->gpio_drd_host_detect, GPIOF_IN,
			"DRD_HOST_DETECT");
		if (err) {
			printk(KERN_ERR "failed to request drd_host gpio\n");
			return;
		}

		s3c_gpio_cfgpin(pdata->gpio_drd_host_detect, S3C_GPIO_SFN(0xF));
		s3c_gpio_setpull(pdata->gpio_drd_host_detect,
			S3C_GPIO_PULL_NONE);
		gpio_free(pdata->gpio_drd_host_detect);

		pdata->gpio_drd_device_detect = EXYNOS5_GPX0(6);
		err = gpio_request_one(pdata->gpio_drd_device_detect, GPIOF_IN,
			"DRD_DEVICE_DETECT");
		if (err) {
			printk(KERN_ERR "failed to request drd_device\n");
			return;
		}

		s3c_gpio_cfgpin(pdata->gpio_drd_device_detect,
			S3C_GPIO_SFN(0xF));
		s3c_gpio_setpull(pdata->gpio_drd_device_detect,
			S3C_GPIO_PULL_NONE);
		gpio_free(pdata->gpio_drd_device_detect);
	}

	s5p_usbswitch_set_platdata(pdata);
}
开发者ID:0x7678,项目名称:SJKernel-gn2,代码行数:82,代码来源:mach-smdk5250.c


示例16: s3c6410_spi_probe


//.........这里部分代码省略.........
#elif defined (CONFIG_SPICLK_EPLL)
	writel((readl(S3C_PCLK_GATE)|S3C_CLKCON_PCLK_SPI0|S3C_CLKCON_PCLK_SPI1),S3C_PCLK_GATE);
	writel((readl(S3C_SCLK_GATE)|S3C_CLKCON_SCLK_SPI0|S3C_CLKCON_SCLK_SPI1),S3C_SCLK_GATE);

	writel(readl(S3C_CLK_SRC)|S3C_CLKSRC_MPLL_CLKSEL, S3C_CLK_SRC);

	/* Set SPi Clock to DOUTMPLL*/
	if(hw->id == 0)		/* SPI_CHANNEL = 0 */
		writel((readl(S3C_CLK_SRC)&~(0x3<<14))|(1<<14), S3C_CLK_SRC);
	else  				/* SPI_CHANNEL = 1 */
		writel((readl(S3C_CLK_SRC)&~(0x3<<16))|(1<<16), S3C_CLK_SRC);

	/* CLK_DIV2 setting */
	/* SPI Input Clock(88.87Mhz) = 266.66Mhz / (2 + 1)*/
	writel(((readl(S3C_CLK_DIV2) & ~(0xff << 0)) | 2) , S3C_CLK_DIV2);

	hw->in_clk = 266660000;

#elif defined (CONFIG_SPICLK_USBCLK)
	writel((readl(S3C_PCLK_GATE)| S3C_CLKCON_PCLK_SPI0|S3C_CLKCON_PCLK_SPI1),S3C_PCLK_GATE);
	writel((readl(S3C_SCLK_GATE)|S3C_CLKCON_SCLK_SPI0_48|S3C_CLKCON_SCLK_SPI1_48),S3C_SCLK_GATE);
	hw->in_clk = 48000000;
#endif
	
	printk("SPI: Source Clock = %ldMhz\n", hw->in_clk);

	/* initialize the gpio */
	if (hw->id == 0) {
		s3c_gpio_cfgpin(S3C64XX_GPC(0), S3C64XX_GPC0_SPI_MISO0);
		s3c_gpio_cfgpin(S3C64XX_GPC(1), S3C64XX_GPC1_SPI_CLK0);
		s3c_gpio_cfgpin(S3C64XX_GPC(2), S3C64XX_GPC2_SPI_MOSI0);
		s3c_gpio_cfgpin(S3C64XX_GPC(3), S3C64XX_GPC3_SPI_nCS0);

		s3c_gpio_setpull(S3C64XX_GPC(0), S3C_GPIO_PULL_UP);
		s3c_gpio_setpull(S3C64XX_GPC(1), S3C_GPIO_PULL_UP);
		s3c_gpio_setpull(S3C64XX_GPC(2), S3C_GPIO_PULL_UP);
		s3c_gpio_setpull(S3C64XX_GPC(3), S3C_GPIO_PULL_UP);
	} else {
		s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C64XX_GPC4_SPI_MISO1);
		s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C64XX_GPC5_SPI_CLK1);
		s3c_gpio_cfgpin(S3C64XX_GPC(6), S3C64XX_GPC6_SPI_MOSI1);
		s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C64XX_GPC7_SPI_nCS1);

		s3c_gpio_setpull(S3C64XX_GPC(4), S3C_GPIO_PULL_UP);
		s3c_gpio_setpull(S3C64XX_GPC(5), S3C_GPIO_PULL_UP);
		s3c_gpio_setpull(S3C64XX_GPC(6), S3C_GPIO_PULL_UP);
		s3c_gpio_setpull(S3C64XX_GPC(7), S3C_GPIO_PULL_UP);
	}

	/* SW Reset */	
	writel(readl(hw->regs + S3C_CH_CFG) | SPI_CH_SW_RST, hw->regs + S3C_CH_CFG);
	udelay(100);
	writel(readl(hw->regs + S3C_CH_CFG) & (~SPI_CH_SW_RST), hw->regs + S3C_CH_CFG);
	udelay(100);

	/* disable  SPI Interrupt */
	writel(SPI_INT_ALL_DISABLE, hw->regs + S3C_SPI_INT_EN);

	/* Set transfer type (CPOL & CPHA set) */
	spi_chcfg = readl(hw->regs + S3C_CH_CFG);
	spi_chcfg &= ~SPI_CH_HSPD_EN;
	spi_chcfg |= SPI_CH_FORMAT_B | SPI_CH_RISING | SPI_CH_MASTER; 
	writel(spi_chcfg, hw->regs + S3C_CH_CFG);

	/* Set NSSOUT to start high after Reset */
	s3c6410_spi_set_cs(hw, BITBANG_CS_INACTIVE);
开发者ID:Asrake,项目名称:m8_android_kernel,代码行数:67,代码来源:spi_s3c64xx.c


示例17: config_umts_modem_gpio

/*
** Function definitions
*/
static void config_umts_modem_gpio(void)
{
	int err;
	unsigned gpio_cp_on = umts_modem_data.gpio_cp_on;
	unsigned gpio_cp_rst = umts_modem_data.gpio_cp_reset;
	unsigned gpio_pda_active = umts_modem_data.gpio_pda_active;
	unsigned gpio_phone_active = umts_modem_data.gpio_phone_active;
	unsigned gpio_active_state = umts_modem_data.gpio_host_active;
	unsigned gpio_host_wakeup = umts_modem_data.gpio_host_wakeup;
	unsigned gpio_slave_wakeup = umts_modem_data.gpio_slave_wakeup;
	unsigned gpio_dpram_int = umts_modem_data.gpio_dpram_int;
	unsigned gpio_dpram_status = umts_modem_data.gpio_dpram_status;
	unsigned gpio_dpram_wakeup = umts_modem_data.gpio_dpram_wakeup;
	unsigned gpio_dynamic_switching =
			umts_modem_data.gpio_dynamic_switching;
#ifdef CONFIG_EXYNOS4_CPUFREQ
	unsigned gpio_cpufreq_lock = umts_modem_data.gpio_cpufreq_lock;
#endif

	if (gpio_cp_on) {
		err = gpio_request(gpio_cp_on, "CMC_ON");
		if (err) {
			mif_err("ERR: fail to request gpio %s\n", "CMC_ON");
		} else {
			gpio_direction_output(gpio_cp_on, 0);
			s3c_gpio_setpull(gpio_cp_on, S3C_GPIO_PULL_NONE);
		}
	}

	if (gpio_cp_rst) {
		err = gpio_request(gpio_cp_rst, "CMC_RST");
		if (err) {
			mif_err("ERR: fail to request gpio %s\n", "CMC_RST");
		} else {
			gpio_direction_output(gpio_cp_rst, 0);
			s3c_gpio_setpull(gpio_cp_rst, S3C_GPIO_PULL_NONE);
		}
	}

	if (gpio_pda_active) {
		err = gpio_request(gpio_pda_active, "PDA_ACTIVE");
		if (err) {
			mif_err("ERR: fail to request gpio %s\n", "PDA_ACTIVE");
		} else {
			gpio_direction_output(gpio_pda_active, 0);
			s3c_gpio_setpull(gpio_pda_active, S3C_GPIO_PULL_NONE);
		}
	}

	if (gpio_phone_active) {
		err = gpio_request(gpio_phone_active, "CMC_ACTIVE");
		if (err) {
			mif_err("ERR: fail to request gpio %s\n", "CMC_ACTIVE");
		} else {
			/* Configure as a wake-up source */
			gpio_direction_input(gpio_phone_active);
			s3c_gpio_setpull(gpio_phone_active, S3C_GPIO_PULL_DOWN);
			s3c_gpio_cfgpin(gpio_phone_active, S3C_GPIO_SFN(0xF));
		}
	}

	if (gpio_active_state) {
		err = gpio_request(gpio_active_state, "CMC_ACTIVE_STATE");
		if (err) {
			mif_err("ERR: fail to request gpio %s\n",
				"CMC_ACTIVE_STATE");
		} else {
			gpio_direction_output(gpio_active_state, 0);
			s3c_gpio_setpull(gpio_active_state, S3C_GPIO_PULL_NONE);
		}
	}

	if (gpio_slave_wakeup) {
		err = gpio_request(gpio_slave_wakeup, "CMC_SLAVE_WAKEUP");
		if (err) {
			mif_err("ERR: fail to request gpio %s\n",
				"CMC_SLAVE_WAKEUP");
		} else {
			gpio_direction_output(gpio_slave_wakeup, 0);
			s3c_gpio_setpull(gpio_slave_wakeup, S3C_GPIO_PULL_NONE);
		}
	}

	if (gpio_host_wakeup) {
		err = gpio_request(gpio_host_wakeup, "CMC_HOST_WAKEUP");
		if (err) {
			mif_err("ERR: fail to request gpio %s\n",
				"CMC_HOST_WAKEUP");
		} else {
			/* Configure as a wake-up source */
			gpio_direction_input(gpio_host_wakeup);
			s3c_gpio_setpull(gpio_host_wakeup, S3C_GPIO_PULL_DOWN);
			s3c_gpio_cfgpin(gpio_host_wakeup, S3C_GPIO_SFN(0xF));
		}
	}

	if (gpio_dpram_int) {
//.........这里部分代码省略.........
开发者ID:ParanoidNote,项目名称:arter97-i9300-release,代码行数:101,代码来源:board-c1-modems.c


示例18: universal_sdhci2_cfg_ext_cd

void universal_sdhci2_cfg_ext_cd(void)
{
	printk(KERN_DEBUG "Universal :SD Detect configuration\n");
	s3c_gpio_setpull(S5PV210_GPH3(4), S3C_GPIO_PULL_NONE);
	set_irq_type(IRQ_EINT(28), IRQ_TYPE_EDGE_BOTH);
}
开发者ID:makarabelong,项目名称:shw-m110s-kernel,代码行数:6,代码来源:setup-sdhci.c


示例19: sii8240_cfg_gpio

static void sii8240_cfg_gpio(void)
{
	printk(KERN_INFO "%s()\n", __func__);

#ifdef CONFIG_MACH_JA
#if defined(CONFIG_MACH_JA_KOR_LGT)
	if ( (system_rev < 06)  || (system_rev == 7) ) {
#else
	if (system_rev < 06 ) {
#endif

#endif
	/* AP_MHL_SDA */
	s3c_gpio_cfgpin(GPIO_MHL_SDA_18V, S3C_GPIO_SFN(0x0));
	s3c_gpio_setpull(GPIO_MHL_SDA_18V, S3C_GPIO_PULL_NONE);

	/* AP_MHL_SCL */
	s3c_gpio_cfgpin(GPIO_MHL_SCL_18V, S3C_GPIO_SFN(0x0));
	s3c_gpio_setpull(GPIO_MHL_SCL_18V, S3C_GPIO_PULL_NONE);

	s5p_gpio_set_drvstr(GPIO_MHL_SCL_18V, S5P_GPIO_DRVSTR_LV4);
	s5p_gpio_set_drvstr(GPIO_MHL_SDA_18V, S5P_GPIO_DRVSTR_LV4);
#ifdef CONFIG_MACH_JA
	} else {
		/* AP_MHL_SDA */
		s3c_gpio_cfgpin(GPIO_MHL_SDA_18V_06, S3C_GPIO_SFN(0x0));
		s3c_gpio_setpull(GPIO_MHL_SDA_18V_06, S3C_GPIO_PULL_NONE);

		/* AP_MHL_SCL */
		s3c_gpio_cfgpin(GPIO_MHL_SCL_18V_06, S3C_GPIO_SFN(0x0));
		s3c_gpio_setpull(GPIO_MHL_SCL_18V_06, S3C_GPIO_PULL_NONE);

		s5p_gpio_set_drvstr(GPIO_MHL_SCL_18V_06, S5P_GPIO_DRVSTR_LV4);
		s5p_gpio_set_drvstr(GPIO_MHL_SDA_18V_06, S5P_GPIO_DRVSTR_LV4);
	}
#endif

	gpio_request(GPIO_MHL_INT, "MHL_INT");
	s5p_register_gpio_interrupt(GPIO_MHL_INT);
	s3c_gpio_setpull(GPIO_MHL_INT, S3C_GPIO_PULL_DOWN);
	irq_set_irq_type(gpio_to_irq(GPIO_MHL_INT), IRQ_TYPE_EDGE_RISING);
	s3c_gpio_cfgpin(GPIO_MHL_INT, S3C_GPIO_SFN(0xF));

	s3c_gpio_cfgpin(GPIO_MHL_RST, S3C_GPIO_OUTPUT);
	s3c_gpio_setpull(GPIO_MHL_RST, S3C_GPIO_PULL_NONE);
	gpio_set_value(GPIO_MHL_RST, 0);
}

static void sii8240_power_onoff(bool on)
{
	struct regulator *regulator1_8, *regulator3_3, *regulator1_2;

	regulator1_8 = regulator_get(NULL, MHL_LDO1_8);
	regulator3_3 = regulator_get(NULL, MHL_LDO3_3);
	regulator1_2 = regulator_get(NULL, MHL_LDO1_2);
	if ((IS_ERR(regulator1_8)) || (IS_ERR(regulator3_3))
		|| (IS_ERR(regulator1_2))) {
		pr_err("%s : regulato is not available", __func__);
		return;
	}

	if (mhl_power_on == on) {
		pr_info("sii8240 : sii8240_power_onoff : alread %d\n", on);
		regulator_put(regulator1_2);
		regulator_put(regulator3_3);
		regulator_put(regulator1_8);
		return;
	}

	mhl_power_on = on;
	pr_info("sii8240 : sii8240_power_onoff : %d\n", on);

	if (on) {
		/* To avoid floating state of the HPD pin *
		 * in the absence of external pull-up     */
		s3c_gpio_setpull(GPIO_HDMI_HPD, S3C_GPIO_PULL_NONE);
		regulator_enable(regulator3_3);
		regulator_enable(regulator1_8);
		regulator_enable(regulator1_2);
		usleep_range(10000, 20000);
	} else {
		/* To avoid floating state of the HPD pin *
		 * in the absence of external pull-up     */
		s3c_gpio_setpull(GPIO_HDMI_HPD, S3C_GPIO_PULL_DOWN);
		regulator_disable(regulator3_3);
		regulator_disable(regulator1_8);
		regulator_disable(regulator1_2);

		gpio_set_value(GPIO_MHL_RST, 0);
	}
	regulator_put(regulator3_3);
	regulator_put(regulator1_8);
	regulator_put(regulator1_2);

}

static void sii8240_reset(void)
{
	printk(KERN_INFO "%s()\n", __func__);

//.........这里部分代码省略.........
开发者ID:turter99,项目名称:android_kernel_samsung_jaltektt_perseus_4.2.2,代码行数:101,代码来源:board-universal5410-mhl.c


示例20: onedram_cfg_gpio

/* onedram */
static void onedram_cfg_gpio(void)
{
	s3c_gpio_cfgpin(GPIO_nINT_ONEDRAM_AP, S3C_GPIO_SFN(GPIO_nINT_ONEDRAM_AP_AF));
	s3c_gpio_setpull(GPIO_nINT_ONEDRAM_AP, S3C_GPIO_PULL_UP);
	set_irq_type(GPIO_nINT_ONEDRAM_AP, IRQ_TYPE_LEVEL_LOW);
}
开发者ID:Benz0X,项目名称:bdroid,代码行数:7,代码来源:dev-s1-phone.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ s3c_gpiolib_getchip函数代码示例发布时间:2022-05-30
下一篇:
C++ s3c_gpio_cfgpin函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap