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

[media] adv7604/adv7842: replace FMT_CHANGED by V4L2_DEVICE_NOTIFY_EVENT

This makes it easier for the bridge driver to just passthrough such
events to the corresponding device node.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
48519838 17e48468

+18 -9
+9 -3
drivers/media/i2c/adv7604.c
··· 341 341 { }, 342 342 }; 343 343 344 + static const struct v4l2_event adv76xx_ev_fmt = { 345 + .type = V4L2_EVENT_SOURCE_CHANGE, 346 + .u.src_change.changes = V4L2_EVENT_SRC_CH_RESOLUTION, 347 + }; 348 + 344 349 /* ----------------------------------------------------------------------- */ 345 350 346 351 static inline struct adv76xx_state *to_state(struct v4l2_subdev *sd) ··· 1749 1744 state->selected_input = input; 1750 1745 1751 1746 disable_input(sd); 1752 - 1753 1747 select_input(sd); 1754 - 1755 1748 enable_input(sd); 1756 1749 1750 + v4l2_subdev_notify(sd, V4L2_DEVICE_NOTIFY_EVENT, 1751 + (void *)&adv76xx_ev_fmt); 1757 1752 return 0; 1758 1753 } 1759 1754 ··· 1920 1915 "%s: fmt_change = 0x%x, fmt_change_digital = 0x%x\n", 1921 1916 __func__, fmt_change, fmt_change_digital); 1922 1917 1923 - v4l2_subdev_notify(sd, ADV76XX_FMT_CHANGE, NULL); 1918 + v4l2_subdev_notify(sd, V4L2_DEVICE_NOTIFY_EVENT, 1919 + (void *)&adv76xx_ev_fmt); 1924 1920 1925 1921 if (handled) 1926 1922 *handled = true;
+9 -2
drivers/media/i2c/adv7842.c
··· 242 242 { }, 243 243 }; 244 244 245 + static const struct v4l2_event adv7842_ev_fmt = { 246 + .type = V4L2_EVENT_SOURCE_CHANGE, 247 + .u.src_change.changes = V4L2_EVENT_SRC_CH_RESOLUTION, 248 + }; 249 + 245 250 /* ----------------------------------------------------------------------- */ 246 251 247 252 static inline struct adv7842_state *to_state(struct v4l2_subdev *sd) ··· 1980 1975 select_input(sd, state->vid_std_select); 1981 1976 enable_input(sd); 1982 1977 1983 - v4l2_subdev_notify(sd, ADV7842_FMT_CHANGE, NULL); 1978 + v4l2_subdev_notify(sd, V4L2_DEVICE_NOTIFY_EVENT, 1979 + (void *)&adv7842_ev_fmt); 1984 1980 1985 1981 return 0; 1986 1982 } ··· 2214 2208 "%s: fmt_change_cp = 0x%x, fmt_change_digital = 0x%x, fmt_change_sdp = 0x%x\n", 2215 2209 __func__, fmt_change_cp, fmt_change_digital, 2216 2210 fmt_change_sdp); 2217 - v4l2_subdev_notify(sd, ADV7842_FMT_CHANGE, NULL); 2211 + v4l2_subdev_notify(sd, V4L2_DEVICE_NOTIFY_EVENT, 2212 + (void *)&adv7842_ev_fmt); 2218 2213 if (handled) 2219 2214 *handled = true; 2220 2215 }
-1
include/media/adv7604.h
··· 168 168 169 169 /* notify events */ 170 170 #define ADV76XX_HOTPLUG 1 171 - #define ADV76XX_FMT_CHANGE 2 172 171 173 172 #endif
-3
include/media/adv7842.h
··· 230 230 #define V4L2_CID_ADV_RX_FREE_RUN_COLOR_MANUAL (V4L2_CID_DV_CLASS_BASE + 0x1001) 231 231 #define V4L2_CID_ADV_RX_FREE_RUN_COLOR (V4L2_CID_DV_CLASS_BASE + 0x1002) 232 232 233 - /* notify events */ 234 - #define ADV7842_FMT_CHANGE 1 235 - 236 233 /* custom ioctl, used to test the external RAM that's used by the 237 234 * deinterlacer. */ 238 235 #define ADV7842_CMD_RAM_TEST _IO('V', BASE_VIDIOC_PRIVATE)