History log of /linux-master/arch/arm/mach-omap1/board-sx1.c
Revision Date Author Comments
# 5bb578a0 09-May-2023 Linus Walleij <linus.walleij@linaro.org>

ARM: 9298/1: Drop custom mdesc->handle_irq()

ARM exclusively uses GENERIC_IRQ_MULTI_HANDLER, so at some point
set_handle_irq() needs to be called to handle system-wide
interrupts.

For all DT-enabled boards, this call happens down in the
drivers/irqchip subsystem, after locating the target irqchip
driver from the device tree.

We still have a few instances of the boardfiles with machine
descriptors passing a machine-specific .handle_irq() to the
ARM kernel core.

Get rid of this by letting the few remaining machines consistently
call set_handle_irq() from the end of the .init_irq() callback
instead and diet down one member from the machine descriptor.

Cc: Marc Zyngier <maz@kernel.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>


# 480c82da 30-Apr-2023 Linus Walleij <linus.walleij@linaro.org>

ARM: omap1: Remove reliance on GPIO numbers from SX1

It appears this happens because the OMAP driver now
allocates GPIO numbers dynamically, so all that is
references by number is a bit up in the air.

Utilize the NULL device to define some board-specific
GPIO lookups and use these to immediately look up the
same GPIOs, convert to IRQ numbers and pass as resources
to the devices. This is ugly but should work.

Fixes: 92bf78b33b0b ("gpio: omap: use dynamic allocation of base")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>


# 9a99b142 04-Jan-2023 Arnd Bergmann <arnd@arndb.de>

ARM: omap1: merge omap1_map_io functions

The OMAP15xx/OMAP16xx variants are exactly the same, so merge them
into one.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>


# 7e0a9e62 06-Aug-2019 Arnd Bergmann <arnd@arndb.de>

ARM: omap1: move mach/*.h into mach directory

Most of the header files are no longer referenced from outside
arch/arm/mach-omap1, so move them all to that place directly
and change their users to use the new location.

The exceptions are:

- mach/compress.h is used by the core architecture code
- mach/serial.h is used by mach/compress.h

The mach/memory.h is empty and gets removed in the process,
avoiding the need for CONFIG_NEED_MACH_MEMORY_H.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>


# e8e77e97 06-Aug-2019 Arnd Bergmann <arnd@arndb.de>

ARM: omap1: move mach/usb.h to include/linux/soc

The register definitions in this header are used in at least four
different places, with little hope of completely cleaning that up.

Split up the file into a portion that becomes a linux-wide header
under include/linux/soc/ti/, and the parts that are actually only
needed by board files.

Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>


# d2912cb1 04-Jun-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500

Based on 2 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 4122 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Enrico Weigelt <info@metux.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d25c70cf 22-Aug-2017 Bhumika Goyal <bhumirks@gmail.com>

ARM: omap1: add const and initconst to omap_lcd_config

Make these const as they are only passed to a const argument of the function
omapfb_set_lcd_config.
Also, replace __initdata with __initconst to avoid section conflict error.
Done using Coccinelle.

@match disable optional_qualifier@
identifier s;
@@
static struct omap_lcd_config s = {...};

@ref@
position p;
identifier match.s;
@@
s@p

@good1@
identifier match.s;
position ref.p;
@@
omapfb_set_lcd_config(&s@p,...)

@bad depends on !good1@
position ref.p;
identifier match.s;
@@
s@p

@depends on forall !bad disable optional_qualifier@
identifier match.s;
@@
static
+ const
struct omap_lcd_config s;

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 100f9638 30-Jan-2015 Arnd Bergmann <arnd@arndb.de>

ARM: omap1: make headers more local

Some header files are never included outside of a mach-omap1
directory and do not need to be made visible in include/mach,
so let's just move them all down one level.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Tony Lindgren <tony@atomide.com>


# b694331c 20-May-2015 Tony Lindgren <tony@atomide.com>

ARM: omap1: Switch to use MULTI_IRQ

This allows us to get a bit further with SPARSE_IRQ and
MULTIARCH support.

Note that we now also rename omap_irq_flags to omap_l2_irq
as that's the omap_irq_flags naming is confusing. It just
contains the interrupt number for the l2 irq.

Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 4906cc73 15-May-2014 Paul Bolle <pebolle@tiscali.nl>

ARM: OMAP: SX1: remove check for CONFIG_SX1_OLD_FLASH

A check for CONFIG_SX1_OLD_FLASH was added in v2.6.24. But the related
Kconfig symbol was never part of the tree. So we can remove some dead
code.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# b6a85477 15-Jun-2013 Jarkko Nikula <jarkko.nikula@bitmer.com>

ARM: OMAP1: Remove legacy irda.h and irda setup from board files

omap-ir.c driver has never been upstream and was also removed from
linux-omap.git four years ago (See linux-omap.git commit efd1e3f
("REMOVE OMAP LEGACY CODE: Reset drivers/net/irda to mainline")).

Therefore remove needless device registration from a few board files
and delete thus to be unused arch/arm/mach-omap1/include/mach/irda.h
and unused OMAP_DMA_UART3_* definitions from dma.h.

Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 6bb27d73 08-Nov-2012 Stephen Warren <swarren@nvidia.com>

ARM: delete struct sys_timer

Now that the only field in struct sys_timer is .init, delete the struct,
and replace the machine descriptor .timer field with the initialization
function itself.

This will enable moving timer drivers into drivers/clocksource without
having to place a public prototype of each struct sys_timer object into
include/linux; the intent is to create a single of_clocksource_init()
function that determines which timer driver to initialize by scanning
the device dtree, much like the proposed irqchip_init() at:
http://www.spinics.net/lists/arm-kernel/msg203686.html

Includes mach-omap2 fixes from Igor Grinberg.

Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Stephen Warren <swarren@nvidia.com>


# 45c3eb7d 30-Nov-2012 Tony Lindgren <tony@atomide.com>

ARM: OMAP: Move plat-omap/dma-omap.h to include/linux/omap-dma.h

Based on earlier discussions[1] we attempted to find a suitable
location for the omap DMA header in commit 2b6c4e73 (ARM: OMAP:
DMA: Move plat/dma.h to plat-omap/dma-omap.h) until the conversion
to dmaengine is complete.

Unfortunately that was before I was able to try to test compile
of the ARM multiplatform builds for omap2+, and the end result
was not very good.

So I'm creating yet another all over the place patch to cut the
last dependency for building omap2+ for ARM multiplatform. After
this, we have finally removed the driver dependencies to the
arch/arm code, except for few drivers that are being worked on.

The other option was to make the <plat-omap/dma-omap.h> path
to work, but we'd have to add some new header directory to for
multiplatform builds.

Or we would have to manually include arch/arm/plat-omap/include
again from arch/arm/Makefile for omap2+.

Neither of these alternatives sound appealing as they will
likely lead addition of various other headers exposed to the
drivers, which we want to avoid for the multiplatform kernels.

Since we already have a minimal include/linux/omap-dma.h,
let's just use that instead and add a note to it to not
use the custom omap DMA functions any longer where possible.

Note that converting omap DMA to dmaengine depends on
dmaengine supporting automatically incrementing the FIFO
address at the device end, and converting all the remaining
legacy drivers. So it's going to be few more merge windows.

[1] https://patchwork.kernel.org/patch/1519591/#

cc: Russell King <linux@arm.linux.org.uk>
cc: Kevin Hilman <khilman@ti.com>
cc: "Benoît Cousson" <b-cousson@ti.com>
cc: Herbert Xu <herbert@gondor.apana.org.au>
cc: "David S. Miller" <davem@davemloft.net>
cc: Vinod Koul <vinod.koul@intel.com>
cc: Dan Williams <djbw@fb.com>
cc: Mauro Carvalho Chehab <mchehab@infradead.org>
cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
cc: David Woodhouse <dwmw2@infradead.org>
cc: Kyungmin Park <kyungmin.park@samsung.com>
cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
cc: Hans Verkuil <hans.verkuil@cisco.com>
cc: Vaibhav Hiremath <hvaibhav@ti.com>
cc: Lokesh Vutla <lokeshvutla@ti.com>
cc: Rusty Russell <rusty@rustcorp.com.au>
cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
cc: Afzal Mohammed <afzal@ti.com>
cc: linux-crypto@vger.kernel.org
cc: linux-media@vger.kernel.org
cc: linux-mtd@lists.infradead.org
cc: linux-usb@vger.kernel.org
cc: linux-fbdev@vger.kernel.org
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# f300af86 01-Oct-2012 Lokesh Vutla <lokeshvutla@ti.com>

ARM: OMAP1: Remove omap_reserve() callback for all omap1 boards

omap_reserve() is a stub for omap1. So dropping
omap_reserve callback from all OMAP1 board files.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 54b693d4 02-Oct-2012 Tony Lindgren <tony@atomide.com>

ARM: OMAP1: Move plat/tc.h to mach/tc.h for omap1

We cannot keep this in plat as it causes problems
with the ARM single zImage support.

Cc: Felipe Balbi <balbi@ti.com>
Cc: linux-pcmcia@lists.infradead.org
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 2b6c4e73 15-Oct-2012 Lokesh Vutla <lokeshvutla@ti.com>

ARM: OMAP: DMA: Move plat/dma.h to plat-omap/dma-omap.h

Move plat/dma.h to plat-omap/dma-omap.h as part of single
zImage work

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 8c4cc005 15-Oct-2012 Lokesh Vutla <lokeshvutla@ti.com>

ARM: OMAP1: DMA: Moving OMAP1 DMA channel definitions to mach-omap1

Some of the omap1 dma channel definitions are used by some drivers.
For moving omap1 dma channel definitions to mach-omap1/, the used
ones should be defined locally to driver. Driver can eliminate it
by using DT, platform data, or IORESOURCE_DMA.
And moving OMAP1 DMA channel definitions to mach-omap1

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 2f7cd573 20-Sep-2012 Tony Lindgren <tony@atomide.com>

ARM: OMAP1: Move irda.h from plat to mach

This is only used by omap1.

Signed-off-by: Tony Lindgren <tony@atomide.com>


# 578fad4d 20-Sep-2012 Tony Lindgren <tony@atomide.com>

ARM: OMAP1: Move flash.h from plat to mach

This is only used by omap1.

Signed-off-by: Tony Lindgren <tony@atomide.com>


# c392b21d 20-Sep-2012 Tony Lindgren <tony@atomide.com>

ARM: OMAP1: Move board-sx1.h from plat to mach

This is only used by omap1.

Signed-off-by: Tony Lindgren <tony@atomide.com>


# 70c494c3 19-Sep-2012 Tony Lindgren <tony@atomide.com>

ARM: OMAP1: Make plat/mux.h omap1 only

We are moving omap2+ to use the device tree based pinctrl-single.c
and will be removing the old mux framework. This will remove the
omap1 specific parts from plat-omap.

Acked-by: Felipe Balbi <balbi@ti.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: linux-usb@vger.kernel.org
Cc: linux-pcmcia@lists.infradead.org
Cc: spi-devel-general@lists.sourceforge.net
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 2203747c 24-Aug-2012 Arnd Bergmann <arnd@arndb.de>

ARM: omap: move platform_data definitions

Platform data for device drivers should be defined in
include/linux/platform_data/*.h, not in the architecture
and platform specific directories.

This moves such data out of the omap include directories

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Tony Lindgren <tony@atomide.com>
Cc: Kevin Hilman <khilman@ti.com>
Cc: "Benoît Cousson" <b-cousson@ti.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Ohad Ben-Cohen <ohad@wizery.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Omar Ramirez Luna <omar.ramirez@ti.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Jarkko Nikula <jarkko.nikula@bitmer.com>
Cc: Liam Girdwood <lrg@ti.com>
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: Jean Pihet <j-pihet@ti.com>
Cc: J Keerthy <j-keerthy@ti.com>
Cc: linux-omap@vger.kernel.org


# ad6c9101 28-Aug-2012 Igor Grinberg <grinberg@compulab.co.il>

ARM: OMAP1: move lcd pdata out of arch/arm/*

omap1 lcd platform data resides inside plat/board.h while it
should be inside include/linux/...
Move the omap1 lcd platform data to include/linux/omapfb.h.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# b924b204 04-Jun-2012 Tony Lindgren <tony@atomide.com>

ARM: OMAP: Make FS USB omap1 only

As the FS USB code is not being actively used for omap2+
there's no point keeping it around for omap2+.

Let's make the FS USB platform init code omap1 only so
we can remove the last user of omap_read/write for omap2+,
and simplify things for further USB, DMA, and device tree
related work.

While at it, also group the mach includes for the related
drivers.

Cc: linux-usb@vger.kernel.org
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 82c3bd03 25-Apr-2012 Shawn Guo <shawn.guo@linaro.org>

ARM: omap1: use machine specific hook for late init

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Tony Lindgren <tony@atomide.com>


# 2e3ee9f4 24-Feb-2012 Tony Lindgren <tony@atomide.com>

ARM: OMAP1: Move most of plat/io.h into local iomap.h

There's no need to have these in plat/io.h.

While at it, clean up the includes to group them
like they typically are grouped.

Signed-off-by: Tony Lindgren <tony@atomide.com>


# 5f1cc13f 20-Sep-2011 Tomi Valkeinen <tomi.valkeinen@ti.com>

OMAP1: Remove unused LCD devices from board files

Some OMAP1 board files define LCD platform_devices, but there are no
corresponding LCD drivers for those in the kernel. Thus remove these LCD
devices.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>


# ddba6c7f 20-Sep-2011 Tomi Valkeinen <tomi.valkeinen@ti.com>

OMAP1: pass LCD config with omapfb_set_lcd_config()

LCD config for old omapfb driver is passed with OMAP_TAG_LCD from board
files or from the bootloader. In an effort to remove OMAP_TAG_LCD, this
patch adds omapfb_set_lcd_config() function that the board files can
call to set the LCD config.

This has the drawback that configuration can no longer come from the
bootloader. Of the boards supported by the kernel, this should only
affect N770 which depends on the data from the bootloader. This patch
adds an LCD config for N770 to its board files, but that is most
probably broken. Fixing this would need information about the HW setup
in N770 boards.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>


# baa95883 05-Nov-2011 Russell King <rmk+kernel@arm.linux.org.uk>

ARM: restart: omap: use new restart hook

Hook these platforms restart code into the new restart hook rather
than using arch_reset().

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>


# 4e65331c 10-Nov-2011 Tony Lindgren <tony@atomide.com>

ARM: 7159/1: OMAP: Introduce local common.h files

As suggested by Russell King - ARM Linux <linux@arm.linux.org.uk>,
there's no need to keep local prototypes in non-local headers.

Add mach-omap1/common.h and mach-omap2/common.h and move the
local prototypes there from plat/common.h and mach/omap4-common.h.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>


# dc28094b 31-Jul-2011 Paul Gortmaker <paul.gortmaker@windriver.com>

arm: Add export.h to ARM specific files as required.

These files all make use of one of the EXPORT_SYMBOL variants
or the THIS_MODULE macro. So they will need <linux/export.h>

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>


# 7b88e62f 05-Oct-2011 Tony Lindgren <tony@atomide.com>

ARM: OMAP1: Use generic map_io, init_early and init_irq

This allows removing omap hacks for map_io allowing generic
map_io.

Note that in the future we can't do cpu_is_omapxxxx detection
until in init_early. This means that board-innovator.c now
assumes 15xx only, and board-generic.c assumes 16xx only.
This is best fixed later on by passing the SoC type from
device tree.

Signed-off-by: Tony Lindgren <tony@atomide.com>


# 246e389d 05-Jul-2011 Nicolas Pitre <nico@fluxnic.net>

ARM: mach-omap1: convert boot_params to atag_offset

Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>


# 2f8163ba 26-Jul-2011 Russell King <rmk+kernel@arm.linux.org.uk>

ARM: gpio: convert includes of mach/gpio.h and asm/gpio.h to linux/gpio.h

Convert arch/arm includes of mach/gpio.h and asm/gpio.h to linux/gpio.h
before we start consolidating the individual platform implementations
of the gpio header files.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>


# e74984e4 29-Mar-2011 Tony Lindgren <tony@atomide.com>

omap: Set separate timer init functions to avoid cpu_is_omap tests

This is needed for the following patches so we can initialize the
rest of the hardware timers later on.

As with the init_irq calls, there's no need to do cpu_is_omap calls
during the timer init as we only care about the major omap generation.
This means that we can initialize the sys_timer with the .timer
entries alone.

Note that for now we just set stubs for the various sys_timer entries
that will get populated in a later patch. The following patches will
also remove the omap_dm_timer_init calls and change the init for the
rest of the hardware timers to happen with an arch_initcall.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>


# 741e3a89 17-May-2011 Tony Lindgren <tony@atomide.com>

omap: Use separate init_irq functions to avoid cpu_is_omap tests early

This allows us to remove cpu_is_omap calls from init_irq functions.
There should not be any need for cpu_is_omap calls as at this point.
During the timer init we only care about SoC generation, and not about
subrevisions.

The main reason for the patch is that we want to initialize only
minimal omap specific code from the init_early call.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>


# 25985edc 30-Mar-2011 Lucas De Marchi <lucas.demarchi@profusion.mobi>

Fix common misspellings

Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>


# da1f026b 20-Dec-2010 Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>

Keyboard: omap-keypad: use matrix_keypad.h

Most keypad drivers make use of the <linux/input/matrix_keypad.h>
defined macros, structures and inline functions.

Convert omap-keypad driver to use those as well, as suggested by a
compile time warning, hardcoded into the OMAP <palt/keypad.h>.

Created against linux-2.6.37-rc5.
Tested on Amstrad Delta.
Compile tested with omap1_defconfig and omap2plus_defconfig shrinked to
board-h4.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Reviewed-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 77640aab 07-Dec-2010 Varadarajan, Charulatha <charu@ti.com>

OMAP: GPIO: Implement GPIO as a platform device

Implement GPIO as a platform device.

GPIO APIs are used in machine_init functions. Hence it is
required to complete GPIO probe before board_init. Therefore
GPIO device register and driver register are implemented as
postcore_initcalls.

omap_gpio_init() does nothing now and this function would be
removed in the next patch as it's usage is spread across most
of the board files.

Inorder to convert GPIO as platform device, modifications are
required in clockxxxx_data.c file for OMAP1 so that device names
can be used to obtain clock instead of getting clocks by
name/NULL ptr.

Use runtime pm APIs (pm_runtime_put*/pm_runtime_get*) for enabling
or disabling the clocks, modify sysconfig settings and remove usage
of clock FW APIs.
Note 1: Converting GPIO driver to use runtime PM APIs is not done as a
separate patch because GPIO clock names are different for various OMAPs
and are different for some of the banks in the same CPU. This would need
usage of cpu_is checks and bank id checks while using clock FW APIs in
the gpio driver. Hence while making GPIO a platform driver framework,
PM runtime APIs are used directly.

Note 2: While implementing GPIO as a platform device, pm runtime APIs
are used as mentioned above and modification is not done in gpio's
prepare for idle/ resume after idle functions. This would be done
in the next patch series and GPIO driver would be made to use dev_pm_ops
instead of sysdev_class in that series only.

Due to the above, the GPIO driver implicitly relies on
CM_AUTOIDLE = 1 on its iclk for power management to work, since the
driver never disables its iclk.
This would be taken care in the next patch series (see Note 3 below).

Refer to
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg39112.html
for more details.

Note 3: only pm_runtime_get_sync is called in gpio's probe() and
pm_runtime_put* is never called. This is to make the implementation
similar to the existing GPIO code. Another patch series would be sent
to correct this.

In OMAP3 and OMAP4 gpio's debounce clocks are optional clocks. They
are enabled/ disabled whenever required using clock framework APIs

TODO:
1. Cleanup the GPIO driver. Use function pointers and register
offest pointers instead of using hardcoded values
2. Remove all cpu_is_ checks and OMAP specific macros
3. Remove usage of gpio_bank array so that only
instance specific information is used in driver code
4. Rename 'method'/ avoid it's usage
5. Fix the non-wakeup gpios handling for OMAP2430, OMAP3 & OMAP4
6. Modify gpio's prepare for idle/ resume after idle functions
to use runtime pm implentation.

Signed-off-by: Charulatha V <charu@ti.com>
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Reviewed-by: Basak, Partha <p-basak2@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
[tony@atomide.com: updated for bank specific revision and updated boards]
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 6451d778 14-Oct-2010 Nicolas Pitre <nico@fluxnic.net>

arm: remove machine_desc.io_pg_offst and .phys_io

Since we're now using addruart to establish the debug mapping, we can
remove the io_pg_offst and phys_io members of struct machine_desc.

The various declarations were removed using the following script:

grep -rl MACHINE_START arch/arm | xargs \
sed -i '/MACHINE_START/,/MACHINE_END/ { /\.\(phys_io\|io_pg_offst\)/d }'

[ Initial patch was from Jeremy Kerr, example script from Russell King ]

Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Acked-by: Eric Miao <eric.miao at canonical.com>


# 71ee7dad 23-May-2010 Russell King <rmk+kernel@arm.linux.org.uk>

ARM: OMAP: Convert to use ->reserve method to reserve boot time memory

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>


# dd0cdd88 05-Jul-2010 Tony Lindgren <tony@atomide.com>

omap: Move omap1 USB platform init code into mach-omap1/usb.c

Move omap1 FS USB platform init code into mach-omap1/usb.c

Signed-off-by: Tony Lindgren <tony@atomide.com>


# 561b036a 15-Feb-2010 Ladislav Michl <ladis@linux-mips.org>

omap: convert boards to use physmap-flash

Convert OMAP based boards to use physmap-flash. Refreshed against today's
Linux omap kernel tree

Cc: linux-mtd@lists.infradead.org
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# c33da3a8 22-Oct-2009 Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>

omap1: Fix redundant UARTs pin muxing that can break other hardware support

Commit 15ac408ee5a509053a765b816e9179515329369f removed enabled_uart
and OMAP_TAG_UART. This works for mach-omap2, but causes issues on
mach-omap1 for some boards as the mach-omap1 serial.c was muxing
pins based on the enabled_uart flag for 15xx.

Fix this by muxing pins in board-*.c files for the 15xx boards for
the uart ports that had enabled_uart flag set before the commit
above.

Tested on Amsdtrad Delta only.

Note that in the future we should add support for powering down
the uarts with a timer like mach-omap2/serial.c does. Otherwise
the enabled uarts will be blocking retention-while-idle.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# ce491cf8 20-Oct-2009 Tony Lindgren <tony@atomide.com>

omap: headers: Move remaining headers from include/mach to include/plat

Move the remaining headers under plat-omap/include/mach
to plat-omap/include/plat. Also search and replace the
files using these headers to include using the right path.

This was done with:

#!/bin/bash
mach_dir_old="arch/arm/plat-omap/include/mach"
plat_dir_new="arch/arm/plat-omap/include/plat"
headers=$(cd $mach_dir_old && ls *.h)
omap_dirs="arch/arm/*omap*/ \
drivers/video/omap \
sound/soc/omap"
other_files="drivers/leds/leds-ams-delta.c \
drivers/mfd/menelaus.c \
drivers/mfd/twl4030-core.c \
drivers/mtd/nand/ams-delta.c"

for header in $headers; do
old="#include <mach\/$header"
new="#include <plat\/$header"
for dir in $omap_dirs; do
find $dir -type f -name \*.[chS] | \
xargs sed -i "s/$old/$new/"
done
find drivers/ -type f -name \*omap*.[chS] | \
xargs sed -i "s/$old/$new/"
for file in $other_files; do
sed -i "s/$old/$new/" $file
done
done

for header in $(ls $mach_dir_old/*.h); do
git mv $header $plat_dir_new/
done

Signed-off-by: Tony Lindgren <tony@atomide.com>


# 15ac408e 28-Aug-2009 Kalle Valo <kalle.valo@iki.fi>

OMAP: UART: drop OMAP_TAG_UART, enable all UARTs, auto-disabled on idle

OMAP tags are deprecrated so drop them.

Drop UART config data which decides which UARTs to enable during boot.
This is no longer necessary since serial core code disables clocks
after inactivity.

Background: with new UART idle code, all on-chip UARTs are idled using
a configurable inactivity timer (default 5 seconds.) After the
inactivity timer, UART clocks are disabled automatically.

Signed-off-by: Kalle Valo <kalle.valo@iki.fi>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# b0b5aa3f 23-Mar-2009 Felipe Balbi <felipe.balbi@nokia.com>

ARM: OMAP: get rid of OMAP_TAG_USB, v2

OMAP_TAGS should vanish soon since they're not generic arm tags.
Most of them can be converted to a platform_data or parsed
from a command line like e.g. serial tag.

For OMAP_TAG_USB we just let boards call omap_usb_init()
passing a pointer to omap_usb_config.

Patch updated by Tony for mainline, basically make
n770 and h4 compile. Also folded in a fix for OSK
by David Brownell <dbrownell@users.sourceforge.net>.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# b2830810 23-Mar-2009 Tony Lindgren <tony@atomide.com>

ARM: OMAP: No need to include board-palm*.h from hardware.h

Move the defines to the associated board file and remove
the now unnecessary header files.

Signed-off-by: Tony Lindgren <tony@atomide.com>


# e999bbe7 15-Jan-2009 Tony Lindgren <tony@atomide.com>

ARM: OMAP: Remove unused platform devices, v3

This patch removes old platform devices. Alsa should now
be using the ASoC driver. For boards not yet using ASoC,
please see sound/soc/omap/osk5912.c.

Add dummy aic23_power_up and aic23_power_down functions for 770
to keep things compiling.

Remove references to omap_gpio_switch, and unused h2_nand_dev_ready
function.

This patch is based on an earlier patch by Arun KS.

Cc: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Arun KS <arunks@mistralsolutions.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 73069e38 15-Jan-2009 Jarkko Nikula <jarkko.nikula@nokia.com>

ARM: OMAP: Fix gpio by switching to generic gpio calls, v2

Fix compile by removing remaining omap specific gpio
calls. Based on earlier patches by Jarkko Nikula.

Also remove old GPIO key code, there is already a patch
to do this with gpio_keys.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 652bcd8f 10-Dec-2008 Tony Lindgren <tony@atomide.com>

omap mmc: Remove broken MMC init code

Most of the omap1 MMC boards got broken by an earlier patch
138ab9f8321f67c71984ca43222efa71b0a0a0a9. If you look closely,
the MMC init funtions are pretty much just stubs.

Remove broken init code to make room for cleaner MMC init code.

Cc: Pierre Ossman <drzeus-mmc@drzeus.cx>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# e918edf7 10-Dec-2008 David Brownell <dbrownell@users.sourceforge.net>

ARM: OMAP: switch to gpio_direction_output

More conversion to the standard GPIO interfaces: stop using
omap_set_gpio_direction() entirely, and switch over to the
gpio_direction_output() call.

Note that because gpio_direction_output() includes the initial
value, this change isn't quite transparent.

- For the call sites which defined an initial value either
before or after setting the direction, that value was used.

When that value was previously assigned afterwards, this
could eliminate a brief output glitch ... and possibly
change behavior. In a few cases (LCDs) several values
were assigned together ... those were re-arranged to match
the explicit sequence provided.

- Some call sites didn't define such a value; so I chose an
initial "off/reset" value that seemed to default to "off".

In short, files touched by this patch might notice some small
changes in startup behavior (with trivial fixes).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 0b84b5ca 10-Dec-2008 David Brownell <dbrownell@users.sourceforge.net>

ARM: OMAP: switch to standard gpio get/set calls

This patch replaces some legacy OMAP GPIO calls with the "new" (not
really, any more!) calls that work on most platforms.

The calls addressed by this patch are the simple ones to get and set
values ... for code that's in mainline, including the implementations
of those calls.

Except for the declarations and definitions of those calls, all of
these changes were performed by a simple SED script. Plus, a few
"if() set() else set()" branches were merged by hand.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# a09e64fb 05-Aug-2008 Russell King <rmk@dyn-67.arm.linux.org.uk>

[ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach

This just leaves include/asm-arm/plat-* to deal with.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>


# be509729 04-Aug-2008 Russell King <rmk@dyn-67.arm.linux.org.uk>

[ARM] Remove asm/hardware.h, use asm/arch/hardware.h instead

Remove includes of asm/hardware.h in addition to asm/arch/hardware.h.
Then, since asm/hardware.h only exists to include asm/arch/hardware.h,
update everything to directly include asm/arch/hardware.h and remove
asm/hardware.h.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>


# c9a2c46d 24-Feb-2008 Jean Delvare <khali@linux-fr.org>

ARM: OMAP: Release i2c_adapter after use (Siemens SX1)

Each call to i2c_get_adapter() must be followed by a call to
i2c_put_adapter() to release the grabbed reference. Otherwise the
reference count grows forever and the adapter can never be
unregistered.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Vladimir Ananiev <vovan888@gmail.com>
Acked-by: Tony Lindgren <tony@atomide.com>


# e27a93a9 18-Dec-2007 Tony Lindgren <tony@atomide.com>

ARM: OMAP1: Misc clean-up

This patch cleans up omap1 files to sync up with linux-omap tree:

- Remove omap-generic MMC config as it should be defined in board-*.c files
instead of using board-generic.c
- New style I2C board_info from David Brownell <dbrownell@users.sourceforge.net>
- Init section fixes from Dirk Behme <dirk.behme@googlemail.com>

Signed-off-by: Tony Lindgren <tony@atomide.com>


# 1ed16a86 06-Nov-2007 Jarkko Nikula <jarkko.nikula@nokia.com>

ARM: OMAP1: Use I2C bus registration helper for omap1

This patch starts using introduced I2C bus registration helper by cleaning
up registration currently done in various places and by doing necessary
board file modifications.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 087c5030 29-Nov-2007 Carlos Eduardo Aguiar <carlos.aguiar@indt.org.br>

ARM: OMAP1: Use MMC multislot structures for Siemens SX1 board

Use MMC multislot structures for Siemens SX1 board

Signed-off-by: Carlos Eduardo Aguiar <carlos.aguiar@indt.org.br>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# c79ed194 06-Dec-2006 Vladimir Ananiev <vovan888@gmail.com>

ARM: OMAP: Basic support for siemens sx1

This adds basic support for Siemens SX1. More patches are available,
with video driver, mixer, and serial ports working. That is enough to
do gsm calls with right userland.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Tony Lindgren <tony@atomide.com>