From fc91da385da7b7bbb7a25f7ad8d3897eec6e1ff5 Mon Sep 17 00:00:00 2001 From: Sudhir Vyas Date: Wed, 19 Feb 2020 20:10:37 +0530 Subject: drivers: media: gmsl sensor flexi connections Enable splitter mode only if more than one devices said to be attached. Consider sensor device does not exist, if serializer fails to communicate on newly assigned proxy slave. Also skip sensor probe in this case, to avoid creating false dev node. Reset to active gmsl link if all source devices are not physically connected. This enables support for all combinations of sensor connections for streaming, i.e. dual or link-A only or link-B only. Use max_src instead of num_src during boot, since num_src only reflects the number of devices registered so far. Keep using num_src for streaming sequence. Some trivial fixes. Bug 2838597 Change-Id: Ia5624906191cca3b4d30405d0ffba899eba95da6 Signed-off-by: Sudhir Vyas Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2299611 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Frank Chen Reviewed-by: mobile promotions Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- include/media/gmsl-link.h | 3 ++- include/media/max9296.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/media/gmsl-link.h b/include/media/gmsl-link.h index 79cef63fe..94df6bf3f 100644 --- a/include/media/gmsl-link.h +++ b/include/media/gmsl-link.h @@ -1,5 +1,5 @@ /** - * Copyright (c) 2018-2019, NVIDIA Corporation. All rights reserved. + * Copyright (c) 2018-2020, NVIDIA Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -59,6 +59,7 @@ struct gmsl_link_ctx { __u32 ser_reg; __u32 sdev_reg; __u32 sdev_def; + bool serdev_found; struct gmsl_stream streams[GMSL_DEV_MAX_NUM_DATA_STREAMS]; struct device *s_dev; }; diff --git a/include/media/max9296.h b/include/media/max9296.h index ffc8eae0e..014af0af2 100644 --- a/include/media/max9296.h +++ b/include/media/max9296.h @@ -1,5 +1,5 @@ /** - * Copyright (c) 2018-2019, NVIDIA Corporation. All rights reserved. + * Copyright (c) 2018-2020, NVIDIA Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -21,7 +21,7 @@ int max9296_setup_link(struct device *dev, struct device *s_dev); -int max9296_setup_control(struct device *dev); +int max9296_setup_control(struct device *dev, struct device *s_dev); int max9296_reset_control(struct device *dev, struct device *s_dev); -- cgit v1.2.2