pwm: Add new pwm-samsung driver

This patch introduces new Samsung PWM driver, which uses Samsung
PWM/timer master driver to control shared parts of the hardware.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
ARM: SAMSUNG: Rework private data handling in dev-backlight

This patch modifies dev-backlight helpers to get private data using
container_of instead of abusing platform_data field of PWM device.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
ARM: SAMSUNG: Modify board files to use new PWM platform device

This patch modifies any board files using the legacy PWM device to use
the new device instead.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
pwm: Remove superseded pwm-samsung-legacy driver

This patch removes the now unused pwm-samsung-legacy driver, which was
replaced by new pwm-samsung driver.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
ARM: SAMSUNG: Remove pwm-clock infrastructure

Since all the used PWM prescalers and dividers configuration has been
moved to appropriate drivers, the pwm-clock infrastructure is now
unused and so this patch removes it.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
ARM: SAMSUNG: Remove remaining uses of plat/regs-timer.h header

This patch removes remaining inclusions of plat/regs-timer.h as a
preparation to remove the header.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
ARM: SAMSUNG: Remove plat/regs-timer.h header

Since all uses of the header has been removed by previous patches it can
be removed safely.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
clocksource: samsung-pwm: Move samsung_pwm_alloc out ouf ifdef CONFIG_OF

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
[fixup] clocksource: samsung-pwm: Add infrastructure to share PWM hardware
[fixup] clocksource: samsung-pwm: Use platform data to setup the clocksource
clocksource: samsung-pwm: Correct programming of clock events

In current code, the tick count value programmed to the hardware is
always decremented by one. This is reasonable for periodic mode, since
there is one extra tick between 0 and COUNT (after reloading), but it
makes oneshot events happen 1 tick earlier than requested, because the
interrupt is triggered on transition from 1 to 0.

This patch removes the decrementation from PWM channel setup code and
moves it instead to periodic timer setup, to make both periodic and
oneshot modes work correctly.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
clocksource: samsung-pwm: Work around rounding errors in clockevents core

Due to rounding errors in clockevents core (in conversions between ticks
and nsecs), it might happen that the set_next_event callback gets called
with cycles = 0, causing the code to incorrectly program the PWM timer.

This patch modifies the callback to program the timer for 1 tick, if
received tick count value is 0.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>