Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

media: atomisp: Remove custom VCM handling

Remove the custom VCM handling, instead the VCM should be controlled
through its own v4l2-subdev and the new ipu-bridge.c code already
supports instantiating an i2c_client for this and setting up
the necessary endpoints in the fwnode graph.

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

authored by

Hans de Goede and committed by
Mauro Carvalho Chehab
95146b9d ce5547e7

+3 -110
-3
drivers/staging/media/atomisp/include/linux/atomisp.h
··· 914 914 /* VCM step time */ 915 915 #define V4L2_CID_VCM_TIMING (V4L2_CID_CAMERA_LASTP1 + 12) 916 916 917 - /* Query Focus Status */ 918 - #define V4L2_CID_FOCUS_STATUS (V4L2_CID_CAMERA_LASTP1 + 14) 919 - 920 917 /* number of frames to skip at stream start */ 921 918 #define V4L2_CID_G_SKIP_FRAMES (V4L2_CID_CAMERA_LASTP1 + 17) 922 919
+2 -3
drivers/staging/media/atomisp/include/linux/atomisp_platform.h
··· 111 111 112 112 enum intel_v4l2_subdev_type { 113 113 RAW_CAMERA = 1, 114 - CAMERA_MOTOR = 2, 115 - LED_FLASH = 3, 116 - TEST_PATTERN = 4, 114 + LED_FLASH = 2, 115 + TEST_PATTERN = 3, 117 116 }; 118 117 119 118 struct intel_v4l2_subdev_id {
-4
drivers/staging/media/atomisp/pci/atomisp_internal.h
··· 134 134 struct v4l2_rect active_rect; 135 135 /* Sensor state for which == V4L2_SUBDEV_FORMAT_TRY calls */ 136 136 struct v4l2_subdev_state *try_sd_state; 137 - 138 - struct v4l2_subdev *motor; 139 - 140 137 /* 141 138 * To show this resource is used by 142 139 * which stream, in ISP multiple stream mode ··· 207 210 unsigned int input_cnt; 208 211 struct atomisp_input_subdev inputs[ATOM_ISP_MAX_INPUTS]; 209 212 struct v4l2_subdev *flash; 210 - struct v4l2_subdev *motor; 211 213 212 214 struct atomisp_regs saved_regs; 213 215 struct atomisp_css_env css_env;
+1 -85
drivers/staging/media/atomisp/pci/atomisp_ioctl.c
··· 557 557 struct video_device *vdev = video_devdata(file); 558 558 struct atomisp_device *isp = video_get_drvdata(vdev); 559 559 int index = input->index; 560 - struct v4l2_subdev *motor; 561 560 562 561 if (index >= isp->input_cnt) 563 562 return -EINVAL; ··· 567 568 memset(input, 0, sizeof(struct v4l2_input)); 568 569 strscpy(input->name, isp->inputs[index].camera->name, 569 570 sizeof(input->name)); 570 - 571 - /* 572 - * HACK: append actuator's name to sensor's 573 - * As currently userspace can't talk directly to subdev nodes, this 574 - * ioctl is the only way to enum inputs + possible external actuators 575 - * for 3A tuning purpose. 576 - */ 577 - if (!IS_ISP2401) 578 - motor = isp->inputs[index].motor; 579 - else 580 - motor = isp->motor; 581 - 582 - if (motor && strlen(motor->name) > 0) { 583 - const int cur_len = strlen(input->name); 584 - const int max_size = sizeof(input->name) - cur_len - 1; 585 - 586 - if (max_size > 1) { 587 - input->name[cur_len] = '+'; 588 - strscpy(&input->name[cur_len + 1], 589 - motor->name, max_size); 590 - } 591 - } 592 571 593 572 input->type = V4L2_INPUT_TYPE_CAMERA; 594 573 input->index = index; ··· 606 629 struct atomisp_video_pipe *pipe = atomisp_to_video_pipe(vdev); 607 630 struct atomisp_sub_device *asd = pipe->asd; 608 631 struct v4l2_subdev *camera = NULL; 609 - struct v4l2_subdev *motor; 610 632 int ret; 611 633 612 634 ret = atomisp_pipe_check(pipe, true); ··· 641 665 dev_err(isp->dev, "Failed to power-on sensor\n"); 642 666 return ret; 643 667 } 644 - 645 - if (!IS_ISP2401) { 646 - motor = isp->inputs[input].motor; 647 - } else { 648 - motor = isp->motor; 649 - if (motor) 650 - ret = v4l2_subdev_call(motor, core, s_power, 1); 651 - } 652 - 653 - if (motor) 654 - ret = v4l2_subdev_call(motor, core, init, 1); 655 668 656 669 asd->input_curr = input; 657 670 /* mark this camera is used by the current stream */ ··· 1398 1433 static int atomisp_queryctl(struct file *file, void *fh, 1399 1434 struct v4l2_queryctrl *qc) 1400 1435 { 1401 - int i, ret = -EINVAL; 1402 1436 struct video_device *vdev = video_devdata(file); 1403 - struct atomisp_sub_device *asd = atomisp_to_video_pipe(vdev)->asd; 1404 - struct atomisp_device *isp = video_get_drvdata(vdev); 1405 - 1406 - switch (qc->id) { 1407 - case V4L2_CID_FOCUS_ABSOLUTE: 1408 - case V4L2_CID_FOCUS_RELATIVE: 1409 - case V4L2_CID_FOCUS_STATUS: 1410 - if (!IS_ISP2401) { 1411 - return v4l2_queryctrl(isp->inputs[asd->input_curr].camera-> 1412 - ctrl_handler, qc); 1413 - } 1414 - /* ISP2401 */ 1415 - if (isp->motor) 1416 - return v4l2_queryctrl(isp->motor->ctrl_handler, qc); 1417 - else 1418 - return v4l2_queryctrl(isp->inputs[asd->input_curr]. 1419 - camera->ctrl_handler, qc); 1420 - } 1437 + int i, ret = -EINVAL; 1421 1438 1422 1439 if (qc->id & V4L2_CTRL_FLAG_NEXT_CTRL) 1423 1440 return ret; ··· 1425 1478 struct video_device *vdev = video_devdata(file); 1426 1479 struct atomisp_sub_device *asd = atomisp_to_video_pipe(vdev)->asd; 1427 1480 struct atomisp_device *isp = video_get_drvdata(vdev); 1428 - struct v4l2_subdev *motor; 1429 1481 struct v4l2_control ctrl; 1430 1482 int i; 1431 1483 int ret = 0; 1432 - 1433 - if (!IS_ISP2401) 1434 - motor = isp->inputs[asd->input_curr].motor; 1435 - else 1436 - motor = isp->motor; 1437 1484 1438 1485 for (i = 0; i < c->count; i++) { 1439 1486 ctrl.id = c->controls[i].id; ··· 1449 1508 ret = 1450 1509 v4l2_g_ctrl(isp->inputs[asd->input_curr].camera-> 1451 1510 ctrl_handler, &ctrl); 1452 - break; 1453 - case V4L2_CID_FOCUS_ABSOLUTE: 1454 - case V4L2_CID_FOCUS_RELATIVE: 1455 - case V4L2_CID_FOCUS_STATUS: 1456 - case V4L2_CID_FOCUS_AUTO: 1457 - if (motor) 1458 - ret = v4l2_g_ctrl(motor->ctrl_handler, &ctrl); 1459 1511 break; 1460 1512 case V4L2_CID_FLASH_STATUS: 1461 1513 case V4L2_CID_FLASH_INTENSITY: ··· 1518 1584 struct video_device *vdev = video_devdata(file); 1519 1585 struct atomisp_sub_device *asd = atomisp_to_video_pipe(vdev)->asd; 1520 1586 struct atomisp_device *isp = video_get_drvdata(vdev); 1521 - struct v4l2_subdev *motor; 1522 1587 struct v4l2_control ctrl; 1523 1588 int i; 1524 1589 int ret = 0; 1525 - 1526 - if (!IS_ISP2401) 1527 - motor = isp->inputs[asd->input_curr].motor; 1528 - else 1529 - motor = isp->motor; 1530 1590 1531 1591 for (i = 0; i < c->count; i++) { 1532 1592 struct v4l2_ctrl *ctr; ··· 1543 1615 ret = v4l2_s_ctrl(NULL, 1544 1616 isp->inputs[asd->input_curr].camera-> 1545 1617 ctrl_handler, &ctrl); 1546 - break; 1547 - case V4L2_CID_FOCUS_ABSOLUTE: 1548 - case V4L2_CID_FOCUS_RELATIVE: 1549 - case V4L2_CID_FOCUS_STATUS: 1550 - case V4L2_CID_FOCUS_AUTO: 1551 - if (motor) 1552 - ret = v4l2_s_ctrl(NULL, motor->ctrl_handler, 1553 - &ctrl); 1554 - else 1555 - ret = v4l2_s_ctrl(NULL, 1556 - isp->inputs[asd->input_curr]. 1557 - camera->ctrl_handler, &ctrl); 1558 1618 break; 1559 1619 case V4L2_CID_FLASH_STATUS: 1560 1620 case V4L2_CID_FLASH_INTENSITY:
-15
drivers/staging/media/atomisp/pci/atomisp_v4l2.c
··· 823 823 isp->sensor_lanes[mipi_port] = subdevs->lanes; 824 824 isp->sensor_subdevs[subdevs->port] = subdevs->subdev; 825 825 break; 826 - case CAMERA_MOTOR: 827 - if (isp->motor) { 828 - dev_warn(isp->dev, "too many atomisp motors\n"); 829 - continue; 830 - } 831 - isp->motor = subdevs->subdev; 832 - break; 833 826 case LED_FLASH: 834 827 if (isp->flash) { 835 828 dev_warn(isp->dev, "too many atomisp flash devices\n"); ··· 1058 1065 input->camera = isp->sensor_subdevs[i]; 1059 1066 1060 1067 atomisp_init_sensor(input); 1061 - 1062 - /* 1063 - * HACK: Currently VCM belongs to primary sensor only, but correct 1064 - * approach must be to acquire from platform code which sensor 1065 - * owns it. 1066 - */ 1067 - if (i == ATOMISP_CAMERA_PORT_PRIMARY) 1068 - input->motor = isp->motor; 1069 1068 1070 1069 err = media_create_pad_link(&input->camera->entity, 0, 1071 1070 &isp->csi2_port[i].subdev.entity,