aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/s5p-tv
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-13 15:09:57 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-13 15:09:57 -0400
commit858655116bfc722837e3aec0909b8e9d08f96996 (patch)
treeef9171d51ffcd01e40d1131d62be32e5a7d371dc /drivers/media/platform/s5p-tv
parent239dab4636f7f5f971ac39b5ca84254cff112cac (diff)
parent1b2c14b44adcb7836528640bfdc40bf7499d987d (diff)
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media updates from Mauro Carvalho Chehab: "This series contain: - new i2c video drivers: ml86v7667 (video decoder), ths8200 (video encoder) - a new video driver for EasyCap cards based on Fushicai USBTV007 - Improved support for OF and embedded systems, with V4L2 async initialization and a better support for clocks - API cleanups on the ioctls used by the v4l2 debug tool - Lots of cleanups - As usual, several driver improvements and new cards additions - Revert two changesets that change the minimal symbol rate for stv0399, as request by Manu - Update MAINTAINERS and other files to point to my new e-mail" * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (378 commits) MAINTAINERS & ABI: Update to point to my new email [media] stb0899: restore minimal rate to 5Mbauds [media] exynos4-is: Correct colorspace handling at FIMC-LITE [media] exynos4-is: Set valid initial format on FIMC.n subdevs [media] exynos4-is: Set valid initial format on FIMC-IS-ISP subdev pads [media] exynos4-is: Fix format propagation on FIMC-IS-ISP subdev [media] exynos4-is: Set valid initial format at FIMC-LITE [media] exynos4-is: Fix format propagation on FIMC-LITE.n subdevs [media] MAINTAINERS: Update S5P/Exynos FIMC driver entry [media] Documentation: Update driver's directory in video4linux/fimc.txt [media] exynos4-is: Change fimc-is firmware file names [media] exynos4-is: Add support for Exynos5250 MIPI-CSIS [media] exynos4-is: Add Exynos5250 SoC support to fimc-lite driver [media] exynos4-is: Drop drvdata handling in fimc-lite for non-dt platforms [media] media: i2c: tvp514x: remove manual setting of subdev name [media] media: i2c: tvp7002: remove manual setting of subdev name [media] mem2mem: set missing v4l2_dev pointer [media] wl128x: add missing struct v4l2_device [media] tvp514x: Fix init seqeunce [media] saa7134: Fix sparse warnings by adding __user annotation ...
Diffstat (limited to 'drivers/media/platform/s5p-tv')
-rw-r--r--drivers/media/platform/s5p-tv/hdmi_drv.c39
-rw-r--r--drivers/media/platform/s5p-tv/mixer_drv.c22
-rw-r--r--drivers/media/platform/s5p-tv/mixer_video.c3
-rw-r--r--drivers/media/platform/s5p-tv/sdo_drv.c22
-rw-r--r--drivers/media/platform/s5p-tv/sii9234_drv.c4
5 files changed, 70 insertions, 20 deletions
diff --git a/drivers/media/platform/s5p-tv/hdmi_drv.c b/drivers/media/platform/s5p-tv/hdmi_drv.c
index 4e86626dad4b..1b34c3629858 100644
--- a/drivers/media/platform/s5p-tv/hdmi_drv.c
+++ b/drivers/media/platform/s5p-tv/hdmi_drv.c
@@ -576,16 +576,22 @@ static int hdmi_s_stream(struct v4l2_subdev *sd, int enable)
576 return hdmi_streamoff(hdev); 576 return hdmi_streamoff(hdev);
577} 577}
578 578
579static void hdmi_resource_poweron(struct hdmi_resources *res) 579static int hdmi_resource_poweron(struct hdmi_resources *res)
580{ 580{
581 int ret;
582
581 /* turn HDMI power on */ 583 /* turn HDMI power on */
582 regulator_bulk_enable(res->regul_count, res->regul_bulk); 584 ret = regulator_bulk_enable(res->regul_count, res->regul_bulk);
585 if (ret < 0)
586 return ret;
583 /* power-on hdmi physical interface */ 587 /* power-on hdmi physical interface */
584 clk_enable(res->hdmiphy); 588 clk_enable(res->hdmiphy);
585 /* use VPP as parent clock; HDMIPHY is not working yet */ 589 /* use VPP as parent clock; HDMIPHY is not working yet */
586 clk_set_parent(res->sclk_hdmi, res->sclk_pixel); 590 clk_set_parent(res->sclk_hdmi, res->sclk_pixel);
587 /* turn clocks on */ 591 /* turn clocks on */
588 clk_enable(res->sclk_hdmi); 592 clk_enable(res->sclk_hdmi);
593
594 return 0;
589} 595}
590 596
591static void hdmi_resource_poweroff(struct hdmi_resources *res) 597static void hdmi_resource_poweroff(struct hdmi_resources *res)
@@ -728,11 +734,13 @@ static int hdmi_runtime_resume(struct device *dev)
728{ 734{
729 struct v4l2_subdev *sd = dev_get_drvdata(dev); 735 struct v4l2_subdev *sd = dev_get_drvdata(dev);
730 struct hdmi_device *hdev = sd_to_hdmi_dev(sd); 736 struct hdmi_device *hdev = sd_to_hdmi_dev(sd);
731 int ret = 0; 737 int ret;
732 738
733 dev_dbg(dev, "%s\n", __func__); 739 dev_dbg(dev, "%s\n", __func__);
734 740
735 hdmi_resource_poweron(&hdev->res); 741 ret = hdmi_resource_poweron(&hdev->res);
742 if (ret < 0)
743 return ret;
736 744
737 /* starting MHL */ 745 /* starting MHL */
738 ret = v4l2_subdev_call(hdev->mhl_sd, core, s_power, 1); 746 ret = v4l2_subdev_call(hdev->mhl_sd, core, s_power, 1);
@@ -755,6 +763,15 @@ static const struct dev_pm_ops hdmi_pm_ops = {
755 .runtime_resume = hdmi_runtime_resume, 763 .runtime_resume = hdmi_runtime_resume,
756}; 764};
757 765
766static void hdmi_resource_clear_clocks(struct hdmi_resources *res)
767{
768 res->hdmi = ERR_PTR(-EINVAL);
769 res->sclk_hdmi = ERR_PTR(-EINVAL);
770 res->sclk_pixel = ERR_PTR(-EINVAL);
771 res->sclk_hdmiphy = ERR_PTR(-EINVAL);
772 res->hdmiphy = ERR_PTR(-EINVAL);
773}
774
758static void hdmi_resources_cleanup(struct hdmi_device *hdev) 775static void hdmi_resources_cleanup(struct hdmi_device *hdev)
759{ 776{
760 struct hdmi_resources *res = &hdev->res; 777 struct hdmi_resources *res = &hdev->res;
@@ -765,17 +782,18 @@ static void hdmi_resources_cleanup(struct hdmi_device *hdev)
765 regulator_bulk_free(res->regul_count, res->regul_bulk); 782 regulator_bulk_free(res->regul_count, res->regul_bulk);
766 /* kfree is NULL-safe */ 783 /* kfree is NULL-safe */
767 kfree(res->regul_bulk); 784 kfree(res->regul_bulk);
768 if (!IS_ERR_OR_NULL(res->hdmiphy)) 785 if (!IS_ERR(res->hdmiphy))
769 clk_put(res->hdmiphy); 786 clk_put(res->hdmiphy);
770 if (!IS_ERR_OR_NULL(res->sclk_hdmiphy)) 787 if (!IS_ERR(res->sclk_hdmiphy))
771 clk_put(res->sclk_hdmiphy); 788 clk_put(res->sclk_hdmiphy);
772 if (!IS_ERR_OR_NULL(res->sclk_pixel)) 789 if (!IS_ERR(res->sclk_pixel))
773 clk_put(res->sclk_pixel); 790 clk_put(res->sclk_pixel);
774 if (!IS_ERR_OR_NULL(res->sclk_hdmi)) 791 if (!IS_ERR(res->sclk_hdmi))
775 clk_put(res->sclk_hdmi); 792 clk_put(res->sclk_hdmi);
776 if (!IS_ERR_OR_NULL(res->hdmi)) 793 if (!IS_ERR(res->hdmi))
777 clk_put(res->hdmi); 794 clk_put(res->hdmi);
778 memset(res, 0, sizeof(*res)); 795 memset(res, 0, sizeof(*res));
796 hdmi_resource_clear_clocks(res);
779} 797}
780 798
781static int hdmi_resources_init(struct hdmi_device *hdev) 799static int hdmi_resources_init(struct hdmi_device *hdev)
@@ -793,8 +811,9 @@ static int hdmi_resources_init(struct hdmi_device *hdev)
793 dev_dbg(dev, "HDMI resource init\n"); 811 dev_dbg(dev, "HDMI resource init\n");
794 812
795 memset(res, 0, sizeof(*res)); 813 memset(res, 0, sizeof(*res));
796 /* get clocks, power */ 814 hdmi_resource_clear_clocks(res);
797 815
816 /* get clocks, power */
798 res->hdmi = clk_get(dev, "hdmi"); 817 res->hdmi = clk_get(dev, "hdmi");
799 if (IS_ERR(res->hdmi)) { 818 if (IS_ERR(res->hdmi)) {
800 dev_err(dev, "failed to get clock 'hdmi'\n"); 819 dev_err(dev, "failed to get clock 'hdmi'\n");
diff --git a/drivers/media/platform/s5p-tv/mixer_drv.c b/drivers/media/platform/s5p-tv/mixer_drv.c
index 5733033a6ead..51805a5e2beb 100644
--- a/drivers/media/platform/s5p-tv/mixer_drv.c
+++ b/drivers/media/platform/s5p-tv/mixer_drv.c
@@ -211,6 +211,15 @@ fail:
211 return ret; 211 return ret;
212} 212}
213 213
214static void mxr_resource_clear_clocks(struct mxr_resources *res)
215{
216 res->mixer = ERR_PTR(-EINVAL);
217 res->vp = ERR_PTR(-EINVAL);
218 res->sclk_mixer = ERR_PTR(-EINVAL);
219 res->sclk_hdmi = ERR_PTR(-EINVAL);
220 res->sclk_dac = ERR_PTR(-EINVAL);
221}
222
214static void mxr_release_plat_resources(struct mxr_device *mdev) 223static void mxr_release_plat_resources(struct mxr_device *mdev)
215{ 224{
216 free_irq(mdev->res.irq, mdev); 225 free_irq(mdev->res.irq, mdev);
@@ -222,15 +231,15 @@ static void mxr_release_clocks(struct mxr_device *mdev)
222{ 231{
223 struct mxr_resources *res = &mdev->res; 232 struct mxr_resources *res = &mdev->res;
224 233
225 if (!IS_ERR_OR_NULL(res->sclk_dac)) 234 if (!IS_ERR(res->sclk_dac))
226 clk_put(res->sclk_dac); 235 clk_put(res->sclk_dac);
227 if (!IS_ERR_OR_NULL(res->sclk_hdmi)) 236 if (!IS_ERR(res->sclk_hdmi))
228 clk_put(res->sclk_hdmi); 237 clk_put(res->sclk_hdmi);
229 if (!IS_ERR_OR_NULL(res->sclk_mixer)) 238 if (!IS_ERR(res->sclk_mixer))
230 clk_put(res->sclk_mixer); 239 clk_put(res->sclk_mixer);
231 if (!IS_ERR_OR_NULL(res->vp)) 240 if (!IS_ERR(res->vp))
232 clk_put(res->vp); 241 clk_put(res->vp);
233 if (!IS_ERR_OR_NULL(res->mixer)) 242 if (!IS_ERR(res->mixer))
234 clk_put(res->mixer); 243 clk_put(res->mixer);
235} 244}
236 245
@@ -239,6 +248,8 @@ static int mxr_acquire_clocks(struct mxr_device *mdev)
239 struct mxr_resources *res = &mdev->res; 248 struct mxr_resources *res = &mdev->res;
240 struct device *dev = mdev->dev; 249 struct device *dev = mdev->dev;
241 250
251 mxr_resource_clear_clocks(res);
252
242 res->mixer = clk_get(dev, "mixer"); 253 res->mixer = clk_get(dev, "mixer");
243 if (IS_ERR(res->mixer)) { 254 if (IS_ERR(res->mixer)) {
244 mxr_err(mdev, "failed to get clock 'mixer'\n"); 255 mxr_err(mdev, "failed to get clock 'mixer'\n");
@@ -299,6 +310,7 @@ static void mxr_release_resources(struct mxr_device *mdev)
299 mxr_release_clocks(mdev); 310 mxr_release_clocks(mdev);
300 mxr_release_plat_resources(mdev); 311 mxr_release_plat_resources(mdev);
301 memset(&mdev->res, 0, sizeof(mdev->res)); 312 memset(&mdev->res, 0, sizeof(mdev->res));
313 mxr_resource_clear_clocks(&mdev->res);
302} 314}
303 315
304static void mxr_release_layers(struct mxr_device *mdev) 316static void mxr_release_layers(struct mxr_device *mdev)
diff --git a/drivers/media/platform/s5p-tv/mixer_video.c b/drivers/media/platform/s5p-tv/mixer_video.c
index ef0efdf422fe..641b1f071e06 100644
--- a/drivers/media/platform/s5p-tv/mixer_video.c
+++ b/drivers/media/platform/s5p-tv/mixer_video.c
@@ -81,8 +81,9 @@ int mxr_acquire_video(struct mxr_device *mdev,
81 } 81 }
82 82
83 mdev->alloc_ctx = vb2_dma_contig_init_ctx(mdev->dev); 83 mdev->alloc_ctx = vb2_dma_contig_init_ctx(mdev->dev);
84 if (IS_ERR_OR_NULL(mdev->alloc_ctx)) { 84 if (IS_ERR(mdev->alloc_ctx)) {
85 mxr_err(mdev, "could not acquire vb2 allocator\n"); 85 mxr_err(mdev, "could not acquire vb2 allocator\n");
86 ret = PTR_ERR(mdev->alloc_ctx);
86 goto fail_v4l2_dev; 87 goto fail_v4l2_dev;
87 } 88 }
88 89
diff --git a/drivers/media/platform/s5p-tv/sdo_drv.c b/drivers/media/platform/s5p-tv/sdo_drv.c
index ab6f9ef89423..0afa90f0f6ab 100644
--- a/drivers/media/platform/s5p-tv/sdo_drv.c
+++ b/drivers/media/platform/s5p-tv/sdo_drv.c
@@ -262,11 +262,21 @@ static int sdo_runtime_resume(struct device *dev)
262{ 262{
263 struct v4l2_subdev *sd = dev_get_drvdata(dev); 263 struct v4l2_subdev *sd = dev_get_drvdata(dev);
264 struct sdo_device *sdev = sd_to_sdev(sd); 264 struct sdo_device *sdev = sd_to_sdev(sd);
265 int ret;
265 266
266 dev_info(dev, "resume\n"); 267 dev_info(dev, "resume\n");
267 clk_enable(sdev->sclk_dac); 268
268 regulator_enable(sdev->vdac); 269 ret = clk_enable(sdev->sclk_dac);
269 regulator_enable(sdev->vdet); 270 if (ret < 0)
271 return ret;
272
273 ret = regulator_enable(sdev->vdac);
274 if (ret < 0)
275 goto dac_clk_dis;
276
277 ret = regulator_enable(sdev->vdet);
278 if (ret < 0)
279 goto vdac_r_dis;
270 280
271 /* software reset */ 281 /* software reset */
272 sdo_write_mask(sdev, SDO_CLKCON, ~0, SDO_TVOUT_SW_RESET); 282 sdo_write_mask(sdev, SDO_CLKCON, ~0, SDO_TVOUT_SW_RESET);
@@ -285,6 +295,12 @@ static int sdo_runtime_resume(struct device *dev)
285 SDO_COMPENSATION_CVBS_COMP_OFF); 295 SDO_COMPENSATION_CVBS_COMP_OFF);
286 sdo_reg_debug(sdev); 296 sdo_reg_debug(sdev);
287 return 0; 297 return 0;
298
299vdac_r_dis:
300 regulator_disable(sdev->vdac);
301dac_clk_dis:
302 clk_disable(sdev->sclk_dac);
303 return ret;
288} 304}
289 305
290static const struct dev_pm_ops sdo_pm_ops = { 306static const struct dev_pm_ops sdo_pm_ops = {
diff --git a/drivers/media/platform/s5p-tv/sii9234_drv.c b/drivers/media/platform/s5p-tv/sii9234_drv.c
index 39b77d24b9c2..3dd762e5b67e 100644
--- a/drivers/media/platform/s5p-tv/sii9234_drv.c
+++ b/drivers/media/platform/s5p-tv/sii9234_drv.c
@@ -249,7 +249,9 @@ static int sii9234_runtime_resume(struct device *dev)
249 int ret; 249 int ret;
250 250
251 dev_info(dev, "resume start\n"); 251 dev_info(dev, "resume start\n");
252 regulator_enable(ctx->power); 252 ret = regulator_enable(ctx->power);
253 if (ret < 0)
254 return ret;
253 255
254 ret = sii9234_reset(ctx); 256 ret = sii9234_reset(ctx);
255 if (ret) 257 if (ret)