您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ tegra_gpio_enable函数代码示例

51自学网 2021-06-03 08:43:27
  C++
这篇教程C++ tegra_gpio_enable函数代码示例写得很实用,希望能帮到您。

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

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

示例1: enterprise_nfc_init

static void enterprise_nfc_init(void){	tegra_gpio_enable(TEGRA_GPIO_PS4);	tegra_gpio_enable(TEGRA_GPIO_PM6);}
开发者ID:ARMP,项目名称:android_kernel_lge_x3,代码行数:5,


示例2: n1_max17043_gpio_init

static void n1_max17043_gpio_init(void){	tegra_gpio_enable(GPIO_FUEL_ALERT);	gpio_request(GPIO_FUEL_ALERT, "fuel_alert");	gpio_direction_input(GPIO_FUEL_ALERT);}
开发者ID:Kick-Buttowski,项目名称:samsung-stock-kernel,代码行数:6,


示例3: n1_gpio_i2c_init

int __init n1_gpio_i2c_init(int lpm_mode){	/* image converter */	platform_device_register(&tegra_gpio_i2c10_device);	i2c_register_board_info(10, sec_gpio_i2c10_info,			ARRAY_SIZE(sec_gpio_i2c10_info));	platform_device_register(&tegra_gpio_i2c8_device);	i2c_register_board_info(8, sec_gpio_i2c8_info,			ARRAY_SIZE(sec_gpio_i2c8_info));	platform_device_register(&tegra_gpio_i2c11_device);	i2c_register_board_info(11, sec_gpio_i2c11_info,			ARRAY_SIZE(sec_gpio_i2c11_info));	tegra_gpio_enable(tegra_gpio_i2c8_pdata.sda_pin);	tegra_gpio_enable(tegra_gpio_i2c8_pdata.scl_pin);	tegra_gpio_enable(tegra_gpio_i2c11_pdata.sda_pin);	tegra_gpio_enable(tegra_gpio_i2c11_pdata.scl_pin);	/* nct1008 Thermal monitor */	n1_nct1008_init();	platform_device_register(&tegra_gpio_i2c15_device);	i2c_register_board_info(15, sec_gpio_i2c15_info, ARRAY_SIZE(sec_gpio_i2c15_info));	tegra_gpio_enable(tegra_gpio_i2c15_pdata.sda_pin);	tegra_gpio_enable(tegra_gpio_i2c15_pdata.scl_pin);	/* max17043 Fuel Gauge */	n1_max17043_gpio_init();	platform_device_register(&fuelgauge_gpio_i2c_device);	i2c_register_board_info(5, n1_fuelgauge, ARRAY_SIZE(n1_fuelgauge));	tegra_gpio_enable(fuelgauge_gpio_i2c_pdata.sda_pin);	tegra_gpio_enable(fuelgauge_gpio_i2c_pdata.scl_pin);	platform_device_register(&tegra_gpio_i2c9_device);	i2c_register_board_info(9, sec_gpio_i2c9_info,			ARRAY_SIZE(sec_gpio_i2c9_info));	tegra_gpio_enable(tegra_gpio_i2c9_pdata.sda_pin);	tegra_gpio_enable(tegra_gpio_i2c9_pdata.scl_pin);	tegra_gpio_enable(sec_gpio_i2c9_info[0].irq);	/* compass */	tegra_gpio_enable(gpio_i2c7_platdata.sda_pin);	tegra_gpio_enable(gpio_i2c7_platdata.scl_pin);	platform_device_register(&n1_device_gpio_i2c7);	/* fmradio : si4709 */	if (system_rev >= 4) {		n1_fmradio_init(lpm_mode);		platform_device_register(&n1_device_gpio_i2c6);		i2c_register_board_info(6, sec_gpio_i2c6_info,			ARRAY_SIZE(sec_gpio_i2c6_info));		tegra_gpio_enable(gpio_i2c6_platdata.sda_pin);		tegra_gpio_enable(gpio_i2c6_platdata.scl_pin);	}	if (system_rev >= 4) {		platform_device_register(&tegra_gpio_i2c16_device);		tegra_gpio_enable(tegra_gpio_i2c16_pdata.sda_pin);		tegra_gpio_enable(tegra_gpio_i2c16_pdata.scl_pin);	}	if(system_rev >= 5) {		platform_device_register(&tegra_gpio_i2c17_device);		tegra_gpio_enable(tegra_gpio_i2c17_pdata.sda_pin);		tegra_gpio_enable(tegra_gpio_i2c17_pdata.scl_pin);	}	return 0;}
开发者ID:Kick-Buttowski,项目名称:samsung-stock-kernel,代码行数:76,


示例4: grouper_panel_init

int __init grouper_panel_init(void){	int err;	struct resource __maybe_unused *res;	struct board_info board_info;	tegra_get_board_info(&board_info);#if defined(CONFIG_TEGRA_NVMAP)	grouper_carveouts[1].base = tegra_carveout_start;	grouper_carveouts[1].size = tegra_carveout_size;#endif/*	gpio_request(grouper_lvds_avdd_en, "lvds_avdd_en");	gpio_direction_output(grouper_lvds_avdd_en, 1);	tegra_gpio_enable(grouper_lvds_avdd_en);	//gpio_request(grouper_lvds_stdby, "lvds_stdby");	//gpio_direction_output(grouper_lvds_stdby, 1);	//tegra_gpio_enable(grouper_lvds_stdby);	gpio_request(grouper_lvds_rst, "lvds_rst");	gpio_direction_output(grouper_lvds_rst, 1);	tegra_gpio_enable(grouper_lvds_rst);	if (board_info.fab == BOARD_FAB_A00) {		gpio_request(grouper_lvds_rs_a00, "lvds_rs");		gpio_direction_output(grouper_lvds_rs_a00, 0);		tegra_gpio_enable(grouper_lvds_rs_a00);	} else {		gpio_request(grouper_lvds_rs, "lvds_rs");		gpio_direction_output(grouper_lvds_rs, 0);		tegra_gpio_enable(grouper_lvds_rs);	}	gpio_request(grouper_lvds_lr, "lvds_lr");	gpio_direction_output(grouper_lvds_lr, 1);	tegra_gpio_enable(grouper_lvds_lr);*//*	gpio_request(grouper_lvds_shutdown, "lvds_shutdown");	gpio_direction_output(grouper_lvds_shutdown, 1);	tegra_gpio_enable(grouper_lvds_shutdown);*/	if( grouper_get_project_id() == GROUPER_PROJECT_BACH)	{		grouper_disp1_out.parent_clk = "pll_d_out0";		grouper_disp1_out.modes->pclk = 81750000;		grouper_disp1_out.modes->h_sync_width= 64;		grouper_disp1_out.modes->h_back_porch= 128;		grouper_disp1_out.modes->h_front_porch = 64;		printk("Bach: Set LCD pclk as %d Hz/n", grouper_disp1_out.modes->pclk);		gpio_request(TEGRA_GPIO_PV6, "gpio_v6");		tegra_gpio_enable(TEGRA_GPIO_PV6);	}	tegra_gpio_enable(grouper_hdmi_hpd);	gpio_request(grouper_hdmi_hpd, "hdmi_hpd");	gpio_direction_input(grouper_hdmi_hpd);#ifdef CONFIG_HAS_EARLYSUSPEND	grouper_panel_early_suspender.suspend = grouper_panel_early_suspend;	grouper_panel_early_suspender.resume = grouper_panel_late_resume;	grouper_panel_early_suspender.level = EARLY_SUSPEND_LEVEL_DISABLE_FB;	register_early_suspend(&grouper_panel_early_suspender);#endif#ifdef CONFIG_TEGRA_GRHOST	err = nvhost_device_register(&tegra_grhost_device);	if (err)		return err;#endif	err = platform_add_devices(grouper_gfx_devices,				ARRAY_SIZE(grouper_gfx_devices));#if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_DC)	res = nvhost_get_resource_byname(&grouper_disp1_device,					 IORESOURCE_MEM, "fbmem");	res->start = tegra_fb_start;	res->end = tegra_fb_start + tegra_fb_size - 1;#endif	/* Copy the bootloader fb to the fb. *///	tegra_move_framebuffer(tegra_fb_start, tegra_bootloader_fb_start,//				min(tegra_fb_size, tegra_bootloader_fb_size));#if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_DC)	if (!err)		err = nvhost_device_register(&grouper_disp1_device);	res = nvhost_get_resource_byname(&grouper_disp2_device,					 IORESOURCE_MEM, "fbmem");	res->start = tegra_fb2_start;	res->end = tegra_fb2_start + tegra_fb2_size - 1;	if (!err)		err = nvhost_device_register(&grouper_disp2_device);#endif//.........这里部分代码省略.........
开发者ID:filipkofron,项目名称:ubuntu-nexus7,代码行数:101,


示例5: ventana_nct1008_init

static void ventana_nct1008_init(void){	tegra_gpio_enable(NCT1008_THERM2_GPIO);	gpio_request(NCT1008_THERM2_GPIO, "temp_alert");	gpio_direction_input(NCT1008_THERM2_GPIO);}
开发者ID:ViViDboarder,项目名称:android_kernel_TF101,代码行数:6,


示例6: enterprise_panel_init

int __init enterprise_panel_init(void){	int err;	struct resource __maybe_unused *res;	bl_output = enterprise_bl_output_measured;	if (WARN_ON(ARRAY_SIZE(enterprise_bl_output_measured) != 256))		pr_err("bl_output array does not have 256 elements/n");	enterprise_dsi.chip_id = tegra_get_chipid();	enterprise_dsi.chip_rev = tegra_get_revision();	enterprise_carveouts[1].base = tegra_carveout_start;	enterprise_carveouts[1].size = tegra_carveout_size;	tegra_gpio_enable(enterprise_hdmi_hpd);	gpio_request(enterprise_hdmi_hpd, "hdmi_hpd");	gpio_direction_input(enterprise_hdmi_hpd);	tegra_gpio_enable(enterprise_lcd_2d_3d);	gpio_request(enterprise_lcd_2d_3d, "lcd_2d_3d");	gpio_direction_output(enterprise_lcd_2d_3d, 0);	enterprise_stereo_set_mode(enterprise_stereo.mode_2d_3d);	tegra_gpio_enable(enterprise_lcd_swp_pl);	gpio_request(enterprise_lcd_swp_pl, "lcd_swp_pl");	gpio_direction_output(enterprise_lcd_swp_pl, 0);	enterprise_stereo_set_orientation(enterprise_stereo.orientation);#if !(DC_CTRL_MODE & TEGRA_DC_OUT_ONE_SHOT_MODE)	tegra_gpio_enable(enterprise_lcd_te);	gpio_request(enterprise_lcd_swp_pl, "lcd_te");	gpio_direction_input(enterprise_lcd_te);#endif#ifdef CONFIG_HAS_EARLYSUSPEND	enterprise_panel_early_suspender.suspend = enterprise_panel_early_suspend;	enterprise_panel_early_suspender.resume = enterprise_panel_late_resume;	enterprise_panel_early_suspender.level = EARLY_SUSPEND_LEVEL_DISABLE_FB;	register_early_suspend(&enterprise_panel_early_suspender);#endif	err = platform_add_devices(enterprise_gfx_devices,				ARRAY_SIZE(enterprise_gfx_devices));#if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_DC)	res = nvhost_get_resource_byname(&enterprise_disp1_device,					 IORESOURCE_MEM, "fbmem");	res->start = tegra_fb_start;	res->end = tegra_fb_start + tegra_fb_size - 1;#endif	/* Copy the bootloader fb to the fb. */	tegra_move_framebuffer(tegra_fb_start, tegra_bootloader_fb_start,		min(tegra_fb_size, tegra_bootloader_fb_size));#if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_DC)	if (!err)		err = nvhost_device_register(&enterprise_disp1_device);	res = nvhost_get_resource_byname(&enterprise_disp2_device,					 IORESOURCE_MEM, "fbmem");	res->start = tegra_fb2_start;	res->end = tegra_fb2_start + tegra_fb2_size - 1;	if (!err)		err = nvhost_device_register(&enterprise_disp2_device);#endif#if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_NVAVP)	if (!err)		err = nvhost_device_register(&nvavp_device);#endif	if (!err)		err = platform_add_devices(enterprise_bl_devices,				ARRAY_SIZE(enterprise_bl_devices));	return err;}
开发者ID:AndroidRoot,项目名称:android_kernel_asus_tf201,代码行数:79,


示例7: enterprise_gps_init

static void enterprise_gps_init(void){	tegra_gpio_enable(TEGRA_GPIO_PE4);	tegra_gpio_enable(TEGRA_GPIO_PE5);}
开发者ID:sloanyang,项目名称:android_kernel_zte_u950,代码行数:5,


示例8: cardhu_panel_init

int __init cardhu_panel_init(void){	int err;	struct resource __maybe_unused *res;	tegra_get_board_info(&board_info);	tegra_get_display_board_info(&display_board_info);	cardhu_carveouts[1].base = tegra_carveout_start;	cardhu_carveouts[1].size = tegra_carveout_size;	if (board_info.board_id == BOARD_E1291 &&		((board_info.sku & SKU_TOUCHSCREEN_MECH_FIX) == 0)) {		/* use 55Hz panel timings to reduce noise on sensitive touch */		printk("Using cardhu_panel_modes_55hz/n");		cardhu_disp1_out.modes = cardhu_panel_modes_55hz;		cardhu_disp1_out.n_modes = ARRAY_SIZE(cardhu_panel_modes_55hz);	}#if defined(CONFIG_TEGRA_DC) && !defined(CONFIG_TEGRA_CARDHU_DSI)	if (display_board_info.board_id == BOARD_DISPLAY_PM313) {		/* initialize the values */#if defined(PM313_LVDS_PANEL_19X12)		cardhu_disp1_out.modes = panel_19X12_modes;		cardhu_disp1_out.n_modes = ARRAY_SIZE(panel_19X12_modes);		cardhu_disp1_out.parent_clk = "pll_d_out0";#if (PM313_LVDS_PANEL_BPP == 1)		cardhu_disp1_out.depth = 18;#else		cardhu_disp1_out.depth = 24;#endif		cardhu_fb_data.xres = 1920;		cardhu_fb_data.yres = 1200;		cardhu_disp2_out.parent_clk = "pll_d2_out0";		cardhu_hdmi_fb_data.xres = 1920;		cardhu_hdmi_fb_data.yres = 1200;#endif		/* lvds configuration */		err = gpio_request(pm313_R_FDE, "R_FDE");		err |= gpio_direction_output(pm313_R_FDE, 1);		tegra_gpio_enable(pm313_R_FDE);		err |= gpio_request(pm313_R_FB, "R_FB");		err |= gpio_direction_output(pm313_R_FB, 1);		tegra_gpio_enable(pm313_R_FB);		err |= gpio_request(pm313_MODE0, "MODE0");		err |= gpio_direction_output(pm313_MODE0, 1);		tegra_gpio_enable(pm313_MODE0);		err |= gpio_request(pm313_MODE1, "MODE1");		err |= gpio_direction_output(pm313_MODE1, 0);		tegra_gpio_enable(pm313_MODE1);		err |= gpio_request(pm313_BPP, "BPP");		err |= gpio_direction_output(pm313_BPP, PM313_LVDS_PANEL_BPP);		tegra_gpio_enable(pm313_BPP);		err = gpio_request(pm313_lvds_shutdown, "lvds_shutdown");		/* free ride provided by bootloader */		err |= gpio_direction_output(pm313_lvds_shutdown, 1);		tegra_gpio_enable(pm313_lvds_shutdown);		if (err)			printk(KERN_ERR "ERROR(s) in LVDS configuration/n");	}/*	else if ((display_board_info.board_id == BOARD_DISPLAY_E1247 &&				board_info.board_id == BOARD_PM269) ||				(board_info.board_id == BOARD_E1257) ||				(board_info.board_id == BOARD_PM305) ||				(board_info.board_id == BOARD_PM311)) {		gpio_request(e1247_pm269_lvds_shutdown, "lvds_shutdown");		gpio_direction_output(e1247_pm269_lvds_shutdown, 1);		tegra_gpio_enable(e1247_pm269_lvds_shutdown);	} else {		gpio_request(cardhu_lvds_shutdown, "lvds_shutdown");		gpio_direction_output(cardhu_lvds_shutdown, 1);		tegra_gpio_enable(cardhu_lvds_shutdown);	}*/#endif	tegra_gpio_enable(cardhu_hdmi_enb);	gpio_request(cardhu_hdmi_enb, "hdmi_5v_en");	gpio_direction_output(cardhu_hdmi_enb, 1);	tegra_gpio_enable(cardhu_hdmi_hpd);	gpio_request(cardhu_hdmi_hpd, "hdmi_hpd");	gpio_direction_input(cardhu_hdmi_hpd);#ifdef CONFIG_HAS_EARLYSUSPEND	cardhu_panel_early_suspender.suspend = cardhu_panel_early_suspend;	cardhu_panel_early_suspender.resume = cardhu_panel_late_resume;	cardhu_panel_early_suspender.level = EARLY_SUSPEND_LEVEL_DISABLE_FB;	register_early_suspend(&cardhu_panel_early_suspender);#endif	err = platform_add_devices(cardhu_gfx_devices,				ARRAY_SIZE(cardhu_gfx_devices));//.........这里部分代码省略.........
开发者ID:AndroidRoot,项目名称:kernel_tf201_stock,代码行数:101,


示例9: cardhu_dsi_panel_enable

static int cardhu_dsi_panel_enable(void){	int ret;	if (cardhu_dsi_reg == NULL) {		cardhu_dsi_reg = regulator_get(NULL, "avdd_dsi_csi");		if (IS_ERR_OR_NULL(cardhu_dsi_reg)) {		pr_err("dsi: Could not get regulator avdd_dsi_csi/n");			cardhu_dsi_reg = NULL;			return PTR_ERR(cardhu_dsi_reg);		}	}	regulator_enable(cardhu_dsi_reg);	ret = gpio_request(TEGRA_GPIO_PJ1, "DSI TE");	if (ret < 0)		return ret;	ret = gpio_direction_input(TEGRA_GPIO_PJ1);	if (ret < 0) {		gpio_free(TEGRA_GPIO_PJ1);		return ret;	}	tegra_gpio_enable(TEGRA_GPIO_PJ1);#if DSI_PANEL_219	ret = gpio_request(TEGRA_GPIO_PH0, "ph0");	if (ret < 0)		return ret;	ret = gpio_direction_output(TEGRA_GPIO_PH0, 0);	if (ret < 0) {		gpio_free(TEGRA_GPIO_PH0);		return ret;	}	else		tegra_gpio_enable(TEGRA_GPIO_PH0);	ret = gpio_request(TEGRA_GPIO_PH2, "ph2");	if (ret < 0)		return ret;	ret = gpio_direction_output(TEGRA_GPIO_PH2, 0);	if (ret < 0) {		gpio_free(TEGRA_GPIO_PH2);		return ret;	}	else		tegra_gpio_enable(TEGRA_GPIO_PH2);	ret = gpio_request(TEGRA_GPIO_PU2, "pu2");	if (ret < 0)		return ret;	ret = gpio_direction_output(TEGRA_GPIO_PU2, 0);	if (ret < 0) {		gpio_free(TEGRA_GPIO_PU2);		return ret;	}	else		tegra_gpio_enable(TEGRA_GPIO_PU2);	gpio_set_value(cardhu_lvds_shutdown, 1);	mdelay(20);	gpio_set_value(TEGRA_GPIO_PH0, 1);	mdelay(10);	gpio_set_value(TEGRA_GPIO_PH2, 1);	mdelay(15);	gpio_set_value(TEGRA_GPIO_PU2, 0);	gpio_set_value(TEGRA_GPIO_PU2, 1);	mdelay(10);	gpio_set_value(TEGRA_GPIO_PU2, 0);	mdelay(10);	gpio_set_value(TEGRA_GPIO_PU2, 1);	mdelay(15);#endif#if DSI_PANEL_218	printk("DSI_PANEL_218 is enabled/n");	ret = gpio_request(AVDD_LCD, "avdd_lcd");	if(ret < 0)		gpio_free(AVDD_LCD);	ret = gpio_direction_output(AVDD_LCD, 1);	if(ret < 0)		gpio_free(AVDD_LCD);	else		tegra_gpio_enable(AVDD_LCD);#if DSI_PANEL_RESET	ret = gpio_request(TEGRA_GPIO_PD2, "pd2");	if (ret < 0){		return ret;	}	ret = gpio_direction_output(TEGRA_GPIO_PD2, 0);	if (ret < 0) {		gpio_free(TEGRA_GPIO_PD2);		return ret;	}	else		tegra_gpio_enable(TEGRA_GPIO_PD2);	gpio_set_value(TEGRA_GPIO_PD2, 1);//.........这里部分代码省略.........
开发者ID:AndroidRoot,项目名称:kernel_tf201_stock,代码行数:101,


示例10: baseband_init

static int baseband_init(void){//zte_modify nv patch begin#if 0	int irq;#endif//zte_modify nv patch end	int ret;	ret = gpio_request_array(modem_gpios, ARRAY_SIZE(modem_gpios));	if (ret)		return ret;	//[ECID:000000]ZTEBSP DangXiao 20120206 start, for ACM0 missing patch	/* enable pull-down for BB_RST_OUT */	tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_UAC,				    TEGRA_PUPD_PULL_DOWN);	//[ECID:000000]ZTEBSP DangXiao 20120206 start, for ACM0 missing patch	tegra_gpio_enable(MODEM_PWR_ON);	tegra_gpio_enable(MODEM_RESET);	tegra_gpio_enable(AP2MDM_ACK2);//zte_modify nv patch begin#if 0	tegra_gpio_enable(BB_RST_OUT);#endif//zte_modify nv patch end	tegra_gpio_enable(AP2MDM_ACK);	tegra_gpio_enable(MDM2AP_ACK);	tegra_gpio_enable(TEGRA_GPIO_PY3);	tegra_gpio_enable(TEGRA_GPIO_PY1);	tegra_gpio_enable(TEGRA_GPIO_PO1);	tegra_gpio_enable(TEGRA_GPIO_PO2);	/* export GPIO for user space access through sysfs */	gpio_export(MODEM_PWR_ON, false);//zte_modify nv patch begin	gpio_export(AP2MDM_ACK2, false);//zte_modify nv patch end	/* phy init */	tegra_start_usb_host();//zte_modify nv patch begin#if 0	wake_lock_init(&mdm_wake_lock, WAKE_LOCK_SUSPEND, "mdm_lock");	/* enable IRQ for BB_RST_OUT */	irq = gpio_to_irq(BB_RST_OUT);	ret = request_threaded_irq(irq, NULL, mdm_start_thread,				   IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,				   "mdm_start", NULL);	if (ret < 0) {		pr_err("%s: request_threaded_irq error/n", __func__);		return ret;	}	ret = enable_irq_wake(irq);	if (ret) {		pr_err("%s: enable_irq_wake error/n", __func__);		free_irq(irq, NULL);		return ret;	}#endif//zte_modify nv patch end	return 0;}
开发者ID:sparkma,项目名称:kernel,代码行数:67,


示例11: ventana_akm8975_init

static void ventana_akm8975_init(void){	tegra_gpio_enable(AKM8975_IRQ_GPIO);	gpio_request(AKM8975_IRQ_GPIO, "akm8975");	gpio_direction_input(AKM8975_IRQ_GPIO);}
开发者ID:ViViDboarder,项目名称:android_kernel_TF101,代码行数:6,


示例12: pcbid_init

static int pcbid_init(void){	int ret;	ret = gpio_request(TEGRA_GPIO_PR4, "PCB_ID0");	if (ret) {		gpio_free(TEGRA_GPIO_PR4);		return ret;        }	ret = gpio_request(TEGRA_GPIO_PR5, "PCB_ID1");	if (ret) {		gpio_free(TEGRA_GPIO_PR4);		gpio_free(TEGRA_GPIO_PR5);		return ret;        }	ret = gpio_request(TEGRA_GPIO_PQ4, "PCB_ID2");	if (ret) {		gpio_free(TEGRA_GPIO_PR4);		gpio_free(TEGRA_GPIO_PR5);		gpio_free(TEGRA_GPIO_PQ4);		return ret;        }	ret = gpio_request(TEGRA_GPIO_PQ7, "PCB_ID3");	if (ret) {		gpio_free(TEGRA_GPIO_PR4);		gpio_free(TEGRA_GPIO_PR5);		gpio_free(TEGRA_GPIO_PQ4);		gpio_free(TEGRA_GPIO_PQ7);		return ret;        }	ret = gpio_request(TEGRA_GPIO_PR2, "PCB_ID4");	if (ret) {		gpio_free(TEGRA_GPIO_PR4);		gpio_free(TEGRA_GPIO_PR5);		gpio_free(TEGRA_GPIO_PQ4);		gpio_free(TEGRA_GPIO_PQ7);		gpio_free(TEGRA_GPIO_PR2);		return ret;        }	ret = gpio_request(TEGRA_GPIO_PQ5, "PCB_ID5");	if (ret) {		gpio_free(TEGRA_GPIO_PR4);		gpio_free(TEGRA_GPIO_PR5);		gpio_free(TEGRA_GPIO_PQ4);		gpio_free(TEGRA_GPIO_PQ7);		gpio_free(TEGRA_GPIO_PR2);		gpio_free(TEGRA_GPIO_PQ5);		return ret;        }	ret = gpio_request(TEGRA_GPIO_PJ0, "PCB_ID6");	if (ret) {		gpio_free(TEGRA_GPIO_PR4);		gpio_free(TEGRA_GPIO_PR5);		gpio_free(TEGRA_GPIO_PQ4);		gpio_free(TEGRA_GPIO_PQ7);		gpio_free(TEGRA_GPIO_PR2);		gpio_free(TEGRA_GPIO_PQ5);		gpio_free(TEGRA_GPIO_PJ0);		return ret;	}	ret = gpio_request(TEGRA_GPIO_PJ2, "PCB_ID7");	if (ret) {		gpio_free(TEGRA_GPIO_PR4);		gpio_free(TEGRA_GPIO_PR5);		gpio_free(TEGRA_GPIO_PQ4);		gpio_free(TEGRA_GPIO_PQ7);		gpio_free(TEGRA_GPIO_PR2);		gpio_free(TEGRA_GPIO_PQ5);		gpio_free(TEGRA_GPIO_PJ0);		gpio_free(TEGRA_GPIO_PJ2);		return ret;        }	ret = gpio_request(TEGRA_GPIO_PK3, "PCB_ID8");	if (ret) {		gpio_free(TEGRA_GPIO_PR4);		gpio_free(TEGRA_GPIO_PR5);		gpio_free(TEGRA_GPIO_PQ4);		gpio_free(TEGRA_GPIO_PQ7);		gpio_free(TEGRA_GPIO_PR2);		gpio_free(TEGRA_GPIO_PQ5);		gpio_free(TEGRA_GPIO_PJ0);		gpio_free(TEGRA_GPIO_PJ2);		gpio_free(TEGRA_GPIO_PK3);		return ret;        }	tegra_gpio_enable(TEGRA_GPIO_PR4);	tegra_gpio_enable(TEGRA_GPIO_PR5);	tegra_gpio_enable(TEGRA_GPIO_PQ4);	tegra_gpio_enable(TEGRA_GPIO_PQ7);	tegra_gpio_enable(TEGRA_GPIO_PR2);	tegra_gpio_enable(TEGRA_GPIO_PQ5);//.........这里部分代码省略.........
开发者ID:TheRat,项目名称:Asus-Prime-Kernel-8.8.3.23,代码行数:101,


示例13: ventana_bq20z75_init

static void ventana_bq20z75_init(void){	tegra_gpio_enable(AC_PRESENT_GPIO);	gpio_request(AC_PRESENT_GPIO, "ac_present");	gpio_direction_input(AC_PRESENT_GPIO);}
开发者ID:ViViDboarder,项目名称:android_kernel_TF101,代码行数:6,


示例14: ifx_spi_probe

static intifx_spi_probe(struct spi_device *spi){	int status;	struct ifx_spi_data *spi_data;	/* Allocate SPI driver data */	spi_data = (struct ifx_spi_data*)kmalloc(sizeof(struct ifx_spi_data), GFP_KERNEL);	memset(spi_data, 0, sizeof(struct ifx_spi_data)) ;	if (!spi_data){		return -ENOMEM;    }    status = ifx_spi_allocate_frame_memory(IFX_SPI_MAX_BUF_SIZE + IFX_SPI_HEADER_SIZE);    if(status != 0){	printk("File: ifx_n721_spi.c/tFunction: int ifx_spi_probe/tFailed to allocate memory for buffers/n");	return -ENOMEM;    }    dev_set_drvdata(&spi->dev,spi_data);    spin_lock_init(&spi_data->spi_lock);    spi_data->ifx_wq = create_singlethread_workqueue("ifxn721");    if(!spi_data->ifx_wq){		printk("Failed to setup workqueue - ifx_wq /n");    }	INIT_WORK(&spi_data->ifx_work,ifx_spi_handle_work);	init_completion(&spi_data->ifx_read_write_completion);        /* Configure SPI */	spi_data->spi = spi;#if 1	// spi->mode = SPI_MODE_1 | SPI_CS_HIGH | SPI_NO_CS;	spi->mode = SPI_MODE_1 | SPI_CS_HIGH | SPI_NO_CS;	// spi->mode = SPI_MODE_0 | SPI_CS_HIGH ;    // spi->bits_per_word = 8;    spi->bits_per_word = 8;	spi->max_speed_hz = SPI_CLOCK;	spi->chip_select = 0 ;	//spi->irq = gpio_to_irq(TEGRA_GPIO_PO5);//0;	memcpy(spi->modalias, "ifxn721", sizeof("ifxn721")) ;//#endif	status = spi_setup(spi);    if(status < 0){		printk("Failed to setup SPI /n");    }// hgahn//	spi_data->ifx_spi_lock =1;	/* Enable SRDY Interrupt request - If the SRDY signal is high then ifx_spi_handle_srdy_irq() is called */	//status = request_irq(spi->irq, ifx_spi_handle_srdy_irq,  IRQF_TRIGGER_RISING, spi->dev.driver->name, spi_data);	gpio_request(TEGRA_GPIO_PO0, "ifx_mrdy"); 	tegra_gpio_enable(TEGRA_GPIO_PO0);	gpio_request(TEGRA_GPIO_PO5, "ifx_srdy"); 	tegra_gpio_enable(TEGRA_GPIO_PO5);	// gpio_set_value(TEGRA_GPIO_PO0, 0);	gpio_direction_output(TEGRA_GPIO_PO0, 0);	gpio_direction_input(TEGRA_GPIO_PO5);	spi->irq = gpio_to_irq(TEGRA_GPIO_PO5) ;    // enable gpios for modem shutdown    //tegra_gpio_enable(GPIO_IFX_RESET_1V8_N);    //tegra_gpio_enable(GPIO_IFX_PWRON_1V8);    //gpio_request_one(GPIO_IFX_RESET_1V8_N, GPIOF_IN, "modem_reset_n");    //gpio_request_one(GPIO_IFX_PWRON_1V8, GPIOF_OUT_INIT_HIGH, "modem_pwron");	spi_data->is_suspend = 0 ;	spi_data->packet_count = 0 ;	status = request_irq(spi->irq, ifx_spi_handle_srdy_irq,IRQF_TRIGGER_RISING ,spi->dev.driver->name, spi_data);	if(is_modem_connected()){		set_irq_wake(spi->irq, 1);	}	else {		disable_irq(spi->irq);	}//20100927-1, [email
C++ tegra_pinmux_config_table函数代码示例
C++ tegra_gpio_disable函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。