sunxi: Kconfig: Add CONFIG_VIDEO option to enable HDMI console support

And make this default to Y since most boards have a HDMI output.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: display: Fix clock-output-names check failure on sun5i

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: display: Add a 1920x1080 mode

Make it easy to use / test 1920x1080 by flipping a single #if.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: display: Pass around calculated clk_div and clk_double values

Rather then reading them back from the register later.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: display: 16 is not a valid clk_div value

We can use div as a clk_div for the lcdc clk, but not for the hdmi clk, so
don't try to use a clk_div of 16.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: display: Use linux-sunxi 3.4 driver values for tx clk and driver values

I don't know where the value currently in the u-boot sunxi-display driver
come from. But they cause my monitor to not sync at all with 1024x768. Use the
proven to work on many monitors values from the linux-sunxi 3.4 driver instead.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: display: Add sun5i fifo tweak from linux-sunxi 3.4 kernels

This fixes some modes / board combinations giving artifacts due to fifo
underruns.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
usb: Remove unnecessary portnr lookup from usb_new_device

If the device has a parent, it is instantiated from usb_hub_port_connect_change
and the portnr is right there in dev->portnr, so there is no need for this
whole dance to look it up.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
usb: Do not power-cycle usb devices on init

Do as the Linux kernel does and power on any ports which are not yet one,
this is enough.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
usb: ehci: Do not disable an already disabled periodic schedule

When periodic_schedules == 0, the schedule is disabled and there is no reason
to disable it again.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
usb: ehci: Move interrupt packet length check to create_int_queue

Preperation patch to use create_int_queue outside of ehci-hcd.c .

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
usb: ehci: Move cache invalidation to poll_int_queue

Preperation patch to use poll_int_queue outside of ehci-hcd.c .

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
usb: Make pollable int support available outside of ehci-hcd.c

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
usb: kbd: Remove unused usb_kbd_generic_poll function

This is not used anywhere, so lets remove it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
usb: kbd: Fix memleak on usb_kbd_deregister()

Free the keyboard hid-report buffer and private data on deregister.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
stdio: Fix memleak on stdio_deregister

stdio_register makes a malloc-ed copy of struct stdio_dev through stdio_clone,
free the malloc-ed memory on stdio_deregister.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
usb: kbd: Cache pipe, interval and packetsize

Instead of looking them up every time we need them.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
usb: kbd: Add (optional) support for using an interrupt queue for polling

Waiting an interrupt packet to complete in usb_kbd_poll_for_event, causes
a 40 ms latency for each call to usb_kbd_testc, which is undesirable.

Using control messages leads to lower (but still not 0) latency, but some
devices do not work well with control messages (e.g. my kvm behaves funny
with them).

This commit adds support for using the int_queue mechanism which at least
the ehci-hcd driver supports. This allows polling with 0 latency, while
using interrupt packets.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: Add usb keyboard Kconfig option

For use together with the hdmi console.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: display: Give various display pipeline blocks time to settle

It seems the various display pipeline blocks need about one frame for their
about to become stable enough for the next block in the pipeline to be able
to sync to it. Without the delays this patch adds, things do not sync up
properly on some boards leading to a video-output with an unwanted x and y
offset.

Even with these delays sometimes (once about every 5 boots on my bananapi),
things still do not sync up properly, luckily this can be detected using the
hdmi fifo over / underrun bits. This commits also adds code to retry the
modeset when this happens.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>