当前位置: 首页>>代码示例>>C++>>正文


C++ ALSPS_LOG函数代码示例

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


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

示例1: ps_store_delay

static ssize_t ps_store_delay(struct device* dev, struct device_attribute *attr,
                                  const char *buf, size_t count)

{
    int delay=0;
    int m_delay=0;
    struct alsps_context *cxt = NULL;
    mutex_lock(&alsps_context_obj->alsps_op_mutex);
    cxt = alsps_context_obj;
    if(NULL == cxt->ps_ctl.set_delay)
    {
        ALSPS_LOG("ps_ctl set_delay NULL\n");
        mutex_unlock(&alsps_context_obj->alsps_op_mutex);
         return count;
    }

    if (1 != sscanf(buf, "%d", &delay)) {
        ALSPS_ERR("invalid format!!\n");
        mutex_unlock(&alsps_context_obj->alsps_op_mutex);
        return count;
    }

    if(false == cxt->ps_ctl.is_report_input_direct)
    {
        m_delay = (int)delay/1000/1000;
        atomic_set(&alsps_context_obj->delay_ps, m_delay);
    }
    cxt->ps_ctl.set_delay(delay);
    ALSPS_LOG(" ps_delay %d ns\n",delay);
    mutex_unlock(&alsps_context_obj->alsps_op_mutex);
    return count;

}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:33,代码来源:alsps.c

示例2: ps_store_active

static ssize_t ps_store_active(struct device* dev, struct device_attribute *attr,
                                  const char *buf, size_t count)
{
    struct alsps_context *cxt = NULL;
    //int err =0;
    ALSPS_LOG("ps_store_active buf=%s\n",buf);
    mutex_lock(&alsps_context_obj->alsps_op_mutex);
    cxt = alsps_context_obj;

    if (!strncmp(buf, "1", 1))
    {
          ps_enable_data(1);
        }
    else if (!strncmp(buf, "0", 1))
    {
       ps_enable_data(0);
        }
    else
    {
      ALSPS_ERR(" ps_store_active error !!\n");
    }
    mutex_unlock(&alsps_context_obj->alsps_op_mutex);
    ALSPS_LOG(" ps_store_active done\n");
    return count;
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:25,代码来源:alsps.c

示例3: alsps_real_driver_init

static int alsps_real_driver_init(void)
{
    int i =0;
    int err=0;
    ALSPS_LOG(" alsps_real_driver_init +\n");
    for(i = 0; i < MAX_CHOOSE_ALSPS_NUM; i++)
    {
      ALSPS_LOG("alsps_real_driver_init i=%d\n",i);
      if(0 != alsps_init_list[i])
      {
        ALSPS_LOG(" alsps try to init driver %s\n", alsps_init_list[i]->name);
        err = alsps_init_list[i]->init();
        if(0 == err)
        {
           ALSPS_LOG(" alsps real driver %s probe ok\n", alsps_init_list[i]->name);
           break;
        }
      }
    }

    if(i == MAX_CHOOSE_ALSPS_NUM)
    {
       ALSPS_LOG(" alsps_real_driver_init fail\n");
       err=-1;
    }
    return err;
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:27,代码来源:alsps.c

示例4: ps_store_batch

static ssize_t ps_store_batch(struct device* dev, struct device_attribute *attr,
                                  const char *buf, size_t count)
{
    struct alsps_context *cxt = NULL;
    //int err =0;
    ALSPS_LOG("ps_store_batch buf=%s\n",buf);
    mutex_lock(&alsps_context_obj->alsps_op_mutex);
    cxt = alsps_context_obj;
    if(cxt->ps_ctl.is_support_batch){
        if (!strncmp(buf, "1", 1))
        {
                cxt->is_ps_batch_enable = true;
        }
        else if (!strncmp(buf, "0", 1))
        {
            cxt->is_ps_batch_enable = false;
            cxt->is_get_valid_ps_data_after_enable = false;
        }
        else
        {
            ALSPS_ERR(" ps_store_batch error !!\n");
        }
    }else{
        ALSPS_LOG(" ps_store_batch not supported\n");
    }
    mutex_unlock(&alsps_context_obj->alsps_op_mutex);
    ALSPS_LOG(" ps_store_batch done: %d\n", cxt->is_ps_batch_enable);
    return count;

}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:30,代码来源:alsps.c

示例5: ps_show_delay

static ssize_t ps_show_delay(struct device* dev,
                                 struct device_attribute *attr, char *buf)
{
    int len = 0;
    ALSPS_LOG("ps_show_delay func called");
    ALSPS_LOG(" not support now\n");
    return len;
}
开发者ID:Swapnil133609,项目名称:Zeus_sprout,代码行数:8,代码来源:alsps.c

示例6: ps_show_active

/*----------------------------------------------------------------------------*/
static ssize_t ps_show_active(struct device* dev,
                                 struct device_attribute *attr, char *buf)
{
    struct alsps_context *cxt = NULL;
    int div = 0;
    cxt = alsps_context_obj;
    div=cxt->ps_data.vender_div;
    ALSPS_LOG("ps_show_active func called");
    ALSPS_LOG("ps vender_div value: %d\n", div);
    return snprintf(buf, PAGE_SIZE, "%d\n", div);
}
开发者ID:Swapnil133609,项目名称:Zeus_sprout,代码行数:12,代码来源:alsps.c

示例7: alsps_probe

static int alsps_probe(struct platform_device *pdev)
{

    int err;
    ALSPS_LOG("alsps_probe func called");
    ALSPS_LOG("+++++++++++++alsps_probe!!\n");

    alsps_context_obj = alsps_context_alloc_object();
    if (!alsps_context_obj)
    {
        err = -ENOMEM;
        ALSPS_ERR("unable to allocate devobj!\n");
        goto exit_alloc_data_failed;
    }

    //init real alspseleration driver
    err = alsps_real_driver_init();
    if(err)
    {
        ALSPS_ERR("alsps real driver init fail\n");
        goto real_driver_init_fail;
    }

    //init input dev
    err = alsps_input_init(alsps_context_obj);
    if(err)
    {
        ALSPS_ERR("unable to register alsps input device!\n");
        goto exit_alloc_input_dev_failed;
    }

        atomic_set(&(alsps_context_obj->early_suspend), 0);
    alsps_context_obj->early_drv.level    = EARLY_SUSPEND_LEVEL_STOP_DRAWING - 1,
    alsps_context_obj->early_drv.suspend  = alsps_early_suspend,
    alsps_context_obj->early_drv.resume   = alsps_late_resume,
    register_early_suspend(&alsps_context_obj->early_drv);


    ALSPS_LOG("----alsps_probe OK !!\n");
    return 0;


    real_driver_init_fail:
    exit_alloc_input_dev_failed:
    kfree(alsps_context_obj);

    exit_alloc_data_failed:


    ALSPS_LOG("----alsps_probe fail !!!\n");
    return err;
}
开发者ID:Swapnil133609,项目名称:Zeus_sprout,代码行数:52,代码来源:alsps.c

示例8: ps_enable_data

static int ps_enable_data(int enable)
{
    struct alsps_context *cxt = NULL;
    //int err =0;
    cxt = alsps_context_obj;
    ALSPS_LOG("ps_enable_data func called");
    if(NULL  == cxt->ps_ctl.open_report_data)
    {
      ALSPS_ERR("no ps control path\n");
      return -1;
    }

        if(1 == enable)
        {
           ALSPS_LOG("PS enable data\n");
           cxt->is_ps_active_data =true;
               cxt->is_ps_first_data_after_enable = true;
           cxt->ps_ctl.open_report_data(1);
           if(false == cxt->is_ps_polling_run && cxt->is_ps_batch_enable == false)
           {
                  if(false == cxt->ps_ctl.is_report_input_direct)
                  {
                      mod_timer(&cxt->timer_ps, jiffies + atomic_read(&cxt->delay_ps)/(1000/HZ));
                      cxt->is_ps_polling_run = true;
                      cxt->is_get_valid_ps_data_after_enable = false;
                  }
           }
        }
    if(0 == enable)
    {
           ALSPS_LOG("PS disable \n");
           cxt->is_ps_active_data =false;
           cxt->ps_ctl.open_report_data(0);
           if(true == cxt->is_ps_polling_run)
           {
                  if(false == cxt->ps_ctl.is_report_input_direct )
                  {
                      cxt->is_ps_polling_run = false;
                      smp_mb();
                      del_timer_sync(&cxt->timer_ps);
                      smp_mb();
                      cancel_work_sync(&cxt->report_ps);
                cxt->drv_data.ps_data.values[0] = ALSPS_INVALID_VALUE;
                  }
           }
    }
    ps_real_enable(enable);
    return 0;
}
开发者ID:Swapnil133609,项目名称:Zeus_sprout,代码行数:49,代码来源:alsps.c

示例9: ps_register_data_path

int ps_register_data_path(struct ps_data_path *data)
{
    struct alsps_context *cxt = NULL;
//    int err =0;
    cxt = alsps_context_obj;
    cxt->ps_data.get_data = data->get_data;
    cxt->ps_data.vender_div = data->vender_div;
    ALSPS_LOG("alsps register data path vender_div: %d\n", cxt->ps_data.vender_div);
    if(NULL == cxt->ps_data.get_data)
    {
        ALSPS_LOG("alsps register data path fail \n");
         return -1;
    }
    return 0;
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:15,代码来源:alsps.c

示例10: alsps_input_init

static int alsps_input_init(struct alsps_context *cxt)
{
    struct input_dev *dev;
    int err = 0;

    ALSPS_LOG("alsps_input_init func called");
    dev = input_allocate_device();
    if (NULL == dev)
        return -ENOMEM;

    dev->name = ALSPS_INPUTDEV_NAME;

    set_bit(EV_REL, dev->evbit);
    set_bit(EV_SYN, dev->evbit);
    input_set_capability(dev, EV_REL, EVENT_TYPE_PS_VALUE);
    input_set_capability(dev, EV_REL, EVENT_TYPE_PS_STATUS);

    input_set_capability(dev, EV_REL, EVENT_TYPE_ALS_VALUE);
    input_set_capability(dev, EV_REL, EVENT_TYPE_ALS_STATUS);

    input_set_drvdata(dev, cxt);

    err = input_register_device(dev);
    if (err < 0) {
        input_free_device(dev);
        return err;
    }
    cxt->idev= dev;

    return 0;
}
开发者ID:Swapnil133609,项目名称:Zeus_sprout,代码行数:31,代码来源:alsps.c

示例11: alsps_driver_add

  int alsps_driver_add(struct alsps_init_info* obj)
{
    int err=0;
    int i =0;

    ALSPS_FUN();

    for(i =0; i < MAX_CHOOSE_ALSPS_NUM; i++ )
    {
        if((i == 0) && (NULL == alsps_init_list[0])){
            ALSPS_LOG("register alsps driver for the first time\n");
            if(platform_driver_register(&als_ps_driver))
            {
                ALSPS_ERR("failed to register alsps driver already exist\n");
            }
        }

        if(NULL == alsps_init_list[i])
        {
          obj->platform_diver_addr = &als_ps_driver;
          alsps_init_list[i] = obj;
          break;
        }
    }
    if(NULL==alsps_init_list[i])
    {
       ALSPS_ERR("ALSPS driver add err \n");
       err=-1;
    }

    return err;
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:32,代码来源:alsps.c

示例12: ps_store_batch

static ssize_t ps_store_batch(struct device* dev, struct device_attribute *attr,
                                  const char *buf, size_t count)
{
	struct alsps_context *cxt = NULL;
	//int err =0;
	ALSPS_LOG("ps_store_batch buf=%s\n",buf);
	mutex_lock(&alsps_context_obj->alsps_op_mutex);
	cxt = alsps_context_obj;
	if(cxt->ps_ctl.is_support_batch){
	    	if (!strncmp(buf, "1", 1)) 
		{
	    		cxt->is_ps_batch_enable = true;
                if(true == cxt->is_ps_polling_run)
                {
                    cxt->is_ps_polling_run = false;
                    del_timer_sync(&cxt->timer_ps);
                    cancel_work_sync(&cxt->report_ps);
                    cxt->drv_data.ps_data.values[0] = ALSPS_INVALID_VALUE;
                    cxt->drv_data.ps_data.values[1] = ALSPS_INVALID_VALUE;
                    cxt->drv_data.ps_data.values[2] = ALSPS_INVALID_VALUE;
                }
	    	} 
		else if (!strncmp(buf, "0", 1))
		{
			cxt->is_ps_batch_enable = false;
                if(false == cxt->is_ps_polling_run)
                {
                    if(false == cxt->ps_ctl.is_report_input_direct)
                    {
                        mod_timer(&cxt->timer_ps, jiffies + atomic_read(&cxt->delay_ps)/(1000/HZ));
                        cxt->is_ps_polling_run = true;
                        cxt->is_get_valid_ps_data_after_enable = false;
                    }
                }
	    	}
		else
		{
			ALSPS_ERR(" ps_store_batch error !!\n");
		}
	}else{
		ALSPS_LOG(" ps_store_batch not supported\n");
	}
	mutex_unlock(&alsps_context_obj->alsps_op_mutex);
	ALSPS_LOG(" ps_store_batch done: %d\n", cxt->is_ps_batch_enable);
    return count;

}
开发者ID:iuncuim,项目名称:A476_V1B_5.1_kernel,代码行数:47,代码来源:alsps.c

示例13: ps_show_devnum

static ssize_t ps_show_devnum(struct device* dev,
                                 struct device_attribute *attr, char *buf)
{
    const char *devname =NULL;
    devname = dev_name(&alsps_context_obj->idev->dev);
    ALSPS_LOG("ps_show_devnum");
    return snprintf(buf, PAGE_SIZE, "%s\n", devname+5);
}
开发者ID:Swapnil133609,项目名称:Zeus_sprout,代码行数:8,代码来源:alsps.c

示例14: ps_data_report

int ps_data_report(struct input_dev *dev, int value,int status)
{
    ALSPS_LOG("ps_data_report func called");
    //ALSPS_LOG("+ps_data_report! %d, %d\n",value,status);
    input_report_rel(dev, EVENT_TYPE_PS_VALUE, (value+1));
    input_report_rel(dev, EVENT_TYPE_PS_STATUS, status);
    input_sync(dev);
    return 0;
}
开发者ID:Swapnil133609,项目名称:Zeus_sprout,代码行数:9,代码来源:alsps.c

示例15: als_poll

static void als_poll(unsigned long data)
{
    struct alsps_context *obj = (struct alsps_context *)data;
    ALSPS_LOG("als_poll func called");
    if((obj != NULL) && (obj->is_als_polling_run))
    {
        schedule_work(&obj->report_als);
    }
}
开发者ID:Swapnil133609,项目名称:Zeus_sprout,代码行数:9,代码来源:alsps.c


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