static long tea6415c_ioctl(struct v4l2_subdev *sd, unsigned cmd, void *arg) { if (cmd == TEA6415C_SWITCH) { struct i2c_client *client = v4l2_get_subdevdata(sd); struct tea6415c_multiplex *v = (struct tea6415c_multiplex *)arg; return switch_matrix(client, v->in, v->out); } return -ENOIOCTLCMD; }
static int command(struct i2c_client *client, unsigned int cmd, void *arg) { struct tea6415c_multiplex *v = (struct tea6415c_multiplex *)arg; int result = 0; switch (cmd) { case TEA6415C_SWITCH: result = switch_matrix(client, v->in, v->out); break; default: return -ENOIOCTLCMD; } return result; }