]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
media: platform: Aspeed: Remove use of reset line
authorEddie James <eajames@linux.ibm.com>
Wed, 24 Apr 2019 15:16:57 +0000 (11:16 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 30 Apr 2019 17:49:44 +0000 (13:49 -0400)
The reset line is toggled by enabling the clocks, so it's not necessary
to manually toggle the reset as well.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/aspeed-video.c

index 692e08ef38c0e6598261c9975f7536ca013b7cba..55c55a68b016d79aeab43fc08033df04884fd5df 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/of_irq.h>
 #include <linux/of_reserved_mem.h>
 #include <linux/platform_device.h>
-#include <linux/reset.h>
 #include <linux/sched.h>
 #include <linux/spinlock.h>
 #include <linux/string.h>
@@ -208,7 +207,6 @@ struct aspeed_video {
        void __iomem *base;
        struct clk *eclk;
        struct clk *vclk;
-       struct reset_control *rst;
 
        struct device *dev;
        struct v4l2_ctrl_handler ctrl_handler;
@@ -483,19 +481,10 @@ static void aspeed_video_enable_mode_detect(struct aspeed_video *video)
        aspeed_video_update(video, VE_SEQ_CTRL, 0, VE_SEQ_CTRL_TRIG_MODE_DET);
 }
 
-static void aspeed_video_reset(struct aspeed_video *video)
-{
-       /* Reset the engine */
-       reset_control_assert(video->rst);
-
-       /* Don't usleep here; function may be called in interrupt context */
-       udelay(100);
-       reset_control_deassert(video->rst);
-}
-
 static void aspeed_video_off(struct aspeed_video *video)
 {
-       aspeed_video_reset(video);
+       /* Disable interrupts */
+       aspeed_video_write(video, VE_INTERRUPT_CTRL, 0);
 
        /* Turn off the relevant clocks */
        clk_disable_unprepare(video->vclk);
@@ -507,8 +496,6 @@ static void aspeed_video_on(struct aspeed_video *video)
        /* Turn on the relevant clocks */
        clk_prepare_enable(video->eclk);
        clk_prepare_enable(video->vclk);
-
-       aspeed_video_reset(video);
 }
 
 static void aspeed_video_bufs_done(struct aspeed_video *video,
@@ -1464,7 +1451,9 @@ static void aspeed_video_stop_streaming(struct vb2_queue *q)
                 * Need to force stop any DMA and try and get HW into a good
                 * state for future calls to start streaming again.
                 */
-               aspeed_video_reset(video);
+               aspeed_video_off(video);
+               aspeed_video_on(video);
+
                aspeed_video_init_regs(video);
 
                aspeed_video_get_resolution(video);
@@ -1619,12 +1608,6 @@ static int aspeed_video_init(struct aspeed_video *video)
                return PTR_ERR(video->vclk);
        }
 
-       video->rst = devm_reset_control_get_exclusive(dev, NULL);
-       if (IS_ERR(video->rst)) {
-               dev_err(dev, "Unable to get VE reset\n");
-               return PTR_ERR(video->rst);
-       }
-
        rc = of_reserved_mem_device_init(dev);
        if (rc) {
                dev_err(dev, "Unable to reserve memory\n");