ARM: OMAP3+: hwmod: Add AM33XX HWMOD data for davinci_mdio

This patch adds minimal hwmod support for davinci mdio driver. This patch
requires rework on parent child relation between cpsw and davinci mdio
hwmod data to support runtime PM.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
net: davinci_mdio: Fix type mistake in calling runtime-pm api

By mistake (most likely a copy-paste), instead of pm_runtime_get_sync()
api, driver is calling pm_runtime_put_sync() api in resume callback
function. The bug was introduced by commit id (ae2c07aaf74:
davinci_mdio: runtime PM support).

Now, the reason why it didn't impact functionality is, the patch has
been tested on AM335x-EVM and BeagleBone platform while submitting;
and in case of AM335x the MDIO driver doesn't control the module
enable/disable part, which is handled by CPSW driver.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Cc: Mugunthan V N <mugunthanvnm@ti.com>
net: cpsw: Add parent<->child relation support between cpsw and mdio

CPGMAC SubSystem consist of various sub-modules, like, mdio, cpdma,
cpsw, etc... These sub-modules are also used in some of Davinci family
of devices. Now based on requirement, use-case and available technology
nodes the integration of these sub-modules varies across devices.

So coming back to Linux net driver, currently separate and independent
platform devices & drivers for CPSW and MDIO is implemented. In case of
Davinci they both has separate control, from resources perspective,
like clock.

In case of AM33XX, the resources are shared and only one register
bit-field is provided to control module/clock enable/disable, makes it
difficult to handle common resource.

So the solution here implemented in this patch is,

Create parent<->child relationship between both the drivers, making
CPSW as a parent and MDIO as its child and enumerate all the child nodes
under cpsw module.
Both the drivers will function exactly the way it was operating before,
including runtime-pm functionality. No change is required in MDIO driver
(for that matter to any child driver).

As this is only supported during DT boot, the parent<->child relationship
is created and populated in DT execution flow. The only required change
is inside DTS file, making MDIO as a child to CPSW node.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Cc: Mugunthan V N <mugunthanvnm@ti.com>
arm/dts: am33xx: Add cpsw and mdio module nodes for AM33XX

Add CPSW and MDIO related device tree data for AM33XX.
Also enable them into board/evm dts files by providing
respective phy-id.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
v3.7-rc1-cpsw
arm/dts: AM33XX: Add basic pinctrl device tree data

Adds basic pinctrl device tree data for AM33XX family of devices.
This patch is based on the pinctrl-single driver.

Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
arm/dts: AM33XX: Configure pinmuxs for user leds control on Bone

Adds GPIO pinctrl nodes to am3358_pinmux master node to control
user leds (USR0, USR1, USR2 and USR3) present on BeagleBone.

Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
beaglebone DT: set default triggers for LEDS

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
v3.7-rc1-pinctrl
arm/dts: AM33XX: Add device tree OPP table

Add DT OPP table for AM33XX family of devices. This data is
decoded by OF with of_init_opp_table() helper function.

Also adds cpu0 supply name to the corresponding dts files.
cpu0-supply name is used by cpufreq-cpu0 driver to get the
regulator pointer for voltage modifications.

Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
v3.7-rc1-cpufreq
input: TSC: ti_tscadc: Correct register usage

This patch cleans up the wrong register definitions
and usage for touchscreen controller.
Bit masks were not defined earlier.

For ex: consider a register define as:
write(xyz, ABC)
ABC is expected to be written to register bits 0-11.
Here we see that value written is as expected, but this write
is also affecting all the remaining bits of xyz.
The remaining bits hold the default value as 0 and the write
also sets it to zero. Hence wrong usage were not causing user
visible bugs.
Due to these reasons it was difficult to follow when
compared with TRM.

Unused definitions are also removed.
Since there is change in some naming convention because of
all the above mentioned reasons, the same has been
updated throughout the code.
Bit declarations are grouped to increase readability.

Signed-off-by: Patil, Rachna <rachna@ti.com>
input: TSC: ti_tscadc: Add Step configuration as platform data

There are 16 programmable Step Configuration
registers which are used by the sequencer.
Program the Steps in order to configure a channel
input to be sampled. If the same step is applied
several times, the coordinate values read are more
accurate.
Hence we provide the user an option of how many steps
should be configured.

For ex: If this value is assigned as 4, This means that
4 steps are applied to read x co-ordinate and 4 steps to read
y co-ordinate. Furtheron the interrupt handler already
holds code to use delta filter and report the best value
out of these values to the input sub-system.

Signed-off-by: Patil, Rachna <rachna@ti.com>
input: TSC: ti_tscadc: set FIFO0 threshold Interrupt

Code currently uses FIFO1 threshold interrupt.
since this is a MFD, Dedicating FIFO0 to touchscreen
and making way for other devices to use FIFO1 as well.
The FIFO can be shared between 2 devices but since the
interrupt used is threshold interrupt on FIFO1, we would
end up having wrong interrupts. Hence changing the same.

Signed-off-by: Patil, Rachna <rachna@ti.com>
input: TSC: ti_tscadc: Remove definition of End Of Interrupt register

The touchscreen IP uses level sensitive interrupts rather
than edge sensitive interrupts and therefore the is no need
to use the EOI register to have the module re-strobe the
interrupt line if there pending interrupts exist.

Signed-off-by: Patil, Rachna <rachna@ti.com>
input: TSC: ti_tscadc: Rename the existing touchscreen driver

Make way for addition of MFD driver.
The existing touchsreen driver is a MFD client.
For better readability we rename the file to
indicate its functionality as only touchscreen.

Signed-off-by: Patil, Rachna <rachna@ti.com>
MFD: ti_tscadc: Add support for TI's TSC/ADC MFDevice

Add the mfd core driver which supports touchscreen
and ADC.
With this patch we are only adding infrastructure to
support the MFD clients.

Signed-off-by: Patil, Rachna <rachna@ti.com>
input: TSC: ti_tsc: Convert TSC into a MFDevice

This patch converts touchscreen into a MFD client.
All the register definitions, clock initialization,
etc has been moved to MFD core driver.

Signed-off-by: Patil, Rachna <rachna@ti.com>
IIO : ADC: tiadc: Add support of TI's ADC driver

This patch adds support for TI's ADC driver.
This is a multifunctional device.
Analog input lines are provided on which
voltage measurements can be carried out.
You can have upto 8 input lines.

Signed-off-by: Patil, Rachna <rachna@ti.com>
MFD: ti_tscadc: add suspend/resume functionality

This patch adds support for suspend/resume of
TSC/ADC MFDevice.

Signed-off-by: Patil, Rachna <rachna@ti.com>