Commit ef9435a5 authored by Luca Ceresoli's avatar Luca Ceresoli Committed by Hans Verkuil

staging: media: tegra-video: add a per-soc enable/disable op

The Tegra20 VI needs an additional operation to enable the VI, add an
operation for that.
Signed-off-by: default avatarLuca Ceresoli <luca.ceresoli@bootlin.com>
Reviewed-by: default avatarDmitry Osipenko <digetx@gmail.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent 3bc46d75
...@@ -1952,6 +1952,9 @@ static int tegra_vi_probe(struct platform_device *pdev) ...@@ -1952,6 +1952,9 @@ static int tegra_vi_probe(struct platform_device *pdev)
vi->client.ops = &vi_client_ops; vi->client.ops = &vi_client_ops;
vi->client.dev = &pdev->dev; vi->client.dev = &pdev->dev;
if (vi->ops->vi_enable)
vi->ops->vi_enable(vi, true);
ret = host1x_client_register(&vi->client); ret = host1x_client_register(&vi->client);
if (ret < 0) { if (ret < 0) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
...@@ -1962,6 +1965,8 @@ static int tegra_vi_probe(struct platform_device *pdev) ...@@ -1962,6 +1965,8 @@ static int tegra_vi_probe(struct platform_device *pdev)
return 0; return 0;
rpm_disable: rpm_disable:
if (vi->ops->vi_enable)
vi->ops->vi_enable(vi, false);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
return ret; return ret;
} }
...@@ -1972,6 +1977,8 @@ static int tegra_vi_remove(struct platform_device *pdev) ...@@ -1972,6 +1977,8 @@ static int tegra_vi_remove(struct platform_device *pdev)
host1x_client_unregister(&vi->client); host1x_client_unregister(&vi->client);
if (vi->ops->vi_enable)
vi->ops->vi_enable(vi, false);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
return 0; return 0;
......
...@@ -37,8 +37,11 @@ enum tegra_vi_pg_mode { ...@@ -37,8 +37,11 @@ enum tegra_vi_pg_mode {
TEGRA_VI_PG_PATCH, TEGRA_VI_PG_PATCH,
}; };
struct tegra_vi;
/** /**
* struct tegra_vi_ops - Tegra VI operations * struct tegra_vi_ops - Tegra VI operations
* @vi_enable: soc-specific operations needed to enable/disable the VI peripheral
* @vi_fmt_align: modify `pix` to fit the hardware alignment * @vi_fmt_align: modify `pix` to fit the hardware alignment
* requirements and fill image geometry * requirements and fill image geometry
* @vi_start_streaming: starts media pipeline, subdevice streaming, sets up * @vi_start_streaming: starts media pipeline, subdevice streaming, sets up
...@@ -48,6 +51,7 @@ enum tegra_vi_pg_mode { ...@@ -48,6 +51,7 @@ enum tegra_vi_pg_mode {
* back any queued buffers. * back any queued buffers.
*/ */
struct tegra_vi_ops { struct tegra_vi_ops {
int (*vi_enable)(struct tegra_vi *vi, bool on);
void (*vi_fmt_align)(struct v4l2_pix_format *pix, unsigned int bpp); void (*vi_fmt_align)(struct v4l2_pix_format *pix, unsigned int bpp);
int (*vi_start_streaming)(struct vb2_queue *vq, u32 count); int (*vi_start_streaming)(struct vb2_queue *vq, u32 count);
void (*vi_stop_streaming)(struct vb2_queue *vq); void (*vi_stop_streaming)(struct vb2_queue *vq);
......
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