diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2013-07-19 11:14:46 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2013-07-30 14:52:00 -0400 |
commit | cfca7644d7959e1f50cb132306d1557bf6c2da57 (patch) | |
tree | 460cb3ca813a309aa3d668d03ca715acf1128451 | |
parent | 3c2ade017a7e10470aa8112f8a4bfdb2ee30f97f (diff) |
[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: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r-- | drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c | 6 | ||||
-rw-r--r-- | drivers/media/platform/soc_camera/soc_camera.c | 2 | ||||
-rw-r--r-- | drivers/media/v4l2-core/v4l2-async.c | 26 | ||||
-rw-r--r-- | include/media/v4l2-async.h | 12 |
4 files changed, 23 insertions, 23 deletions
diff --git a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c index f2de0066089a..dae9716e34b1 100644 --- a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c +++ b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c | |||
@@ -1837,9 +1837,9 @@ static int sh_mobile_ceu_probe(struct platform_device *pdev) | |||
1837 | for (j = 0; pcdev->pdata->asd_sizes[j]; j++) { | 1837 | for (j = 0; pcdev->pdata->asd_sizes[j]; j++) { |
1838 | for (i = 0; i < pcdev->pdata->asd_sizes[j]; i++, asd++) { | 1838 | for (i = 0; i < pcdev->pdata->asd_sizes[j]; i++, asd++) { |
1839 | dev_dbg(&pdev->dev, "%s(): subdev #%d, type %u\n", | 1839 | dev_dbg(&pdev->dev, "%s(): subdev #%d, type %u\n", |
1840 | __func__, i, (*asd)->bus_type); | 1840 | __func__, i, (*asd)->match_type); |
1841 | if ((*asd)->bus_type == V4L2_ASYNC_BUS_PLATFORM && | 1841 | if ((*asd)->match_type == V4L2_ASYNC_MATCH_DEVNAME && |
1842 | !strncmp(name, (*asd)->match.platform.name, | 1842 | !strncmp(name, (*asd)->match.device_name.name, |
1843 | sizeof(name) - 1)) { | 1843 | sizeof(name) - 1)) { |
1844 | pcdev->csi2_asd = *asd; | 1844 | pcdev->csi2_asd = *asd; |
1845 | break; | 1845 | break; |
diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c index 2dd0e5272941..8af572bcf03a 100644 --- a/drivers/media/platform/soc_camera/soc_camera.c +++ b/drivers/media/platform/soc_camera/soc_camera.c | |||
@@ -1475,7 +1475,7 @@ static int scan_async_group(struct soc_camera_host *ici, | |||
1475 | break; | 1475 | break; |
1476 | } | 1476 | } |
1477 | 1477 | ||
1478 | if (i == size || asd[i]->bus_type != V4L2_ASYNC_BUS_I2C) { | 1478 | if (i == size || asd[i]->match_type != V4L2_ASYNC_MATCH_I2C) { |
1479 | /* All useless */ | 1479 | /* All useless */ |
1480 | dev_err(ici->v4l2_dev.dev, "No I2C data source found!\n"); | 1480 | dev_err(ici->v4l2_dev.dev, "No I2C data source found!\n"); |
1481 | return -ENODEV; | 1481 | return -ENODEV; |
diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c index ff87c299f640..86934ca73357 100644 --- a/drivers/media/v4l2-core/v4l2-async.c +++ b/drivers/media/v4l2-core/v4l2-async.c | |||
@@ -34,9 +34,9 @@ static bool match_i2c(struct device *dev, struct v4l2_async_subdev *asd) | |||
34 | #endif | 34 | #endif |
35 | } | 35 | } |
36 | 36 | ||
37 | static bool match_platform(struct device *dev, struct v4l2_async_subdev *asd) | 37 | static bool match_devname(struct device *dev, struct v4l2_async_subdev *asd) |
38 | { | 38 | { |
39 | return !strcmp(asd->match.platform.name, dev_name(dev)); | 39 | return !strcmp(asd->match.device_name.name, dev_name(dev)); |
40 | } | 40 | } |
41 | 41 | ||
42 | static LIST_HEAD(subdev_list); | 42 | static LIST_HEAD(subdev_list); |
@@ -53,17 +53,17 @@ static struct v4l2_async_subdev *v4l2_async_belongs(struct v4l2_async_notifier * | |||
53 | 53 | ||
54 | list_for_each_entry(asd, ¬ifier->waiting, list) { | 54 | list_for_each_entry(asd, ¬ifier->waiting, list) { |
55 | /* bus_type has been verified valid before */ | 55 | /* bus_type has been verified valid before */ |
56 | switch (asd->bus_type) { | 56 | switch (asd->match_type) { |
57 | case V4L2_ASYNC_BUS_CUSTOM: | 57 | case V4L2_ASYNC_MATCH_CUSTOM: |
58 | match = asd->match.custom.match; | 58 | match = asd->match.custom.match; |
59 | if (!match) | 59 | if (!match) |
60 | /* Match always */ | 60 | /* Match always */ |
61 | return asd; | 61 | return asd; |
62 | break; | 62 | break; |
63 | case V4L2_ASYNC_BUS_PLATFORM: | 63 | case V4L2_ASYNC_MATCH_DEVNAME: |
64 | match = match_platform; | 64 | match = match_devname; |
65 | break; | 65 | break; |
66 | case V4L2_ASYNC_BUS_I2C: | 66 | case V4L2_ASYNC_MATCH_I2C: |
67 | match = match_i2c; | 67 | match = match_i2c; |
68 | break; | 68 | break; |
69 | default: | 69 | default: |
@@ -141,15 +141,15 @@ int v4l2_async_notifier_register(struct v4l2_device *v4l2_dev, | |||
141 | for (i = 0; i < notifier->num_subdevs; i++) { | 141 | for (i = 0; i < notifier->num_subdevs; i++) { |
142 | asd = notifier->subdev[i]; | 142 | asd = notifier->subdev[i]; |
143 | 143 | ||
144 | switch (asd->bus_type) { | 144 | switch (asd->match_type) { |
145 | case V4L2_ASYNC_BUS_CUSTOM: | 145 | case V4L2_ASYNC_MATCH_CUSTOM: |
146 | case V4L2_ASYNC_BUS_PLATFORM: | 146 | case V4L2_ASYNC_MATCH_DEVNAME: |
147 | case V4L2_ASYNC_BUS_I2C: | 147 | case V4L2_ASYNC_MATCH_I2C: |
148 | break; | 148 | break; |
149 | default: | 149 | default: |
150 | dev_err(notifier->v4l2_dev ? notifier->v4l2_dev->dev : NULL, | 150 | dev_err(notifier->v4l2_dev ? notifier->v4l2_dev->dev : NULL, |
151 | "Invalid bus-type %u on %p\n", | 151 | "Invalid match type %u on %p\n", |
152 | asd->bus_type, asd); | 152 | asd->match_type, asd); |
153 | return -EINVAL; | 153 | return -EINVAL; |
154 | } | 154 | } |
155 | list_add_tail(&asd->list, ¬ifier->waiting); | 155 | list_add_tail(&asd->list, ¬ifier->waiting); |
diff --git a/include/media/v4l2-async.h b/include/media/v4l2-async.h index c3ec6ac75f7e..33e3b2a30ecb 100644 --- a/include/media/v4l2-async.h +++ b/include/media/v4l2-async.h | |||
@@ -22,10 +22,10 @@ struct v4l2_async_notifier; | |||
22 | /* A random max subdevice number, used to allocate an array on stack */ | 22 | /* A random max subdevice number, used to allocate an array on stack */ |
23 | #define V4L2_MAX_SUBDEVS 128U | 23 | #define V4L2_MAX_SUBDEVS 128U |
24 | 24 | ||
25 | enum v4l2_async_bus_type { | 25 | enum v4l2_async_match_type { |
26 | V4L2_ASYNC_BUS_CUSTOM, | 26 | V4L2_ASYNC_MATCH_CUSTOM, |
27 | V4L2_ASYNC_BUS_PLATFORM, | 27 | V4L2_ASYNC_MATCH_DEVNAME, |
28 | V4L2_ASYNC_BUS_I2C, | 28 | V4L2_ASYNC_MATCH_I2C, |
29 | }; | 29 | }; |
30 | 30 | ||
31 | /** | 31 | /** |
@@ -36,11 +36,11 @@ enum v4l2_async_bus_type { | |||
36 | * probed, to a notifier->waiting list | 36 | * probed, to a notifier->waiting list |
37 | */ | 37 | */ |
38 | struct v4l2_async_subdev { | 38 | struct v4l2_async_subdev { |
39 | enum v4l2_async_bus_type bus_type; | 39 | enum v4l2_async_match_type match_type; |
40 | union { | 40 | union { |
41 | struct { | 41 | struct { |
42 | const char *name; | 42 | const char *name; |
43 | } platform; | 43 | } device_name; |
44 | struct { | 44 | struct { |
45 | int adapter_id; | 45 | int adapter_id; |
46 | unsigned short address; | 46 | unsigned short address; |