gpio: davinci: coding style correction

1. Corrects coding and commenting styles
2. Variables name change to meaningful name
3. Remove unnecessary variable usage
4. Add BINTEN macro definition

Signed-off-by: Philip Avinash <avinashphilip@ti.com>
gpio: davinci: Modify to platform driver

Modify GPIO Davinci driver to be compliant to standard platform drivers.
The driver did not have platform driver structure or a probe. Instead,
had a davinci_gpio_setup() function which is called in the pure_init
sequence. The function also had dependency on davinci_soc_info structure
of the corresponding platform. For Device Tree(DT) implementation, we
need to get rid of the dependency on the davinci_soc_info structure.
Hence as a first stage of DT conversion, we implement a probe. Future
commits shall modify the probe to read platform related data from DT.

- Add platform_driver structure and driver register function for davinci
  GPIO driver. The driver registration is made to happen in
  postcore_initcall. This is required since machine init functions like
  da850_lcd_hw_init() make use of GPIO.
- Convert the davinci_gpio_setup() to davinci_gpio_probe().
- Remove access of members in soc_info structure. Instead, relevant data
  are taken from davinci_gpio_platform_data structure pointed by
  pdev->dev.platform_data.
- Change clk_get() to devm_clk_get() as devm_clk_get() is a device
  managed function and makes error handling simpler.
- Change pr_err to dev_err for ngpio error reporting.
- Arrange include files and variables in alphabetical order

Signed-off-by: KV Sujith <sujithkv@ti.com>
[avinashphilip@ti.com: Remove reference of global variable "struct
davinci_gpio_controller" and set it as driver data.]
Signed-off-by: Philip Avinash <avinashphilip@ti.com>
arm: davinci: da8xx: creation of gpio platform device

gpio controller resource information being associated with
davinci_soc_info structure and not created any device. Hence davinci
gpio didn't fall under proper device model. This patch creates gpio
davinci as a platform device for da8xx platforms.

- Add Memory and IRQ resources for DA8xx.
- Register GPIO platform driver for DA8xx.
- Add da8xx_register_gpio API to create platform device for da8xx
  platforms.

Signed-off-by: KV Sujith <sujithkv@ti.com>
Signed-off-by: Philip Avinash <avinashphilip@ti.com>
arm: davinci: creation of gpio platform device for dm platforms

gpio controller resource information being associated with
davinci_soc_info structure and not created any device. Hence davinci
gpio didn't fall under proper device model. This patch creates gpio
davinci as a platform device for dm platforms.
Also add daivinci_register_gpio API to create platform device for dm*
platforms.

Signed-off-by: Philip Avinash <avinashphilip@ti.com>
arm: davinci: da8xx: gpio device creation

Create davinci gpio device and remove references in davinci_soc_info
structure. Also rearrange header file inclusion in group basis.

Signed-off-by: Philip Avinash <avinashphilip@ti.com>
arm: davinci: create davinci gpio device for dm platforms

Signed-off-by: Philip Avinash <avinashphilip@ti.com>
arm: davinci: start using gpiolib support

Remove NEED_MACH_GPIO_H config option for davinci platforms to start
using common gpio library interface.
Also moves gpio header file definitions from mach-davinci directory to
platform_data directory.

Signed-off-by: Philip Avinash <avinashphilip@ti.com>
gpio: davinci: DT changes for driver

- Add of_device_id for Davinci GPIO driver.
- Add function to populate data from DT.
- Modify the probe to read from DT if DT match is found.

Signed-off-by: KV Sujith <sujithkv@ti.com>
Signed-off-by: Philip Avinash <avinashphilip@ti.com>
Add documentation for GPIO properties specific to Davinci

Add DT binding documentation for Davinci GPIO properties in a new file
gpio-davinci.txt located at Documentation/devicetree/bindings/gpio/.

Signed-off-by: KV Sujith <sujithkv@ti.com>
Signed-off-by: Philip Avinash <avinashphilip@ti.com>
ARM: davinci: da850: add GPIO DT entries

Add DT entries for Davinci GPIO.

Signed-off-by: KV Sujith <sujithkv@ti.com>
Signed-off-by: Philip Avinash <avinashphilip@ti.com>
ARM: davinci: da850 evm: add GPIO DT data

- Add GPIO DT Data and pinmux for DA850 EVM. GPIO is configurable differently
  on different boards. So add GPIO pinmuxing in dts file.
- Dependency: This patch is dependent on Grab-pin-control patch;
  https://patchwork.kernel.org/patch/2013751/

Signed-off-by: KV Sujith <sujithkv@ti.com>
Signed-off-by: Philip Avinash <avinashphilip@ti.com>
for testing only