summaryrefslogtreecommitdiffstats
path: root/drivers/staging
Commit message (Collapse)AuthorAgeFilesLines
...
| * | media: atomisp: Allow camera_mipi_info to be NULLHans de Goede2023-06-092-20/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | camera_mipi_info is an atomisp / atomisp_gmin_platform specific struct, allow mipi_info pointers to be NULL. This is a preparation patch for making atomisp work with standard v4l2 sensor drivers. Link: https://lore.kernel.org/r/20230518153733.195306-9-hdegoede@redhat.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>
| * | media: atomisp: Move pad linking to atomisp_register_device_nodes()Hans de Goede2023-06-093-37/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | atomisp_register_device_nodes() already iterates over the ports/sensors in a loop and that loop already does not include the TPG input. So we can simply setup the CSI2-port <-> ISP and sensor <-> CSI2-port mediactl-pad links there instead of repeating the loop in atomisp_create_pads_links(), which atomisp_register_device_nodes() used to call later on. Link: https://lore.kernel.org/r/20230518153733.195306-8-hdegoede@redhat.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>
| * | media: atomisp: Delay mapping sensors to inputs till ↵Hans de Goede2023-06-092-39/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | atomisp_register_device_nodes() Delay mapping sensors to inputs till atomisp_register_device_nodes() time. There are 2 reasons for this: 1. This guarantees a stable input order independent of the sensor probe order. 2. This is a preparation patch for v4l2-async sensor probing support. Link: https://lore.kernel.org/r/20230518153733.195306-7-hdegoede@redhat.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>
| * | media: atomisp: Store number of sensor lanes per port in struct atomisp_deviceHans de Goede2023-06-094-44/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Store number of sensor lanes per port in struct atomisp_device. This is a preparation patch for adding v4l2-async sensor probing support. With async probing the inputs will get registered later, but we can already fill the sensor_lanes array when parsing the fwnodes. Link: https://lore.kernel.org/r/20230518153733.195306-6-hdegoede@redhat.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>
| * | media: atomisp: Rename __get_mipi_port() to atomisp_port_to_mipi_port()Hans de Goede2023-06-092-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename __get_mipi_port() to atomisp_port_to_mipi_port(), this is not a private (not static) function so its name should be properly prefixed. While at is also cleanup the weird handling of ATOMISP_CAMERA_PORT_TERTIARY this seems to be a left over from when the driver also supported CSI receivers with only 2 ports, but those are not supported by the current code base, so this can be cleaned up now. Link: https://lore.kernel.org/r/20230518153733.195306-5-hdegoede@redhat.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>
| * | media: atomisp: Remove atomisp_video_init() parametrizationHans de Goede2023-06-095-24/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we only have a single /dev/video# node it is no longer necessary for atomisp_video_init() to be parametrized. Remove its parameters and while at it also change the name from the single /dev/video# node from "ATOMISP ISP PREVIEW output" to "ATOMISP video output". Link: https://lore.kernel.org/r/20230518153733.195306-4-hdegoede@redhat.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>
| * | media: atomisp: Remove unused fields from struct atomisp_input_subdevHans de Goede2023-06-093-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unused fields from struct atomisp_input_subdev: 1. frame_size is never used at all 2. sensor_index is always 0, just directly pass 0 in the single user. Link: https://lore.kernel.org/r/20230518153733.195306-3-hdegoede@redhat.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>
| * | media: atomisp: Drop MRFLD_PORT_NUM defineHans de Goede2023-06-092-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The info in the MRFLD_PORT_NUM define is duplicate with the ATOMISP_CAMERA_NR_PORTS and N_MIPI_PORT_ID enum values. Drop the MRFLD_PORT_NUM define and switch to N_MIPI_PORT_ID since the [sensor_]lanes arrays are in enum mipi_port_id order. Link: https://lore.kernel.org/r/20230518153733.195306-2-hdegoede@redhat.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>
| * | media: atomisp: gc0310: Remove gc0310.hHans de Goede2023-06-092-310/+241
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the gc0310.h header file, moving most of its content into atomisp-gc0310.c and dropping some unused parts. This brings the gc0310 sensor driver inline with other sensor regular / non atomisp sensor drivers which usually only are one single .c file. Link: https://lore.kernel.org/r/20230518153214.194976-9-hdegoede@redhat.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>
| * | media: atomisp: gc0310: Remove gc0310_s_config() functionHans de Goede2023-06-091-15/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gc0310_s_config() used to call camera_sensor_platform_data.csi_cfg() back when the gc0310 driver was still using the atomisp_gmin_platform code for power-management. Now it is just a weirdly named wrapper around gc0310_detect(), drop gc0310_s_config() and make probe() call gc0310_detect() directly. Link: https://lore.kernel.org/r/20230518153214.194976-8-hdegoede@redhat.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>
| * | media: atomisp: gc0310: Cleanup includesHans de Goede2023-06-091-14/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove a bunch of unused includes and sort the remainging includes alphabetically. Link: https://lore.kernel.org/r/20230518153214.194976-7-hdegoede@redhat.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>
| * | media: atomisp: gc0310: Fix double free in gc0310_remove()Hans de Goede2023-06-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gc0310_remove() must not call kfree(dev) since the gc0310_device struct is devm managed so explicitly freeing it causes a double free. While at it add a missing mutex_destroy() call for the input_lock. Link: https://lore.kernel.org/r/20230518153214.194976-6-hdegoede@redhat.com Fixes: 340b4dd6c183 ("media: atomisp: gc0310: Use devm_kzalloc() for data struct") 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>
| * | media: atomisp: gc0310: Drop XXGC0310 ACPI hardware-idHans de Goede2023-06-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The XXGC0310 ACPI hardware-id does not appear to be used in the DSDTs of any hardware out there, so drop it. Link: https://lore.kernel.org/r/20230518153214.194976-5-hdegoede@redhat.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>
| * | media: atomisp: Set asd.subdev.devnode once from isp_subdev_init_entities()Hans de Goede2023-06-092-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have only one /dev/video# node we can set asd.subdev.devnode once from isp_subdev_init_entities(), replacing the hack to set it the last opened/closed /dev/video# node from atomisp_open() / atomisp_release(). 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>
| * | media: atomisp: Remove in_reset argument from atomisp_css_start()Hans de Goede2023-06-094-13/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The in_reset argument to atomisp_css_start() is only ever true in atomisp_assert_recovery_work(), drop the argument and move the special reset handlig to atomisp_assert_recovery_work(). 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>
| * | media: atomisp: Remove unused atomisp_get_css_pipe_id() functionHans de Goede2023-06-092-31/+0
| | | | | | | | | | | | | | | | | | | | | | | | Remove no longer user atomisp_get_css_pipe_id() function. 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>
| * | media: atomisp: Remove unused css_pipe_id argument from ↵Hans de Goede2023-06-094-20/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | atomisp_css_[start|stop]() The css_pipe_id argument pass to atomisp_css_[start|stop]() is not used, drop it. 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>
| * | media: atomisp: Remove atomisp_[sub]dev_users()Hans de Goede2023-06-092-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The atomisp_[sub]dev_users() functions are not used anymore, remove them. 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>
| * | media: atomisp: Allow system suspend to continue with open /dev/video# nodesHans de Goede2023-06-092-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just having a /dev/video# node open is not a reason to block system suspend. At least when userspace is not streaming. In that case the worst case scenario is that streams have been created, but we can just destroy those before powering off the ISP and recreate the streams on resume. Fixing suspend when streaming is left as a FIXME item for later. 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>
| * | media: atomisp: Rename atomisp_destroy_pipes_stream_force() to ↵Hans de Goede2023-06-093-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | atomisp_destroy_pipes_stream() There now no longer is a non force version of atomisp_destroy_pipes_stream_force() so having the _force postfix no longer makes sense rename it to atomisp_destroy_pipes_stream(). 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>
| * | media: atomisp: Simplify atomisp_isr() and recovery_work()Hans de Goede2023-06-091-78/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both atomisp_isr() and recovery_work() now have a combination of: 1. "if (!isp->asd.streaming) goto out;" code at the top 2. "if (sp->asd.streaming) {}" blocks in the body which are jumped over by the goto out. This means that the "if (sp->asd.streaming) {}" blocks are always executed if they are not jumped over by the goto. Remove the unnecessary "if (sp->asd.streaming)" checks and re-indent the code. 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>
| * | media: atomisp: Remove atomisp_streaming_count()Hans de Goede2023-06-094-11/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | atomisp_streaming_count() is just an alias for isp->asd.streaming now, replace it with directly checking that and remove the helper. 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>
| * | media: atomisp: Remove no longer used atomisp_css_flush()Hans de Goede2023-06-092-21/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the no longer used atomisp_css_flush() function and merge atomisp_assert_recovery_work() and __atomisp_css_recover() into a single function. 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>
| * | media: atomisp: Turn asd->streaming state tracker into a boolHans de Goede2023-06-097-26/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ATOMISP_DEVICE_STREAMING_STOPPING pipe state comes from when we still had continuous mode. This would be set when streaming from both capture + preview devnodes when 1 of the 2 streams has been stopped and the driver was waiting for the other stream to get stopped too. With continuous mode gone the stopping state is no longer necessary and asd->streaming can be changed to a bool. Note that atomisp_assert_recovery_work() would still temporarily set streaming to stopping, but it does so with the isp->mutex held and changes streaming to either enabled or disabled before releasing the mutex, so none of the consumers which care about the difference ever see the stopping state. 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>
| * | media: atomisp: Simplify atomisp_pipe_check()Hans de Goede2023-06-091-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All switch (pipe->asd->streaming) cases in atomisp_pipe_check() are either no-ops or never happen: 1. ATOMISP_DEVICE_STREAMING_DISABLED already is a no-op 2. The videobuf2 core guarantees that when we are streaming vb2_is_busy() returns true. So the ATOMISP_DEVICE_STREAMING_ENABLED case is already handled by the if above the switch (pipe->asd->streaming). 3. After recent changes pipe->asd->streaming is only ever set to ATOMISP_DEVICE_STREAMING_STOPPING in atomisp_assert_recovery_work() and that function holds isp->mutex and always transitions the streaming state to ATOMISP_DEVICE_STREAMING_DISABLED or ATOMISP_DEVICE_STREAMING_ENABLED before releasing the mutex. So atomisp_pipe_check() never sees ATOMISP_DEVICE_STREAMING_STOPPING. Remove the entire switch-case. 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>
| * | media: atomisp: Simplify atomisp_open() and atomisp_release()Hans de Goede2023-06-091-26/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that continuous mode is gone and we only have 1 /dev/video# node, combined with only allowing 1 open of that /dev/video# node for now, there is no need to check for other (sub)dev / pipe users. Remove the unnecessary checks for a nice cleanup. Note we also don't need to set asd->streaming to disabled since the vb2_fop_release() call done by atomisp_release() will have called atomisp_stop_streaming() already at this point (if necessary) and that will have already done this. 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>
| * | media: atomisp: Simplify atomisp_css_[start|stop]()Hans de Goede2023-06-091-48/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that continuous mode is gone and we only have 1 /dev/video# node, the videobuf2 core guarantees that atomisp_css_[start|stop]() will only be called one at a time. So there is no need for atomisp_streaming_count() counts. When reqbufs has been done then the streams are guaranteed to be created, and streaming cannot be started without reqbufs so there is no need for atomisp_css_start() to check if it needs to create the streams. Use this to clean-up atomisp_css_[start|stop](). While at it also fix atomisp_css_start() not re-creating the streams on an error, breaking the guarantee that the streams are always there after a succesfull reqbufs call. 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>
| * | media: atomisp: Simplify atomisp_[start|stop]_streaming()Hans de Goede2023-06-091-71/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that continuous mode is gone and we only have 1 /dev/video# node, the videobuf2 core guarantees that atomisp_[start|stop]_streaming() will only be called one at a time. So there is no need to check for things like the isp is already streaming when starting, or other streams still being active while stopping. Remove checks for these from atomisp_[start|stop]_streaming(). While at it also improve the logging a bit: 1. Remove the dev_err(isp->dev, "atomisp_reset") logged on every stream stop (even though everything is fine. 2. Log a message when starting/stopping the sensor stream fails 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>
| * | media: atomisp: Remove atomisp_sensor_start_stream()Hans de Goede2023-06-091-36/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we no longer have continuous mode we always want to start the sensor on the first atomisp_start_streaming() call and stop it on the first atomisp_stop_streaming() call. Remove atomisp_sensor_start_stream() which returned the number of streams which should be active before starting the sensor and always start/stop the sensor directly. 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>
| * | media: atomisp: Remove isp_timeout flagHans de Goede2023-06-093-13/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | isp_timeout only ever gets set in __atomisp_css_recover() and then immediately gets cleared again after calling atomisp_reset(). All this happens with isp->mutex held. The only consumer of isp->isp_timeout is atomisp_stop_streaming(), which also holds isp->mutex and which is *not* called by atomisp_reset(). Since both hold isp->mutex and since __atomisp_css_recover() clears isp_timeout before releasing the mutex, atomisp_stop_streaming() can never see isp_timeout being true, so just remove the flag. 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>
| * | media: atomisp: Remove unused mipi_frame_size field from atomisp_[sub_]deviceHans de Goede2023-06-093-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Both the atomisp_device and the atomisp_sub_device structs have an unused mipi_frame_size field, remove the field from both. 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>
| * | media: atomisp: Remove a bunch of unused atomisp_css_*() functionsHans de Goede2023-06-092-128/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove various unused atomisp_css_*() functions from atomisp_compat_css20.c. 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>
| * | media: atomisp: Remove atomisp_subdev_register_video_nodes() helperHans de Goede2023-06-093-21/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that there is only 1 /dev/video# node left there is no need to do this in a helper. Just make atomisp_register_device_nodes() call video_register_device() directly. 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>
| * | media: atomisp: Remove 1 line atomisp_flush_bufs_and_wakeup() helperHans de Goede2023-06-092-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After recent changes this now is just a wrapper around atomisp_flush_video_pipe(). Make its single caller call atomisp_flush_video_pipe() directly and drop the helper. 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>
| * | media: atomisp: Remove source_pad parameter from functions and structsHans de Goede2023-06-097-69/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that there is only 1 source-pad for an asd there is no need to have a parameter for this in various places. Remove the source_pad function parameter and atomisp_sub_device.capture_pad data member. 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>
| * | media: atomisp: Rename video_out_preview to video_outHans de Goede2023-06-096-30/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have only 1 /dev/video# node for output for all different run-modes (with only 1 run-mode at a time) using video_out_preview for the remaining atomisp_pipe does not properly reflect that this is *the* output pipe. Fo the following renames to fix the naming: s/video_out_preview/video_out/ s/ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW/ATOMISP_SUBDEV_PAD_SOURCE/ 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>
| * | media: atomisp: Drop atomisp_is_vf_pipe()Hans de Goede2023-06-094-37/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since there only is one /dev/video# node now (no more continuous mode), there are now no longer separate main capture + view-finder pipes. We are now always on the main pipe, so atomisp_is_vf_pipe() should always return false now. Drop any checks using it, replacing them with the code-path for a false return. 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>
| * | media: atomisp: Register only 1 /dev/video# nodeHans de Goede2023-06-096-233/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we no longer support continuous mode and thus no longer support streaming from 2 /dev/video# nodes at the same time, there is no need to have a separate /dev/video# node (+ matching v4l2-subdev pads) for each run-mode. Keep the video_out_preview /dev/video0 device and remove the video_out_video_capture / video_out_vf / video_out_capture video-devices (atomisp_pipe-s) and also remove the matching ATOMISP_SUBDEV_PAD_SOURCE_VIDEO / ATOMISP_SUBDEV_PAD_SOURCE_VF / ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE source-pads. 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>
| * | media: atomisp: Replace source-pad checks with run-mode checksHans de Goede2023-06-093-103/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently atomisp behavior is determined by a mix of which /dev/video# node (which isp-subdev source-pad) is opened + which run-mode is set. With various combinations not being allowed and likely leading to crashes due to lack of error checking. Now that we no longer support continuous mode and thus no longer support streaming from 2 /dev/video# nodes at the same time, there is no need to have a separate /dev/video# node for each run-mode. Instead the plan is to support the 3 different run-modes on a single /dev/video# node. Since we are moving to a single isp-subdev source-pad, the behavior should then be solely and consistently be defined by the run-mode. Replace various source-pad checks with run-mode checks in preparation for moving to a single source-pad. In some places the new run-mode checks overlap with existing run-mode checks and the checks are folded together into a single check. This removes handling of the ATOMISP_SUBDEV_PAD_SOURCE_VF source-pad, this source-pad was only useful for continuous mode, for which support has been removed. Note that currently the only run-mode which we actually have been able to get to work is the video-capture with scaler aka preview mode and as such that is also the only run-mode tested. This patch is intended to preserve the current (known to not work 100%) behavior of the other run-modes, so that those maybe can be enabled later. 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>
| * | media: atomisp: Drop atomisp_get_css_buf_type()Hans de Goede2023-06-091-28/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since continuous mode has been removed, there no longer is the option for separate capture output + viewfinder output streams at the same time. So all buffers queued by userspace are now for the normal output stream, remove atomisp_get_css_buf_type() and always use IA_CSS_BUFFER_TYPE_OUTPUT_FRAME for buffers queued by userspace. 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>
| * | media: atomisp: Remove isp->need_gfx_throttle fieldHans de Goede2023-06-093-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the isp->need_gfx_throttle field it is only ever set and never read. Also the code setting it is broken, comparing run_mode->val to ATOMISP_SUBDEV_PAD_SOURCE_VIDEO which are not of the same type / not part of the same enum. 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>
| * | media: atomisp: Remove Continuous capture and SDV run-modesHans de Goede2023-06-095-119/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we no longer support Continuous mode, setting the run_mode to ATOMISP_RUN_MODE_CONTINUOUS_CAPTURE no longer make sense, so remove this. While at it, also remove ATOMISP_RUN_MODE_SDV, which was never exposed to userspace in the first place. 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>
| * | media: atomisp: Remove res_overflow parameter from atomisp_try_fmt()Hans de Goede2023-06-093-20/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | The only remaining caller of atomisp_try_fmt() always passes NULL for the res_overflow parameter. Drop it and simplify atomisp_try_fmt(). 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>
| * | media: atomisp: sh_css_mipi: Remove #ifdef ISP2401Kate Hsuan2023-06-091-39/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The actions of ISP2401 and 2400 are determined at the runtime. Link: https://lore.kernel.org/r/20230508062632.34537-5-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
| * | media: atomisp: sh_css_firmware: determine firmware version at runtimeKate Hsuan2023-06-091-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The firmware version of ISP2401 and 2400 is determined at runtime. Link: https://lore.kernel.org/r/20230508062632.34537-4-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
| * | media: atomisp: sh_css_sp: Remove #ifdef ISP2401Kate Hsuan2023-06-091-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The actions of ISP2401 and 2400 will be determined at the runtime. Link: https://lore.kernel.org/r/20230508062632.34537-3-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
| * | media: atomisp: runtime: frame: remove #ifdef ISP2401Kate Hsuan2023-06-091-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The actions of ISP2401 and 2400 are determined at the runtime. Link: https://lore.kernel.org/r/20230508062632.34537-2-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
| * | media: atomisp: sh_css: Remove #ifdef ISP2401Kate Hsuan2023-06-091-285/+239
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The actions of ISP2401 and 2400 are determined at the runtime. Link: https://lore.kernel.org/r/20230508062632.34537-1-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
| * | Merge tag 'v6.4-rc5' into media_stageMauro Carvalho Chehab2023-06-091-2/+2
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux 6.4-rc5 * tag 'v6.4-rc5': (919 commits) Linux 6.4-rc5 leds: qcom-lpg: Fix PWM period limits selftests/ftrace: Choose target function for filter test from samples KVM: selftests: Add test for race in kvm_recalculate_apic_map() KVM: x86: Bail from kvm_recalculate_phys_map() if x2APIC ID is out-of-bounds KVM: x86: Account fastpath-only VM-Exits in vCPU stats KVM: SVM: vNMI pending bit is V_NMI_PENDING_MASK not V_NMI_BLOCKING_MASK KVM: x86/mmu: Grab memslot for correct address space in NX recovery worker tpm, tpm_tis: correct tpm_tis_flags enumeration values Revert "ext4: remove ac->ac_found > sbi->s_mb_min_to_scan dead check in ext4_mb_check_limits" media: uvcvideo: Don't expose unsupported formats to userspace media: v4l2-subdev: Fix missing kerneldoc for client_caps media: staging: media: imx: initialize hs_settle to avoid warning media: v4l2-mc: Drop subdev check in v4l2_create_fwnode_links_to_pad() riscv: Implement missing huge_ptep_get riscv: Fix huge_ptep_set_wrprotect when PTE is a NAPOT module/decompress: Fix error checking on zstd decompression fork, vhost: Use CLONE_THREAD to fix freezer/ps regression dt-bindings: serial: 8250_omap: add rs485-rts-active-high selinux: don't use make's grouped targets feature yet ...
| * | | media: staging: max96712: Switch i2c driver back to use .probe()Uwe Kleine-König2023-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then commit 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>