backport: gpio_backlight.c from: v3.15.10

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
firmware: am335x-pm-firmware.elf

#git://git.ti.com/ti-cm3-pm-firmware/amx3-cm3.git
#fffeab4236d4129ab046bb7081a8ac244134ad89

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
BeagleBone pinmux helper

This patch was derived from 2 commits, but I removed the non-pinmux-helper portions
and added the helper to the bb.org_defconfig:

capemgr: Capemgr makefiles and Kconfig fragments.

Introduce a cape loader using DT overlays and dynamic
DT objects.

Makefile and Kconfig fragments.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>

Conflicts:
	arch/arm/mach-omap2/Kconfig
	drivers/misc/Kconfig
	drivers/misc/Makefile

And:

Pinmux helper driver.

    That's just a hack to get a pinmux helper driver working.

    Define in the DT

    	helper {
    		compatible = "bone-pinmux-helper";
    		pinctrl-names = "default";
    		pinctrl-0 = <&helper_pins>;
    		status = "okay";
    	};
pinmux-helper: Add runtime configuration capability

Pinctrl already supports multiple states. Just make them visible.
pinmux-helper: Switch to using kmalloc

devm_kfree warned out... why? no idea.
gpio: Introduce GPIO OF helper

A gpio OF helper driver that allows configuration to be done via
DT.
Add dir-changeable property to gpio-of-helper

Signed-off-by: Charles Steinkuehler <charles@steinkuehler.net>
am33xx.dtsi: add ocp label

Signed-off-by: Jason Kridner <jdk@ti.com>
beaglebone: added expansion header to dtb

This adds gpio and pinmux helpers to the majority of available expansion header pins
based on the cape-universal work from Charles Steinkuehler making them userspace
configurable. This is not a substitute for Capemgr as it doesn't perform the
configuration based on cape detection, nor does it enable dynamic configuration of
all types of peripherals that could be on a cape. It does, however, enable many
developers to rapidly experiment with a lesser degree of complexity.

Derived from:
https://github.com/cdsteinkuehler/beaglebone-universal-io/blob/52461b52ef3203e648399c16c7e160c848a04b5c$

Signed-off-by: Jason Kridner <jdk@ti.com>
Cc: Charles Steinkuehler <charles@steinkuehler.net>
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
bone-pinmux-helper: Add support for "mode" device-tree parameter The new mode parameter is used to set the initial pinmux mode to something other than "default" or NULL, which is what happens currently. This allows enabling SoC hardware via device-tree which requires specific pinmux settings to function on boot, but still leaves the pinmux register under control of the bone-pinmux- helper driver meaning the pinmux setting can be changed at run time via user-mode access to sysfs.

Signed-off-by: Charles Steinkuehler <charles@steinkuehler.net>
pinmux-helper: add P8_37_pinmux & P8_38_pinmux

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
am335x-bone-common: split out am33xx_pinmux

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
am335x-boneblack: split out am33xx_pinmux

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
am335x-boneblack: split out emmc

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
am335x-boneblack: split out nxp hdmi audio

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
am335x-bone: nxp hdmi no audio

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
pinmux: bone/black disable pins for hdmi/audio/clkout2/mmc1

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
pinmux: i2c

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
pinmux: uart

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
pinmux: spi

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>