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

C++ script_parser_fetch函数代码示例

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

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



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

示例1: mali_platform_init

_mali_osk_errcode_t mali_platform_init(_mali_osk_resource_t *resource)
{
	unsigned long rate;
	int clk_div;
	int mali_used = 0;
	
	//get mali ahb clock
	h_ahb_mali = clk_get(NULL, "ahb_mali");
	if(!h_ahb_mali){
		MALI_PRINT(("try to get ahb mali clock failed!\n"));
	}
	//get mali clk
	h_mali_clk = clk_get(NULL, "mali");
	if(!h_mali_clk){
		MALI_PRINT(("try to get mali clock failed!\n"));
	}

	h_ve_pll = clk_get(NULL, "ve_pll");
	if(!h_ve_pll){
		MALI_PRINT(("try to get ve pll clock failed!\n"));
	}

	//set mali parent clock
	if(clk_set_parent(h_mali_clk, h_ve_pll)){
		MALI_PRINT(("try to set mali clock source failed!\n"));
	}
	
	//set mali clock
	rate = clk_get_rate(h_ve_pll);

	if(!script_parser_fetch("mali_para", "mali_used", &mali_used, 1)) {
		if (mali_used == 1) {
			if (!script_parser_fetch("mali_para", "mali_clkdiv", &clk_div, 1)) {
				if (clk_div > 0) {
					pr_info("mali: use config clk_div %d\n", clk_div);
					mali_clk_div = clk_div;
				}
			}
		}
	}

	pr_info("mali: clk_div %d\n", mali_clk_div);
	rate /= mali_clk_div;

	if(clk_set_rate(h_mali_clk, rate)){
		MALI_PRINT(("try to set mali clock failed!\n"));
	}
	
	if(clk_enable(h_ahb_mali)){
		MALI_PRINT(("try to enable mali ahb failed!\n"));
	}
	if(clk_enable(h_mali_clk)){
		MALI_PRINT(("try to enable mali clock failed!\n"));
	}
	if(clk_reset(h_mali_clk,0)){
		MALI_PRINT(("try to reset release failed!\n"));
	}
	MALI_PRINT(("mali clock set completed, clock is  %d Mhz\n", rate));
    MALI_SUCCESS;
}
开发者ID:aauer1,项目名称:android_device_allwinner_common-sun5i,代码行数:60,代码来源:mali_platform.c


示例2: dht22_sun5i_init_driver

/* Init driver */
static int __init dht22_sun5i_init_driver() {
    int err = 0;
    int dht22_used = 0;
    script_gpio_set_t info;

    dht22_sun5i_proc = proc_mkdir("dht22", NULL);
    create_proc_read_entry("raw_data", 0444, dht22_sun5i_proc, dht22_sun5i_proc_read, NULL);

    err = script_parser_fetch("dht22_para", "dht22_used", &dht22_used, sizeof (dht22_used) / sizeof (int));
    if (!dht22_used || err) {
        printk(KERN_INFO "%s: dht22-bus is not used in config\n", __FUNCTION__);
        return -EINVAL;
    }

    err = script_parser_fetch("dht22_para", "dht22_pin", (int *) &info, sizeof (script_gpio_set_t));
    if (err) {
        printk(KERN_INFO "%s: can not get \"dht22_para\" \"dht22_pin\" gpio handler, already used by others?", __FUNCTION__);
        return -EBUSY;
    }
    dht22_sun5i_gpio_handler = gpio_request_ex("dht22_para", "dht22_pin");
    dht22_sun5i_gpio_direction = PIN_DIR_OUT;
    PIN_DIR(PIN_DIR_OUT);

    return 0;
}
开发者ID:funordie,项目名称:a13-kernel-modules,代码行数:26,代码来源:dht22-sun5i.c


示例3: get_usb_cfg

/*
*******************************************************************************
*                     get_usb_cfg
*
* Description:
*    void
*
* Parameters:
*    void
*
* Return value:
*    void
*
* note:
*    void
*
*******************************************************************************
*/
static s32 get_usb_cfg(struct sw_hci_hcd *sw_hci)
{
	__s32 ret = 0;

	/* usbc enable */
	ret = script_parser_fetch(usbc_name[sw_hci->usbc_no], "usb_used", (int *)&sw_hci->used, 64);
	if(ret != 0){
		DMSG_PANIC("ERR: get usbc2 enable failed\n");
		//return -1;
	}

	/* request gpio */
	ret = script_parser_fetch(usbc_name[sw_hci->usbc_no], "usb_drv_vbus_gpio", (int *)&sw_hci->drv_vbus_gpio_set, 64);
	if(ret != 0){
		DMSG_PANIC("ERR: get usbc%d(%s) id failed\n", sw_hci->usbc_no, usbc_name[sw_hci->usbc_no]);
		return -1;
	}

	/* host_init_state */
	ret = script_parser_fetch(usbc_name[sw_hci->usbc_no], "usb_host_init_state", (int *)&(sw_hci->host_init_state), 64);
	if(ret != 0){
		DMSG_PANIC("ERR: script_parser_fetch host_init_state failed\n");
		return -1;
	}

	return 0;
}
开发者ID:mantrid,项目名称:linux-allwinner,代码行数:45,代码来源:sw_hci_sun5i.c


示例4: ap6210_gpio_wifi_get_res

static int ap6210_gpio_wifi_get_res(void)
{
	struct ap6210_gpio_wifi_ops *ops = &ap6210_wifi_select_pm_ops;

	if (SCRIPT_PARSER_OK != script_parser_fetch(wifi_para, "wifi_used", &ops->wifi_used, 1)) {
		AP6210_ERR("parse wifi_used failed in script.fex.\n" );
		return -1;
	}
	if (!ops->wifi_used) {
		AP6210_ERR("wifi pm disable in script.fex.\n" );
		return -1;
	}

	if (SCRIPT_PARSER_OK != script_parser_fetch(wifi_para, "wifi_sdc_id", &ops->sdio_id, 1)) {
		AP6210_ERR("parse wifi_sdc_id in script.fex failed.\n" );
		return -1;
	}

	if (SCRIPT_PARSER_OK != script_parser_fetch(wifi_para, "wifi_usbc_id", &ops->usb_id, 1)) {
		AP6210_ERR("parse wifi_sdc_id in script.fex failed.\n" );
		return -1;
	}

	if (SCRIPT_PARSER_OK != script_parser_fetch(wifi_para, "wifi_mod_sel", &ops->module_sel, 1)) {
		AP6210_ERR("parse wifi_sdc_id in script.fex failed.\n" );
		return -1;
	}

	ops->mod_name = ap6210_gpio_wifi_get_name(ops->module_sel);
	
	AP6210_ERR("select wifi %s\n", ops->mod_name);

	return 0;
}
开发者ID:GetOcean,项目名称:ocean-os-drivers,代码行数:34,代码来源:ap6210_gpio_wifi.c


示例5: sunxi_pwm_get_sys_config

void sunxi_pwm_get_sys_config(int pwm)
{
    int ret, val;
    char primary_key[25];
    user_gpio_set_t gpio_info[1];

    sprintf(primary_key, "pwm%d_para", pwm);
    ret = script_parser_fetch(primary_key, "pwm_used", &val, 1);
    if(ret < 0) {
        pwm_debug("fetch script data fail\n");
        } else {
            if(val == 1) {
                ret = script_parser_fetch(primary_key, "pwm_positive", (int *)&gpio_info, sizeof(user_gpio_set_t) / sizeof(int));
                if(ret < 0) {
                    pwm_debug("fetch script data fail\n");
                    } else {
                        pwm_pin_count[pwm]++;
                        memcpy(&pwm_gpio_info[pwm][0], gpio_info, sizeof(user_gpio_set_t));
                        }

                ret = script_parser_fetch(primary_key, "pwm_negative", (int *)&gpio_info, sizeof(user_gpio_set_t) / sizeof(int));
                if(ret < 0) {
                    pwm_debug("fetch script data fail\n");
                    } else {
                        pwm_pin_count[pwm]++;
                        memcpy(&pwm_gpio_info[pwm][1], gpio_info, sizeof(user_gpio_set_t));
                        }
                }
            }
}
开发者ID:GREYFOXRGR,项目名称:BPI-M3-bsp,代码行数:30,代码来源:sunxi-pwm.c


示例6: modify_system_uart

int modify_system_uart(void)
{
    script_gpio_set_t fetch_cfg_gpio[2];
    int uart_port_id = 0;
    char uartname[16] ;
    char uart_data[8] ;
    int sdc0_used = 0;

    if(script_parser_fetch("force_uart_para","force_uart_rx",(int *)(&fetch_cfg_gpio[0]),sizeof(script_gpio_set_t)/4))
    {
        printf("debug_mode_error: can't find force_uart_rx \n");
        return -1;
    }
    if(script_parser_fetch("force_uart_para","force_uart_tx",(int *)(&fetch_cfg_gpio[1]),sizeof(script_gpio_set_t)/4))
    {
        printf("debug_mode_error: can't find force_uart_tx \n");
        return -1;
    }
    if(script_parser_fetch("force_uart_para","force_uart_port",(int *)(&uart_port_id),sizeof(int)/4))
    {
        printf("debug_mode_error: can't find card0_tx \n");
        return -1;
    }
    memset(uartname,0,16);
    memset(uart_data,0,8);
#if defined (CONFIG_ARCH_SUN7I) ||defined(CONFIG_ARCH_SUN8IW1P1)
    strcat(uartname,"uart_para");
#else
	strcat(uartname,"uart");
#endif
    sprintf(uart_data,"%d",uart_port_id);
    strcat(uartname,uart_data);
    printf("the uartname is %s  \n",uartname);
    if(script_parser_patch(uartname,"uart_port",(int *)(&uart_port_id),sizeof(int)/4))
    {
        printf("debug_mode_error : can't find uart_debug_port \n");
        return -1;
    }
    if(script_parser_patch(uartname,"uart_rx",(void*)&fetch_cfg_gpio[0],sizeof(script_gpio_set_t)/4))
    {
        printf("debug_mode_error : can't patch uart_debug_rx\n");
        return -1;
    }
    if(script_parser_patch(uartname,"uart_tx",(void*)&fetch_cfg_gpio[1],sizeof(script_gpio_set_t)/4))
    {
        printf("debug_mode_error : can't patch uart_debug_rx\n");
        return -1;
    }
//disable card0 init in linux
    if(script_parser_patch("mmc0_para","sdc_used",(int *)(&sdc0_used),sizeof(int)/4))
    {
        printf("debug_mode_error :can not patch sdc_used \n");
        return -1;
    }
    return 0;
}
开发者ID:mfkiwl,项目名称:a33_bootloader,代码行数:56,代码来源:board_common.c


示例7: check_physical_key_early

int check_physical_key_early(void)
{
	user_gpio_set_t	gpio_recovery;
	__u32 gpio_hd;
	int ret;
	int gpio_value = 0;
	int used = 0;
	int mode = 0;

	if(uboot_spare_head.boot_data.work_mode != WORK_MODE_BOOT)
	{
		return 0;
	}

	ret = script_parser_fetch("recovery_para", "used", (int *)&used, sizeof(int) / 4);
	if (ret || !used)
	{
		printf("[recovery] no use\n");
		return 0;
	}
	ret = script_parser_fetch("recovery_para", "recovery_key", (int *)&gpio_recovery, sizeof(user_gpio_set_t) / 4);
  if (!ret)
	{
		gpio_recovery.mul_sel = 0;		//强制设置成输入
		gpio_hd = gpio_request(&gpio_recovery, 1);
		if (gpio_hd)
		{
			int time;
			gpio_value = 0;
			for(time = 0; time < 4; time++)
			{
				gpio_value += gpio_read_one_pin_value(gpio_hd, 0);
				__msdelay(5);
			}
			if (!gpio_value)
			{
				printf("[box recovery] find the key\n");
				script_parser_fetch("recovery_para", "mode", (int *)&mode, sizeof(int) / 4);
				if (mode == ONEKEY_USB_RECOVERY_MODE)
				{
					gd->key_pressd_value = USB_RECOVERY_KEY_VALUE;
				}
				else if (mode == ONEKEY_SPRITE_RECOVERY_MODE)
				{
					gd->key_pressd_value = SPRITE_RECOVERY_KEY_VALUE;
					uboot_spare_head.boot_data.work_mode = WORK_MODE_SPRITE_RECOVERY;
				}
				else
				{
					printf("[recovery] no option for one key recovery's mode (%d)\n", mode);
				}
			}
		}
	}
	return 0;
}
开发者ID:Ronchou,项目名称:OrangePI-Kernel,代码行数:56,代码来源:board_common.c


示例8: check_boot_recovery_key

int check_boot_recovery_key(void)
{
	user_gpio_set_t	gpio_recovery;
	__u32 gpio_hd;
	int ret;
	int gpio_value = 0;
	int used = 0;
	int mode = 0;

	if(uboot_spare_head.boot_data.work_mode != WORK_MODE_BOOT)
	{
		return 0;
	}
	
	ret = script_parser_fetch("recovery_para", "used", (int *)&used, sizeof(int) / 4);
	if (ret || !used)
	{
		printf("[recovery] no use\n");
		return 0;
	}
	ret = script_parser_fetch("recovery_para", "recovery_key", (int *)&gpio_recovery, sizeof(user_gpio_set_t) / 4);
  if (!ret)
	{
		gpio_recovery.mul_sel = 0;		//强制设置成输入
		gpio_hd = gpio_request(&gpio_recovery, 1);
		if (gpio_hd)
		{
			int time;
			gpio_value = 0;
			for(time = 0; time < 4; time++)
			{
				gpio_value += gpio_read_one_pin_value(gpio_hd, 0);
				__msdelay(5);
			}
			if (!gpio_value)
			{
				script_parser_fetch("recovery_para", "mode", (int *)&mode, sizeof(int) / 4);
				if (mode == ONEKEY_USB_RECOVERY)
				{
					printf("set to one key usb recovery\n");
					write_usb_recovery_to_misc();
				}
				else if (mode == ONEKEY_SPRITE_RECOVERY)
				{
					printf("set to one key sprite recovery\n");
					setenv("bootcmd", "sprite_recovery");
				}
				else
				{
					printf("[recovery] no option for one key recovery's mode\n");
				}
			}
		}
	}
	return 0;
}
开发者ID:mfkiwl,项目名称:a33_bootloader,代码行数:56,代码来源:board_common.c


示例9: tkey_fetch_sysconfig_para

/**
 * tkey_fetch_sysconfig_para - get config info from sysconfig.fex file.
 * return value:  
 *                    = 0; success;
 *                    < 0; err
 */
static int tkey_fetch_sysconfig_para(void)
{
	int ret = -1;
	int device_used = -1;
	__u32 twi_addr = 0;

	char name[I2C_NAME_SIZE];
	script_parser_value_type_t type = SCIRPT_PARSER_VALUE_TYPE_STRING;
	
	//__u32 twi_id = 0;

	printk("========HV Inital ===================\n");
	if(SCRIPT_PARSER_OK != script_parser_fetch("tkey_para", "tkey_used", &device_used, 1)){
	                pr_err("hv_keyboard: script_parser_fetch err. \n");
	                goto script_parser_fetch_err;
	}
	if(1 == device_used){
		if(SCRIPT_PARSER_OK != script_parser_fetch_ex("tkey_para", "tkey_name", (int *)(&name), &type, sizeof(name)/sizeof(int))){
			pr_err("%s: script_parser_fetch err. \n", __func__);
			goto script_parser_fetch_err;
		}
		if(strcmp(HV_NAME, name)){
			pr_err("%s: name %s does not match HV_NAME. \n", __func__, name);
			pr_err(HV_NAME);
			//ret = 1;
			return ret;
		}
		if(SCRIPT_PARSER_OK != script_parser_fetch("tkey_para", "tkey_twi_addr", &twi_addr, sizeof(twi_addr)/sizeof(__u32))){
			pr_err("%s: script_parser_fetch err. \n", name);
			goto script_parser_fetch_err;
		}
		u_i2c_addr.dirty_addr_buf[0] = twi_addr;
		u_i2c_addr.dirty_addr_buf[1] = I2C_CLIENT_END;
		printk("%s: after: tkey_twi_addr is 0x%x, dirty_addr_buf: 0x%hx. dirty_addr_buf[1]: 0x%hx \n", \
		__func__, twi_addr, u_i2c_addr.dirty_addr_buf[0], u_i2c_addr.dirty_addr_buf[1]);
		
		if(SCRIPT_PARSER_OK != script_parser_fetch("tkey_para", "tkey_twi_id", &twi_id, 1)){
			pr_err("%s: script_parser_fetch err. \n", name);
			goto script_parser_fetch_err;
		}
		printk("%s: tkey_twi_id is %d. \n", __func__, twi_id);
		
	}else{
		pr_err("%s: tkey_unused. \n",  __func__);
		ret = -1;
	}

	return 0;

script_parser_fetch_err:
	pr_notice("=========script_parser_fetch_err============\n");
	return ret;

}
开发者ID:Michael-Pizzileo,项目名称:lichee_linux-3.0,代码行数:60,代码来源:hv2605.c


示例10: gsensor_fetch_sysconfig_para

/**
 * gsensor_fetch_sysconfig_para - get config info from sysconfig.fex file.
 * return value:  
 *                    = 0; success;
 *                    < 0; err
 */
static int gsensor_fetch_sysconfig_para(void)
{
	int ret = -1;
	int device_used = -1;
	__u32 twi_addr = 0;
	char name[I2C_NAME_SIZE];
	script_parser_value_type_t type = SCRIPT_PARSER_VALUE_TYPE_STRING;
		
	printk("========%s===================\n", __func__);
	 
	if(SCRIPT_PARSER_OK != (ret = script_parser_fetch("gsensor_para", "gsensor_used", &device_used, 1))){
	                pr_err("%s: script_parser_fetch err.ret = %d. \n", __func__, ret);
	                goto script_parser_fetch_err;
	}
	if(1 == device_used){
		if(SCRIPT_PARSER_OK != script_parser_fetch_ex("gsensor_para", "gsensor_name", (int *)(&name), &type, sizeof(name)/sizeof(int))){
			pr_err("%s: line: %d script_parser_fetch err. \n", __func__, __LINE__);
			goto script_parser_fetch_err;
		}
		if(strcmp(SENSOR_NAME, name)){
			pr_err("%s: name %s does not match SENSOR_NAME. \n", __func__, name);
			pr_err(SENSOR_NAME);
			//ret = 1;
			return ret;
		}
		if(SCRIPT_PARSER_OK != script_parser_fetch("gsensor_para", "gsensor_twi_addr", &twi_addr, sizeof(twi_addr)/sizeof(__u32))){
			pr_err("%s: line: %d: script_parser_fetch err. \n", name, __LINE__);
			goto script_parser_fetch_err;
		}
		u_i2c_addr.dirty_addr_buf[0] = twi_addr;
		u_i2c_addr.dirty_addr_buf[1] = I2C_CLIENT_END;
		printk("%s: after: gsensor_twi_addr is 0x%x, dirty_addr_buf: 0x%hx. dirty_addr_buf[1]: 0x%hx \n", \
			__func__, twi_addr, u_i2c_addr.dirty_addr_buf[0], u_i2c_addr.dirty_addr_buf[1]);

		if(SCRIPT_PARSER_OK != script_parser_fetch("gsensor_para", "gsensor_twi_id", &twi_id, 1)){
			pr_err("%s: script_parser_fetch err. \n", name);
			goto script_parser_fetch_err;
		}
		printk("%s: twi_id is %d. \n", __func__, twi_id);
		
		ret = 0;
		
	}else{
		pr_err("%s: gsensor_unused. \n",  __func__);
		ret = -1;
	}

	return ret;

script_parser_fetch_err:
	pr_notice("=========script_parser_fetch_err============\n");
	return ret;

}
开发者ID:EddyKuo,项目名称:linux-sdk-kernel-source,代码行数:60,代码来源:bma250.c


示例11: detect_other_boot_mode

/*
************************************************************************************************************
*
*                                             function
*
*    name          :
*
*    parmeters     :
*
*    return        :
*
*    note          :
*
*
************************************************************************************************************
*/
static int detect_other_boot_mode(void)
{
    int ret1, ret2;
	int key_high, key_low;
	int keyvalue;
	int user_mode_used = 0;
	keyvalue = gd->key_pressd_value;
	printf("key %d\n", keyvalue);
	script_parser_fetch("platform", "user_mode_used", &user_mode_used, 1);
	if(user_mode_used)
	{
		if(keyvalue >0)
		{
			return USER_SELECT_MODE;
		}
	}
	else
	{
	    ret1 = script_parser_fetch("recovery_key", "key_max", &key_high, 1);
		ret2 = script_parser_fetch("recovery_key", "key_min", &key_low,  1);
		if((ret1) || (ret2))
		{
			printf("cant find rcvy value\n");
		}
		else
		{
			printf("recovery key high %d, low %d\n", key_high, key_low);
			if((keyvalue >= key_low) && (keyvalue <= key_high))
			{
				printf("key found, android recovery\n");

				return ANDROID_RECOVERY_MODE;
			}
		}
	    ret1 = script_parser_fetch("fastboot_key", "key_max", &key_high, 1);
		ret2 = script_parser_fetch("fastboot_key", "key_min", &key_low, 1);
		if((ret1) || (ret2))
		{
			printf("cant find fstbt value\n");
		}
		else
		{
			printf("fastboot key high %d, low %d\n", key_high, key_low);
			if((keyvalue >= key_low) && (keyvalue <= key_high))
			{
				printf("key found, android fastboot\n");
				return ANDROID_FASTBOOT_MODE;
			}
		}
	}
	return ANDROID_NULL_MODE;
}
开发者ID:Ronchou,项目名称:OrangePI-Kernel,代码行数:68,代码来源:board_common.c


示例12: sun4i_vibrator_init

static int __init sun4i_vibrator_init(void)
{
	int vibe_used;
	int err = -1;

	pr_info("hello, sun4i_vibrator init\n");
	err = script_parser_fetch("motor_para", "motor_used",
					&vibe_used, sizeof(vibe_used)/sizeof(int));
	if(err) {
		pr_err("%s script_parser_fetch \"motor_para\" \"motor_used\" error = %d\n",
				__FUNCTION__, err);
		goto exit;
	}

	if(!vibe_used) {
		pr_err("%s motor is not used in config\n", __FUNCTION__);
		err = -1;
		goto exit;
	}

	err = script_parser_fetch("motor_para", "motor_shake",
					(int *)&vibe_gpio, sizeof(vibe_gpio)/sizeof(int));

	if(err) {
		pr_err("%s script_parser_fetch \"motor_para\" \"motor_shaked\" error = %d\n",
				__FUNCTION__, err);
		goto exit;
	}

	vibe_off = vibe_gpio.data;
	pr_debug("vibe_off is %d\n", vibe_off);

	vibe_gpio_handler = gpio_request_ex("motor_para", "motor_shake");

	if(!vibe_gpio_handler) {
		pr_err("%s request motor gpio err\n", __FUNCTION__);
		err = -1;
		goto exit;
	}

	INIT_WORK(&vibrator_work, update_vibrator);

	spin_lock_init(&vibe_lock);
	vibe_state = 0;
	hrtimer_init(&vibe_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
	vibe_timer.function = vibrator_timer_func;

	timed_output_dev_register(&sun4i_vibrator);

exit:
	return err;
}
开发者ID:EddyKuo,项目名称:linux-sdk-kernel-source,代码行数:52,代码来源:sun4i-vibrator.c


示例13: power_oz_patch_gpio

/*
************************************************************************************************************
*
*                                             function
*
*    函数名称:power_oz_patch_gpio
*
*    参数列表:
*
*    返回值  :
*
*    说明    :change the gpio data status in sys_config.fex with the vol input 
*
*
************************************************************************************************************
*/
static int power_oz_patch_gpio(int set_vol)
{
	int ret;
	int i;
	u8 index;
	char sub_name[16];
	user_gpio_set_t oz_gpio_cfg[3];
	memset(oz_gpio_cfg, 0, sizeof(oz_gpio_cfg));

	ret = script_parser_fetch("external_power", "a15_vset1", (int*)&oz_gpio_cfg[0], sizeof(oz_gpio_cfg[0])/sizeof(int));
	if(ret)
	{
		printf("get oz power cfg failed\n");
		return -1;
	}

	ret = script_parser_fetch("external_power", "a15_vset2", (int*)&oz_gpio_cfg[1], sizeof(oz_gpio_cfg[1])/sizeof(int));
	if(ret)
	{
		printf("get oz power cfg failed\n");
		return -1;
	}

	ret = script_parser_fetch("external_power", "a15_vset3", (int*)&oz_gpio_cfg[2], sizeof(oz_gpio_cfg[2])/sizeof(int));
	if(ret)
	{
		printf("get oz power cfg failed\n");
		return -1;
	}

	//get the gpio status with the set_vol
	index = power_oz_probe_gpio(set_vol);

	//配置gpio data
	for(i = 0; i < 3; i++)
	{
		oz_gpio_cfg[i].data = gpio_value[index][i];
		memset(sub_name, 0, 16);
		sprintf(sub_name, "%s%d", "a15_vset", i+1);
		ret = script_parser_patch("external_power", sub_name, (void *)&oz_gpio_cfg[i], sizeof(oz_gpio_cfg[i])/sizeof(int));
		if(ret)
		{
			printf("patch gpio config failed\n");
			return -2;
		}
	}

	return 0;
}
开发者ID:GREYFOXRGR,项目名称:BPI-M3-bsp,代码行数:65,代码来源:oz80120.c


示例14: Hdmi_init

__s32 Hdmi_init(void)
{
	s32 ret = 0;
	disp_hdmi_func disp_func;
	s32 val;

	hdmi_used = 0;

	ret = script_parser_fetch("hdmi_para", "hdmi_used", &val, 1);
	if(ret == 0) {
		hdmi_used = val;

		if(hdmi_used)
		{
#if defined(CONFIG_ARCH_HOMELET) //need to be same later
			ret = script_parser_fetch("hdmi_para", "hdmi_power_boot", (int *)hdmi_power, 25);
#else
			ret = script_parser_fetch("hdmi_para", "hdmi_power", (int *)hdmi_power, 25);
#endif
			if(ret == 0) {
				OSAL_Power_Enable(hdmi_power);
			}
			ret = script_parser_fetch("hdmi_para", "hdmi_cts_compatibility", &val, 1);
			if(ret == 0) {
				Hdmi_hal_cts_enable(val);
				printf("cts_enable, %d\n", val);
			}
			ret = script_parser_fetch("hdmi_para", "hdmi_hdcp_enable", &val, 1);
			if(ret == 0) {
				Hdmi_hal_hdcp_enable(val);
				printf("hdcp_enable, %d\n", val);
			}

			Hdmi_hal_init();

			disp_func.hdmi_open = Hdmi_open;
			disp_func.hdmi_close = Hdmi_close;
			disp_func.hdmi_set_mode = Hdmi_set_display_mode;
			disp_func.hdmi_mode_support = Hdmi_mode_support;
			disp_func.hdmi_get_HPD_status = Hdmi_get_HPD_status;
			disp_func.hdmi_get_video_timing_info = Hdmi_get_video_timming_info;
			disp_func.hdmi_get_video_info_index = Hdmi_get_video_info_index;
			disp_set_hdmi_func(0, &disp_func);
			disp_set_hdmi_func(1, &disp_func);
		}
	}
	return 0;
}
开发者ID:Gucan,项目名称:h3_lichee,代码行数:48,代码来源:drv_hdmi.c


示例15: sw_serial_init

static int __init sw_serial_init(void)
{
    int ret;
    int i;
    int used = 0;
    char uart_para[16];
    
    memset(sw_serial, 0, sizeof(sw_serial));
    uart_used = 0;
    for (i=0; i<MAX_PORTS; i++, used=0) {
        sprintf(uart_para, "uart_para%d", i);
        ret = script_parser_fetch(uart_para, "uart_used", &used, sizeof(int));
        if (ret)
            UART_MSG("failed to get uart%d's used information\n", i);
        if (used) {
            uart_used |= 1 << i;
            platform_device_register(&sw_uart_dev[i]);
        }
    }
    
    if (uart_used) {
        UART_MSG("used uart info.: 0x%02x\n", uart_used);
        ret = platform_driver_register(&sw_serial_driver);
        return ret;
    }

	return 0;
}
开发者ID:Michael-Pizzileo,项目名称:lichee_linux-3.0,代码行数:28,代码来源:8250_sunxi.c


示例16: OSAL_Script_FetchParser_Data

int OSAL_Script_FetchParser_Data(char *main_name, char *sub_name, int value[], int count)
{
	int ret;
	user_gpio_set_t  gpio_info;
	disp_gpio_set_t  *gpio_list;
	ret = script_parser_fetch(main_name, sub_name, value, count);
	if(ret < 0) {
		//__wrn("fetch script data %s.%s fail\n", main_name, sub_name);
	} else {
		if(count == 1) {
			//__inf("%s.%s = %d\n", main_name, sub_name, *value);
		} else if(count == sizeof(disp_gpio_set_t)) {
			memcpy(&gpio_info, value, sizeof(user_gpio_set_t));
			gpio_list = (disp_gpio_set_t  *)value;
			gpio_list->port = gpio_info.port;
			gpio_list->port_num = gpio_info.port_num;
			gpio_list->drv_level = gpio_info.drv_level;
			gpio_list->pull = gpio_info.pull;
			gpio_list->data = gpio_info.data;
			//__inf("%s.%s gpio_port=%d,gpio_port_num:%d, data:%d\n",main_name, sub_name, gpio_list->port, gpio_list->port_num, gpio_list->data);
		} else {
			//__inf("%s.%s = %s\n", main_name, sub_name, value);
		}
	}
	
	return ret;
}
开发者ID:Aorjoa,项目名称:bootloader,代码行数:27,代码来源:OSAL_Parser.c


示例17: sndspdif_codec_init

static int __init sndspdif_codec_init(void)
{
	int ret, spdif_used = 0;

	ret = script_parser_fetch("spdif_para", "spdif_used", &spdif_used, 1);
	if (ret != 0 || !spdif_used)
		return -ENODEV;

	spd_gpio_hdle = gpio_request_ex("spdif_para", "spdif_dout");
	if (0 == spd_gpio_hdle) {
		pr_err("try to request spdif_para gpio failed\n");
		return -1;
	}

	ret = platform_device_register(&sndspdif_codec_device);
	if (ret < 0)
		return ret;

	ret = platform_driver_register(&sndspdif_codec_driver);
	if (ret < 0) {
		platform_device_unregister(&sndspdif_codec_device);
		return ret;
	}

	return 0;
}
开发者ID:EddyKuo,项目名称:linux-sdk-kernel-source,代码行数:26,代码来源:sndspdif.c


示例18: power_oz_probe

/*
************************************************************************************************************
*
*                                             function
*
*    函数名称:
*
*    参数列表:
*
*    返回值  :
*
*    说明    :
*
*
************************************************************************************************************
*/
int power_oz_probe(void)
{
	int ret;
	u32 oz_power_hd;
	user_gpio_set_t oz_gpio_cfg[1];

	memset(oz_gpio_cfg, 0, sizeof(oz_gpio_cfg));
	ret = script_parser_fetch("external_power", "a15_pwr_en", (int*)&oz_gpio_cfg[0], sizeof(oz_gpio_cfg[0])/sizeof(int));
	if(ret)
	{
		printf("get a15_pwr_en cfg failed\n");
		return -1;
	}

	oz_gpio_cfg[0].data = 1;

	//配置使能gpio
	ret = script_parser_patch("external_power", "a15_pwr_en", (int*)&oz_gpio_cfg[0], sizeof(oz_gpio_cfg[0])/sizeof(int));
	if(ret)
	{
		printf("patch a15_pwr_en config failed\n");
		return -2;
	}

	oz_power_hd = gpio_request_simple("external_power", "a15_pwr_en");
	if(oz_power_hd)
	{
		printf("set gpio failed\n");
		return -3;
	}
	return 0;
}
开发者ID:GREYFOXRGR,项目名称:BPI-M3-bsp,代码行数:48,代码来源:oz80120.c


示例19: board_probe_bat_status

static int board_probe_bat_status(int standby_mode)
{
	int   bat_cal = 1;
	int   ret, chargemode = 0;
	//当前可以确定是火牛开机,但是是否开机还不确定,需要确认电池是否存在
	//当电池不存在即开机,电池存在则关机
	//新添加,根据环境变量,是启动当前的待机,或者android待机功能
	ret = script_parser_fetch("charging_type", "charging_type", &chargemode, 1);
	if((!ret) && chargemode)
	{
		gd->chargemode = 1;

		return 0;
	}
	if(battery_charge_cartoon_init(0) < 0)
	{
		tick_printf("init charge cartoon fail\n");

		return -1;
	}
	bat_cal = axp_probe_rest_battery_capacity();
	printf("bat not inited\n");
	if(battery_charge_cartoon_init(bat_cal/(100/(SUNXI_BAT_BMP_MAX-1))) < 0)
	{
		tick_printf("init charge cartoon fail\n");

		return -1;
	}
	if((!bat_cal) && (standby_mode))
	{
		bat_cal = 100;
	}

	return bat_cal;
}
开发者ID:Aorjoa,项目名称:bootloader,代码行数:35,代码来源:load_check.c


示例20: sun5i_sndi2s_init

static int __init sun5i_sndi2s_init(void)
{
	int ret;
	int ret2;
	
	ret2 = script_parser_fetch("i2s_para","i2s_used", &i2s_used, sizeof(int));
	if (ret2) {
        printk("[I2S]sun5i_sndi2s_init fetch i2s using configuration failed\n");
    } 
    
    if (i2s_used) {
		sun5i_sndi2s_device = platform_device_alloc("soc-audio", 2);
		if(!sun5i_sndi2s_device)
			return -ENOMEM;
		platform_set_drvdata(sun5i_sndi2s_device, &snd_soc_sun5i_sndi2s);
		ret = platform_device_add(sun5i_sndi2s_device);		
		if (ret) {			
			platform_device_put(sun5i_sndi2s_device);
		}
	}else{
		printk("[I2S]sun5i_sndi2s cannot find any using configuration for controllers, return directly!\n");
        return 0;
	}
	return ret;
}
开发者ID:pocketbook,项目名称:U7,代码行数:25,代码来源:sun5i-sndi2s.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ script_value_to_float函数代码示例发布时间:2022-05-30
下一篇:
C++ script_get_item函数代码示例发布时间: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