sunxi-disp: Add current mode to modelist when not using EDID

When edid is not enabled make sure the current mode is in the mode-list,
so that the user-set mode is honored.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi-sound: Merge sun5i sound support into sun4i code

I did a diff between the 2 soc/sound/sun?i dirs, then renamed differently
named files, and s/sun5i/sun4i/ and run the diff again. After this the
differences were very small. This patch adds the differences to the
sun4i code (with machine_sun4i() / machine_sun5i()) checks and drops the
entire sun5i dir.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi-sound: Fix module Section mismatch warning

This fixes this warning during kernel build:

WARNING: sound/soc/sun4i/built-in.o(.devinit.text+0x64): Section mismatch in
reference from the function sun4i_codec_probe() to the function
.init.text:snd_chip_codec_mixer_new()
The function __devinit sun4i_codec_probe() references
a function __init snd_chip_codec_mixer_new().
If snd_chip_codec_mixer_new is only used by sun4i_codec_probe then
annotate snd_chip_codec_mixer_new with a matching annotation.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi-sound: Fix soc-audio.x should use snd_soc_register_card() warnings

These warnings are thrown at runtime when the device(s) in question are
registering.

Note this is possibly a 3.4 only thing / patch-series.

While almost rewriting this code anyways also fix:
1) script_parser_fetch's last argument is an integer count, not a byte count
2) Fix cleaning up of platform_device when driver registration fails
3) On module onload properly remove both the device and the driver

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi-sound: Honor audio_used fex file setting

So that devices which don't have analog audio hooked up don't get an
alsa sound-card for it.

While almost rewriting this code anyways also fix:
1) Cleaning up of platform_device when driver registration fails
2) On module onload properly remove both the device and the driver

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi-sound: Move registration of hdmi-audio devices to sunxi-hdmi code

Registering the hdmi audio-devices when not using hdmi means that userspace
may end up trying to use hdmi while it is not working. When hdmi-audio is
not enabled, and userspace still tries to use it the audio-using app(s) will
hang when trying to write to the audio-device, since the write will never
complete when the video-part is not consuming any hdmi-audio.

Note that this patch does not unregister the audio-card again if the hdmi
block is powered down (dpms / blank screen), so as to avoid audio-streaming
apps to crash / abort because the soundcard has gone away. Instead the app
will pause (write will block) on monitor powerdown and resume again when
the monitor powers back on.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi-sound: Cleanup spdif_used parsing

Various spdif_used parsing fixes / cleanups:
1) sun4i_spdma was not honoring spdif_used
2) There are 4 .ko files build for spdif, having each of them complain when
   spdif_used is not set is a bit too much
3) script_parser_fetch's last argument is an integer count, not a byte count
4) Fix cleaning up of platform_device when driver registration fails
5) On module onload properly remove both the device and the driver

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