am33xx-musb: Add OF definitions

For some reason these got dropped; reintroduce.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
da8xx-dt: Create da8xx DT adapter device

omap_device is going private.

Move the da8xx-dt adapter device to arch/arm/mach-omap2.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
ti-tscadc-dt: Create ti-tscadc-dt DT adapter device

omap_device is going private.

Move the ti-tscadc-dt adapter device to arch/arm/mach-omap2.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
Mark the device as PRIVATE

Turns out if you enable CONFIG_NET_DMA the ip stack will try
to grab all the available non-private DMA channels sometime late in the
boot sequence.

That's bad enough, what is worse is that it brindly iterates over
any possible channel; if the driver returns ENODEV on any of the
channels dmaengine will remove the device from the list of available
dma devices.

Very crazy bug.
omap_hsmmc: Bug fixes, pinctl & gpio-reset

Cleanup omapmmc & add gpio-reset.

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

Conflicts:
	drivers/mmc/host/omap_hsmmc.c
tps65217-bl: Locate backlight node correctly.

When using overlays find_node doesn't work like it used to, because
the new nodes are inserted at the head of allnodes.

Use the correct function to locate the child node.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
arm: Export cache flush management symbols when !MULTI_CACHE

When compiling a kernel without CONFIG_MULTI_CACHE enabled the
dma access functions end up not being exported. Fix it.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
am335x-bone-dtsi: Clean up

Clean up the common dtsi.

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

Conflicts:
	arch/arm/boot/dts/am335x-bone-common.dtsi
	arch/arm/boot/dts/am335x-bone.dts
am335x-bone-dtsi: Introduce new I2C entries

Introduce I2C entries that are required for capes.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
am335x-dt: Add I2C0 pinctrl entries.

Make sure I2C0 gets it's own pinctrl entries and doesn't rely on the
bootloader.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
am33xx-hwmod: Fix wrongly terminated am33xx_usbss_mpu_irqs array

The IRQ array must be terminated by -1 and not by -1+OMAP_INTC_START
This led to having a resource list of 100s of IRQs.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
omap3beagle compile fix
Cleanup am33xx.dtsi
Fix platform device resource linking

Platform device removal uncovered a number of problems with
the way resources are handled in the core platform code.

Resources now form child/parent linkages and this requires
proper linking of the resources. On top of that the OF core
directly creates it's own platform devices. Simplify things
by providing helper functions that manage the linking properly.

Two functions are provided:

platform_device_link_resources(), which links all the
linkable resources (if not already linked).

and platform_device_unlink_resources(), which unlinks all the
resources.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
Link platform device resources properly.

The resources of the platform devices created by the OF core were
not properly linked. Make sure that they are, so that we don't get
any crashes when trying to remove the device.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
Properly handle resources for omap_devices

omap_device relies on the platform notifier callbacks managing resources
behind the scenes. The resources were not properly linked causing crashes
when removing the device.

Rework the resource modification code so that linking is performed properly,
and make sure that no resources that have no parent (which can happen for DMA
& IRQ resources) are ever left for cleanup by the core resource layer.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
omap: DT node Timer iteration fix

The iterator correctly handles of_node_put() calls.
Remove it before continue'ing the loop.
Without this patch you get:

ERROR: Bad of_node_put() on /ocp/timer@44e31000!
[<c001329c>] (unwind_backtrace+0x0/0xe0) from [<c03dd8f0>] (of_node_release+0x2c/0xa0)!
[<c03dd8f0>] (of_node_release+0x2c/0xa0) from [<c03ddea0>] (of_find_matching_node_and_match+0x78/0x90)!
[<c03ddea0>] (of_find_matching_node_and_match+0x78/0x90) from [<c06d349c>] (omap_get_timer_dt+0x78/0x90)!
[<c06d349c>] (omap_get_timer_dt+0x78/0x90) from [<c06d3664>] (omap_dm_timer_init_one.clone.2+0x34/0x2bc)!
[<c06d3664>] (omap_dm_timer_init_one.clone.2+0x34/0x2bc) from [<c06d3a2c>] (omap2_gptimer_clocksource_init.clone.4+0x24/0xa8)!
[<c06d3a2c>] (omap2_gptimer_clocksource_init.clone.4+0x24/0xa8) from [<c06cca58>] (time_init+0x20/0x30)!
[<c06cca58>] (time_init+0x20/0x30) from [<c06c9690>] (start_kernel+0x1a8/0x2fc)!

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
omap: Avoid crashes in the case of hwmod misconfiguration

omap hwmod is really sensitive to hwmod misconfiguration.
Getting a minor clock wrong always ended up in a crash.
Attempt to be more resilient by not assigning variables with
error codes and then attempting to use them.

Without this patch, missing a clock ends up with something like this:
omap_hwmod: ehrpwm0: cannot clk_get opt_clk ehrpwm0_tbclk!
Unable to handle kernel NULL pointer dereference at virtual address 0000002a!
pgd = c0004000!
[0000002a] *pgd=00000000!
Internal error: Oops: 5 [#1] SMP ARM!
Modules linked in:!
CPU: 0    Not tainted  (3.8.0-rc2-12157-g76c7825-dirty #291)!
PC is at __clk_prepare+0x10/0x70!
LR is at clk_prepare+0x1c/0x34!
pc : [<c03e37f0>]    lr : [<c03e386c>]    psr: a0000113!
sp : cf04fef8  ip : 22222222  fp : 00000000!
r10: ffffffea  r9 : 00000000  r8 : 00000000!
r7 : fffffffe  r6 : 00000001  r5 : fffffffe  r4 : fffffffe!
r3 : cf041ac0  r2 : cf04ff00  r1 : 22222222  r0 : fffffffe!
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel!
Control: 10c5387d  Table: 80004019  DAC: 00000015!
Process swapper/0 (pid: 1, stack limit = 0xcf04e240)!
Stack: (0xcf04fef8 to 0xcf050000)!
fee0:                                                       cf041ac0 c07749f4!
ff00: fffffffe c03e386c c07499cc c073c070 c073d2fc c06d4e4c c073c070 c071cc18!
ff20: c06d4c4c 00000000 00000000 c0708284 c06c91bc c0025e28 c073a030 00000001!
ff40: c06f5f60 c06f5f40 c06d5324 c06d533c cf04e000 c0008870 c06d5324 c060abe8!
ff60: c07082e8 00000002 00000001 c06f5f60 c06f5f40 c077d700 00000099 c04a43d4!
ff80: 00000001 00000001 c06c91bc 00000000 00000000 c04a42dc 00000000 00000000!
ffa0: 00000000 00000000 00000000 c000d678 00000000 00000000 00000000 00000000!
ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000!
ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 9e7befee f7bbaaab!
[<c03e37f0>] (__clk_prepare+0x10/0x70) from [<c03e386c>] (clk_prepare+0x1c/0x34)!
[<c03e386c>] (clk_prepare+0x1c/0x34) from [<c06d4e4c>] (_init+0x200/0x288)!
[<c06d4e4c>] (_init+0x200/0x288) from [<c0025e28>] (omap_hwmod_for_each+0x28/0x58)!
[<c0025e28>] (omap_hwmod_for_each+0x28/0x58) from [<c06d533c>] (omap_hwmod_setup_all+0x18/0x34)!
[<c06d533c>] (omap_hwmod_setup_all+0x18/0x34) from [<c0008870>] (do_one_initcall+0x90/0x160)!
[<c0008870>] (do_one_initcall+0x90/0x160) from [<c04a43d4>] (kernel_init+0xf8/0x290)!
[<c04a43d4>] (kernel_init+0xf8/0x290) from [<c000d678>] (ret_from_fork+0x14/0x3c)!
Code: e92d4038 e2504000 01a05004 0a000015 (e594302c) !
---[ end trace 1b75b31a2719ed1c ]---!
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b!

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
i2c-EEPROM: In kernel memory accessor interface

In kernel users need to access the EEPROM using the i2c_client
interface. Extend at24 to use it via the command interface.

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

The method used did not account for multi-part strings.

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