Commit 2f0a5c65 authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab

media: tvp5150: issue source change events

Issue a V4L2_EVENT_SOURCE_CHANGE notification when the TVP5150 locks
onto a signal and when it loses the lock.
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
[m.felsch@pengutronix.de: partly mainline part port]
Signed-off-by: default avatarMarco Felsch <m.felsch@pengutronix.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 62a764e1
...@@ -801,6 +801,11 @@ static v4l2_std_id tvp5150_read_std(struct v4l2_subdev *sd) ...@@ -801,6 +801,11 @@ static v4l2_std_id tvp5150_read_std(struct v4l2_subdev *sd)
} }
} }
static const struct v4l2_event tvp5150_ev_fmt = {
.type = V4L2_EVENT_SOURCE_CHANGE,
.u.src_change.changes = V4L2_EVENT_SRC_CH_RESOLUTION,
};
static irqreturn_t tvp5150_isr(int irq, void *dev_id) static irqreturn_t tvp5150_isr(int irq, void *dev_id)
{ {
struct tvp5150 *decoder = dev_id; struct tvp5150 *decoder = dev_id;
...@@ -816,6 +821,7 @@ static irqreturn_t tvp5150_isr(int irq, void *dev_id) ...@@ -816,6 +821,7 @@ static irqreturn_t tvp5150_isr(int irq, void *dev_id)
if (status & TVP5150_INT_A_LOCK) { if (status & TVP5150_INT_A_LOCK) {
decoder->lock = !!(status & TVP5150_INT_A_LOCK_STATUS); decoder->lock = !!(status & TVP5150_INT_A_LOCK_STATUS);
v4l2_subdev_notify_event(&decoder->sd, &tvp5150_ev_fmt);
regmap_update_bits(map, TVP5150_MISC_CTL, mask, regmap_update_bits(map, TVP5150_MISC_CTL, mask,
decoder->lock ? decoder->oe : 0); decoder->lock ? decoder->oe : 0);
} }
...@@ -1183,6 +1189,7 @@ static int tvp5150_s_stream(struct v4l2_subdev *sd, int enable) ...@@ -1183,6 +1189,7 @@ static int tvp5150_s_stream(struct v4l2_subdev *sd, int enable)
/* Enable outputs if decoder is locked */ /* Enable outputs if decoder is locked */
val = decoder->lock ? decoder->oe : 0; val = decoder->lock ? decoder->oe : 0;
int_val = TVP5150_INT_A_LOCK; int_val = TVP5150_INT_A_LOCK;
v4l2_subdev_notify_event(&decoder->sd, &tvp5150_ev_fmt);
} }
regmap_update_bits(decoder->regmap, TVP5150_MISC_CTL, mask, val); regmap_update_bits(decoder->regmap, TVP5150_MISC_CTL, mask, val);
...@@ -1399,7 +1406,6 @@ static const struct v4l2_subdev_internal_ops tvp5150_internal_ops = { ...@@ -1399,7 +1406,6 @@ static const struct v4l2_subdev_internal_ops tvp5150_internal_ops = {
.registered = tvp5150_registered, .registered = tvp5150_registered,
}; };
/**************************************************************************** /****************************************************************************
I2C Client & Driver I2C Client & Driver
****************************************************************************/ ****************************************************************************/
......
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