type stringclasses 5
values | content stringlengths 9 163k |
|---|---|
functions | void elv_quiesce_start(struct request_queue *q)
{
if (!q->elevator)
return;
queue_flag_set(QUEUE_FLAG_ELVSWITCH, q);
/*
* make sure we don't have any requests in flight
*/
elv_drain_elevator(q);
while (q->rq.elvpriv) {
__blk_run_queue(q);
spin_unlock_irq(q->queue_lock);
msleep(10);
spin_lock_irq(q-... |
functions | void elv_quiesce_end(struct request_queue *q)
{
queue_flag_clear(QUEUE_FLAG_ELVSWITCH, q);
} |
functions | void __elv_add_request(struct request_queue *q, struct request *rq, int where)
{
trace_block_rq_insert(q, rq);
rq->q = q;
if (rq->cmd_flags & REQ_SOFTBARRIER) {
/* barriers are scheduling boundary, update end_sector */
if (rq->cmd_type == REQ_TYPE_FS ||
(rq->cmd_flags & REQ_DISCARD)) {
q->end_sector =... |
functions | void elv_add_request(struct request_queue *q, struct request *rq, int where)
{
unsigned long flags;
spin_lock_irqsave(q->queue_lock, flags);
__elv_add_request(q, rq, where);
spin_unlock_irqrestore(q->queue_lock, flags);
} |
functions | int elv_set_request(struct request_queue *q, struct request *rq, gfp_t gfp_mask)
{
struct elevator_queue *e = q->elevator;
if (e->ops->elevator_set_req_fn)
return e->ops->elevator_set_req_fn(q, rq, gfp_mask);
rq->elevator_private[0] = NULL;
return 0;
} |
functions | void elv_put_request(struct request_queue *q, struct request *rq)
{
struct elevator_queue *e = q->elevator;
if (e->ops->elevator_put_req_fn)
e->ops->elevator_put_req_fn(rq);
} |
functions | int elv_may_queue(struct request_queue *q, int rw)
{
struct elevator_queue *e = q->elevator;
if (e->ops->elevator_may_queue_fn)
return e->ops->elevator_may_queue_fn(q, rw);
return ELV_MQUEUE_MAY;
} |
functions | void elv_abort_queue(struct request_queue *q)
{
struct request *rq;
blk_abort_flushes(q);
while (!list_empty(&q->queue_head)) {
rq = list_entry_rq(q->queue_head.next);
rq->cmd_flags |= REQ_QUIET;
trace_block_rq_abort(q, rq);
/*
* Mark this request as started so we don't trigger
* any debug logic in t... |
functions | void elv_completed_request(struct request_queue *q, struct request *rq)
{
struct elevator_queue *e = q->elevator;
/*
* request is released from the driver, io must be done
*/
if (blk_account_rq(rq)) {
q->in_flight[rq_is_sync(rq)]--;
if ((rq->cmd_flags & REQ_SORTED) &&
e->ops->elevator_completed_req_fn... |
functions | ssize_t
elv_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
{
struct elv_fs_entry *entry = to_elv(attr);
struct elevator_queue *e;
ssize_t error;
if (!entry->show)
return -EIO;
e = container_of(kobj, struct elevator_queue, kobj);
mutex_lock(&e->sysfs_lock);
error = e->ops ? entry->show(e,... |
functions | ssize_t
elv_attr_store(struct kobject *kobj, struct attribute *attr,
const char *page, size_t length)
{
struct elv_fs_entry *entry = to_elv(attr);
struct elevator_queue *e;
ssize_t error;
if (!entry->store)
return -EIO;
e = container_of(kobj, struct elevator_queue, kobj);
mutex_lock(&e->sysfs_lock);
... |
functions | int elv_register_queue(struct request_queue *q)
{
struct elevator_queue *e = q->elevator;
int error;
error = kobject_add(&e->kobj, &q->kobj, "%s", "iosched");
if (!error) {
struct elv_fs_entry *attr = e->elevator_type->elevator_attrs;
if (attr) {
while (attr->attr.name) {
if (sysfs_create_file(&e->kobj,... |
functions | void __elv_unregister_queue(struct elevator_queue *e)
{
kobject_uevent(&e->kobj, KOBJ_REMOVE);
kobject_del(&e->kobj);
e->registered = 0;
} |
functions | void elv_unregister_queue(struct request_queue *q)
{
if (q)
__elv_unregister_queue(q->elevator);
} |
functions | void elv_register(struct elevator_type *e)
{
char *def = "";
spin_lock(&elv_list_lock);
BUG_ON(elevator_find(e->elevator_name));
list_add_tail(&e->list, &elv_list);
spin_unlock(&elv_list_lock);
if (!strcmp(e->elevator_name, chosen_elevator) ||
(!*chosen_elevator &&
!strcmp(e->elevator_name, CONFIG_DEFAUL... |
functions | void elv_unregister(struct elevator_type *e)
{
struct task_struct *g, *p;
/*
* Iterate every thread in the process to remove the io contexts.
*/
if (e->ops.trim) {
read_lock(&tasklist_lock);
do_each_thread(g, p) {
task_lock(p);
if (p->io_context)
e->ops.trim(p->io_context);
task_unlock(p);
} |
functions | int elevator_switch(struct request_queue *q, struct elevator_type *new_e)
{
struct elevator_queue *old_elevator, *e;
void *data;
int err;
/*
* Allocate new elevator
*/
e = elevator_alloc(q, new_e);
if (!e)
return -ENOMEM;
data = elevator_init_queue(q, e);
if (!data) {
kobject_put(&e->kobj);
return -... |
functions | int elevator_change(struct request_queue *q, const char *name)
{
char elevator_name[ELV_NAME_MAX];
struct elevator_type *e;
if (!q->elevator)
return -ENXIO;
strlcpy(elevator_name, name, sizeof(elevator_name));
e = elevator_get(strstrip(elevator_name));
if (!e) {
printk(KERN_ERR "elevator: type %s not found\... |
functions | ssize_t elv_iosched_store(struct request_queue *q, const char *name,
size_t count)
{
int ret;
if (!q->elevator)
return count;
ret = elevator_change(q, name);
if (!ret)
return count;
printk(KERN_ERR "elevator: switch to %s failed\n", name);
return ret;
} |
functions | ssize_t elv_iosched_show(struct request_queue *q, char *name)
{
struct elevator_queue *e = q->elevator;
struct elevator_type *elv;
struct elevator_type *__e;
int len = 0;
if (!q->elevator || !blk_queue_stackable(q))
return sprintf(name, "none\n");
elv = e->elevator_type;
spin_lock(&elv_list_lock);
list_for... |
includes |
#include <linux/ctype.h> |
includes | #include <linux/slab.h> |
includes | #include <linux/export.h> |
includes | #include <media/v4l2-ioctl.h> |
includes | #include <media/v4l2-device.h> |
includes | #include <media/v4l2-ctrls.h> |
includes | #include <media/v4l2-event.h> |
includes | #include <media/v4l2-dev.h> |
defines |
#define has_op(master, op) \ |
defines | #define call_op(master, op) \ |
structs | struct v4l2_ctrl_helper {
/* Pointer to the control reference of the master control */
struct v4l2_ctrl_ref *mref;
/* The control corresponding to the v4l2_ext_control ID field. */
struct v4l2_ctrl *ctrl;
/* v4l2_ext_control index of the next control belonging to the
same cluster, or 0 if there isn't any. */
... |
functions | bool is_cur_manual(const struct v4l2_ctrl *master)
{
return master->is_auto && master->cur.val == master->manual_mode_value;
} |
functions | bool is_new_manual(const struct v4l2_ctrl *master)
{
return master->is_auto && master->val == master->manual_mode_value;
} |
functions | void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
s32 *min, s32 *max, s32 *step, s32 *def, u32 *flags)
{
*name = v4l2_ctrl_get_name(id);
*flags = 0;
switch (id) {
case V4L2_CID_AUDIO_MUTE:
case V4L2_CID_AUDIO_LOUDNESS:
case V4L2_CID_AUTO_WHITE_BALANCE:
case V4L2_CID_AUTOGAIN:
case... |
functions | bool type_is_int(const struct v4l2_ctrl *ctrl)
{
switch (ctrl->type) {
case V4L2_CTRL_TYPE_INTEGER64:
case V4L2_CTRL_TYPE_STRING:
/* Nope, these need v4l2_ext_control */
return false;
default:
return true;
} |
functions | void fill_event(struct v4l2_event *ev, struct v4l2_ctrl *ctrl, u32 changes)
{
memset(ev->reserved, 0, sizeof(ev->reserved));
ev->type = V4L2_EVENT_CTRL;
ev->id = ctrl->id;
ev->u.ctrl.changes = changes;
ev->u.ctrl.type = ctrl->type;
ev->u.ctrl.flags = ctrl->flags;
if (ctrl->type == V4L2_CTRL_TYPE_STRING)
ev->u.... |
functions | void send_event(struct v4l2_fh *fh, struct v4l2_ctrl *ctrl, u32 changes)
{
struct v4l2_event ev;
struct v4l2_subscribed_event *sev;
if (list_empty(&ctrl->ev_subs))
return;
fill_event(&ev, ctrl, changes);
list_for_each_entry(sev, &ctrl->ev_subs, node)
if (sev->fh != fh ||
(sev->flags & V4L2_EVENT_SUB_FL... |
functions | int cur_to_user(struct v4l2_ext_control *c,
struct v4l2_ctrl *ctrl)
{
u32 len;
switch (ctrl->type) {
case V4L2_CTRL_TYPE_STRING:
len = strlen(ctrl->cur.string);
if (c->size < len + 1) {
c->size = len + 1;
return -ENOSPC;
} |
functions | int user_to_new(struct v4l2_ext_control *c,
struct v4l2_ctrl *ctrl)
{
int ret;
u32 size;
ctrl->is_new = 1;
switch (ctrl->type) {
case V4L2_CTRL_TYPE_INTEGER64:
ctrl->val64 = c->value64;
break;
case V4L2_CTRL_TYPE_STRING:
size = c->size;
if (size == 0)
return -ERANGE;
if (size > ctrl->maximu... |
functions | int new_to_user(struct v4l2_ext_control *c,
struct v4l2_ctrl *ctrl)
{
u32 len;
switch (ctrl->type) {
case V4L2_CTRL_TYPE_STRING:
len = strlen(ctrl->string);
if (c->size < len + 1) {
c->size = ctrl->maximum + 1;
return -ENOSPC;
} |
functions | void new_to_cur(struct v4l2_fh *fh, struct v4l2_ctrl *ctrl,
bool update_inactive)
{
bool changed = false;
if (ctrl == NULL)
return;
switch (ctrl->type) {
case V4L2_CTRL_TYPE_BUTTON:
changed = true;
break;
case V4L2_CTRL_TYPE_STRING:
/* strings are always 0-terminated */
changed = strcmp(ctrl->stri... |
functions | void cur_to_new(struct v4l2_ctrl *ctrl)
{
if (ctrl == NULL)
return;
switch (ctrl->type) {
case V4L2_CTRL_TYPE_STRING:
/* strings are always 0-terminated */
strcpy(ctrl->string, ctrl->cur.string);
break;
case V4L2_CTRL_TYPE_INTEGER64:
ctrl->val64 = ctrl->cur.val64;
break;
default:
ctrl->val = ctrl->cu... |
functions | int cluster_changed(struct v4l2_ctrl *master)
{
int diff = 0;
int i;
for (i = 0; !diff && i < master->ncontrols; i++) {
struct v4l2_ctrl *ctrl = master->cluster[i];
if (ctrl == NULL)
continue;
switch (ctrl->type) {
case V4L2_CTRL_TYPE_BUTTON:
/* Button controls are always 'different' */
return 1;
... |
functions | int validate_new_int(const struct v4l2_ctrl *ctrl, s32 *pval)
{
s32 val = *pval;
u32 offset;
switch (ctrl->type) {
case V4L2_CTRL_TYPE_INTEGER:
/* Round towards the closest legal value */
val += ctrl->step / 2;
if (val < ctrl->minimum)
val = ctrl->minimum;
if (val > ctrl->maximum)
val = ctrl->maximum... |
functions | int validate_new(const struct v4l2_ctrl *ctrl, struct v4l2_ext_control *c)
{
char *s = c->string;
size_t len;
switch (ctrl->type) {
case V4L2_CTRL_TYPE_INTEGER:
case V4L2_CTRL_TYPE_BOOLEAN:
case V4L2_CTRL_TYPE_MENU:
case V4L2_CTRL_TYPE_BITMASK:
case V4L2_CTRL_TYPE_BUTTON:
case V4L2_CTRL_TYPE_CTRL_CLASS:
ret... |
functions | u32 node2id(struct list_head *node)
{
return list_entry(node, struct v4l2_ctrl_ref, node)->ctrl->id;
} |
functions | int handler_set_err(struct v4l2_ctrl_handler *hdl, int err)
{
if (hdl->error == 0)
hdl->error = err;
return err;
} |
functions | int v4l2_ctrl_handler_init(struct v4l2_ctrl_handler *hdl,
unsigned nr_of_controls_hint)
{
mutex_init(&hdl->lock);
INIT_LIST_HEAD(&hdl->ctrls);
INIT_LIST_HEAD(&hdl->ctrl_refs);
hdl->nr_of_buckets = 1 + nr_of_controls_hint / 8;
hdl->buckets = kcalloc(hdl->nr_of_buckets, sizeof(hdl->buckets[0]),
GFP_K... |
functions | void v4l2_ctrl_handler_free(struct v4l2_ctrl_handler *hdl)
{
struct v4l2_ctrl_ref *ref, *next_ref;
struct v4l2_ctrl *ctrl, *next_ctrl;
struct v4l2_subscribed_event *sev, *next_sev;
if (hdl == NULL || hdl->buckets == NULL)
return;
mutex_lock(&hdl->lock);
/* Free all nodes */
list_for_each_entry_safe(ref, next... |
functions | int handler_new_ref(struct v4l2_ctrl_handler *hdl,
struct v4l2_ctrl *ctrl)
{
struct v4l2_ctrl_ref *ref;
struct v4l2_ctrl_ref *new_ref;
u32 id = ctrl->id;
u32 class_ctrl = V4L2_CTRL_ID2CLASS(id) | 1;
int bucket = id % hdl->nr_of_buckets; /* which bucket to use */
/* Automatically add the control class if it... |
functions | int v4l2_ctrl_add_handler(struct v4l2_ctrl_handler *hdl,
struct v4l2_ctrl_handler *add)
{
struct v4l2_ctrl_ref *ref;
int ret = 0;
/* Do nothing if either handler is NULL or if they are the same */
if (!hdl || !add || hdl == add)
return 0;
if (hdl->error)
return hdl->error;
mutex_lock(&add->lock);
list_... |
functions | void v4l2_ctrl_cluster(unsigned ncontrols, struct v4l2_ctrl **controls)
{
bool has_volatiles = false;
int i;
/* The first control is the master control and it must not be NULL */
BUG_ON(ncontrols == 0 || controls[0] == NULL);
for (i = 0; i < ncontrols; i++) {
if (controls[i]) {
controls[i]->cluster = contro... |
functions | void v4l2_ctrl_auto_cluster(unsigned ncontrols, struct v4l2_ctrl **controls,
u8 manual_val, bool set_volatile)
{
struct v4l2_ctrl *master = controls[0];
u32 flag = 0;
int i;
v4l2_ctrl_cluster(ncontrols, controls);
WARN_ON(ncontrols <= 1);
WARN_ON(manual_val < master->minimum || manual_val > master->maximu... |
functions | void v4l2_ctrl_activate(struct v4l2_ctrl *ctrl, bool active)
{
/* invert since the actual flag is called 'inactive' */
bool inactive = !active;
bool old;
if (ctrl == NULL)
return;
if (inactive)
/* set V4L2_CTRL_FLAG_INACTIVE */
old = test_and_set_bit(4, &ctrl->flags);
else
/* clear V4L2_CTRL_FLAG_INACTI... |
functions | void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed)
{
bool old;
if (ctrl == NULL)
return;
v4l2_ctrl_lock(ctrl);
if (grabbed)
/* set V4L2_CTRL_FLAG_GRABBED */
old = test_and_set_bit(1, &ctrl->flags);
else
/* clear V4L2_CTRL_FLAG_GRABBED */
old = test_and_clear_bit(1, &ctrl->flags);
if (old != gra... |
functions | void log_ctrl(const struct v4l2_ctrl *ctrl,
const char *prefix, const char *colon)
{
if (ctrl->flags & (V4L2_CTRL_FLAG_DISABLED | V4L2_CTRL_FLAG_WRITE_ONLY))
return;
if (ctrl->type == V4L2_CTRL_TYPE_CTRL_CLASS)
return;
printk(KERN_INFO "%s%s%s: ", prefix, colon, ctrl->name);
switch (ctrl->type) {
case... |
functions | void v4l2_ctrl_handler_log_status(struct v4l2_ctrl_handler *hdl,
const char *prefix)
{
struct v4l2_ctrl *ctrl;
const char *colon = "";
int len;
if (hdl == NULL)
return;
if (prefix == NULL)
prefix = "";
len = strlen(prefix);
if (len && prefix[len - 1] != ' ')
colon = ": ";
mutex_lock(&hdl->lock);
l... |
functions | int v4l2_ctrl_handler_setup(struct v4l2_ctrl_handler *hdl)
{
struct v4l2_ctrl *ctrl;
int ret = 0;
if (hdl == NULL)
return 0;
mutex_lock(&hdl->lock);
list_for_each_entry(ctrl, &hdl->ctrls, node)
ctrl->done = false;
list_for_each_entry(ctrl, &hdl->ctrls, node) {
struct v4l2_ctrl *master = ctrl->cluster[0];
... |
functions | int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc)
{
u32 id = qc->id & V4L2_CTRL_ID_MASK;
struct v4l2_ctrl_ref *ref;
struct v4l2_ctrl *ctrl;
if (hdl == NULL)
return -EINVAL;
mutex_lock(&hdl->lock);
/* Try to find it */
ref = find_ref(hdl, id);
if ((qc->id & V4L2_CTRL_FLAG_NEXT_CT... |
functions | else if (ref) {
/* We found a control with the given ID, so just get
the next one in the list. */
ref = list_entry(ref->node.next, typeof(*ref), node);
} |
functions | int v4l2_subdev_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)
{
if (qc->id & V4L2_CTRL_FLAG_NEXT_CTRL)
return -EINVAL;
return v4l2_queryctrl(sd->ctrl_handler, qc);
} |
functions | int v4l2_querymenu(struct v4l2_ctrl_handler *hdl, struct v4l2_querymenu *qm)
{
struct v4l2_ctrl *ctrl;
u32 i = qm->index;
ctrl = v4l2_ctrl_find(hdl, qm->id);
if (!ctrl)
return -EINVAL;
qm->reserved = 0;
/* Sanity checks */
if (ctrl->qmenu == NULL ||
i < ctrl->minimum || i > ctrl->maximum)
return -EINV... |
functions | int v4l2_subdev_querymenu(struct v4l2_subdev *sd, struct v4l2_querymenu *qm)
{
return v4l2_querymenu(sd->ctrl_handler, qm);
} |
functions | int prepare_ext_ctrls(struct v4l2_ctrl_handler *hdl,
struct v4l2_ext_controls *cs,
struct v4l2_ctrl_helper *helpers)
{
struct v4l2_ctrl_helper *h;
bool have_clusters = false;
u32 i;
for (i = 0, h = helpers; i < cs->count; i++, h++) {
struct v4l2_ext_control *c = &cs->controls[i];
struct v4l2_ct... |
functions | int class_check(struct v4l2_ctrl_handler *hdl, u32 ctrl_class)
{
if (ctrl_class == 0)
return list_empty(&hdl->ctrl_refs) ? -EINVAL : 0;
return find_ref_lock(hdl, ctrl_class | 1) ? 0 : -EINVAL;
} |
functions | int v4l2_g_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *cs)
{
struct v4l2_ctrl_helper helper[4];
struct v4l2_ctrl_helper *helpers = helper;
int ret;
int i, j;
cs->error_idx = cs->count;
cs->ctrl_class = V4L2_CTRL_ID2CLASS(cs->ctrl_class);
if (hdl == NULL)
return -EINVAL;
if (cs->count... |
functions | int v4l2_subdev_g_ext_ctrls(struct v4l2_subdev *sd, struct v4l2_ext_controls *cs)
{
return v4l2_g_ext_ctrls(sd->ctrl_handler, cs);
} |
functions | int get_ctrl(struct v4l2_ctrl *ctrl, s32 *val)
{
struct v4l2_ctrl *master = ctrl->cluster[0];
int ret = 0;
int i;
if (ctrl->flags & V4L2_CTRL_FLAG_WRITE_ONLY)
return -EACCES;
v4l2_ctrl_lock(master);
/* g_volatile_ctrl will update the current control values */
if (ctrl->flags & V4L2_CTRL_FLAG_VOLATILE) {
fo... |
functions | int v4l2_g_ctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_control *control)
{
struct v4l2_ctrl *ctrl = v4l2_ctrl_find(hdl, control->id);
if (ctrl == NULL || !type_is_int(ctrl))
return -EINVAL;
return get_ctrl(ctrl, &control->value);
} |
functions | int v4l2_subdev_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *control)
{
return v4l2_g_ctrl(sd->ctrl_handler, control);
} |
functions | s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl)
{
s32 val = 0;
/* It's a driver bug if this happens. */
WARN_ON(!type_is_int(ctrl));
get_ctrl(ctrl, &val);
return val;
} |
functions | int try_or_set_cluster(struct v4l2_fh *fh,
struct v4l2_ctrl *master, bool set)
{
bool update_flag;
int ret;
int i;
/* Go through the cluster and either validate the new value or
(if no new value was set), copy the current value to the new
value, ensuring a consistent view for the control ops when
... |
functions | int validate_ctrls(struct v4l2_ext_controls *cs,
struct v4l2_ctrl_helper *helpers, bool set)
{
unsigned i;
int ret = 0;
cs->error_idx = cs->count;
for (i = 0; i < cs->count; i++) {
struct v4l2_ctrl *ctrl = helpers[i].ctrl;
cs->error_idx = i;
if (ctrl->flags & V4L2_CTRL_FLAG_READ_ONLY)
return -EACCE... |
functions | void update_from_auto_cluster(struct v4l2_ctrl *master)
{
int i;
for (i = 0; i < master->ncontrols; i++)
cur_to_new(master->cluster[i]);
if (!call_op(master, g_volatile_ctrl))
for (i = 1; i < master->ncontrols; i++)
if (master->cluster[i])
master->cluster[i]->is_new = 1;
} |
functions | int try_set_ext_ctrls(struct v4l2_fh *fh, struct v4l2_ctrl_handler *hdl,
struct v4l2_ext_controls *cs,
bool set)
{
struct v4l2_ctrl_helper helper[4];
struct v4l2_ctrl_helper *helpers = helper;
unsigned i, j;
int ret;
cs->error_idx = cs->count;
cs->ctrl_class = V4L2_CTRL_ID2CLASS(cs->ctrl_class);
... |
functions | int v4l2_try_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *cs)
{
return try_set_ext_ctrls(NULL, hdl, cs, false);
} |
functions | int v4l2_s_ext_ctrls(struct v4l2_fh *fh, struct v4l2_ctrl_handler *hdl,
struct v4l2_ext_controls *cs)
{
return try_set_ext_ctrls(fh, hdl, cs, true);
} |
functions | int v4l2_subdev_try_ext_ctrls(struct v4l2_subdev *sd, struct v4l2_ext_controls *cs)
{
return try_set_ext_ctrls(NULL, sd->ctrl_handler, cs, false);
} |
functions | int v4l2_subdev_s_ext_ctrls(struct v4l2_subdev *sd, struct v4l2_ext_controls *cs)
{
return try_set_ext_ctrls(NULL, sd->ctrl_handler, cs, true);
} |
functions | int set_ctrl(struct v4l2_fh *fh, struct v4l2_ctrl *ctrl, s32 *val)
{
struct v4l2_ctrl *master = ctrl->cluster[0];
int ret;
int i;
ret = validate_new_int(ctrl, val);
if (ret)
return ret;
v4l2_ctrl_lock(ctrl);
/* Reset the 'is_new' flags of the cluster */
for (i = 0; i < master->ncontrols; i++)
if (master-... |
functions | int v4l2_s_ctrl(struct v4l2_fh *fh, struct v4l2_ctrl_handler *hdl,
struct v4l2_control *control)
{
struct v4l2_ctrl *ctrl = v4l2_ctrl_find(hdl, control->id);
if (ctrl == NULL || !type_is_int(ctrl))
return -EINVAL;
if (ctrl->flags & V4L2_CTRL_FLAG_READ_ONLY)
return -EACCES;
return set_ctrl(fh, ctrl, &con... |
functions | int v4l2_subdev_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *control)
{
return v4l2_s_ctrl(NULL, sd->ctrl_handler, control);
} |
functions | int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val)
{
/* It's a driver bug if this happens. */
WARN_ON(!type_is_int(ctrl));
return set_ctrl(NULL, ctrl, &val);
} |
functions | void v4l2_ctrl_add_event(struct v4l2_ctrl *ctrl,
struct v4l2_subscribed_event *sev)
{
v4l2_ctrl_lock(ctrl);
list_add_tail(&sev->node, &ctrl->ev_subs);
if (ctrl->type != V4L2_CTRL_TYPE_CTRL_CLASS &&
(sev->flags & V4L2_EVENT_SUB_FL_SEND_INITIAL)) {
struct v4l2_event ev;
u32 changes = V4L2_EVENT_CTRL_CH_FL... |
functions | void v4l2_ctrl_del_event(struct v4l2_ctrl *ctrl,
struct v4l2_subscribed_event *sev)
{
v4l2_ctrl_lock(ctrl);
list_del(&sev->node);
v4l2_ctrl_unlock(ctrl);
} |
functions | int v4l2_ctrl_log_status(struct file *file, void *fh)
{
struct video_device *vfd = video_devdata(file);
struct v4l2_fh *vfh = file->private_data;
if (test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags) && vfd->v4l2_dev)
v4l2_ctrl_handler_log_status(vfh->ctrl_handler,
vfd->v4l2_dev->name);
return 0;
} |
functions | int v4l2_ctrl_subscribe_event(struct v4l2_fh *fh,
struct v4l2_event_subscription *sub)
{
if (sub->type == V4L2_EVENT_CTRL)
return v4l2_event_subscribe(fh, sub, 0);
return -EINVAL;
} |
functions | int v4l2_ctrl_poll(struct file *file, struct poll_table_struct *wait)
{
struct v4l2_fh *fh = file->private_data;
if (v4l2_event_pending(fh))
return POLLPRI;
poll_wait(file, &fh->wait, wait);
return 0;
} |
includes |
#include <linux/kernel.h> |
includes | #include <linux/module.h> |
includes | #include <linux/mutex.h> |
includes | #include <linux/sysfs.h> |
includes | #include <linux/slab.h> |
includes | #include <linux/acpi.h> |
includes | #include <linux/iio/iio.h> |
includes | #include <linux/iio/sysfs.h> |
includes | #include <linux/iio/trigger.h> |
includes |
#include <linux/iio/common/st_sensors.h> |
defines |
#define ST_ACCEL_NUMBER_DATA_CHANNELS 3 |
defines | #define ST_ACCEL_DEFAULT_OUT_X_L_ADDR 0x28 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.