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: adv7180: Split device initialization and reset

The two different tasks of resetting and initializing the devices, and
configured the video formats are grouped lumped together in a single
function. These two tasks are then only performed at probe time, or when
resuming from suspend. Configuration of formats are then done directly
by the IOCTL callbacks, such as .set_fmt.

Prepare for reworking the driver to only reset the device at probe and
resume, and configuring all video formats in .s_stream instead of in
each IOCTL callback by splitting the two tasks in two different
functions.

At this point there is no functional change.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Niklas Söderlund and committed by
Hans Verkuil
b918cbcb f55cd379

+20 -7
+20 -7
drivers/media/i2c/adv7180.c
··· 878 878 879 879 lockdep_assert_held(&state->mutex); 880 880 881 + ret = adv7180_program_std(state); 882 + if (ret) 883 + return ret; 884 + 885 + adv7180_set_field_mode(state); 886 + 887 + __v4l2_ctrl_handler_setup(&state->ctrl_hdl); 888 + 889 + return ret; 890 + } 891 + 892 + static int adv7180_reset_device(struct adv7180_state *state) 893 + { 894 + int ret; 895 + 896 + lockdep_assert_held(&state->mutex); 897 + 881 898 adv7180_set_power_pin(state, true); 882 899 adv7180_set_reset_pin(state, false); 883 900 ··· 912 895 if (ret) 913 896 return ret; 914 897 915 - ret = adv7180_program_std(state); 898 + ret = init_device(state); 916 899 if (ret) 917 900 return ret; 918 - 919 - adv7180_set_field_mode(state); 920 - 921 - __v4l2_ctrl_handler_setup(&state->ctrl_hdl); 922 901 923 902 /* register for interrupts */ 924 903 if (state->irq > 0) { ··· 1500 1487 goto err_free_ctrl; 1501 1488 1502 1489 mutex_lock(&state->mutex); 1503 - ret = init_device(state); 1490 + ret = adv7180_reset_device(state); 1504 1491 mutex_unlock(&state->mutex); 1505 1492 if (ret) 1506 1493 goto err_media_entity_cleanup; ··· 1586 1573 1587 1574 guard(mutex)(&state->mutex); 1588 1575 1589 - ret = init_device(state); 1576 + ret = adv7180_reset_device(state); 1590 1577 if (ret < 0) 1591 1578 return ret; 1592 1579