这篇教程C++ ARRAY_SIZE函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ARRAY_SIZE函数的典型用法代码示例。如果您正苦于以下问题:C++ ARRAY_SIZE函数的具体用法?C++ ARRAY_SIZE怎么用?C++ ARRAY_SIZE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ARRAY_SIZE函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ARRAY_SIZE};static struct __initdata omap_gpio_platform_data omap7xx_mpu_gpio_config = { .virtual_irq_start = IH_MPUIO_BASE, .bank_type = METHOD_MPUIO, .bank_width = 32, .bank_stride = 2,};static struct __initdata platform_device omap7xx_mpu_gpio = { .name = "omap_gpio", .id = 0, .dev = { .platform_data = &omap7xx_mpu_gpio_config, }, .num_resources = ARRAY_SIZE(omap7xx_mpu_gpio_resources), .resource = omap7xx_mpu_gpio_resources,};/* gpio1 */static struct __initdata resource omap7xx_gpio1_resources[] = { { .start = OMAP7XX_GPIO1_BASE, .end = OMAP7XX_GPIO1_BASE + SZ_2K - 1, .flags = IORESOURCE_MEM, }, { .start = INT_7XX_GPIO_BANK1, .flags = IORESOURCE_IRQ, },};
开发者ID:AbheekG,项目名称:XIA-for-Linux,代码行数:31,
示例2: encoder/* This prototype is set up to be compatible with the cx2341x_mbox_func prototype in cx2341x.h, which should be in kernels 2.6.18 or later. We do this so that we can enable cx2341x.ko to write to our encoder (by handing it a pointer to this function). For earlier kernels this doesn't really matter. */static int pvr2_encoder_cmd(void *ctxt, u32 cmd, int arg_cnt_send, int arg_cnt_recv, u32 *argp){ unsigned int poll_count; unsigned int try_count = 0; int retry_flag; int ret = 0; unsigned int idx; /* These sizes look to be limited by the FX2 firmware implementation */ u32 wrData[16]; u32 rdData[16]; struct pvr2_hdw *hdw = (struct pvr2_hdw *)ctxt; /* The encoder seems to speak entirely using blocks 32 bit words. In ivtv driver terms, this is a mailbox at MBOX_BASE which we populate with data and watch what the hardware does with it. The first word is a set of flags used to control the transaction, the second word is the command to execute, the third byte is zero (ivtv driver suggests that this is some kind of return value), and the fourth byte is a specified timeout (windows driver always uses 0x00060000 except for one case when it is zero). All successive words are the argument words for the command. First, write out the entire set of words, with the first word being zero. Next, write out just the first word again, but set it to IVTV_MBOX_DRIVER_DONE | IVTV_DRIVER_BUSY this time (which probably means "go"). Next, read back the return count words. Check the first word, which should have IVTV_MBOX_FIRMWARE_DONE set. If however that bit is not set, then the command isn't done so repeat the read until it is set. Finally, write out just the first word again, but set it to 0x0 this time (which probably means "idle"). */ if (arg_cnt_send > (ARRAY_SIZE(wrData) - 4)) { pvr2_trace( PVR2_TRACE_ERROR_LEGS, "Failed to write cx23416 command" " - too many input arguments" " (was given %u limit %lu)", arg_cnt_send, (long unsigned) ARRAY_SIZE(wrData) - 4); return -EINVAL; } if (arg_cnt_recv > (ARRAY_SIZE(rdData) - 4)) { pvr2_trace( PVR2_TRACE_ERROR_LEGS, "Failed to write cx23416 command" " - too many return arguments" " (was given %u limit %lu)", arg_cnt_recv, (long unsigned) ARRAY_SIZE(rdData) - 4); return -EINVAL; } LOCK_TAKE(hdw->ctl_lock); do { if (!hdw->state_encoder_ok) { ret = -EIO; break; } retry_flag = 0; try_count++; ret = 0; wrData[0] = 0; wrData[1] = cmd; wrData[2] = 0; wrData[3] = 0x00060000; for (idx = 0; idx < arg_cnt_send; idx++) { wrData[idx+4] = argp[idx]; } for (; idx < ARRAY_SIZE(wrData) - 4; idx++) { wrData[idx+4] = 0; } ret = pvr2_encoder_write_words(hdw,MBOX_BASE,wrData,idx); if (ret) break; wrData[0] = IVTV_MBOX_DRIVER_DONE|IVTV_MBOX_DRIVER_BUSY; ret = pvr2_encoder_write_words(hdw,MBOX_BASE,wrData,1); if (ret) break; poll_count = 0;//.........这里部分代码省略.........
开发者ID:1703011,项目名称:asuswrt-merlin,代码行数:101,
示例3: do_cros_ec//.........这里部分代码省略......... if (!ret) { printf("vbnv_block: "); for (i = 0; i < EC_VBNV_BLOCK_SIZE; i++) printf("%02x", block[i]); putc('/n'); } } else { /* * TODO(clchiou): Move this to a utility function as * cmd_spi might want to call it. */ memset(block, 0, EC_VBNV_BLOCK_SIZE); len = strlen(argv[2]); buf[2] = '/0'; for (i = 0; i < EC_VBNV_BLOCK_SIZE; i++) { if (i * 2 >= len) break; buf[0] = argv[2][i * 2]; if (i * 2 + 1 >= len) buf[1] = '0'; else buf[1] = argv[2][i * 2 + 1]; strict_strtoul(buf, 16, &result); block[i] = result; } ret = cros_ec_write_vbnvcontext(dev, block); } if (ret) { debug("%s: Could not %s VbNvContext/n", __func__, argc <= 2 ? "read" : "write"); } } else if (0 == strcmp("test", cmd)) { int result = cros_ec_test(dev); if (result) printf("Test failed with error %d/n", result); else puts("Test passed/n"); } else if (0 == strcmp("version", cmd)) { struct ec_response_get_version *p; char *build_string; ret = cros_ec_read_version(dev, &p); if (!ret) { /* Print versions */ printf("RO version: %1.*s/n", (int)sizeof(p->version_string_ro), p->version_string_ro); printf("RW version: %1.*s/n", (int)sizeof(p->version_string_rw), p->version_string_rw); printf("Firmware copy: %s/n", (p->current_image < ARRAY_SIZE(ec_current_image_name) ? ec_current_image_name[p->current_image] : "?")); ret = cros_ec_read_build_info(dev, &build_string); if (!ret) printf("Build info: %s/n", build_string); } } else if (0 == strcmp("ldo", cmd)) { uint8_t index, state; char *endp; if (argc < 3) return CMD_RET_USAGE; index = simple_strtoul(argv[2], &endp, 10); if (*argv[2] == 0 || *endp != 0) return CMD_RET_USAGE; if (argc > 3) { state = simple_strtoul(argv[3], &endp, 10); if (*argv[3] == 0 || *endp != 0) return CMD_RET_USAGE; ret = cros_ec_set_ldo(dev, index, state); } else { ret = cros_ec_get_ldo(dev, index, &state); if (!ret) { printf("LDO%d: %s/n", index, state == EC_LDO_STATE_ON ? "on" : "off"); } } if (ret) { debug("%s: Could not access LDO%d/n", __func__, index); return ret; } } else if (0 == strcmp("i2c", cmd)) { ret = cros_ec_i2c_passthrough(dev, flag, argc - 2, argv + 2); } else { return CMD_RET_USAGE; } if (ret < 0) { printf("Error: CROS-EC command failed (error %d)/n", ret); ret = 1; } return ret;}
开发者ID:PanizBertsch,项目名称:u-boot,代码行数:101,
示例4: BIT .max = 2, .types = BIT(NL80211_IFTYPE_STATION), }, { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_CLIENT), },};static const struct ieee80211_iface_combinationiwlagn_iface_combinations_dualmode[] = { { .num_different_channels = 1, .max_interfaces = 2, .beacon_int_infra_match = true, .limits = iwlagn_sta_ap_limits, .n_limits = ARRAY_SIZE(iwlagn_sta_ap_limits), }, { .num_different_channels = 1, .max_interfaces = 2, .limits = iwlagn_2sta_limits, .n_limits = ARRAY_SIZE(iwlagn_2sta_limits), },};static const struct ieee80211_iface_combinationiwlagn_iface_combinations_p2p[] = { { .num_different_channels = 1, .max_interfaces = 2, .beacon_int_infra_match = true, .limits = iwlagn_p2p_sta_go_limits, .n_limits = ARRAY_SIZE(iwlagn_p2p_sta_go_limits),
开发者ID:BreakDaLotus,项目名称:attitude_adjustment,代码行数:31,
示例5: SET_TLB_ENTRY /* * TLB 5: 64M Non-cacheable, guarded * 0xe000_0000 1M CCSRBAR * 0xe200_0000 1M PCI1 IO * 0xe210_0000 1M PCI2 IO * 0xe300_0000 1M PCIe IO */ SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS, MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, 0, 5, BOOKE_PAGESZ_64M, 1), /* * TLB 6: 64M Cacheable, non-guarded * 0xf000_0000 64M LBC SDRAM */ SET_TLB_ENTRY(1, CONFIG_SYS_LBC_CACHE_BASE, CONFIG_SYS_LBC_CACHE_BASE, MAS3_SX|MAS3_SW|MAS3_SR, 0, 0, 6, BOOKE_PAGESZ_64M, 1), /* * TLB 7: 64M Non-cacheable, guarded * 0xf8000000 64M CADMUS registers, relocated L2SRAM */ SET_TLB_ENTRY(1, CONFIG_SYS_LBC_NONCACHE_BASE, CONFIG_SYS_LBC_NONCACHE_BASE, MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, 0, 7, BOOKE_PAGESZ_64M, 1),};int num_tlb_entries = ARRAY_SIZE(tlb_table);
开发者ID:Aorjoa,项目名称:bootloader,代码行数:29,
示例6: tskey_i2c_probe/* ------------------------------------------------------------------------ */static inttskey_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id){ int ret = 0; int i; struct SO240001_platform_data *pdata; unsigned keycode = KEY_UNKNOWN; TSKD("entry/n"); if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)){ TSKE("it is not support I2C_FUNC_I2C./n"); return -ENODEV; } tskey_pdev = kzalloc(sizeof(struct so240001_device), GFP_KERNEL); if (tskey_pdev == NULL) { TSKE("failed to allocation/n"); return -ENOMEM; } INIT_DELAYED_WORK(&tskey_pdev->dwork, tskey_work_func); tskey_pdev->client = client; i2c_set_clientdata(tskey_pdev->client, tskey_pdev); /* allocate input device for transfer proximity event */ tskey_pdev->input_dev = input_allocate_device(); if (NULL == tskey_pdev->input_dev) { dev_err(&client->dev, "failed to allocation/n"); goto err_input_allocate_device; } /* initialise input device for tskey00200F */ tskey_pdev->input_dev->name = "touch_keypad"; tskey_pdev->input_dev->phys = "touch_keypad/input3"; tskey_pdev->input_dev->evbit[0] = BIT_MASK(EV_KEY); tskey_pdev->input_dev->keycode = BUT1, BUT2, BUT3, BUT4; tskey_pdev->input_dev->keycodesize = sizeof(unsigned short); tskey_pdev->input_dev->keycodemax = MAX_BUT; keycode = BUT1; set_bit(keycode, tskey_pdev->input_dev->keybit); keycode = BUT2; set_bit(keycode, tskey_pdev->input_dev->keybit); keycode = BUT3; set_bit(keycode, tskey_pdev->input_dev->keybit); keycode = BUT4; set_bit(keycode, tskey_pdev->input_dev->keybit); /* register input device for tskey */ ret = input_register_device(tskey_pdev->input_dev); if (ret < 0) { TSKE("failed to register input/n"); goto err_input_register_device; } pdata = tskey_pdev->client->dev.platform_data; if (pdata == NULL) { TSKE("failed to get platform data/n"); goto err_tskey_initialise; } TSKD("input_register_device/n"); spin_lock_init(&tskey_pdev->lock); tskey_pdev->irq = gpio_to_irq(GPIO_TOUCH_ATTN); /* register interrupt handler */ ret = request_irq(tskey_pdev->irq, tskey_irq_handler, IRQF_TRIGGER_FALLING, "so240001_irq", tskey_pdev);// ret = request_irq(tskey_pdev->irq, tskey_irq_handler, IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, "so240001_irq", tskey_pdev); if (ret < 0) { TSKE("failed to register irq/n"); goto err_irq_request; } TSKD("i2c client addr(0x%x)/n", tskey_pdev->client->addr); TSKD("ATTN STATE : %d/n", gpio_get_value(GPIO_TOUCH_ATTN)); for (i = 0; i < ARRAY_SIZE(tskey_device_attrs); i++) { ret = device_create_file(&client->dev, &tskey_device_attrs[i]); if (ret) { goto err_device_create_file; } } /* set up registers according to VOUT output mode */ ret = tskey_device_initialise(); if (ret < 0) { TSKE("failed to init/n"); goto err_tskey_initialise; } TSKD("exit/n"); return 0;//.........这里部分代码省略.........
开发者ID:lMonsterl,项目名称:LG_Revolution_Kernel,代码行数:101,
示例7: dwc3_pci_probestatic int dwc3_pci_probe(struct pci_dev *pci, const struct pci_device_id *id){ struct dwc3_pci *dwc; struct resource res[2]; int ret; struct device *dev = &pci->dev; ret = pcim_enable_device(pci); if (ret) { dev_err(dev, "failed to enable pci device/n"); return -ENODEV; } pci_set_master(pci); dwc = devm_kzalloc(dev, sizeof(*dwc), GFP_KERNEL); if (!dwc) return -ENOMEM; dwc->dwc3 = platform_device_alloc("dwc3", PLATFORM_DEVID_AUTO); if (!dwc->dwc3) return -ENOMEM; memset(res, 0x00, sizeof(struct resource) * ARRAY_SIZE(res)); res[0].start = pci_resource_start(pci, 0); res[0].end = pci_resource_end(pci, 0); res[0].name = "dwc_usb3"; res[0].flags = IORESOURCE_MEM; res[1].start = pci->irq; res[1].name = "dwc_usb3"; res[1].flags = IORESOURCE_IRQ; ret = platform_device_add_resources(dwc->dwc3, res, ARRAY_SIZE(res)); if (ret) { dev_err(dev, "couldn't add resources to dwc3 device/n"); return ret; } dwc->pci = pci; dwc->dwc3->dev.parent = dev; ACPI_COMPANION_SET(&dwc->dwc3->dev, ACPI_COMPANION(dev)); ret = dwc3_pci_quirks(dwc); if (ret) goto err; ret = platform_device_add(dwc->dwc3); if (ret) { dev_err(dev, "failed to register dwc3 device/n"); goto err; } device_init_wakeup(dev, true); device_set_run_wake(dev, true); pci_set_drvdata(pci, dwc); pm_runtime_put(dev); return 0;err: platform_device_put(dwc->dwc3); return ret;}
开发者ID:forgivemyheart,项目名称:linux,代码行数:65,
示例8: defined#if defined(CONFIG_TOUCHSCREEN_SYNAPTICS_RMI4_I2C) || defined(CONFIG_TOUCHSCREEN_SYNAPTICS_RMI4_I2C_MODULE)#ifndef CLEARPAD3000_ATTEN_GPIO#define CLEARPAD3000_ATTEN_GPIO (48)#endif#ifndef CLEARPAD3000_RESET_GPIO#define CLEARPAD3000_RESET_GPIO (26)#endif#define KP_INDEX(row, col) ((row)*ARRAY_SIZE(kp_col_gpios) + (col))static unsigned int kp_row_gpios[] = {31, 32, 33, 34, 35};static unsigned int kp_col_gpios[] = {36, 37, 38, 39, 40};static const unsigned short keymap[ARRAY_SIZE(kp_col_gpios) * ARRAY_SIZE(kp_row_gpios)] = { [KP_INDEX(0, 0)] = KEY_7, [KP_INDEX(0, 1)] = KEY_DOWN, [KP_INDEX(0, 2)] = KEY_UP, [KP_INDEX(0, 3)] = KEY_RIGHT, [KP_INDEX(0, 4)] = KEY_ENTER, [KP_INDEX(1, 0)] = KEY_LEFT, [KP_INDEX(1, 1)] = KEY_SEND, [KP_INDEX(1, 2)] = KEY_1, [KP_INDEX(1, 3)] = KEY_4, [KP_INDEX(1, 4)] = KEY_CLEAR, [KP_INDEX(2, 0)] = KEY_6, [KP_INDEX(2, 1)] = KEY_5,
开发者ID:su-haris,项目名称:SKernel,代码行数:31,
示例9: ARRAY_SIZE POWER_SUPPLY_PROP_PRESENT, POWER_SUPPLY_PROP_TECHNOLOGY, POWER_SUPPLY_PROP_VOLTAGE_NOW, POWER_SUPPLY_PROP_TEMP, POWER_SUPPLY_PROP_CAPACITY,};static enum power_supply_property adbattery_ac_props[] = { POWER_SUPPLY_PROP_ONLINE,};static struct power_supply adbattery_bat = { .name = "battery", .type = POWER_SUPPLY_TYPE_BATTERY, .properties = adbattery_battery_props, .num_properties = ARRAY_SIZE(adbattery_battery_props), .get_property = adbattery_bat_get_property, .use_for_apm = 1,};static struct power_supply adbattery_ac = { .name = "ac", .type = POWER_SUPPLY_TYPE_MAINS, .properties = adbattery_ac_props, .num_properties = ARRAY_SIZE(adbattery_ac_props), .get_property = adbattery_ac_get_property,};static struct power_supply adbattery_usb = { .name = "usb", .type = POWER_SUPPLY_TYPE_MAINS,
开发者ID:werty100,项目名称:android_kernel_boxer8_ouya,代码行数:31,
示例10: ns2_genpll_scr_clk_initstatic void __init ns2_genpll_scr_clk_init(struct device_node *node){ iproc_pll_clk_setup(node, &genpll_scr, NULL, 0, genpll_scr_clk, ARRAY_SIZE(genpll_scr_clk));}
开发者ID:0-T-0,项目名称:ps4-linux,代码行数:5,
示例11: ARRAY_SIZE .flags = IORESOURCE_IRQ, }, { .start = IRQ_DM646X_EMACMISCINT, .end = IRQ_DM646X_EMACMISCINT, .flags = IORESOURCE_IRQ, },};static struct platform_device dm646x_emac_device = { .name = "davinci_emac", .id = 1, .dev = { .platform_data = &dm646x_emac_pdata, }, .num_resources = ARRAY_SIZE(dm646x_emac_resources), .resource = dm646x_emac_resources,};static struct resource dm646x_mdio_resources[] = { { .start = DM646X_EMAC_MDIO_BASE, .end = DM646X_EMAC_MDIO_BASE + SZ_4K - 1, .flags = IORESOURCE_MEM, },};static struct platform_device dm646x_mdio_device = { .name = "davinci_mdio", .id = 0, .num_resources = ARRAY_SIZE(dm646x_mdio_resources),
开发者ID:71eh,项目名称:open80211s,代码行数:31,
示例12: ns2_lcpll_ports_clk_initstatic void __init ns2_lcpll_ports_clk_init(struct device_node *node){ iproc_pll_clk_setup(node, &lcpll_ports, NULL, 0, lcpll_ports_clk, ARRAY_SIZE(lcpll_ports_clk));}
开发者ID:0-T-0,项目名称:ps4-linux,代码行数:5,
示例13: mx31ads_map_io/*! * Set up static virtual mappings. */void __init mx31ads_map_io(void){ mxc_map_io(); iotable_init(mx31ads_io_desc, ARRAY_SIZE(mx31ads_io_desc));}
开发者ID:D-Land,项目名称:operating-systems,代码行数:8,
示例14: ARRAY_SIZE .num_modes = 1, .modes = &jzfb_videomode, .lcd_type = LCD_TYPE_SLCD, .bpp = 18, .width = 37, .height = 49, .pinmd = 0, .smart_config.rsply_cmd_high = 0, .smart_config.csply_active_high = 0, .smart_config.newcfg_fmt_conv = 1, .smart_config.write_gram_cmd = frd240a3602b_cmd_buf, .smart_config.length_cmd = ARRAY_SIZE(frd240a3602b_cmd_buf), .smart_config.bus_width = 8, .smart_config.data_table = frd240a3602b_data_table, .smart_config.length_data_table = ARRAY_SIZE(frd240a3602b_data_table), .dither_enable = 0,};#ifdef CONFIG_BACKLIGHT_PWMstatic int backlight_init(struct device *dev){#if 0 int ret; ret = gpio_request(GPIO_LCD_PWM, "Backlight"); if (ret) { printk(KERN_ERR "failed to request GPF for PWM-OUT1/n"); return ret;
开发者ID:lishaman,项目名称:minispeaker,代码行数:30,
示例15: enterprise_panel_initint __init enterprise_panel_init(void){ int err; struct resource __maybe_unused *res; struct board_info board_info; tegra_get_board_info(&board_info); BUILD_BUG_ON(ARRAY_SIZE(enterprise_bl_output_measured_a03) != 256); BUILD_BUG_ON(ARRAY_SIZE(enterprise_bl_output_measured_a02) != 256); if (board_info.fab >= BOARD_FAB_A03) { enterprise_disp1_backlight_data.clk_div = 0x1D; bl_output = enterprise_bl_output_measured_a03; } else bl_output = enterprise_bl_output_measured_a02; enterprise_dsi.chip_id = tegra_get_chipid(); enterprise_dsi.chip_rev = tegra_get_revision();#if defined(CONFIG_TEGRA_NVMAP) enterprise_carveouts[1].base = tegra_carveout_start; enterprise_carveouts[1].size = tegra_carveout_size;#endif 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#ifdef CONFIG_TEGRA_GRHOST err = nvhost_device_register(&tegra_grhost_device); if (err) return err;#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:clemsyn,项目名称:rel-15r7,代码行数:94,
示例16: MSM_GPIO_TO_INT { .name = "host_wake", .start = MSM_GPIO_TO_INT(BT_HOST_WAKE), .end = MSM_GPIO_TO_INT(BT_HOST_WAKE), .flags = IORESOURCE_IRQ, },};static struct bluesleep_platform_data thunderg_bluesleep_data = { .bluetooth_port_num = 0,};static struct platform_device msm_bluesleep_device = { .name = "bluesleep", .id = -1, .num_resources = ARRAY_SIZE(bluesleep_resources), .resource = bluesleep_resources, .dev = { .platform_data = &thunderg_bluesleep_data, }, };void __init lge_add_btpower_devices(void){ bt_power_init();#ifdef CONFIG_BT platform_device_register(&msm_bt_power_device);#endif platform_device_register(&msm_bluesleep_device);}
开发者ID:edgestorm,项目名称:lu3700-cm-gin,代码行数:30,
示例17: platform_clock_initvoid platform_clock_init(void){ clk_init(msm_clocks_fsm9900, ARRAY_SIZE(msm_clocks_fsm9900));}
开发者ID:sndnvaps,项目名称:lk-1,代码行数:4,
示例18: setup }}static void setup(void){ struct passwd *pw; pw = SAFE_GETPWNAM("nobody"); uid = pw->pw_uid; memset(longpathname, 'a', sizeof(longpathname) - 1); SAFE_TOUCH(FNAME1, 0333, NULL); SAFE_TOUCH(DNAME, 0644, NULL); SAFE_SYMLINK(SNAME1, SNAME2); SAFE_SYMLINK(SNAME2, SNAME1);}static struct tst_test test = { .tcnt = ARRAY_SIZE(tcases), .needs_tmpdir = 1, .needs_root = 1, .forks_child = 1, .needs_rofs = 1, .mntpoint = MNT_POINT, .setup = setup, .test = verify_access,};
开发者ID:kraj,项目名称:ltp,代码行数:30,
示例19: enable_dev/** * Create device structures and allocate resources to devices specified in the * pnp_dev_info array (above). * * @param dev Pointer to structure describing a Super I/O device. */static void enable_dev(struct device *dev){ pnp_enable_devices(dev, &pnp_ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);}
开发者ID:tidatida,项目名称:coreboot,代码行数:11,
示例20: lock_cachefile//.........这里部分代码省略......... n = write(cachefile, &buffer, sizeof(int) * 3); if (n == -1) { outputerr("something went wrong writing the cachefile! : %s/n", strerror(errno)); return FALSE; } return TRUE;}static bool generate_socket(unsigned int family, unsigned int protocol, unsigned int type){ struct socket_triplet st; int fd; st.family = family; st.type = type; st.protocol = protocol; fd = open_socket(st.family, st.type, st.protocol); if (fd > -1) { write_socket_to_cache(&st); return TRUE; } output(2, "Couldn't open socket %d:%d:%d. %s/n", family, type, protocol, strerror(errno)); return FALSE;}static bool generate_specific_socket(int family){ struct socket_triplet st; int fd; st.family = family; BUG_ON(st.family >= ARRAY_SIZE(no_domains)); if (no_domains[st.family]) return FALSE; if (get_domain_name(st.family) == NULL) return FALSE; if (valid_proto(st.family) == FALSE) { outputerr("Can't do protocol %s/n", get_domain_name(st.family)); return FALSE; } st.protocol = rnd() % 256; if (sanitise_socket_triplet(&st) == -1) rand_proto_type(&st); fd = open_socket(st.family, st.type, st.protocol); if (fd == -1) { output(0, "Couldn't open socket (%d:%d:%d). %s/n", st.family, st.type, st.protocol, strerror(errno)); return FALSE; } return write_socket_to_cache(&st);}#define NR_SOCKET_FDS 50static bool generate_sockets(void){ int i, r, ret = FALSE;
开发者ID:kernelslacker,项目名称:trinity,代码行数:67,
示例21: ARRAY_SIZE "i2c2", "i2c3", "nand", "sd", "uart0", "uart1", "uart2", "usb0", "usb1", "usb2", "usb3",};static struct uniphier_pinctrl_socdata uniphier_ld6b_pinctrl_socdata = { .pins = uniphier_ld6b_pins, .pins_count = ARRAY_SIZE(uniphier_ld6b_pins), .groups = uniphier_ld6b_groups, .groups_count = ARRAY_SIZE(uniphier_ld6b_groups), .functions = uniphier_ld6b_functions, .functions_count = ARRAY_SIZE(uniphier_ld6b_functions),};static int uniphier_ld6b_pinctrl_probe(struct udevice *dev){ return uniphier_pinctrl_probe(dev, &uniphier_ld6b_pinctrl_socdata);}static const struct udevice_id uniphier_ld6b_pinctrl_match[] = { { .compatible = "socionext,ph1-ld6b-pinctrl" }, { /* sentinel */ }};
开发者ID:675816156,项目名称:uboot-2016-for-itop4412,代码行数:31,
示例22: ARRAY_SIZEstruct ustat ubuf;static struct test_case_t { char *err_desc; int exp_errno; char *exp_errval; dev_t *dev; struct ustat *buf;} tc[] = { {"Invalid parameter", EINVAL, "EINVAL", &invalid_dev, &ubuf},#ifndef UCLINUX {"Bad address", EFAULT, "EFAULT", &root_dev, (void*)-1}#endif};int TST_TOTAL = ARRAY_SIZE(tc);int main(int ac, char **av){ int lc, i; char *msg; if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); setup(); for (lc = 0; TEST_LOOPING(lc); lc++) { tst_count = 0;
开发者ID:dacongy,项目名称:ltp,代码行数:30,
示例23: module_initstatic int module_init(void){ conf_get_str(conf_cur(), "auloop_codec", aucodec, sizeof(aucodec)); return cmd_register(cmdv, ARRAY_SIZE(cmdv));}
开发者ID:AmesianX,项目名称:baresip,代码行数:6,
示例24: pxa910_clk_initvoid __init pxa910_clk_init(void){ struct clk *clk; struct clk *uart_pll; void __iomem *mpmu_base; void __iomem *apmu_base; void __iomem *apbcp_base; void __iomem *apbc_base; mpmu_base = ioremap(APB_PHYS_BASE + 0x50000, SZ_4K); if (mpmu_base == NULL) { pr_err("error to ioremap MPMU base/n"); return; } apmu_base = ioremap(AXI_PHYS_BASE + 0x82800, SZ_4K); if (apmu_base == NULL) { pr_err("error to ioremap APMU base/n"); return; } apbcp_base = ioremap(APB_PHYS_BASE + 0x3b000, SZ_4K); if (apbcp_base == NULL) { pr_err("error to ioremap APBC extension base/n"); return; } apbc_base = ioremap(APB_PHYS_BASE + 0x15000, SZ_4K); if (apbc_base == NULL) { pr_err("error to ioremap APBC base/n"); return; } clk = clk_register_fixed_rate(NULL, "clk32", NULL, CLK_IS_ROOT, 3200); clk_register_clkdev(clk, "clk32", NULL); clk = clk_register_fixed_rate(NULL, "vctcxo", NULL, CLK_IS_ROOT, 26000000); clk_register_clkdev(clk, "vctcxo", NULL); clk = clk_register_fixed_rate(NULL, "pll1", NULL, CLK_IS_ROOT, 624000000); clk_register_clkdev(clk, "pll1", NULL); clk = clk_register_fixed_factor(NULL, "pll1_2", "pll1", CLK_SET_RATE_PARENT, 1, 2); clk_register_clkdev(clk, "pll1_2", NULL); clk = clk_register_fixed_factor(NULL, "pll1_4", "pll1_2", CLK_SET_RATE_PARENT, 1, 2); clk_register_clkdev(clk, "pll1_4", NULL); clk = clk_register_fixed_factor(NULL, "pll1_8", "pll1_4", CLK_SET_RATE_PARENT, 1, 2); clk_register_clkdev(clk, "pll1_8", NULL); clk = clk_register_fixed_factor(NULL, "pll1_16", "pll1_8", CLK_SET_RATE_PARENT, 1, 2); clk_register_clkdev(clk, "pll1_16", NULL); clk = clk_register_fixed_factor(NULL, "pll1_6", "pll1_2", CLK_SET_RATE_PARENT, 1, 3); clk_register_clkdev(clk, "pll1_6", NULL); clk = clk_register_fixed_factor(NULL, "pll1_12", "pll1_6", CLK_SET_RATE_PARENT, 1, 2); clk_register_clkdev(clk, "pll1_12", NULL); clk = clk_register_fixed_factor(NULL, "pll1_24", "pll1_12", CLK_SET_RATE_PARENT, 1, 2); clk_register_clkdev(clk, "pll1_24", NULL); clk = clk_register_fixed_factor(NULL, "pll1_48", "pll1_24", CLK_SET_RATE_PARENT, 1, 2); clk_register_clkdev(clk, "pll1_48", NULL); clk = clk_register_fixed_factor(NULL, "pll1_96", "pll1_48", CLK_SET_RATE_PARENT, 1, 2); clk_register_clkdev(clk, "pll1_96", NULL); clk = clk_register_fixed_factor(NULL, "pll1_13", "pll1", CLK_SET_RATE_PARENT, 1, 13); clk_register_clkdev(clk, "pll1_13", NULL); clk = clk_register_fixed_factor(NULL, "pll1_13_1_5", "pll1", CLK_SET_RATE_PARENT, 2, 3); clk_register_clkdev(clk, "pll1_13_1_5", NULL); clk = clk_register_fixed_factor(NULL, "pll1_2_1_5", "pll1", CLK_SET_RATE_PARENT, 2, 3); clk_register_clkdev(clk, "pll1_2_1_5", NULL); clk = clk_register_fixed_factor(NULL, "pll1_3_16", "pll1", CLK_SET_RATE_PARENT, 3, 16); clk_register_clkdev(clk, "pll1_3_16", NULL); uart_pll = mmp_clk_register_factor("uart_pll", "pll1_4", 0, mpmu_base + MPMU_UART_PLL, &uart_factor_masks, uart_factor_tbl, ARRAY_SIZE(uart_factor_tbl));//.........这里部分代码省略.........
开发者ID:0x000000FF,项目名称:Linux4Edison,代码行数:101,
示例25: ARRAY_SIZE { 0x18, KEY_UP}, { 0x19, KEY_DOWN}, { 0x1a, KEY_LEFT}, { 0x1b, KEY_RIGHT}, { 0x1c, KEY_RED}, { 0x1d, KEY_GREEN}, { 0x1e, KEY_YELLOW}, { 0x1f, KEY_BLUE},};static struct rc_map_list kaiomy_map = { .map = { .scan = kaiomy, .size = ARRAY_SIZE(kaiomy), .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */ .name = RC_MAP_KAIOMY, }};static int __init init_rc_map_kaiomy(void){ return rc_map_register(&kaiomy_map);}static void __exit exit_rc_map_kaiomy(void){ rc_map_unregister(&kaiomy_map);}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:29,
示例26: hw_devices_initstatic int __devinit hw_devices_init(void){ sensor_layout_init(); i2c_register_board_info(0, k3v2oem1_i2c_0_boardinfo, ARRAY_SIZE(k3v2oem1_i2c_0_boardinfo)); return 0;}
开发者ID:Wonfee,项目名称:huawei_u9508_kernel,代码行数:6,
示例27: KEY KEY(2, 5, KEY_S), KEY(3, 5, KEY_W), KEY(4, 5, KEY_P), KEY(5, 5, KEY_Q), KEY(6, 5, KEY_A), KEY(0, 6, KEY_CONNECT), /* Voice button */ KEY(2, 6, KEY_CANCEL), /* End key */ KEY(3, 6, KEY_VOLUMEDOWN), /* Volume down */ KEY(4, 6, KEY_F1), /* Left bar (landscape) */ KEY(5, 6, KEY_WWW), /* OK button (portrait) */ KEY(6, 6, KEY_CALENDAR), /* Left bar (portrait) */};static const struct matrix_keymap_data htc_herald_keymap_data = { .keymap = htc_herald_keymap, .keymap_size = ARRAY_SIZE(htc_herald_keymap),};static struct omap_kp_platform_data htcherald_kp_data = { .rows = 7, .cols = 7, .delay = 20, .rep = true, .keymap_data = &htc_herald_keymap_data,};static struct resource kp_resources[] = { [0] = { .start = INT_7XX_MPUIO_KEYPAD, .end = INT_7XX_MPUIO_KEYPAD, .flags = IORESOURCE_IRQ,
开发者ID:dana,项目名称:linux,代码行数:31,
示例28: ARRAY_SIZE * any TE signal. The value of refresh_rate is also used to * calculate the pixel clock. */ .refresh_rate = 66, .rated_refresh_rate = 60,#else .refresh_rate = 60,#endif .virtual_channel = TEGRA_DSI_VIRTUAL_CHANNEL_0, .panel_has_frame_buffer = true, .dsi_instance = 0, .panel_reset = DSI_PANEL_RESET, .power_saving_suspend = true, .n_init_cmd = ARRAY_SIZE(dsi_init_cmd), .dsi_init_cmd = dsi_init_cmd, .n_early_suspend_cmd = ARRAY_SIZE(dsi_early_suspend_cmd), .dsi_early_suspend_cmd = dsi_early_suspend_cmd, .n_late_resume_cmd = ARRAY_SIZE(dsi_late_resume_cmd), .dsi_late_resume_cmd = dsi_late_resume_cmd, .n_suspend_cmd = ARRAY_SIZE(dsi_suspend_cmd), .dsi_suspend_cmd = dsi_suspend_cmd, .video_data_type = TEGRA_DSI_VIDEO_TYPE_COMMAND_MODE, .lp_cmd_mode_freq_khz = 20000, /* TODO: Get the vender recommended freq */
开发者ID:clemsyn,项目名称:rel-15r7,代码行数:31,
示例29: ARRAY_SIZE { .name = "kernel", .offset = MTDPART_OFS_APPEND, .size = 8 * 1024 * 1024, }, { .name = "data", .offset = MTDPART_OFS_APPEND, .size = MTDPART_SIZ_FULL, },};static struct physmap_flash_data nor_flash_data = { .width = 2, .parts = nor_flash_partitions, .nr_parts = ARRAY_SIZE(nor_flash_partitions),};static struct resource nor_flash_resources[] = { [0] = { .start = 0x20000000, /* CS0 shadow instead of regular CS0 */ .end = 0x28000000 - 1, /* needed by USB MASK ROM boot */ .flags = IORESOURCE_MEM, }};static struct platform_device nor_flash_device = { .name = "physmap-flash", .dev = { .platform_data = &nor_flash_data, },
开发者ID:AllenWeb,项目名称:linux,代码行数:31,
示例30: ARRAY_SIZE#include <linux/module.h>#include <linux/device.h>#include <linux/platform_device.h>#include <sound/core.h>#include <sound/pcm.h>#include <sound/soc.h>static struct snd_soc_dai_ops msm_fe_dai_ops = {};/* Conventional and unconventional sample rate supported */static unsigned int supported_sample_rates[] = { 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000};static struct snd_pcm_hw_constraint_list constraints_sample_rates = { .count = ARRAY_SIZE(supported_sample_rates), .list = supported_sample_rates, .mask = 0,};static int multimedia_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai){ snd_pcm_hw_constraint_list(substream->runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &constraints_sample_rates); return 0;}static struct snd_soc_dai_ops msm_fe_Multimedia_dai_ops = {
开发者ID:FPChaim,项目名称:android_kernel_lge_msm7x27-3.0.x,代码行数:31,
注:本文中的ARRAY_SIZE函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ARRAY_SIZE_IN_ELEMENTS函数代码示例 C++ ARRAY_LENGTH函数代码示例 |