• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * Samsung S5P/EXYNOS4 SoC Camera Subsystem driver
4  *
5  * Copyright (C) 2013 Samsung Electronics Co., Ltd.
6  * Author: Sylwester Nawrocki <s.nawrocki@samsung.com>
7  */
8 
9 #include <linux/module.h>
10 #include <media/drv-intf/exynos-fimc.h>
11 #include "common.h"
12 
13 /* Called with the media graph mutex held or entity->stream_count > 0. */
fimc_find_remote_sensor(struct media_entity * entity)14 struct v4l2_subdev *fimc_find_remote_sensor(struct media_entity *entity)
15 {
16 	struct media_pad *pad = &entity->pads[0];
17 	struct v4l2_subdev *sd;
18 
19 	while (pad->flags & MEDIA_PAD_FL_SINK) {
20 		/* source pad */
21 		pad = media_entity_remote_pad(pad);
22 		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
23 			break;
24 
25 		sd = media_entity_to_v4l2_subdev(pad->entity);
26 
27 		if (sd->grp_id == GRP_ID_FIMC_IS_SENSOR ||
28 		    sd->grp_id == GRP_ID_SENSOR)
29 			return sd;
30 		/* sink pad */
31 		pad = &sd->entity.pads[0];
32 	}
33 	return NULL;
34 }
35 EXPORT_SYMBOL(fimc_find_remote_sensor);
36 
__fimc_vidioc_querycap(struct device * dev,struct v4l2_capability * cap)37 void __fimc_vidioc_querycap(struct device *dev, struct v4l2_capability *cap)
38 {
39 	strscpy(cap->driver, dev->driver->name, sizeof(cap->driver));
40 	strscpy(cap->card, dev->driver->name, sizeof(cap->card));
41 	snprintf(cap->bus_info, sizeof(cap->bus_info),
42 				"platform:%s", dev_name(dev));
43 }
44 EXPORT_SYMBOL(__fimc_vidioc_querycap);
45 
46 MODULE_LICENSE("GPL");
47