leds:sunxi: Added LEDS driver for sunxi platforms

Signed-off-by: Alexandr V. Shutko <alex@shutko.ru>
sunxi-leds: adjusted for 3.4

Signed-off-by: Alejandro Mery <amery@geeks.cl>
mach-sunxi: configure IRQ for ARM Cortex-A8 performance monitoring unit

This allows the use of performance monitoring unit for statistical
sampling based profiling (oprofile, perf).

The downside is that the performance unit in Cortex-A8 is affected
by erratum 628216, which causes it to miss interrupts in some cases
and disrupt profiling results. Some information in public access
about this erratum can be found here:
    http://www.freescale.com/files/32bit/doc/errata/IMX53CE.pdf

As a result, it may be preferable to keep using the standard
timer for general purpose profiling instead of the PMU cycle
counter. But some of the other performance events may be still
useful in practice (cache misses, ...).

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
selinux: classmap: Add mappings for capabilities 35 and 36

These are present in include/linux/capability.h but are missing from
security/selinux/include/classmap.h.

Note that capability 36 is called CAP_EPOLLWAKEUP yet it is mapped to
"block_suspend" in classmap.h, this is done because it was renamed later
to CAP_BLOCK_SUSPEND <sigh> and recent userspace (recent selinux policies)
expect it to be named that way.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
block:sunxi-nand: New flash chips from i-onik.de allwinner source

I found that the i-onik sources from allwinner had an updated nand_id.c
file with settings I needed for a nand chip on a new device.  This
series of patches merges it in.  This patch adds all the new entries
that didn't exist before.

Signed-off-by: Neal Peacock <neal@nic-stix.com>
block:sunxi-nand: settings updates for various flash chips based on i-onik.de allwinner source dump

This patch updates the settings that were found to be different, note I
haven't tested all these changes.

Signed-off-by: Neal Peacock <neal@nic-stix.com>
sunxi-hdmi: Fix pixelclock conversion harder

The pixelclock in hz -> picoseconds -> hz conversions loosing precision
first fixed by "sunxi-hdmi: Fix some modes no longer working with X",
is still a problem with some modes :|

For example 130000000 becomes 130010000, and X does not work.

We can only do pixelclocks which are a divider of 1 - 15 of a multiple of
3 MHz. Combining this with EDID's granularity of 10 Khz, all clocks must have
been a multiple of 100 or 250 KHz before the conversion.

Therefore this patch changes the rounding in fb_videomode_pixclock_to_hdmi_pclk
from rounding to 10Khz to rounding to 50Khz, which should hopefullly be
enough to get rid of any imprecision introduced by the conversion process.

Reported-by: Daniel Veillard <veillard@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi-disp: Fix tv-out / standard tv-modes not working

For the tv / hdmi output lcd_clk_div is not used when programming the pll,
instead pre_scale is used. My commit titled:
"sunxi-hdmi: Dynamically determine pll frequency for hdmi modes"

Wrongly sets lcd_clk_div rather then setting pre_scale. This bug did not get
noticed sofar because pre_scale gets initialized to 1, which is the correct
value for non 27000000 Hz pixelclock modes.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi-disp: Add missing break

This fixes a kernel NULL ptr deref (trying to call hdmi functions before they
are registered) when trying to use tv-out.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi-disp: Use mode names like pal and ntsc for specifying tv-out modes

Some of the tv modes have the exact same dimensions but are different in
things like how the color is encoded, so specifying <width>x<height> is not
enough to uniquely identify them.

Therefore this patch changes the screen0_output_mode value to be a mode-name
like pal, ntsc or pal-nc when the screen0_output_type is set to tv.

As an added bonus this patch also limits which modes from the tv_mode table
can be selected, so that the user can no longer select hdmi only modes when
using tv-out.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
axp20-mfd.h: Re-format chip init register values

So that they can be read without needing horizontal scrolling.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
axp20-mfd.h: Fixup axp20_init_chip to not cause spurious interrupts

Before this patch axp20_init_chip did the following:
1) Set the interrupt enable registers to 0x000000000103ffd8
2) Write 0xffffffffffffffff to the interrupt status registers to
   write-clear all interrupt status bits
3) Write 0x0000000000000000 to the interrupt enable registers to
   disable all interrupts

Between 2 and 3 an unwanted interrupt can trigger and since this is all
done over slow i2c there is plenty of time for this.

This patch fixes this by changing the init sequence to:
1) Set the interrupt enable registers to 0x0000000000000000
2) Write 0xffffffffffffffff to the interrupt status registers to
   write-clear all interrupt status bits

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
input:touchscreen:ft5x_ts: Enable needed bits for xorg input device probe.

[    17.888] (II) config/udev: Adding input device ft5x_ts (/dev/input/event1)
[    17.888] (**) ft5x_ts: Applying InputClass "evdev touchscreen catchall"
[    17.888] (II) Using input driver 'evdev' for 'ft5x_ts'
[    17.888] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
[    17.888] (**) ft5x_ts: always reports core events
[    17.889] (**) evdev: ft5x_ts: Device: "/dev/input/event1"
[    17.889] (--) evdev: ft5x_ts: Vendor 0 Product 0
[    17.889] (--) evdev: ft5x_ts: Found absolute axes
[    17.889] (--) evdev: ft5x_ts: Found absolute multitouch axes
[    17.889] (--) evdev: ft5x_ts: Found x and y absolute axes
[    17.889] (--) evdev: ft5x_ts: Found absolute touchscreen
[    17.890] (II) evdev: ft5x_ts: Configuring as touchscreen
[    17.890] (**) evdev: ft5x_ts: YAxisMapping: buttons 4 and 5
[    17.890] (**) evdev: ft5x_ts: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[    17.890] (**) Option "config_info" "udev:/sys/devices/platform/sun4i-i2c.2/i2c-2/2-0038/input/input1/event1"
[    17.891] (II) XINPUT: Adding extended input device "ft5x_ts" (type: TOUCHSCREEN, id 7)
[    17.891] (II) evdev: ft5x_ts: initialized for absolute axes.
[    17.893] (**) ft5x_ts: (accel) keeping acceleration scheme 1
[    17.893] (**) ft5x_ts: (accel) acceleration profile 0
[    17.893] (**) ft5x_ts: (accel) acceleration factor: 2.000
[    17.893] (**) ft5x_ts: (accel) acceleration threshold: 4
[    17.895] (II) config/udev: Adding input device ft5x_ts (/dev/input/mouse0)
[    17.896] (II) No input driver specified, ignoring this device.
[    17.896] (II) This device may have been added with another device file.

Signed-off-by: Jari Helaakoski <tekkuli@gmail.com>
sunxi-hdmi: Fix data byte 1 of hdmi avi frame

Fix the low nibble of data byte 1 of hdmi avi frame, before this patch
it was being set to 0 for YUV_COLORSPACE, which is wrong since that
means no bar-data, no overscan-data. But we want to explicitly disable
overscan so as to for example not make xfce's panel(s) go offscreen.

And it was being set to e for RGB colorspace, which is wrong since that
means both horz. and vert. bar-data, underscan. While the avi frame does
not contain any (valid) bar data.

This patch changes the low nibble to 2 for each case, or iow to:
no bar-data, underscan.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi-hdmi: Fix data byte 2 of hdmi avi frame

Before this patch the YUV_COLORSPACE was dynamically adjusting the 2nd data
byte based on the pixelclock, to select between the ITU601 (old standard
tv colorspace) and ITU709 colorspace (new hd tv colorspace), as well as
between 4:3 and 16:9 picture aspect ratio.

But in RGB colorspace mode the 2nd data byte is hardcoded to ITO601 4:3.

This patch fixes this, and also makes only the colorspace selection depend
on the pixelclock (checking for sd-mode clocks). While using the actual
picture aspect ratio to set the aspect ratio. This is necessary since with
EDID support non SD modes may still have a 4:3 aspect ratio.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi-hdmi: Fix data byte 3 of hdmi avi frame

Always set the IT content flag, to tell the display to not do scaling /
filtering (which conflicts with for example computer rendered anti-aliased
text). And for RGB colorspace also set the Full Range flag (pixel values
go from 0-255).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: configs: remove unneeded cubieboard_defconfig

Signed-off-by: Alejandro Mery <amery@geeks.cl>
leds:sunxi: use [leds_para] instead of [leds]

for consistency with the other script.bin sections

Signed-off-by: Alejandro Mery <amery@geeks.cl>
sunxi-disp: Fix compiling for sun5i

It looks like the 3.4 branch has been broken for compiling for sun5i
for a while, this fixes it.

Signed-off-by : Hans de Goede <hdegoede@redhat.com>
sunxi-disp: Allow build without axp

I wrote this patch while working on A10s support, then when I tried to
get my Olinuxino A13_Micro running using commits from
https://github.com/hehopmajieh/linux-sunxi/

I noticed a similar patch there:
https://github.com/hehopmajieh/linux-sunxi/commit/e7c1fc23a723bdf799c0aef02920b55650c06e12

But I believe this fix is better because:
1) It properly checks for CONFIG_AXP rather then CONFIG_POWER, as the former
can still be unset when the latter is set
2) Rather then just ignoring axp gpio calls when not build with axp support
it complains loudly when other code tries to use axp gpio-s when built without

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