Re: i.MX6 IPU CSI analog video input on Ventana

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey,

* Krzysztof Hałasa, 2018-05-10 10:19:
> I'm using analog PAL video in on GW53xx/54xx boards (through ADV7180
> chip and 8-bit parallel CSI input, with (presumably) BT.656).
[...]
> First, I can't find a way to change to PAL standard. *s_std() doesn't
> propagate from "ipu2_csi1 capture" through "ipu2_csi1_mux" to adv7180.
>
> For now I have just changed the default:
> --- a/drivers/media/i2c/adv7180.c
> +++ b/drivers/media/i2c/adv7180.c
> @@ -1320,7 +1321,7 @@ static int adv7180_probe(struct i2c_client *client,
>
>       state->irq = client->irq;
>       mutex_init(&state->mutex);
> -    state->curr_norm = V4L2_STD_NTSC;
> +    state->curr_norm = V4L2_STD_PAL;
>       if (state->chip_info->flags & ADV7180_FLAG_RESET_POWERED)
>           state->powered = true;
>       else

JFTR: I had a similar problem on a board, where there can either be an
NTSC *or* a PAL camera, so I had to make it dynamic.


diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index 3df28f2f9b38..e5ebebf7a1f4 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -1320,7 +1320,27 @@ static int adv7180_probe(struct i2c_client *client,

         state->irq = client->irq;
         mutex_init(&state->mutex);
+
+       /* check if video standard (PAL, NTSC) has already been determined */
+       ret = adv7180_read(state, ADV7180_REG_STATUS1);
+       if (ret < 0) {
+               ret = -EIO;
+               goto err_unregister_vpp_client;
+       }
+
         state->curr_norm = V4L2_STD_NTSC;
+       if (ret & ADV7180_STATUS1_IN_LOCK) {
+               ret = (ret >> 4) & 0x07; /* autodetection result (AD_RESULT) */
+               if (ret >= 2 && ret <= 4) {
+                       v4l_info(client, "locked on PAL signal\n");
+                       state->curr_norm = V4L2_STD_PAL;
+               } else {
+                       v4l_info(client, "locked on NTSC signal\n");
+               }
+       } else {
+               v4l_info(client, "no signal, using NTSC\n");
+       }
+
         if (state->chip_info->flags & ADV7180_FLAG_RESET_POWERED)
                 state->powered = true;
         else
m.


Melchior Franz | Entwicklung Software

GINZINGER ELECTRONIC SYSTEMS GMBH

Tel.: +43 7723 5422 156
Mail: melchior.franz@xxxxxxxxxxxxx
Web: www.ginzinger.com







________________________________________

Ginzinger electronic systems GmbH
Gewerbegebiet Pirath 16
4952 Weng im Innkreis
www.ginzinger.com

Firmenbuchnummer: FN 364958d
Firmenbuchgericht: Ried im Innkreis
UID-Nr.: ATU66521089





[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux