OMAP4470: OPP: Add initial BB2D OPP definitions

Add new 4470 OPP definitions for 2D graphics accelerator subsystem

Change-Id: I8e41b788df4769ed2ffab496f8a2ea4fc8cb5b1f
Signed-off-by: Taras Kondratiuk <taras@ti.com>
Signed-off-by: Eugen Mandrenko <ievgen.mandrenko@ti.com>
usb: musb: implement (un)map_urb_for_dma hooks

MUSB controller cannot work in DMA mode with misaligned buffers,
switching in PIO mode.

HCD core has hooks that allow to override the default DMA
mapping and unmapping routines for host controllers that have
special DMA requirements, such as alignment contraints.

It is observed that work in PIO mode is slow and it's better
to align buffers properly before pass them to MUSB

Some ideas taken from ehci-tegra.c

Change-Id: Id6eeaa811063d408f121c79012aba921f26eb582
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
usb: hcd: Add a dma_align flag

Some host controllers has special DMA requirements,
such as alignment contraints.
Added a flag dma_align for indicating this requirement

Change-Id: I06277ade030429a832e6db38cc695128a1033f08
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
usbnet: dma alignment fix

Allow usb ethernet driver to be used with a controller
driver that does not support DMA to adresses not aligned
to a 4-byte boundary

Change-Id: I017163921792c888c1cffff2531de55ef7bdb7f3
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
usb: musb: indicate DMA alignment requirement

The MUSB host controller requires DMA buffers to be aligned.
If DMA buffers are misaligned it will use (un)map_urb_for_dma
for re-aligning buffers.
This often happens with USB network adapters, where skbuff
alignment is often in the middle of a 4-byte dword.
Indicate host controller DMA alignment requirement for such cases

Change-Id: I8a03f392caff762e9b48b65d31a119fdd833ae69
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
usb: ehci-omap: indicate DMA alignment requirement

The OMAP host controller requires DMA buffers to be aligned.
If DMA buffers are misaligned then DMA transfers may take more
time.
This often happens with USB network adapters, where skbuff
alignment is often in the middle of a 4-byte dword.
Indicate host controller DMA alignment requirement for such cases

Change-Id: Ic2191f3f339cb189b02218d43b6d432cfe136269
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
OMAP4470: clock:  Fixed L3_set_rate on OMAP4470

CLKOUTX2_M7_DPLL_CORE, CLKOUTX2_M6_DPLL_PER might be used for PER_BB2D_FCLK
on OMAP4470. Therefore, those clocks must be controlled by BB2D driver,
not omap4_virt_l3_set_rate().

Change-Id: I8c930cf9d53203db45fe8ad348b61735b39256fa
Signed-off-by: Oleg Matcovschi <oleg.matcovschi@ti.com>
OMAP4470: gcx: Add device_scale, bandwith interface functions.

Extend device platform data to support device scaling and querying
L3 bandwidth.

Change-Id: I7e926767ba727bacc0f13543425d43225f815ccd
Signed-off-by: Oleg Matcovschi <oleg.matcovschi@ti.com>
OMAP4470: gcx: Use device scaling instead of L3 throughput.

Previously, L3 throughput affected BB2D clock frequency indirectly
due bug. Problem is fixed, so driver should use device scaling
mechanism to switch OPP's.

Change-Id: I1900fe1add7fd3ae597f2a7abf59d7231228125a
Signed-off-by: Oleg Matcovschi <oleg.matcovschi@ti.com>
gcx: mmu refactoring.

Switch to using cached memory for MMU.
MMU walking optimizied/simplified in map/unmap.
Slave allocation changed to allocate in chunks rather then one at time.
Moved global variables to gccorecontext structure.
Renamed MMU definitions.
Minor MMU cleanup.
Use standard list constructs.

Change-Id: I9eabc9d421ed0df7a9e2899e2a4a3e379bcf203d
Signed-off-by: Alexei Shlychkov <shlychkov@gmail.com>
gcx: debug logging.

Includes std linux logging and custom logging backends.

Change-Id: I8f93e87390f6473964407c21c8f243c186e2270f
Signed-off-by: Alexei Shlychkov <x0177296@ti.com>
gcx: removed iounmap from exit.

We don't explicitly map register space anymore so
we shouldn't unmap it explicitly either.

Change-Id: I20acf9510c60362069b929e77c06c887c02fde3a
Signed-off-by: Alexei Shlychkov <x0177296@ti.com>
gcx: mmu improvements.

Moved mmu shared object to the driver context;
Added mmu init/exit functions;
Memory alloc/free moved to gcmem.

Change-Id: I6475b839423377d80ff7fda50699a43012b7b6d7
Signed-off-by: Alexei Shlychkov <x0177296@ti.com>
gpu: ion: check for input arguments in ion_free

ion_free is a public API and is directly dereferencing a
pointer without checking for NULL. A check has been
added for the same and throws a WARN in case of invalid
arguments.

Change-Id: Idcf72e4449f8cba2b8342d6fb0f64600c2c59c7e
Signed-off-by: Suman Anna <s-anna@ti.com>
MFD: twl6040-codec: cancel synch all active works on suspend

The TWL6040 vib_update work has to be canceled synchronously
before continue suspending, because of:
- it may sleep while accessing to I2C bus and, as result, WFI may be
reached in the middle of its execution and that may prevent system
from entering to OFF state.
- the device suspend handler may switch TWL6040 device to sleep
state while vib_update work is still active.

Change-Id: I77b681188976378eec9242ea64dc5f001960d279
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
MFD: TWL6030: cancel synch all active works on suspend

The TWL6030 battery works have to be canceled synchronously
before continue suspending, because of:
- they may sleep while accessing to I2C bus and, as result, WFI may be
reached in the middle of its execution and that may prevent system
from entering to OFF state.
- the device suspend handler may switch TWL6030 device to sleep
state while their works are still active.

Change-Id: Ie3ef579e05bded049e39f9186acb01b116283c87
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
ALSA: usb-audio: fixed usb audio subsystem initialization

If USB audio device is already present on bus during
snd_usb_audio_init initialization will fail and kernel
will reboot due to null-pointer dereference.

The snd_usb_audio_init consists of 2 steps:
1) usb_register() - registers USB audio driver
2) switch_dev_register() - initializes the switch_dev sdev structure

If there is no USB audio device present on the bus, the
snd_usb_audio_init will finish with initialized sdev structure.
After that if USB audio device is plugged, the usb_audio_probe
callback will initialize device (during this step we are accessing sdev)

But if USB audio device is already present on bus during
snd_usb_audio_init initialization, usb_audio_probe callback will
be called during usb_register() - when sdev isn't initialized yet.
We are getting reboot due to null-pointer dereference.

Changed order of described steps so sdev is initialized when
calling usb_register.

Change-Id: Id22356157af2b69038506f1138a6da78d8f1e727
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
bma180: cancel synch active accel work on suspend

The bma180_accel_device_worklogic has to be canceled synchronously
before continue suspending, because of:
- it may sleep while accessing to I2C bus and, as result, WFI may be
reached in the middle of its execution and that may prevent system
from entering to OFF state.
- the accel device suspend handler may switch bm180 to sleep state while
bma180_accel_device_worklogic is still active.

Change-Id: I66d56c895a37cc9391cfbb095f6e9ee45be86e49
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
twl6030_bci_battery remove use_eeprom_config

In all sensible use cases use_eeprom_config and use_hw_charger are
actually synonymous so simplify the code and remove the use_eeprom_config.

Change-Id: Ibf473ea8106a72038f646e9163665caa91de9e06
Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
twl6030_bci_battery read charger mode from register

For the twl6032 read the charger mode and power path usage from a register
on the chip.

Because of this change these parameters no longer need to be provided by
platform data so move these variable to the private structure.

This change also means that these variables being set also implies
twl6032 is the chip type so simplify the code by removing checks
for this from features at each usage of one of these variables.

Change-Id: If371db6270e40edf2ee315696300cf29bd9e8ea8
Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>