Commit cfca7644 authored by Sylwester Nawrocki's avatar Sylwester Nawrocki Committed by Mauro Carvalho Chehab

[media] V4L: Rename v4l2_async_bus_* to v4l2_async_match_*

enum v4l2_async_bus_type also selects a method subdevs are matched
in the notification handlers, rename it to v4l2_async_match_type
so V4L2_ASYNC_MATCH_OF entry can be further added for matching by
device tree node pointer.
Acked-and-tested-by: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 3c2ade01
...@@ -1837,9 +1837,9 @@ static int sh_mobile_ceu_probe(struct platform_device *pdev) ...@@ -1837,9 +1837,9 @@ static int sh_mobile_ceu_probe(struct platform_device *pdev)
for (j = 0; pcdev->pdata->asd_sizes[j]; j++) { for (j = 0; pcdev->pdata->asd_sizes[j]; j++) {
for (i = 0; i < pcdev->pdata->asd_sizes[j]; i++, asd++) { for (i = 0; i < pcdev->pdata->asd_sizes[j]; i++, asd++) {
dev_dbg(&pdev->dev, "%s(): subdev #%d, type %u\n", dev_dbg(&pdev->dev, "%s(): subdev #%d, type %u\n",
__func__, i, (*asd)->bus_type); __func__, i, (*asd)->match_type);
if ((*asd)->bus_type == V4L2_ASYNC_BUS_PLATFORM && if ((*asd)->match_type == V4L2_ASYNC_MATCH_DEVNAME &&
!strncmp(name, (*asd)->match.platform.name, !strncmp(name, (*asd)->match.device_name.name,
sizeof(name) - 1)) { sizeof(name) - 1)) {
pcdev->csi2_asd = *asd; pcdev->csi2_asd = *asd;
break; break;
......
...@@ -1475,7 +1475,7 @@ static int scan_async_group(struct soc_camera_host *ici, ...@@ -1475,7 +1475,7 @@ static int scan_async_group(struct soc_camera_host *ici,
break; break;
} }
if (i == size || asd[i]->bus_type != V4L2_ASYNC_BUS_I2C) { if (i == size || asd[i]->match_type != V4L2_ASYNC_MATCH_I2C) {
/* All useless */ /* All useless */
dev_err(ici->v4l2_dev.dev, "No I2C data source found!\n"); dev_err(ici->v4l2_dev.dev, "No I2C data source found!\n");
return -ENODEV; return -ENODEV;
......
...@@ -34,9 +34,9 @@ static bool match_i2c(struct device *dev, struct v4l2_async_subdev *asd) ...@@ -34,9 +34,9 @@ static bool match_i2c(struct device *dev, struct v4l2_async_subdev *asd)
#endif #endif
} }
static bool match_platform(struct device *dev, struct v4l2_async_subdev *asd) static bool match_devname(struct device *dev, struct v4l2_async_subdev *asd)
{ {
return !strcmp(asd->match.platform.name, dev_name(dev)); return !strcmp(asd->match.device_name.name, dev_name(dev));
} }
static LIST_HEAD(subdev_list); static LIST_HEAD(subdev_list);
...@@ -53,17 +53,17 @@ static struct v4l2_async_subdev *v4l2_async_belongs(struct v4l2_async_notifier * ...@@ -53,17 +53,17 @@ static struct v4l2_async_subdev *v4l2_async_belongs(struct v4l2_async_notifier *
list_for_each_entry(asd, &notifier->waiting, list) { list_for_each_entry(asd, &notifier->waiting, list) {
/* bus_type has been verified valid before */ /* bus_type has been verified valid before */
switch (asd->bus_type) { switch (asd->match_type) {
case V4L2_ASYNC_BUS_CUSTOM: case V4L2_ASYNC_MATCH_CUSTOM:
match = asd->match.custom.match; match = asd->match.custom.match;
if (!match) if (!match)
/* Match always */ /* Match always */
return asd; return asd;
break; break;
case V4L2_ASYNC_BUS_PLATFORM: case V4L2_ASYNC_MATCH_DEVNAME:
match = match_platform; match = match_devname;
break; break;
case V4L2_ASYNC_BUS_I2C: case V4L2_ASYNC_MATCH_I2C:
match = match_i2c; match = match_i2c;
break; break;
default: default:
...@@ -141,15 +141,15 @@ int v4l2_async_notifier_register(struct v4l2_device *v4l2_dev, ...@@ -141,15 +141,15 @@ int v4l2_async_notifier_register(struct v4l2_device *v4l2_dev,
for (i = 0; i < notifier->num_subdevs; i++) { for (i = 0; i < notifier->num_subdevs; i++) {
asd = notifier->subdev[i]; asd = notifier->subdev[i];
switch (asd->bus_type) { switch (asd->match_type) {
case V4L2_ASYNC_BUS_CUSTOM: case V4L2_ASYNC_MATCH_CUSTOM:
case V4L2_ASYNC_BUS_PLATFORM: case V4L2_ASYNC_MATCH_DEVNAME:
case V4L2_ASYNC_BUS_I2C: case V4L2_ASYNC_MATCH_I2C:
break; break;
default: default:
dev_err(notifier->v4l2_dev ? notifier->v4l2_dev->dev : NULL, dev_err(notifier->v4l2_dev ? notifier->v4l2_dev->dev : NULL,
"Invalid bus-type %u on %p\n", "Invalid match type %u on %p\n",
asd->bus_type, asd); asd->match_type, asd);
return -EINVAL; return -EINVAL;
} }
list_add_tail(&asd->list, &notifier->waiting); list_add_tail(&asd->list, &notifier->waiting);
......
...@@ -22,10 +22,10 @@ struct v4l2_async_notifier; ...@@ -22,10 +22,10 @@ struct v4l2_async_notifier;
/* A random max subdevice number, used to allocate an array on stack */ /* A random max subdevice number, used to allocate an array on stack */
#define V4L2_MAX_SUBDEVS 128U #define V4L2_MAX_SUBDEVS 128U
enum v4l2_async_bus_type { enum v4l2_async_match_type {
V4L2_ASYNC_BUS_CUSTOM, V4L2_ASYNC_MATCH_CUSTOM,
V4L2_ASYNC_BUS_PLATFORM, V4L2_ASYNC_MATCH_DEVNAME,
V4L2_ASYNC_BUS_I2C, V4L2_ASYNC_MATCH_I2C,
}; };
/** /**
...@@ -36,11 +36,11 @@ enum v4l2_async_bus_type { ...@@ -36,11 +36,11 @@ enum v4l2_async_bus_type {
* probed, to a notifier->waiting list * probed, to a notifier->waiting list
*/ */
struct v4l2_async_subdev { struct v4l2_async_subdev {
enum v4l2_async_bus_type bus_type; enum v4l2_async_match_type match_type;
union { union {
struct { struct {
const char *name; const char *name;
} platform; } device_name;
struct { struct {
int adapter_id; int adapter_id;
unsigned short address; unsigned short address;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment