Re: [PATCH 1/2] sh_mobile_ceu: add soft reset function
Magnus Damm <[email protected]>
| Newsgroups | gmane.comp.video.video4linux |
|---|---|
| Message-ID | <[email protected]> |
Hi Morimoto-san, On Wed, Aug 5, 2009 at 7:21 PM, Kuninori Morimoto<[email protected]> wrote: > + while (t--) { > + if (!(ceu_read(pcdev, CAPSR) & (1 << 16))) > + break; > + cpu_relax(); > + } > + > + t = 10000; > + while (t--) { > + if (!(ceu_read(pcdev, CSTSR) & 1)) > + break; > + cpu_relax(); > + } > +} > + > /* > * Videobuf operations > */ > @@ -366,9 +386,7 @@ static int sh_mobile_ceu_add_device(struct soc_camera_device *icd) > > clk_enable(pcdev->clk); > > - ceu_write(pcdev, CAPSR, 1 << 16); /* reset */ > - while (ceu_read(pcdev, CSTSR) & 1) > - msleep(1); So the original code is using msleep(1) for timing, but your new code does not have any delay in the loops. Please use some delay code in there so that the polling times out after a known amount of time. In this version the time depends on cpu speed which is not so good. Thanks, / magnus -- video4linux-list mailing list Unsubscribe mailto:[email protected]?subject=unsubscribe https://www.redhat.com/mailman/listinfo/video4linux-list