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

C++ NV_ARRAY_SIZE函数代码示例

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

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



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

示例1: NvRmPrivIoPowerControlInit

void NvRmPrivIoPowerControlInit(NvRmDeviceHandle hRmDeviceHandle)
{
    NvU32 i, v;
    NvU32 NoIoPwrMask = 0;
    const NvOdmPeripheralConnectivity* pPmuRail = NULL;

    if (NvRmPrivGetExecPlatform(hRmDeviceHandle) != ExecPlatform_Soc)
    {
        // Invalidate IO Power detect map if not SoC platform
        for (i = 0; i < NV_ARRAY_SIZE(s_IoPowerDetectMap); i++)
            s_IoPowerDetectMap[i].PmuRailAddress = NV_RAIL_ADDR_INVALID;
        return;
    }

    for (i = 0; i < NV_ARRAY_SIZE(s_IoPowerDetectMap); i++)
    {
        // Fill in PMU rail addresses in IO Power detect map
        pPmuRail = NvOdmPeripheralGetGuid(s_IoPowerDetectMap[i].PowerRailId);
        NV_ASSERT(pPmuRail && pPmuRail->NumAddress);
        s_IoPowerDetectMap[i].PmuRailAddress = pPmuRail->AddressList[0].Address;

        // Find all unpowered rails
        v = NvRmPrivPmuRailGetVoltage(
            hRmDeviceHandle, s_IoPowerDetectMap[i].PowerRailId);
        if (v == ODM_VOLTAGE_OFF)
            NoIoPwrMask |= s_IoPowerDetectMap[i].DisableRailMask;
    }

    // Latch already powered IO rails
    NvRmPrivIoPowerDetectLatch(hRmDeviceHandle);

    // Disable IO pads for unpowered rails
    if (NoIoPwrMask)
        NvRmPrivIoPowerControl(hRmDeviceHandle, NoIoPwrMask, NV_FALSE);
}
开发者ID:BuzzBumbleBee,项目名称:gtab-2632,代码行数:35,代码来源:ap15rm_power.c


示例2:

const NvOdmUsbProperty *NvOdmQueryGetUsbProperty(
    NvOdmIoModule Module,
    NvU32 Instance)
{
    static const NvOdmUsbProperty usb[] =
    {
        {
            NvOdmUsbInterfaceType_Utmi,
            (NvOdmUsbChargerType_SE0 | NvOdmUsbChargerType_SE1 |
            NvOdmUsbChargerType_SK),
            20, NV_TRUE, NvOdmUsbModeType_Device, NvOdmUsbIdPinType_CableId,
            NvOdmUsbConnectorsMuxType_None, NV_TRUE, { 0, 0, 0, 0 }
        },
        {
            NvOdmUsbInterfaceType_UlpiExternalPhy,
            NvOdmUsbChargerType_UsbHost,
            20, NV_TRUE, NvOdmUsbModeType_Host, NvOdmUsbIdPinType_None,
            NvOdmUsbConnectorsMuxType_None, NV_TRUE, { 0, 0, 0, 0 }
        },
        {
            NvOdmUsbInterfaceType_Utmi,
            NvOdmUsbChargerType_UsbHost,
            20, NV_TRUE, NvOdmUsbModeType_Host, NvOdmUsbIdPinType_None,
            NvOdmUsbConnectorsMuxType_None, NV_TRUE, { 0, 0, 0, 0 }
        },
    };

    if (Module != NvOdmIoModule_Usb || Instance >= NV_ARRAY_SIZE(usb))
        return NULL;

    return &usb[Instance];
}
开发者ID:BuzzBumbleBee,项目名称:android_kernel_advent_vega,代码行数:32,代码来源:nvodm_query.c


示例3: NvOdmMouseEnableInterrupt

NvBool NvOdmMouseEnableInterrupt(
    NvOdmMouseDeviceHandle hDevice, 
    NvOdmOsSemaphoreHandle hInterruptSemaphore)
{
    NvError Status = NvSuccess;
    NvEcEventType EventTypes[] = {
        (NvEcEventType) (NvEcEventType_AuxDevice0 + MOUSE_PS2_PORT_ID_0),
        (NvEcEventType) (NvEcEventType_AuxDevice0 + MOUSE_PS2_PORT_ID_1)
    };

    Status = NvEcRegisterForEvents(
        hDevice->hEc,
        &hDevice->hEcEventRegister,
        (NvOsSemaphoreHandle)hInterruptSemaphore,
        NV_ARRAY_SIZE(EventTypes), // number of EventType's
        EventTypes,                // Auxillary 0 event
        1,                         // One event packet is expected
        // event packet size = packet overhead + size of the mouse sample;
        // max sample size is 4 bytes (for an Intellimouse 5-button mouse)
        NVEC_MIN_EVENT_SIZE+4); 

    if (Status != NvSuccess)
        return NV_FALSE;

    return NV_TRUE;
}
开发者ID:BuzzBumbleBee,项目名称:android_kernel_advent_vega,代码行数:26,代码来源:nvodm_mouse.c


示例4: return

const NvOdmWakeupPadInfo *NvOdmQueryGetWakeupPadTable(NvU32 *pSize)
{
    if (pSize)
        *pSize = NV_ARRAY_SIZE(s_NvOdmWakeupPadInfo);

    return (const NvOdmWakeupPadInfo *) s_NvOdmWakeupPadInfo;
}
开发者ID:BuzzBumbleBee,项目名称:gtab-2632,代码行数:7,代码来源:nvodm_query.c


示例5: NvOdmKbcKeyMappingGetVirtualKeyMappingList

NvU32
NvOdmKbcKeyMappingGetVirtualKeyMappingList(
    const struct NvOdmKeyVirtTableDetail ***pVirtKeyTableList)
{
   *pVirtKeyTableList = s_pVirtualKeyTables;
   return NV_ARRAY_SIZE(s_pVirtualKeyTables);
}
开发者ID:0x0f,项目名称:adam-kernel,代码行数:7,代码来源:nvodm_kbc_keymapping.c


示例6: NvOdmQueryDapPortGetProperty

const NvOdmQueryDapPortProperty *
NvOdmQueryDapPortGetProperty(
    NvU32 DapPortId)
{
    if (DapPortId > 0 && DapPortId < NV_ARRAY_SIZE(s_NvOdmQueryDapPortInfoTable) )
        return &s_NvOdmQueryDapPortInfoTable[DapPortId];

    return NULL;
}
开发者ID:BuzzBumbleBee,项目名称:gtab-2632,代码行数:9,代码来源:nvodm_query.c


示例7: NvOdmQueryPinAttributes

NvU32
NvOdmQueryPinAttributes(const NvOdmPinAttrib** pPinAttributes)
{
    if (pPinAttributes)
    {
        *pPinAttributes = &pin_config[0];
        return NV_ARRAY_SIZE(pin_config);
    }
    return 0;
}
开发者ID:BuzzBumbleBee,项目名称:gtab-2632,代码行数:10,代码来源:nvodm_query.c


示例8: Adt7461ParameterCapsGet

void
Adt7461ParameterCapsGet(
    NvOdmTmonDeviceHandle hTmon,
    NvOdmTmonZoneID ZoneId,
    NvOdmTmonConfigParam ParamId,
    NvOdmTmonParameterCaps* pCaps)
{
    NvBool ExtRange;
    ADT7461PrivData* pPrivData;
    const ADT7461ChannelInfo* pChannel;

    NV_ASSERT(hTmon && hTmon->pPrivate && pCaps);
    pPrivData = hTmon->pPrivate;
#if PRE_ER_GMT_THERMALSENSOR
    ExtRange = 0; /* not support ADT thermal sensor*/
#else
    ExtRange = ((pPrivData->ShadowConfig &
                 ADT7461ConfigBits_ExtendedRange) != 0);
#endif			

    pChannel = &pPrivData->pDeviceInfo->Channels[(
        pPrivData->ConnectivityMap[ZoneId])];

    switch (ParamId)
    {
        case NvOdmTmonConfigParam_IntrLimitHigh:
        case NvOdmTmonConfigParam_IntrLimitLow:
            pCaps->OdmProtected =
                pChannel->ChannelPolicy.IntrLimitsOdmProtected;
            break;

        case NvOdmTmonConfigParam_HwLimitCrit:
            pCaps->OdmProtected =
                pChannel->ChannelPolicy.HwLimitCritOdmProtected;
            break;

        case NvOdmTmonConfigParam_SampleMs:
            // smaple intervals in descending order
            pCaps->MaxValue = s_Adt7461SampleIntervalsMS[0];
            pCaps->MinValue = s_Adt7461SampleIntervalsMS[(
                NV_ARRAY_SIZE(s_Adt7461SampleIntervalsMS) - 1)];
            pCaps->OdmProtected = pChannel->ChannelPolicy.RateOdmProtected;
            return;

        default:        // unsupported parameter
            pCaps->MaxValue = ODM_TMON_PARAMETER_UNSPECIFIED;
            pCaps->MinValue = ODM_TMON_PARAMETER_UNSPECIFIED;
            pCaps->OdmProtected = NV_TRUE;
            return;
    }

    // Common range for limits
    pCaps->MaxValue = ADT7461_T_RANGE_LIMIT_HIGH(ExtRange);
    pCaps->MinValue = ADT7461_T_RANGE_LIMIT_LOW(ExtRange);
}
开发者ID:nopy,项目名称:kernel_folio100,代码行数:55,代码来源:nvodm_tmon_adt7461.c


示例9: NvOdmKbcKeyMappingGetVirtualKeyMappingList

NvU32 
NvOdmKbcKeyMappingGetVirtualKeyMappingList(
    const struct NvOdmKeyVirtTableDetail ***pVirtKeyTableList)
{

   if (HWREV_REV(system_rev) <= HWREV_REV_1C)
	s_ScvkKeyMap.pVirtualKeyTable = KbcLayOutVirtualKey_P1C;


   *pVirtKeyTableList = s_pVirtualKeyTables;
   return NV_ARRAY_SIZE(s_pVirtualKeyTables);
}
开发者ID:Atrix-Dev-Team,项目名称:kernel-MB860,代码行数:12,代码来源:nvodm_kbc_keymapping.c


示例10: Adt7461ConfigureSampleInterval

static NvBool
Adt7461ConfigureSampleInterval(
    ADT7461PrivData* pPrivData,
    NvBool OdmProtected,
    NvS32* pTargetMs)
{
    NvU8 i;
    NvS32 Delta;
    const ADT7461RegisterInfo* pReg = &pPrivData->pDeviceInfo->Rate;

    if (OdmProtected ||
        ((*pTargetMs) == ODM_TMON_PARAMETER_UNSPECIFIED))
    {
        // Read ADT7461 rate register (fail the call if returned data
        // does not make sense)
        if(!Adt7461ReadReg(pPrivData, pReg, &i))
            return NV_FALSE;
        if (i >= NV_ARRAY_SIZE(s_Adt7461SampleIntervalsMS))
            return NV_FALSE;
    }
    else
    {
        // Find and set the best floor approximation of the target sample
        // interval. Note the descending order of sample intervals array.
        for (i = 0; i < NV_ARRAY_SIZE(s_Adt7461SampleIntervalsMS); i++)
        {
            Delta = (*pTargetMs) - s_Adt7461SampleIntervalsMS[i];
            if(Delta >= 0)
                break;
        }
        if (i == NV_ARRAY_SIZE(s_Adt7461SampleIntervalsMS))
            i--;    // min interval is the best we can do

        if(!Adt7461WriteReg(pPrivData, pReg, i))
            return NV_FALSE;
        pPrivData->ShadowRate = i;
    }
    *pTargetMs = s_Adt7461SampleIntervalsMS[i];
    return NV_TRUE;
}
开发者ID:nopy,项目名称:kernel_folio100,代码行数:40,代码来源:nvodm_tmon_adt7461.c


示例11: switch

const NvOdmGpioPinInfo *NvOdmQueryGpioPinMap(NvOdmGpioPinGroup Group,
    NvU32 Instance, NvU32 *pCount)
{
    switch (Group)
    {
        case NvOdmGpioPinGroup_Display:
            *pCount = NV_ARRAY_SIZE(s_display);
            return s_display;

        case NvOdmGpioPinGroup_Hdmi:
            *pCount = NV_ARRAY_SIZE(s_hdmi);
            return s_hdmi;

        case NvOdmGpioPinGroup_Sdio:
            if (Instance == 2)
            {
                *pCount = NV_ARRAY_SIZE(s_sdio);
                return s_sdio;
            }
            else
            {
                *pCount = 0;
                return NULL;
            }

        case NvOdmGpioPinGroup_Bluetooth:
            *pCount = NV_ARRAY_SIZE(s_Bluetooth);
            return s_Bluetooth;

        case NvOdmGpioPinGroup_Wlan:
            *pCount = NV_ARRAY_SIZE(s_Wlan);
            return s_Wlan;

        case NvOdmGpioPinGroup_Vi:
            *pCount = NV_ARRAY_SIZE(s_vi);
            return s_vi;

        case NvOdmGpioPinGroup_keypadMisc:
                *pCount = NV_ARRAY_SIZE(s_GpioKeyBoard);
                return s_GpioKeyBoard;

        case NvOdmGpioPinGroup_Battery:
            *pCount = NV_ARRAY_SIZE(s_Battery);
            return s_Battery;

        default:
            *pCount = 0;
            return NULL;
    }
}
开发者ID:0x0f,项目名称:adam-kernel,代码行数:50,代码来源:nvodm_query_gpio.c


示例12: NvOdmQueryDapPortGetConnectionTable

const NvOdmQueryDapPortConnection*
NvOdmQueryDapPortGetConnectionTable(
    NvU32 ConnectionIndex)
{
    NvU32 TableIndex   = 0;
    for( TableIndex = 0; 
         TableIndex < NV_ARRAY_SIZE(s_NvOdmQueryDapPortConnectionTable);
         TableIndex++)
    {
        if (s_NvOdmQueryDapPortConnectionTable[TableIndex].UseIndex 
                                                    == ConnectionIndex)
            return &s_NvOdmQueryDapPortConnectionTable[TableIndex];
    }
    return NULL;
}
开发者ID:BuzzBumbleBee,项目名称:gtab-2632,代码行数:15,代码来源:nvodm_query.c


示例13: NvOdmQueryGetSdioInterfaceProperty

const NvOdmQuerySdioInterfaceProperty* NvOdmQueryGetSdioInterfaceProperty(
    NvU32 Instance)
{
    static const NvOdmQuerySdioInterfaceProperty sdio[] =
    {
        { NV_FALSE, 10, NV_TRUE, 0x8, NvOdmQuerySdioSlotUsage_wlan   },
        { NV_FALSE,  0, NV_FALSE, 0, NvOdmQuerySdioSlotUsage_unused  },
        { NV_TRUE,   0, NV_FALSE, 0x6, NvOdmQuerySdioSlotUsage_Media },
        { NV_FALSE,  0, NV_FALSE, 0x4, NvOdmQuerySdioSlotUsage_Boot  },
    };

    if (Instance < NV_ARRAY_SIZE(sdio))
        return &sdio[Instance];

    return NULL;
}
开发者ID:BuzzBumbleBee,项目名称:android_kernel_advent_vega,代码行数:16,代码来源:nvodm_query.c


示例14: UsbPhyOpenHwInterface

static void
UsbPhyOpenHwInterface(
    NvDdkUsbPhyHandle hUsbPhy)
{
    static NvDdkUsbPhyCapabilities s_UsbPhyCap[] =
    {
        //  AP15
        { NV_FALSE, NV_FALSE },
        //  AP16
        { NV_FALSE, NV_TRUE },
        //  AP20
        { NV_TRUE, NV_FALSE},
    };
    NvDdkUsbPhyCapabilities *pUsbfCap = NULL;
    NvRmModuleCapability s_UsbPhyCaps[] =
    {
        {1, 0, 0, &s_UsbPhyCap[0]},  // AP15 A01
        {1, 1, 0, &s_UsbPhyCap[0]},  // AP15 A02
        {1, 2, 0, &s_UsbPhyCap[1]},  // AP16, USB1
        {1, 3, 0, &s_UsbPhyCap[1]},  // AP16, USB2
        {1, 5, 0, &s_UsbPhyCap[2]}, // AP20, USB1
        {1, 6, 0, &s_UsbPhyCap[2]}, // AP20, USB2
        {1, 7, 0, &s_UsbPhyCap[2]}, // AP20, USB3
    };

    NV_ASSERT_SUCCESS(
        NvRmModuleGetCapabilities(hUsbPhy->hRmDevice,
            NVRM_MODULE_ID(NvRmModuleID_Usb2Otg, hUsbPhy->Instance),
            s_UsbPhyCaps, NV_ARRAY_SIZE(s_UsbPhyCaps),
            (void**)&pUsbfCap));

    // Fill the client capabilities structure.
    NvOsMemcpy(&hUsbPhy->Caps, pUsbfCap, sizeof(NvDdkUsbPhyCapabilities));

    //NvOsDebugPrintf("NvDdkUsbPhyCapabilities::\n");
    //NvOsDebugPrintf("PhyRegInController::[%d] 0-FALSE 1-TRUE\n", hUsbPhy->Caps.PhyRegInController);
    //NvOsDebugPrintf("CommonClockAndReset::[%d] 0-FALSE 1-TRUE\n", hUsbPhy->Caps.CommonClockAndReset);

    if (hUsbPhy->Caps.PhyRegInController)
    {
        //NvOsDebugPrintf("AP20 USB Controllers\n");
        Ap20UsbPhyOpenHwInterface(hUsbPhy);
    }
}
开发者ID:BuzzBumbleBee,项目名称:android_kernel_advent_vega,代码行数:44,代码来源:nvddk_usbphy.c


示例15: IoPowerMapRail

static void IoPowerMapRail(
    NvU32 PmuRailAddress,
    NvU32* pIoPwrDetectMask,
    NvU32* pNoIoPwrMask)
{
    NvU32 i;
    *pIoPwrDetectMask = 0;
    *pNoIoPwrMask = 0;

    // Find all power detect cells and controls on this IO rail
    for (i = 0; i < NV_ARRAY_SIZE(s_IoPowerDetectMap); i++)
    {
        if (s_IoPowerDetectMap[i].PmuRailAddress == PmuRailAddress)
        {
            *pIoPwrDetectMask |= s_IoPowerDetectMap[i].EnablePwrDetMask;
            *pNoIoPwrMask |= s_IoPowerDetectMap[i].DisableRailMask;
        }
    }
}
开发者ID:BuzzBumbleBee,项目名称:gtab-2632,代码行数:19,代码来源:ap15rm_power.c


示例16: NvRm_Dispatch_Others

NvError NvRm_Dispatch_Others( void *InBuffer, NvU32 InSize, void *OutBuffer, NvU32 OutSize, NvDispatchCtx* Ctx )
{
    NvU32 packid_;
    NvU32 funcid_;
    NvIdlDispatchTable *table_;

    NV_ASSERT( InBuffer );
    NV_ASSERT( OutBuffer );

    packid_ = ((NvU32 *)InBuffer)[0];
    funcid_ = ((NvU32 *)InBuffer)[1];
    table_ = gs_DispatchTable;

    switch (packid_)
    {
        case NvRm_nvrm_init:
            if ( !(s_FuncAllowedInNvrmInitPackage & (1 << funcid_)) )
                goto fail;
            break;
        case NvRm_nvrm_module:
            if ( !(s_FuncAllowedInNvrmModulePackage & (1 << funcid_)) )
                goto fail;
            break;
        case NvRm_nvrm_power:
            if ( !(s_FuncAllowedInNvrmPowerPackage_1 & (1 << funcid_)) )
                goto fail;
            break;
        default:
            goto fail;
    }

    if ( packid_-1 >= NV_ARRAY_SIZE(gs_DispatchTable) ||
         !table_[packid_ - 1].DispFunc )
        return NvError_IoctlFailed;

    return table_[packid_ - 1].DispFunc( funcid_, InBuffer, InSize,
        OutBuffer, OutSize, Ctx );
fail:
    pr_debug("\n\n\n\n*****nvrm dispatch permission error,"
        "packid_=%d, funcid_=%d,uid=%d,gid=%d****\n\n\n\n",
        packid_, funcid_, (int)sys_getuid(), (int)sys_getgid());
    return NvError_IoctlFailed;
}
开发者ID:Atrix-Dev-Team,项目名称:kernel-MB860,代码行数:43,代码来源:NvRm_Dispatch.c


示例17: write_sysfs_accel

/** Function to take settings values to the caller modules/application
 * though the use of sysfs. This function can be used to set the
 * device specific caps/attributes as specidied by the caller modules/app
 *  This function maps to store of sysfs
 */
ssize_t write_sysfs_accel(struct device *dev,
	struct device_attribute *attr, const char *buffer, size_t count)
{
	NvS32  i = 0;
	NvS8 *input;
	NvS32 value;

	count = count > READ_BUFFER_LENGTH ? READ_BUFFER_LENGTH : count;
	input = kzalloc(((int)count+1), GFP_KERNEL);
	if (!input) {
		goto err_0;
	}

	memcpy(input, buffer, count);

	input[count] = '\0';
	for (i=0; i<NV_ARRAY_SIZE(parameter); i++)  {
		if (count > strlen(parameter[i]) &&
			!strncmp(parameter[i], input, strlen(parameter[i]))) {
			value = simple_strtol(&input[strlen(parameter[i])],
				'\0', 10);
			accel_enum = i;
			goto proceed;
		}
	}
	goto err_0;

proceed:
	if (accel_dev->hOdmAcr)
		change_nvodm_accelerometer_settings(accel_enum, value);
	else
		count = 0;

	kfree(input);
	return count;
err_0:
	if(input)
		kfree(input);
	count = 0;
	return count;

}
开发者ID:Feeyo,项目名称:LG_Optimus2X,代码行数:47,代码来源:tegra_odm_accel.c


示例18: NvRm_Dispatch

NvError NvRm_Dispatch( void *InBuffer, NvU32 InSize, void *OutBuffer, NvU32 OutSize, NvDispatchCtx* Ctx )
{
    NvU32 packid_;
    NvU32 funcid_;
    NvIdlDispatchTable *table_;

    NV_ASSERT( InBuffer );
    NV_ASSERT( OutBuffer );

    packid_ = ((NvU32 *)InBuffer)[0];
    funcid_ = ((NvU32 *)InBuffer)[1];
    table_ = gs_DispatchTable;

    if ( packid_-1 >= NV_ARRAY_SIZE(gs_DispatchTable) ||
         !table_[packid_ - 1].DispFunc )
        return NvError_IoctlFailed;

    return table_[packid_ - 1].DispFunc( funcid_, InBuffer, InSize,
        OutBuffer, OutSize, Ctx );
}
开发者ID:Atrix-Dev-Team,项目名称:kernel-MB860,代码行数:20,代码来源:NvRm_Dispatch.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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