예제 #1
0
/**
 * public api
 */
struct nxp_hdmi *create_nxp_hdmi(struct nxp_hdmi_platformdata *pdata)
{
    int ret;
    struct nxp_hdmi *me;

    pr_debug("%s\n", __func__);

    me = kzalloc(sizeof(*me), GFP_KERNEL);
    if (!me) {
        pr_err("%s: failed to alloc me!!!\n", __func__);
        return NULL;
    }

    /* init media entity */
    ret = _init_entities(me);
    if (ret < 0) {
        pr_err("%s: failed to _init_entities()\n", __func__);
        kfree(me);
        return NULL;
    }

#ifdef CONFIG_ANDROID
    wake_lock_init(&me->wake_lock, WAKE_LOCK_SUSPEND, "nxp-hdmi");
#endif

    /*me->plat_data = pdata;*/
    me->plat_data = (struct nxp_hdmi_platformdata *)kmalloc(sizeof(struct nxp_hdmi_platformdata), GFP_KERNEL);
    memcpy(me->plat_data, pdata, sizeof(struct nxp_hdmi_platformdata));

    return me;
}
예제 #2
0
/**
 * public api
 */
struct nxp_resc *create_nxp_resc(int id)
{
    int ret;
    struct nxp_resc *me;

    pr_debug("%s\n", __func__);

    me = kzalloc(sizeof(struct nxp_resc), GFP_KERNEL);
    if (!me) {
        pr_err("%s: failed to alloc me!!!\n", __func__);
        return NULL;
    }

    me->id = id;
    ret = _init_entities(me);

    if (unlikely(ret)) {
        pr_err("%s: failed to _init_entities()\n", __func__);
        kfree(me);
        return NULL;
    }

    me->streaming = false;

    return me;
}
예제 #3
0
struct nxp_loopback_sensor *create_nxp_loopback_sensor(struct nxp_capture_platformdata *pdata)
{
  struct nxp_loopback_sensor *me = &_context;
  int ret;

	ret = _init_entities(me);

	return me;
}