Allow pin read in output mode

Signed-off-by: Alexandr V. Shutko <alex@shutko.ru>
sunxi: move clocksource code to plat-sunxi

It is identical for sun4i and sun5i, so no merging was needed.

Note checkpatch very much dislikes the code, but this patch does not change it,
it just moves it around.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: Merge/move core.c code from mach to plat

Note that:
1) This patch also includes one functionaly change, the clock_event_device
declared in core.c had a rating of 100 in sun4i and of 300 for sun5i. This
patch keeps the sun4i setting, thereby working around the timer0 code being
broken in periodic mode (something to fix another day), as the working
"highres" clock_event_device from clocksrc.c has a rating of 300 and thus
gets used instead *if* CONFIG_HIGH_RES_TIMERS is set!

This subtle change fixes the sun5i_defconfig kernel hanging within 10 - 30
seconds after boot due to the timer stopping.

2) checkpatch dislikes parts of this patch, but this patch is just moving
(ugly) code around not introducing it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Merge remote-tracking branch 'sunxi/stage/sunxi-3.4' into work-3.4