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

C++ script_get_item函数代码示例

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

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



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

示例1: sw_serial_get_config

static int sw_serial_get_config(struct sw_serial_port *sport, u32 uart_id)
{
    char uart_para[16] = {0};
    script_item_u val;
    script_item_value_type_e type;

    memset(uart_para, 0, sizeof(uart_para));
    snprintf(uart_para, sizeof(uart_para), "uart_para%d", uart_id);

    type = script_get_item(uart_para, "uart_port", &val);
    if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
        UART_ERR("%s: uart%d get uart port error\n", __func__,
                uart_id);
        return -1;
    }
    sport->port_no  = val.val;

    if (sport->port_no != uart_id) {
        UART_ERR("%s: port%d and uart%d not match\n",
               __func__, sport->port_no, uart_id);
        return -1;
    }

    type = script_get_item(uart_para, "uart_type", &val);
    if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
        UART_ERR("%s: uart%d get uart type error\n", __func__,
                uart_id);
        return -1;
    }
    sport->pin_num  = val.val;

    return 0;
}
开发者ID:mfkiwl,项目名称:PhoenixA20_linux_sourcecode,代码行数:33,代码来源:8250_sunxi.c


示例2: platform_wifi_power_on

/*
 * Return:
 *	0:	power on successfully
 *	others: power on failed
 */
int platform_wifi_power_on(void)
{
	int ret = 0;

#ifdef CONFIG_MMC
	{
		script_item_u val;
		script_item_value_type_e type;

#ifdef CONFIG_PLATFORM_ARM_SUN8I_W5P1
		unsigned int mod_sel = get_rf_mod_type();
#else
		unsigned int mod_sel = wifi_pm_get_mod_type();
#endif

		type = script_get_item("wifi_para", "wifi_sdc_id", &val);
		if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
			RTW_INFO("get wifi_sdc_id failed\n");
			ret = -1;
		} else {
			sdc_id = val.val;
			RTW_INFO("----- %s sdc_id: %d, mod_sel: %d\n", __FUNCTION__, sdc_id, mod_sel);

#if defined(CONFIG_PLATFORM_ARM_SUN6I) || defined(CONFIG_PLATFORM_ARM_SUN7I)
			sw_mci_rescan_card(sdc_id, 1);
#elif defined(CONFIG_PLATFORM_ARM_SUN8I)
			sunxi_mci_rescan_card(sdc_id, 1);
#endif
			mdelay(100);
			wifi_pm_power(1);

			RTW_INFO("%s: power up, rescan card.\n", __FUNCTION__);
		}

#ifdef CONFIG_GPIO_WAKEUP
#ifdef CONFIG_PLATFORM_ARM_SUN8I_W5P1
		type = script_get_item("wifi_para", "wl_host_wake", &val);
#else
#ifdef CONFIG_RTL8723B
		type = script_get_item("wifi_para", "rtl8723bs_wl_host_wake", &val);
#endif
#ifdef CONFIG_RTL8188E
		type = script_get_item("wifi_para", "rtl8189es_host_wake", &val);
#endif
#endif /* CONFIG_PLATFORM_ARM_SUN8I_W5P1 */
		if (SCIRPT_ITEM_VALUE_TYPE_PIO != type) {
			RTW_INFO("No definition of wake up host PIN\n");
			ret = -1;
		} else {
			gpio_eint_wlan = val.gpio.gpio;
#ifdef CONFIG_PLATFORM_ARM_SUN8I
			oob_irq = gpio_to_irq(gpio_eint_wlan);
#endif
		}
#endif /* CONFIG_GPIO_WAKEUP */
	}
#endif /* CONFIG_MMC */

	return ret;
}
开发者ID:MingxuZhang,项目名称:rtl8821cu,代码行数:65,代码来源:platform_ARM_SUNnI_sdio.c


示例3: camera_get_sysconfig

__s32 camera_get_sysconfig(char *main_name, char *sub_name, __s32 *buf, __u32 cnt)
{
        script_item_u   val;
        script_item_value_type_e  type;
        int ret = -1;

        if(cnt == 1)
        {
                type = script_get_item(main_name, sub_name, &val);
                if(SCIRPT_ITEM_VALUE_TYPE_INT == type)
                {
                        ret = 0;
                        *buf = val.val;
                        detect_print("%s.%s=%d\n", main_name, sub_name, *buf);
                }
                else
                {
                        ret = -1;
                        detect_print("fetch script data %s.%s fail\n", main_name, sub_name);
                }
        }
        else if(cnt == sizeof(__camera_gpio_set_t)/sizeof(__s32))
        {
                type = script_get_item(main_name, sub_name, &val);
                if(SCIRPT_ITEM_VALUE_TYPE_PIO == type)
                {
                        __camera_gpio_set_t *gpio_info = (__camera_gpio_set_t *)buf;

                        ret = 0;
                        gpio_info->gpio = val.gpio.gpio;
                        gpio_info->mul_sel = val.gpio.mul_sel;
                        gpio_info->pull = val.gpio.pull;
                        gpio_info->drv_level = val.gpio.drv_level;
                        gpio_info->data = val.gpio.data;
                        memcpy(gpio_info->gpio_name, sub_name, strlen(sub_name)+1);
                        detect_print("%s.%s gpio=%d,mul_sel=%d,data:%d\n",main_name, sub_name, gpio_info->gpio, gpio_info->mul_sel, gpio_info->data);
                }
                else
                {
                        ret = -1;
                        detect_print("fetch script data %s.%s fail\n", main_name, sub_name);
                }
        }
        else if(cnt == MAX_VDD_STR_LEN)
        {
                type = script_get_item(main_name, sub_name, &val);
                if(SCIRPT_ITEM_VALUE_TYPE_STR == type)
                {
                        strcpy((char *)buf, val.str);
                        detect_print("%s.%s=%s\n", main_name, sub_name, (char *)buf);
                }
                else
                {
                        ret = -1;
                        detect_print("fetch script data %s.%s fail\n", main_name, sub_name);
                }
        }

        return ret;
}
开发者ID:mfkiwl,项目名称:PhoenixA20_linux_sourcecode,代码行数:60,代码来源:camera_detector.c


示例4: sunxi_daudio0_init

static int __init sunxi_daudio0_init(void)
{	
	int err = 0;
	script_item_u val;
	script_item_value_type_e  type;

	type = script_get_item(TDM_NAME, "daudio_used", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
        pr_err("[DAUDIO] type err!\n");
    }

	daudio_used = val.val;

	type = script_get_item(TDM_NAME, "daudio_select", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
        pr_err("[DAUDIO] daudio_select:%s,line:%d type err!\n", __func__, __LINE__);
    }
	daudio_select = val.val;

 	if (daudio_used) {
		if((err = platform_device_register(&sunxi_daudio_device)) < 0)
			return err;
	
		if ((err = platform_driver_register(&sunxi_daudio_driver)) < 0)
			return err;	
	} else {
        pr_err("[DAUDIO]sunxi-daudio cannot find any using configuration for controllers, return directly!\n");
        return 0;
    }

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


示例5: keypad_sys_setup

static int keypad_sys_setup(void)/////unfinish
{
	int ret = -1;
	script_item_u	val;
	script_item_value_type_e  type;
	
	key_pressed[0] = 0;
	key_pressed[1] = 0;

	type = script_get_item("kp0", "keypad_used", &val);
 
	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
		pr_err("%s: type err  device_used = %d. \n", __func__, val.val);
		ret = -1;
	}
	
	if (1 == val.val) {
		type = script_get_item("kp0", "keypad_power_key_code", &val);
		if(SCIRPT_ITEM_VALUE_TYPE_INT != type){
			pr_err("%s: keypad power key type err! \n", __func__);
		}
		keypad_power_key = val.val;

		ret = 0;
		
	} else {
		pr_err("%s: keypad_unused. \n",  __func__);
		ret = -1;
	}

	return ret;
}
开发者ID:jernejsk,项目名称:linux,代码行数:32,代码来源:sunxi-keypad.c


示例6: rtl8723au_gpio_init

void rtl8723au_gpio_init(void)
{
	script_item_u val;
	script_item_value_type_e type;
	struct wifi_pm_ops *ops = &wifi_select_pm_ops;

	rtl8723au_msg("exec rtl8723au_wifi_gpio_init\n");

	type = script_get_item(wifi_para, "wifi_power", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_STR != type) {
		rtl8723au_msg("failed to fetch wifi_power\n");
		return ;
	}
	axp_name = val.str;

	type = script_get_item(wifi_para, "wifi_usbc_id", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
		rtl8723au_msg("failed to fetch wifi_usbc_id\n");
		return ;
	}
	usbc_id = val.val;
	
	ops->standby   = rtl8723au_standby;
	rtl8723au_wifi_power = 0;
	rtl8723au_bt_power = 0;
	
	// make sure wifi power up when system start up
	rtl8723au_module_power(1);
}
开发者ID:cta08403,项目名称:android_kernel_allwinner_a31,代码行数:29,代码来源:wifi_pm_rtl8723au.c


示例7: sunxigk_script_init

static int sunxigk_script_init(void)
{
	script_item_u	val;
	script_item_value_type_e  type;

	type = script_get_item("gpio_power_key", "key_used", &val);

	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
		pr_err("%s: key para not found, used default para. \n", __func__);
		return -1;
	}

	if(1 == val.val){
		type = script_get_item("gpio_power_key", "key_io", &val);
		if(SCIRPT_ITEM_VALUE_TYPE_PIO != type){
			pr_err("%s: get key io err! \n", __func__);
			return -1;
		}
		power_key_io = val.gpio;
		dprintk(DEBUG_INT,"%s power key io number = %d.\n", __func__, power_key_io.gpio);

	}else{
		dprintk(DEBUG_INT,"sunxi io power key no used.\n");
		return -1;
	}

	return 0;
}
开发者ID:condret,项目名称:OrangePI-Kernel,代码行数:28,代码来源:sunxi-gpiokey.c


示例8: twi_chan_cfg

static void twi_chan_cfg(struct sunxi_i2c_platform_data *pdata)
{
	int i;
	script_item_u item = {0};
	script_item_value_type_e type = 0;
	char twi_para[16] = {0};

	for (i=0; i<SUNXI_TWI_NUM; i++) {
		sprintf(twi_para, "twi%d", i);
		type = script_get_item(twi_para, "twi_used", &item);
		if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
			I2C_ERR("[twi%d] has no twi_used!\n", i);
			continue;
		}
		if (item.val)
			twi_used_mask |= SUNXI_TWI_CHAN_MASK(i);

		type = script_get_item(twi_para, "twi_regulator", &item);
		if (SCIRPT_ITEM_VALUE_TYPE_STR != type) {
			I2C_ERR("[twi%d] has no twi_regulator.\n", i);
			continue;
		}
		strncpy(pdata[i].regulator_id, item.str, 16);
	}
}
开发者ID:alex-deng,项目名称:a33_linux,代码行数:25,代码来源:i2c-sunxi.c


示例9: sw_rfkill_init

static int __init sw_rfkill_init(void)
{
	script_item_value_type_e type;
	script_item_u val;
	struct gpio_config  *gpio_p = NULL;

	type = script_get_item("bt_para", "bt_used", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
		RF_MSG("failed to fetch bt configuration!\n");
		return -1;
	}
	if (!val.val) {
		RF_MSG("init no bt used in configuration\n");
		return 0;
	}
	bt_used = val.val;

	bt_rst_n = -1;
	type = script_get_item("bt_para", "bt_rst_n", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_PIO!=type)
		RF_MSG("mod has no bt_rst_n gpio\n");
	else {
		gpio_p = &val.gpio;
		bt_rst_n = gpio_p->gpio;
		sunxi_gpio_req(gpio_p);
	}

	platform_device_register(&sw_rfkill_dev);
	return platform_driver_register(&sw_rfkill_driver);
}
开发者ID:condret,项目名称:OrangePI-Kernel,代码行数:30,代码来源:bt_pm.c


示例10: ap6xxx_gpio_init

void ap6xxx_gpio_init(void)
{
	script_item_u val;
	script_item_value_type_e type;
	struct wifi_pm_ops *ops = &wifi_select_pm_ops;

	type = script_get_item(wifi_para, "wifi_power", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_STR != type) {
		ap6xxx_msg("failed to fetch wifi_power\n");
		return;
	}

	axp_name = val.str;
	ap6xxx_msg("module power name %s\n", axp_name);

	type = script_get_item(wifi_para, "ap6xxx_wl_regon", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_PIO!=type) 
		ap6xxx_msg("get ap6xxx ap6xxx_wl_regon gpio failed\n");
	else
		ap6xxx_wl_regon = val.gpio.gpio;

	type = script_get_item(wifi_para, "ap6xxx_bt_regon", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_PIO!=type) 
		ap6xxx_msg("get ap6xxx ap6xxx_bt_regon gpio failed\n");
	else
		ap6xxx_bt_regon = val.gpio.gpio;

	ops->gpio_ctrl	= ap6xxx_gpio_ctrl;
	ops->power = ap6xxx_power;

	ap6xxx_module_power(1);
}
开发者ID:jiangdoudou,项目名称:a31_422_v33_lichee,代码行数:32,代码来源:wifi_pm_ap6xxx.c


示例11: NAND_GetNandExtPara

__u32 NAND_GetNandExtPara(__u32 para_num)
{
	script_item_u nand_para;
    script_item_value_type_e type;

	if (para_num == 0) {
	    type = script_get_item("nand0_para", "nand_p0", &nand_para);
	    if(SCIRPT_ITEM_VALUE_TYPE_INT != type)
	    {
	        printk("nand0_para, nand_p0, nand type err! %d\n", type);
			return 0xffffffff;
	    }
		else
			return nand_para.val;
	} else if (para_num == 1) {
	    type = script_get_item("nand0_para", "nand_p1", &nand_para);
	    if(SCIRPT_ITEM_VALUE_TYPE_INT != type)
	    {
	        printk("nand0_para, nand_p1, nand type err! %d\n", type);
			return 0xffffffff;
	    }
		else
			return nand_para.val;
	} else {
		printk("NAND_GetNandExtPara: wrong para num: %d\n", para_num);
		return 0xffffffff;
	}
}
开发者ID:songjmcn,项目名称:linux-3.4-sunxi,代码行数:28,代码来源:nand_osal_for_linux.c


示例12: sun6i_i2s_init

static int __init sun6i_i2s_init(void)
{	
	int err = 0;
	int cnt = 0;
	int i 	= 0;
	script_item_u val;
	script_item_u *list = NULL;
	script_item_value_type_e  type;

	type = script_get_item("i2s_para", "i2s_used", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
        printk("[I2S] type err!\n");
    }

	i2s_used = val.val;

	type = script_get_item("i2s_para", "i2s_select", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
        printk("[I2S] i2s_select type err!\n");
    }
	i2s_select = val.val;

 	if (i2s_used) {
		/* get gpio list */
		cnt = script_get_pio_list("i2s_para", &list);
		if (0 == cnt) {
			printk("get i2s_para gpio list failed\n");
			return -EFAULT;
		}
	/* req gpio */
	for (i = 0; i < cnt; i++) {
		if (0 != gpio_request(list[i].gpio.gpio, NULL)) {
			printk("[i2s] request some gpio fail\n");
			goto end;
		}
	}
	/* config gpio list */
	if (0 != sw_gpio_setall_range(&list[0].gpio, cnt)) {
		printk("sw_gpio_setall_range failed\n");
	}

	if((err = platform_device_register(&sun6i_i2s_device)) < 0)
		return err;

	if ((err = platform_driver_register(&sun6i_i2s_driver)) < 0)
			return err;	
	} else {
        printk("[I2S]sun6i-i2s cannot find any using configuration for controllers, return directly!\n");
        return 0;
    }

end:
	/* release gpio */
	while(i--)
		gpio_free(list[i].gpio.gpio);

	return 0;
}
开发者ID:BPI-SINOVOIP,项目名称:BPI-M2-bsp,代码行数:58,代码来源:sun6i-i2s.c


示例13: sunxi_snddaudio0_dev_probe

static int __devinit sunxi_snddaudio0_dev_probe(struct platform_device *pdev)
{
	int ret = 0;
	script_item_u val;
	script_item_value_type_e  type;
	struct snd_soc_card *card = &snd_soc_sunxi_snddaudio;

	type = script_get_item(TDM_NAME, "daudio_used", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
        	pr_err("[daudio0]:%s,line:%d type err!\n", __func__, __LINE__);
	}
	daudio_used = val.val;
	type = script_get_item(TDM_NAME, "daudio_select", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
		pr_err("[I2S0] daudio_select type err!\n");
	}
	daudio_pcm_select = val.val;

	type = script_get_item(TDM_NAME, "daudio_master", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
		pr_err("[I2S0] daudio_master type err!\n");
	}
	daudio_master = val.val;

	type = script_get_item(TDM_NAME, "audio_format", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
		pr_err("[I2S0] audio_format type err!\n");
	}
	audio_format = val.val;

	type = script_get_item(TDM_NAME, "signal_inversion", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
		pr_err("[I2S0] signal_inversion type err!\n");
	}
	signal_inversion = val.val;

	pr_debug("%s, line:%d, daudio_used:%d,daudio_pcm_select:%d,daudio_master:%d,audio_format:%d,signal_inversion:%d\n", __func__,
			__LINE__, daudio_used,daudio_pcm_select,daudio_master,audio_format,signal_inversion);
	if (daudio_used) {
		card->dev = &pdev->dev;
	
		ret = snd_soc_register_card(card);
		if (ret) {
			dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
				ret);
		}
	} else {
		pr_err("[daudio0]sunxi_snddaudio0 cannot find any using configuration for controllers, return directly!\n");
        return 0;
	}
		
	return ret;
}
开发者ID:phi-psi,项目名称:linux-3.4-sunxi,代码行数:53,代码来源:a83_ac200.c


示例14: ls_fetch_sysconfig_para

static int ls_fetch_sysconfig_para(enum input_sensor_type *ls_type)
{
	int ret = -1;
	script_item_u	val;
	script_item_value_type_e  type;
	struct sensor_config_info *data = container_of(ls_type,
					struct sensor_config_info, input_type);

	type = script_get_item("ls_para", "ls_used", &val);

	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
		pr_err("%s: type err  device_used = %d. \n", __func__, val.val);
		goto script_get_err;
	}
	data->sensor_used = val.val;
	
	if (1 == data->sensor_used) {
		type = script_get_item("ls_para", "ls_twi_id", &val);	
		if(SCIRPT_ITEM_VALUE_TYPE_INT != type){
			pr_err("%s: type err twi_id = %d. \n", __func__, val.val);
			goto script_get_err;
		}
		data->twi_id = val.val;

		type = script_get_item("ls_para", "ls_int", &val);	
		if (SCIRPT_ITEM_VALUE_TYPE_PIO != type) {
			printk("%s: type err twi int1 = %d. \n", __func__, val.gpio.gpio);
			goto script_get_err;
		}
		data->irq_gpio = val.gpio;
		data->int_number = val.gpio.gpio;
		
		type = script_get_item("ls_para", "ls_ldo", &val);
		if (SCIRPT_ITEM_VALUE_TYPE_STR != type)
			pr_err("%s: no ldo for light distance sensor, ignore it\n", __func__);
		else
			data->ldo = val.str;

		ret = 0;
		
	} else {
		pr_err("%s: ls_unused. \n",  __func__);
		ret = -1;
	}

	return ret;

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

}
开发者ID:lucatib,项目名称:a33_linux,代码行数:52,代码来源:init-input.c


示例15: aw_pm_init

/*
*********************************************************************************************************
*                           aw_pm_init
*
*Description: initial pm sub-system for platform;
*
*Arguments  : none;
*
*Return     : result;
*
*Notes      :
*
*********************************************************************************************************
*/
static int __init aw_pm_init(void)
{
    script_item_u item;
    script_item_u   *list = NULL;
    int cpu0_en = 0;
    int dram_selfresh_en = 0;
    int wakeup_src_cnt = 0;
    
    PM_DBG("aw_pm_init!\n");

    if (fetch_dram_para(&standby_info.dram_para) != 0)
    {
        memset(&standby_info.dram_para, 0, sizeof(standby_info.dram_para));
        pr_err("%s: fetch_dram_para err. \n", __func__);
    }
    memcpy(&mem_para_info.dram_para, &standby_info.dram_para, sizeof(standby_info.dram_para));
    
    //get standby_mode.
    if(SCIRPT_ITEM_VALUE_TYPE_INT != script_get_item("pm_para", "standby_mode", &item)){
        pr_err("%s: script_parser_fetch err. \n", __func__);
        standby_mode = 0;
        //standby_mode = 1;
        pr_err("notice: standby_mode = %d.\n", standby_mode);
    }else{
        standby_mode = item.val;
        pr_info("standby_mode = %d. \n", standby_mode);
        if(1 != standby_mode){
            pr_err("%s: not support super standby. \n",  __func__);
        }
    }

    //get wakeup_src_para cpu_en
    if(SCIRPT_ITEM_VALUE_TYPE_INT != script_get_item("wakeup_src_para", "cpu_en", &item)){
        cpu0_en = 0;
    }else{
        cpu0_en = item.val;
    }
    pr_info("cpu0_en = %d.\n", cpu0_en);

    //get dram_selfresh en
    if(SCIRPT_ITEM_VALUE_TYPE_INT != script_get_item("wakeup_src_para", "dram_selfresh_en", &item)){
        dram_selfresh_en = 1;
    }else{
        dram_selfresh_en = item.val;
    }
    pr_info("dram_selfresh_en = %d.\n", dram_selfresh_en);

    if(0 == dram_selfresh_en && 0 == cpu0_en){
        pr_err("Notice: if u don't want the dram enter selfresh mode,\n \
                make sure the cpu0 is not allowed to be powered off.\n");
        goto script_para_err;
    }else{
开发者ID:dwlinux,项目名称:Armcore_a20_V30_lichee,代码行数:66,代码来源:pm.c


示例16: platform_wifi_power_on

/*
 * Return:
 *	0:	power on successfully
 *	others: power on failed
 */
int platform_wifi_power_on(void)
{
	int ret = 0;

#ifdef CONFIG_MMC
{
	script_item_u val;
	script_item_value_type_e type;

	type = script_get_item("wifi_para", "wifi_used", &val);
	if ((SCIRPT_ITEM_VALUE_TYPE_INT != type) || (0 == val.val)) {
		DBG_871X("wifi is not used\n");
		return -1;
	}

	type = script_get_item("wifi_para", "wifi_sdc_id", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_INT!=type) {
		DBG_871X("get wifi_sdc_id failed\n");
		ret = -1;
	} else {
		sdc_id = val.val;
		DBG_871X("----- %s sdc_id: %d\n", __FUNCTION__, sdc_id);

#if defined(CONFIG_PLATFORM_ARM_SUN6I) || defined(CONFIG_PLATFORM_ARM_SUN7I)
		sw_mci_rescan_card(sdc_id, 1);
#elif defined(CONFIG_PLATFORM_ARM_SUN8I)
		sunxi_mci_rescan_card(sdc_id, 1);
#endif
		mdelay(100);
		wifi_pm_power(1);

		DBG_871X("%s: power up, rescan card.\n", __FUNCTION__);
	}

#ifdef CONFIG_GPIO_WAKEUP
	type = script_get_item("wifi_para", "wl_host_wake", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_PIO != type) {
		DBG_871X("No definition of wake up host PIN\n");
		ret = -1;
	} else {
		gpio_eint_wlan = val.gpio.gpio;
#ifdef CONFIG_PLATFORM_ARM_SUN8I
		oob_irq = gpio_to_irq(gpio_eint_wlan);
#endif
	}
#endif // CONFIG_GPIO_WAKEUP
}
#endif // CONFIG_MMC

	return ret;
}
开发者ID:tdlabac,项目名称:RTL8189FS,代码行数:56,代码来源:platform_ARM_SUNnI_sdio.c


示例17: sunxi_pin_init

static int sunxi_pin_init(struct sunxi_otgc *otgc)
{
	int ret = 0;

	script_item_value_type_e type = 0;
	script_item_u item_temp;

	/* usbc drv_vbus */
	type = script_get_item("usbc0", "usb_drv_vbus_gpio", &(otgc->port_ctl.drv_vbus.gpio_set));
	if (type == SCIRPT_ITEM_VALUE_TYPE_PIO) {
		otgc->port_ctl.drv_vbus.valid = 1;
	} else {
		otgc->port_ctl.drv_vbus.valid  = 0;
		DMSG_PANIC("ERR: get usbc det_vbus failed\n");
	}

	if (otgc->port_ctl.drv_vbus.valid) {
		ret = gpio_request(otgc->port_ctl.drv_vbus.gpio_set.gpio.gpio, "otg_drv_vbus");
		if (ret != 0) {
			DMSG_PANIC("ERR: gpio_request failed\n");
			otgc->port_ctl.drv_vbus.valid = 0;
		} else {
			gpio_direction_output(otgc->port_ctl.drv_vbus.gpio_set.gpio.gpio, 0);
		}
	}

	/* get regulator io information */
	type = script_get_item("usbc0", "usb_regulator_io", &item_temp);
	if (type == SCIRPT_ITEM_VALUE_TYPE_STR) {
		if (!strcmp(item_temp.str, "nocare")) {
			DMSG_INFO("get usbc0_regulator is nocare\n");
			otgc->port_ctl.regulator_io = NULL;
		}else{
			otgc->port_ctl.regulator_io = item_temp.str;

			type = script_get_item("usbc0",  "usb_regulator_vol", &item_temp);
			if(type == SCIRPT_ITEM_VALUE_TYPE_INT){
				otgc->port_ctl.regulator_value = item_temp.val;
			}else{
				DMSG_INFO("get usbc0_value is failed\n");
				otgc->port_ctl.regulator_value = 0;
			}
		}
	}else {
		DMSG_INFO("get usbc0_regulator is failed\n");
		otgc->port_ctl.regulator_io = NULL;
	}

	return 0;
}
开发者ID:phi-psi,项目名称:linux-3.4-sunxi,代码行数:50,代码来源:core.c


示例18: sunxi_sndi2s1_init

static int __init sunxi_sndi2s1_init(void)
{
	int ret = 0;
	script_item_u val;
	script_item_value_type_e  type;

	type = script_get_item("i2s1", "i2s1_used", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
        printk("[I2S1] type err!\n");
    }
	i2s1_used = val.val;
	type = script_get_item("i2s1", "i2s1_select", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
        printk("[I2S1] i2s1_select type err!\n");
    }
	i2s1_pcm_select = val.val;
	
	type = script_get_item("i2s1", "i2s1_master", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
        printk("[I2S1] i2s1_master type err!\n");
    }
	i2s1_master = val.val;
	
	type = script_get_item("i2s1", "audio_format", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
        printk("[I2S1] audio_format type err!\n");
    }
	audio_format = val.val;

	type = script_get_item("i2s1", "signal_inversion", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
        printk("[I2S1] signal_inversion type err!\n");
    }
	signal_inversion = val.val;

    if (i2s1_used) {
		sunxi_sndi2s1_device = platform_device_alloc("soc-audio", 3);
		if(!sunxi_sndi2s1_device)
			return -ENOMEM;
		platform_set_drvdata(sunxi_sndi2s1_device, &snd_soc_sunxi_sndi2s1);
		ret = platform_device_add(sunxi_sndi2s1_device);
		if (ret) {
			platform_device_put(sunxi_sndi2s1_device);
		}
	}else{
		printk("[I2S1]sunxi_sndi2s1 cannot find any using configuration for controllers, return directly!\n");
        return 0;
	}
	return ret;
}
开发者ID:alex-deng,项目名称:a33_linux,代码行数:50,代码来源:sunxi-sndi2s1.c


示例19: platform_wifi_power_on

int platform_wifi_power_on(void)
{
	int ret = 0;

#if defined(CONFIG_PLATFORM_ARM_SUN6I) || defined(CONFIG_PLATFORM_ARM_SUN7I)
	{
		script_item_value_type_e type;

		type = script_get_item("wifi_para", "wifi_usbc_id", &item);
		if(SCIRPT_ITEM_VALUE_TYPE_INT != type){
			printk("ERR: script_get_item wifi_usbc_id failed\n");
			ret = -ENOMEM;
			goto exit;
		}

		printk("sw_usb_enable_hcd: usbc_num = %d\n", item.val);
		wifi_pm_power(1);
		mdelay(10);
	
		#if !(defined(CONFIG_RTL8723A)) && !(defined(CONFIG_RTL8723B))
		sw_usb_enable_hcd(item.val);
		#endif
	}
#endif //defined(CONFIG_PLATFORM_ARM_SUN6I) || defined(CONFIG_PLATFORM_ARM_SUN7I)

#if defined(CONFIG_PLATFORM_ARM_SUNxI)
	{
		script_item_value_type_e type;

		type = script_get_item("wifi_para", "wifi_usbc_id", &item);
		if(SCIRPT_ITEM_VALUE_TYPE_INT != type){
			printk("ERR: script_get_item wifi_usbc_id failed\n");
			ret = -ENOMEM;
			goto exit;
		}

		printk("sunxi_usb_enable_hcd: usbc_num = %d\n", item.val);
		wifi_pm_power(1);
		mdelay(10);
	
		#if !(defined(CONFIG_RTL8723A)) && !(defined(CONFIG_RTL8723B))
		sunxi_usb_enable_hcd(item.val);
		#endif
	}
#endif //CONFIG_PLATFORM_ARM_SUNxI

exit:
	return ret;
}
开发者ID:mfkiwl,项目名称:CC-A80-kernel-source,代码行数:49,代码来源:platform_ARM_SUNxI_usb.c


示例20: camera_req_mclk_pin

static __s32 camera_req_mclk_pin(__u32 csi_index)
{
        char *csi_para[2] = {"csi0_para", "csi1_para"};
        int	                        req_status;
	script_item_u                   item;
	script_item_value_type_e        type;    

        /* »ñÈ¡gpio list */
	type = script_get_item(csi_para[csi_index], "csi_ck", &item);
	if(SCIRPT_ITEM_VALUE_TYPE_PIO != type) {
		camera_err("script_get_item return type err\n");
		return -ECFGERR;
	}

        /* ÉêÇëgpio */
	req_status = gpio_request(item.gpio.gpio, NULL);
	if(0 != req_status) {
		camera_err("request gpio failed\n");
                return -ENORMALPIN;
	}

        /* ÅäÖÃgpio */
	if(0 != sw_gpio_setall_range(&item.gpio, 1)) {
		camera_err("sw_gpio_setall_range failed\n");

                gpio_free(item.gpio.gpio);
                return -ECFGPIN;
	}

        /* ÊÍ·Ågpio */
	if(0 == req_status)
		gpio_free(item.gpio.gpio);

        return 0;
}
开发者ID:mfkiwl,项目名称:PhoenixA20_linux_sourcecode,代码行数:35,代码来源:camera_detector.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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