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: i2c: ov9282: add strobe output enable v4l2 control

Add V4L2_CID_FLASH_STROBE_OE enable/disable support using the
"strobe output enable" feature of the sensor.

All values are based on the OV9281 datasheet v1.53 (january 2019) and
tested using an ov9281 VisionComponents module.

Signed-off-by: Richard Leitner <richard.leitner@linux.dev>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Richard Leitner and committed by
Hans Verkuil
f007ad65 47bc0d29

+25 -1
+25 -1
drivers/media/i2c/ov9282.c
··· 670 670 current_val); 671 671 } 672 672 673 + static int ov9282_set_ctrl_flash_strobe_oe(struct ov9282 *ov9282, bool enable) 674 + { 675 + u32 current_val; 676 + int ret; 677 + 678 + ret = ov9282_read_reg(ov9282, OV9282_REG_OUTPUT_ENABLE6, 1, &current_val); 679 + if (ret) 680 + return ret; 681 + 682 + if (enable) 683 + current_val |= OV9282_OUTPUT_ENABLE6_STROBE; 684 + else 685 + current_val &= ~OV9282_OUTPUT_ENABLE6_STROBE; 686 + 687 + return ov9282_write_reg(ov9282, OV9282_REG_OUTPUT_ENABLE6, 1, current_val); 688 + } 689 + 673 690 /** 674 691 * ov9282_set_ctrl() - Set subdevice control 675 692 * @ctrl: pointer to v4l2_ctrl structure ··· 752 735 case V4L2_CID_HBLANK: 753 736 ret = ov9282_write_reg(ov9282, OV9282_REG_TIMING_HTS, 2, 754 737 (ctrl->val + ov9282->cur_mode->width) >> 1); 738 + break; 739 + case V4L2_CID_FLASH_STROBE_OE: 740 + ret = ov9282_set_ctrl_flash_strobe_oe(ov9282, ctrl->val); 755 741 break; 756 742 default: 757 743 dev_err(ov9282->dev, "Invalid control %d", ctrl->id); ··· 1345 1325 u32 lpfr; 1346 1326 int ret; 1347 1327 1348 - ret = v4l2_ctrl_handler_init(ctrl_hdlr, 10); 1328 + ret = v4l2_ctrl_handler_init(ctrl_hdlr, 11); 1349 1329 if (ret) 1350 1330 return ret; 1351 1331 ··· 1409 1389 hblank_min, 1410 1390 OV9282_TIMING_HTS_MAX - mode->width, 1411 1391 1, hblank_min); 1392 + 1393 + /* Flash/Strobe controls */ 1394 + v4l2_ctrl_new_std(ctrl_hdlr, &ov9282_ctrl_ops, 1395 + V4L2_CID_FLASH_STROBE_OE, 0, 1, 1, 0); 1412 1396 1413 1397 ret = v4l2_fwnode_device_parse(ov9282->dev, &props); 1414 1398 if (!ret) {