V4L: Add BCM2048 radio driver

This adds V4L support for the BCM2048 radio module.

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Signed-off-by: Joni Lapilainen <joni.lapilainen@gmail.com>
V4L: Add BCM2048 radio driver to kernel config

Signed-off-by: Joni Lapilainen <joni.lapilainen@gmail.com>
media: rc: Introduce RX51 IR transmitter driver

This is the driver for the IR transmitter diode found on the Nokia
N900 (also known as RX51) device. The driver is mostly the same as
found in the original 2.6.28 based kernel that comes with the device.

The following modifications have been made compared to the original
driver version:

- Adopt to the changes that has happen in the kernel during the past
  five years, such as the change in the include paths

- The OMAP DM-timers require much more care nowadays. The timers need
  to be enabled and disabled or otherwise many actions fail. Timers
  must not be freed without first stopping them or otherwise the timer
  cannot be requested again.

The code has been tested with sending IR codes with N900 device
running Debian userland. The device receiving the codes was Anysee
DVB-C USB receiver.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
Signed-off-by: Joni Lapilainen <joni.lapilainen@gmail.com>
ARM: mach-omap2: board-rx51-peripherals: Add lirc-rx51 data

The IR diode on the RX51 is connected to the GPT9. This data is needed
for the IR driver to function.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
Signed-off-by: Joni Lapilainen <joni.lapilainen@gmail.com>
ir-rx51: Adjust dependencies

Although this kind of IR diode circuitry is known to exist only in
N900 hardware, nothing prevents making similar circuitry on any OMAP
based board. The MACH_NOKIA_RX51 dependency is thus not something we
want to be there.

Also, this should depend on LIRC as it is a LIRC driver.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
Signed-off-by: Joni Lapilainen <joni.lapilainen@gmail.com>
ir-rx51: Handle signals properly

The lirc-dev expects the ir-code to be transmitted when the write call
returns back to the user space. We should not leave TX ongoing no
matter what is the reason we return to the user space. Easiest
solution for that is to simply remove interruptible sleeps.

The first wait_event_interruptible is thus replaced with return -EBUSY
in case there is still ongoing transfer. This should suffice as the
concept of sending multiple codes in parallel does not make sense.

The second wait_event_interruptible call is replaced with
wait_even_timeout with a fixed and safe timeout that should prevent
the process from getting stuck in kernel for too long.

Also, from now on we will force the TX to stop before we return from
write call. If the TX happened to time out for some reason, we should
not leave the HW transmitting anything.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
Signed-off-by: Joni Lapilainen <joni.lapilainen@gmail.com>
ir-rx51: Trivial fixes

-Fix typo

-Change pwm_timer_num type to match type in platform data

-Remove extra parenthesis

-Replace magic constant with proper bit defintions

-Remove duplicate exit pointer

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
Signed-off-by: Joni Lapilainen <joni.lapilainen@gmail.com>
ir-rx51: Clean up timer initialization code

Remove a redundant macro definition. This is unneeded and becomes more
readable once the actual timer code is refactored a little.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
Signed-off-by: Joni Lapilainen <joni.lapilainen@gmail.com>
ir-rx51: Move platform data checking into probe function

This driver is useless without proper platform data. If data is not
available, we should not register the driver at all. Once this check
is done, the BUG_ON check during device open is no longer needed.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
Signed-off-by: Joni Lapilainen <joni.lapilainen@gmail.com>
ir-rx51: Replace module_{init, exit} macros with module_platform_driver

No reason to avoid using the existing helpers.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
Signed-off-by: Joni Lapilainen <joni.lapilainen@gmail.com>
ir-rx51: Convert latency constraints to PM QoS API

Convert the driver from the obsolete omap_pm_set_max_mpu_wakeup_lat
API to the new PM QoS API. This allows the callback to be removed from
the platform data structure.

The latency requirements are also adjusted to prevent the MPU from
going into sleep mode. This is needed as the GP timers have no means
to wake up the MPU once it has gone into sleep. The "side effect" is
that from now on the driver actually works even if there is no
background load keeping the MPU awake.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Jean Pihet <j-pihet@ti.com>
Signed-off-by: Joni Lapilainen <joni.lapilainen@gmail.com>
ir-rx51: Remove useless variable from struct lirc_rx51

As clearly visible from the patch, this variable has no useful purpose
what so ever. Thus, it can be removed altogether without any side
effects.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
Signed-off-by: Joni Lapilainen <joni.lapilainen@gmail.com>
ir-rx51: Add missing quote mark in Kconfig text

This trivial fix cures the following warning message:

drivers/media/rc/Kconfig:275:warning: multi-line strings not supported

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
Signed-off-by: Joni Lapilainen <joni.lapilainen@gmail.com>
arm: omap: sram: skip the first 16K on OMAP3 HS

In some OMAP3 HS devices (at least Nokia N9 and N950), the public SRAM
seems to conflict with secure portition of SRAM. When booting the 3.6-rc3
kernel (and also earlier) on these devices, the kernel gets tainted with
tons of the following warnings:

	[    6.894348] In-band Error seen by MPU  at address 0
	[...]
	[    6.894378] WARNING: at arch/arm/mach-omap2/omap_l3_smx.c:162

Fix this by skipping the first 16K of the public SRAM. (Note that the
mapping could not be changed, as it resulted in secure monitor call
failure in save_secure_sram().)

This will leave 12K SRAM available that should be still sufficient. The
patch has been boot tested with vanilla 3.6-rc3 on N900, N950 and N9.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Joni Lapilainen <joni.lapilainen@gmail.com>