Commit d24c029e authored by Jacopo Mondi's avatar Jacopo Mondi Committed by Mauro Carvalho Chehab

media: rcar-vin: Rename 'digital' to 'parallel'

As the term 'digital' is used all over the rcar-vin code in place of
'parallel', rename all the occurrencies.
Signed-off-by: default avatarJacopo Mondi <jacopo+renesas@jmondi.org>
Acked-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent e35f7021
...@@ -376,12 +376,12 @@ static int rvin_find_pad(struct v4l2_subdev *sd, int direction) ...@@ -376,12 +376,12 @@ static int rvin_find_pad(struct v4l2_subdev *sd, int direction)
} }
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
* Digital async notifier * Parallel async notifier
*/ */
/* The vin lock should be held when calling the subdevice attach and detach */ /* The vin lock should be held when calling the subdevice attach and detach */
static int rvin_digital_subdevice_attach(struct rvin_dev *vin, static int rvin_parallel_subdevice_attach(struct rvin_dev *vin,
struct v4l2_subdev *subdev) struct v4l2_subdev *subdev)
{ {
struct v4l2_subdev_mbus_code_enum code = { struct v4l2_subdev_mbus_code_enum code = {
.which = V4L2_SUBDEV_FORMAT_ACTIVE, .which = V4L2_SUBDEV_FORMAT_ACTIVE,
...@@ -392,15 +392,15 @@ static int rvin_digital_subdevice_attach(struct rvin_dev *vin, ...@@ -392,15 +392,15 @@ static int rvin_digital_subdevice_attach(struct rvin_dev *vin,
ret = rvin_find_pad(subdev, MEDIA_PAD_FL_SOURCE); ret = rvin_find_pad(subdev, MEDIA_PAD_FL_SOURCE);
if (ret < 0) if (ret < 0)
return ret; return ret;
vin->digital->source_pad = ret; vin->parallel->source_pad = ret;
ret = rvin_find_pad(subdev, MEDIA_PAD_FL_SINK); ret = rvin_find_pad(subdev, MEDIA_PAD_FL_SINK);
vin->digital->sink_pad = ret < 0 ? 0 : ret; vin->parallel->sink_pad = ret < 0 ? 0 : ret;
/* Find compatible subdevices mbus format */ /* Find compatible subdevices mbus format */
vin->mbus_code = 0; vin->mbus_code = 0;
code.index = 0; code.index = 0;
code.pad = vin->digital->source_pad; code.pad = vin->parallel->source_pad;
while (!vin->mbus_code && while (!vin->mbus_code &&
!v4l2_subdev_call(subdev, pad, enum_mbus_code, NULL, &code)) { !v4l2_subdev_call(subdev, pad, enum_mbus_code, NULL, &code)) {
code.index++; code.index++;
...@@ -450,21 +450,21 @@ static int rvin_digital_subdevice_attach(struct rvin_dev *vin, ...@@ -450,21 +450,21 @@ static int rvin_digital_subdevice_attach(struct rvin_dev *vin,
vin->vdev.ctrl_handler = &vin->ctrl_handler; vin->vdev.ctrl_handler = &vin->ctrl_handler;
vin->digital->subdev = subdev; vin->parallel->subdev = subdev;
return 0; return 0;
} }
static void rvin_digital_subdevice_detach(struct rvin_dev *vin) static void rvin_parallel_subdevice_detach(struct rvin_dev *vin)
{ {
rvin_v4l2_unregister(vin); rvin_v4l2_unregister(vin);
v4l2_ctrl_handler_free(&vin->ctrl_handler); v4l2_ctrl_handler_free(&vin->ctrl_handler);
vin->vdev.ctrl_handler = NULL; vin->vdev.ctrl_handler = NULL;
vin->digital->subdev = NULL; vin->parallel->subdev = NULL;
} }
static int rvin_digital_notify_complete(struct v4l2_async_notifier *notifier) static int rvin_parallel_notify_complete(struct v4l2_async_notifier *notifier)
{ {
struct rvin_dev *vin = notifier_to_vin(notifier); struct rvin_dev *vin = notifier_to_vin(notifier);
int ret; int ret;
...@@ -478,28 +478,28 @@ static int rvin_digital_notify_complete(struct v4l2_async_notifier *notifier) ...@@ -478,28 +478,28 @@ static int rvin_digital_notify_complete(struct v4l2_async_notifier *notifier)
return rvin_v4l2_register(vin); return rvin_v4l2_register(vin);
} }
static void rvin_digital_notify_unbind(struct v4l2_async_notifier *notifier, static void rvin_parallel_notify_unbind(struct v4l2_async_notifier *notifier,
struct v4l2_subdev *subdev, struct v4l2_subdev *subdev,
struct v4l2_async_subdev *asd) struct v4l2_async_subdev *asd)
{ {
struct rvin_dev *vin = notifier_to_vin(notifier); struct rvin_dev *vin = notifier_to_vin(notifier);
vin_dbg(vin, "unbind digital subdev %s\n", subdev->name); vin_dbg(vin, "unbind parallel subdev %s\n", subdev->name);
mutex_lock(&vin->lock); mutex_lock(&vin->lock);
rvin_digital_subdevice_detach(vin); rvin_parallel_subdevice_detach(vin);
mutex_unlock(&vin->lock); mutex_unlock(&vin->lock);
} }
static int rvin_digital_notify_bound(struct v4l2_async_notifier *notifier, static int rvin_parallel_notify_bound(struct v4l2_async_notifier *notifier,
struct v4l2_subdev *subdev, struct v4l2_subdev *subdev,
struct v4l2_async_subdev *asd) struct v4l2_async_subdev *asd)
{ {
struct rvin_dev *vin = notifier_to_vin(notifier); struct rvin_dev *vin = notifier_to_vin(notifier);
int ret; int ret;
mutex_lock(&vin->lock); mutex_lock(&vin->lock);
ret = rvin_digital_subdevice_attach(vin, subdev); ret = rvin_parallel_subdevice_attach(vin, subdev);
mutex_unlock(&vin->lock); mutex_unlock(&vin->lock);
if (ret) if (ret)
return ret; return ret;
...@@ -507,21 +507,21 @@ static int rvin_digital_notify_bound(struct v4l2_async_notifier *notifier, ...@@ -507,21 +507,21 @@ static int rvin_digital_notify_bound(struct v4l2_async_notifier *notifier,
v4l2_set_subdev_hostdata(subdev, vin); v4l2_set_subdev_hostdata(subdev, vin);
vin_dbg(vin, "bound subdev %s source pad: %u sink pad: %u\n", vin_dbg(vin, "bound subdev %s source pad: %u sink pad: %u\n",
subdev->name, vin->digital->source_pad, subdev->name, vin->parallel->source_pad,
vin->digital->sink_pad); vin->parallel->sink_pad);
return 0; return 0;
} }
static const struct v4l2_async_notifier_operations rvin_digital_notify_ops = { static const struct v4l2_async_notifier_operations rvin_parallel_notify_ops = {
.bound = rvin_digital_notify_bound, .bound = rvin_parallel_notify_bound,
.unbind = rvin_digital_notify_unbind, .unbind = rvin_parallel_notify_unbind,
.complete = rvin_digital_notify_complete, .complete = rvin_parallel_notify_complete,
}; };
static int rvin_digital_parse_v4l2(struct device *dev, static int rvin_parallel_parse_v4l2(struct device *dev,
struct v4l2_fwnode_endpoint *vep, struct v4l2_fwnode_endpoint *vep,
struct v4l2_async_subdev *asd) struct v4l2_async_subdev *asd)
{ {
struct rvin_dev *vin = dev_get_drvdata(dev); struct rvin_dev *vin = dev_get_drvdata(dev);
struct rvin_graph_entity *rvge = struct rvin_graph_entity *rvge =
...@@ -546,28 +546,28 @@ static int rvin_digital_parse_v4l2(struct device *dev, ...@@ -546,28 +546,28 @@ static int rvin_digital_parse_v4l2(struct device *dev,
return -EINVAL; return -EINVAL;
} }
vin->digital = rvge; vin->parallel = rvge;
return 0; return 0;
} }
static int rvin_digital_graph_init(struct rvin_dev *vin) static int rvin_parallel_graph_init(struct rvin_dev *vin)
{ {
int ret; int ret;
ret = v4l2_async_notifier_parse_fwnode_endpoints( ret = v4l2_async_notifier_parse_fwnode_endpoints(
vin->dev, &vin->notifier, vin->dev, &vin->notifier,
sizeof(struct rvin_graph_entity), rvin_digital_parse_v4l2); sizeof(struct rvin_graph_entity), rvin_parallel_parse_v4l2);
if (ret) if (ret)
return ret; return ret;
if (!vin->digital) if (!vin->parallel)
return -ENODEV; return -ENODEV;
vin_dbg(vin, "Found digital subdevice %pOF\n", vin_dbg(vin, "Found parallel subdevice %pOF\n",
to_of_node(vin->digital->asd.match.fwnode)); to_of_node(vin->parallel->asd.match.fwnode));
vin->notifier.ops = &rvin_digital_notify_ops; vin->notifier.ops = &rvin_parallel_notify_ops;
ret = v4l2_async_notifier_register(&vin->v4l2_dev, &vin->notifier); ret = v4l2_async_notifier_register(&vin->v4l2_dev, &vin->notifier);
if (ret < 0) { if (ret < 0) {
vin_err(vin, "Notifier registration failed\n"); vin_err(vin, "Notifier registration failed\n");
...@@ -1136,7 +1136,7 @@ static int rcar_vin_probe(struct platform_device *pdev) ...@@ -1136,7 +1136,7 @@ static int rcar_vin_probe(struct platform_device *pdev)
if (vin->info->use_mc) if (vin->info->use_mc)
ret = rvin_mc_init(vin); ret = rvin_mc_init(vin);
else else
ret = rvin_digital_graph_init(vin); ret = rvin_parallel_graph_init(vin);
if (ret < 0) if (ret < 0)
goto error; goto error;
......
...@@ -733,7 +733,7 @@ static int rvin_setup(struct rvin_dev *vin) ...@@ -733,7 +733,7 @@ static int rvin_setup(struct rvin_dev *vin)
vnmc |= VNMC_BPS; vnmc |= VNMC_BPS;
if (vin->info->model == RCAR_GEN3) { if (vin->info->model == RCAR_GEN3) {
/* Select between CSI-2 and Digital input */ /* Select between CSI-2 and parallel input */
if (vin->mbus_cfg.type == V4L2_MBUS_CSI2) if (vin->mbus_cfg.type == V4L2_MBUS_CSI2)
vnmc &= ~VNMC_DPINE; vnmc &= ~VNMC_DPINE;
else else
...@@ -1088,7 +1088,7 @@ static int rvin_set_stream(struct rvin_dev *vin, int on) ...@@ -1088,7 +1088,7 @@ static int rvin_set_stream(struct rvin_dev *vin, int on)
/* No media controller used, simply pass operation to subdevice. */ /* No media controller used, simply pass operation to subdevice. */
if (!vin->info->use_mc) { if (!vin->info->use_mc) {
ret = v4l2_subdev_call(vin->digital->subdev, video, s_stream, ret = v4l2_subdev_call(vin->parallel->subdev, video, s_stream,
on); on);
return ret == -ENOIOCTLCMD ? 0 : ret; return ret == -ENOIOCTLCMD ? 0 : ret;
......
...@@ -144,7 +144,7 @@ static int rvin_reset_format(struct rvin_dev *vin) ...@@ -144,7 +144,7 @@ static int rvin_reset_format(struct rvin_dev *vin)
{ {
struct v4l2_subdev_format fmt = { struct v4l2_subdev_format fmt = {
.which = V4L2_SUBDEV_FORMAT_ACTIVE, .which = V4L2_SUBDEV_FORMAT_ACTIVE,
.pad = vin->digital->source_pad, .pad = vin->parallel->source_pad,
}; };
int ret; int ret;
...@@ -175,7 +175,7 @@ static int rvin_try_format(struct rvin_dev *vin, u32 which, ...@@ -175,7 +175,7 @@ static int rvin_try_format(struct rvin_dev *vin, u32 which,
struct v4l2_subdev_pad_config *pad_cfg; struct v4l2_subdev_pad_config *pad_cfg;
struct v4l2_subdev_format format = { struct v4l2_subdev_format format = {
.which = which, .which = which,
.pad = vin->digital->source_pad, .pad = vin->parallel->source_pad,
}; };
enum v4l2_field field; enum v4l2_field field;
u32 width, height; u32 width, height;
...@@ -517,7 +517,7 @@ static int rvin_enum_dv_timings(struct file *file, void *priv_fh, ...@@ -517,7 +517,7 @@ static int rvin_enum_dv_timings(struct file *file, void *priv_fh,
if (timings->pad) if (timings->pad)
return -EINVAL; return -EINVAL;
timings->pad = vin->digital->sink_pad; timings->pad = vin->parallel->sink_pad;
ret = v4l2_subdev_call(sd, pad, enum_dv_timings, timings); ret = v4l2_subdev_call(sd, pad, enum_dv_timings, timings);
...@@ -569,7 +569,7 @@ static int rvin_dv_timings_cap(struct file *file, void *priv_fh, ...@@ -569,7 +569,7 @@ static int rvin_dv_timings_cap(struct file *file, void *priv_fh,
if (cap->pad) if (cap->pad)
return -EINVAL; return -EINVAL;
cap->pad = vin->digital->sink_pad; cap->pad = vin->parallel->sink_pad;
ret = v4l2_subdev_call(sd, pad, dv_timings_cap, cap); ret = v4l2_subdev_call(sd, pad, dv_timings_cap, cap);
...@@ -587,7 +587,7 @@ static int rvin_g_edid(struct file *file, void *fh, struct v4l2_edid *edid) ...@@ -587,7 +587,7 @@ static int rvin_g_edid(struct file *file, void *fh, struct v4l2_edid *edid)
if (edid->pad) if (edid->pad)
return -EINVAL; return -EINVAL;
edid->pad = vin->digital->sink_pad; edid->pad = vin->parallel->sink_pad;
ret = v4l2_subdev_call(sd, pad, get_edid, edid); ret = v4l2_subdev_call(sd, pad, get_edid, edid);
...@@ -605,7 +605,7 @@ static int rvin_s_edid(struct file *file, void *fh, struct v4l2_edid *edid) ...@@ -605,7 +605,7 @@ static int rvin_s_edid(struct file *file, void *fh, struct v4l2_edid *edid)
if (edid->pad) if (edid->pad)
return -EINVAL; return -EINVAL;
edid->pad = vin->digital->sink_pad; edid->pad = vin->parallel->sink_pad;
ret = v4l2_subdev_call(sd, pad, set_edid, edid); ret = v4l2_subdev_call(sd, pad, set_edid, edid);
......
...@@ -148,7 +148,7 @@ struct rvin_info { ...@@ -148,7 +148,7 @@ struct rvin_info {
* @v4l2_dev: V4L2 device * @v4l2_dev: V4L2 device
* @ctrl_handler: V4L2 control handler * @ctrl_handler: V4L2 control handler
* @notifier: V4L2 asynchronous subdevs notifier * @notifier: V4L2 asynchronous subdevs notifier
* @digital: entity in the DT for local digital subdevice * @parallel: entity in the DT for local parallel subdevice
* *
* @group: Gen3 CSI group * @group: Gen3 CSI group
* @id: Gen3 group id for this VIN * @id: Gen3 group id for this VIN
...@@ -184,7 +184,7 @@ struct rvin_dev { ...@@ -184,7 +184,7 @@ struct rvin_dev {
struct v4l2_device v4l2_dev; struct v4l2_device v4l2_dev;
struct v4l2_ctrl_handler ctrl_handler; struct v4l2_ctrl_handler ctrl_handler;
struct v4l2_async_notifier notifier; struct v4l2_async_notifier notifier;
struct rvin_graph_entity *digital; struct rvin_graph_entity *parallel;
struct rvin_group *group; struct rvin_group *group;
unsigned int id; unsigned int id;
...@@ -211,7 +211,7 @@ struct rvin_dev { ...@@ -211,7 +211,7 @@ struct rvin_dev {
v4l2_std_id std; v4l2_std_id std;
}; };
#define vin_to_source(vin) ((vin)->digital->subdev) #define vin_to_source(vin) ((vin)->parallel->subdev)
/* Debug */ /* Debug */
#define vin_dbg(d, fmt, arg...) dev_dbg(d->dev, fmt, ##arg) #define vin_dbg(d, fmt, arg...) dev_dbg(d->dev, fmt, ##arg)
......
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