]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
12 years agoARM: at91: dt: enable usb ohci for sam9g20, sam9g45 amd sam9x5
Jean-Christophe PLAGNIOL-VILLARD [Sun, 20 Nov 2011 22:55:18 +0000 (06:55 +0800)]
ARM: at91: dt: enable usb ohci for sam9g20, sam9g45 amd sam9x5

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: devicetree-discuss@lists.ozlabs.org
12 years agoARM: at91: usb ohci add dt support
Jean-Christophe PLAGNIOL-VILLARD [Sun, 20 Nov 2011 22:55:18 +0000 (06:55 +0800)]
ARM: at91: usb ohci add dt support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoARM: at91: add Shutdown Controller (SHDWC) DT support
Jean-Christophe PLAGNIOL-VILLARD [Fri, 2 Mar 2012 13:01:00 +0000 (21:01 +0800)]
ARM: at91: add Shutdown Controller (SHDWC) DT support

Use a string to specific the wakeup mode to make it more readable.

Add the Real-time Clock Wake-up support too for sam9g45 and sam9x5.
Add AT91_SHDW_CPTWK0_MAX to specific the Max of the Wakeup Counter.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91: add ram controller DT support
Jean-Christophe PLAGNIOL-VILLARD [Fri, 2 Mar 2012 12:54:37 +0000 (20:54 +0800)]
ARM: at91: add ram controller DT support

We can now drop the call to ioremap_registers() as we have the binding for the
SDRAM/DDR Controller.

Drop ioremap_registers() for sam9x5 too.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91: add RSTC (Reset Controller) dt support
Jean-Christophe PLAGNIOL-VILLARD [Fri, 2 Mar 2012 19:16:27 +0000 (03:16 +0800)]
ARM: at91: add RSTC (Reset Controller) dt support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91: always enable sam9 restart
Jean-Christophe PLAGNIOL-VILLARD [Fri, 2 Mar 2012 19:14:16 +0000 (03:14 +0800)]
ARM: at91: always enable sam9 restart

This is need for multiple SoC in the same kernel image and DT.
As we will chose the restart function via binding.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91: add pmc DT support
Jean-Christophe PLAGNIOL-VILLARD [Fri, 2 Mar 2012 12:44:23 +0000 (20:44 +0800)]
ARM: at91: add pmc DT support

Specified the main Oscillator via clock binding.
This will allow to do not hardcode it anymore in the DT board at 12MHz.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91/dt: add specific DT soc init
Jean-Christophe PLAGNIOL-VILLARD [Tue, 28 Feb 2012 05:57:51 +0000 (13:57 +0800)]
ARM: at91/dt: add specific DT soc init

This will allow to have static Device mapping and DT probe mapping for the
System Controller.

Temporary keep the call to ioremap_registers() until we have the binding
for the SDRAM/DDR Controller.

Temporary keep the main clock hardcoded to 12MHz until we have the binding
for the PMC.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91/dt: add Calao DAB-MMX daugther board support for USB-A9G20
Jean-Christophe PLAGNIOL-VILLARD [Mon, 6 Feb 2012 12:23:21 +0000 (20:23 +0800)]
ARM: at91/dt: add Calao DAB-MMX daugther board support for USB-A9G20

http://www.calao-systems.com/articles.php?lng=en&pg=6099

this daughter board add the following device:
 - Micro-SD socket
 - TTL 3V3 - (Tx/Rx/RTS/CTS)
 - I2C port
 - 0.96" Serial OLED Display Module (over UART)
 - MP3 decoder with Micro & Speakers
 - 4x PB, 4x Leds (Blue), 3x Leds (Green, Orange, Red)

for now we add only the 2 UARTs, 4 Buttons, 7 leds and i2c via DT

used_led1 will not be re-add via DT as it's used by the motherboard too

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
12 years agoARM: at91: sam9x5 add i2c DT support
Jean-Christophe PLAGNIOL-VILLARD [Thu, 23 Feb 2012 14:50:32 +0000 (22:50 +0800)]
ARM: at91: sam9x5 add i2c DT support

For now on use i2c-gpio driver on the same pin as the hardware IP.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91: sam9g45 add i2c DT support
Jean-Christophe PLAGNIOL-VILLARD [Sun, 5 Feb 2012 10:32:37 +0000 (18:32 +0800)]
ARM: at91: sam9g45 add i2c DT support

For now on use i2c-gpio driver on the same pin as the hardware IP.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91: usb_a9g20 add DT i2c support
Jean-Christophe PLAGNIOL-VILLARD [Sun, 5 Feb 2012 10:31:00 +0000 (18:31 +0800)]
ARM: at91: usb_a9g20 add DT i2c support

Use i2c-gpio and enable rv3029 RTC.

Enable the rtc in the sam9g20 defconfig.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91: sam9g20 add i2c DT support
Jean-Christophe PLAGNIOL-VILLARD [Sun, 5 Feb 2012 10:25:33 +0000 (18:25 +0800)]
ARM: at91: sam9g20 add i2c DT support

For now on use i2c-gpio driver on the same pin as the hardware IP.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoi2c/gpio: add DT support
Jean-Christophe PLAGNIOL-VILLARD [Sun, 5 Feb 2012 10:22:34 +0000 (18:22 +0800)]
i2c/gpio: add DT support

To achieve DT support, we need to populate a custom platform_data in a
private struct from DT information. To simplify code, the adapter and
algorithm are also put into the private struct.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91: sam9x5 add nand support
Jean-Christophe PLAGNIOL-VILLARD [Tue, 21 Feb 2012 13:38:18 +0000 (21:38 +0800)]
ARM: at91: sam9x5 add nand support

Enable the nand in the cpu module with the partition.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
12 years agoatmel/nand: add DT support
Jean-Christophe PLAGNIOL-VILLARD [Wed, 25 Jan 2012 18:11:06 +0000 (02:11 +0800)]
atmel/nand: add DT support

Use a local copy of board informatin and fill with DT data.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoof/mtd/nand: add generic bindings and helpers
Jean-Christophe PLAGNIOL-VILLARD [Sat, 28 Jan 2012 04:12:36 +0000 (12:12 +0800)]
of/mtd/nand: add generic bindings and helpers

- nand-ecc-mode : String, operation mode of the NAND ecc mode.
  Supported values are: "none", "soft", "hw", "hw_syndrome", "hw_oob_first",
  "soft_bch".
- nand-bus-width : 8 or 16 bus width if not present 8
- nand-on-flash-bbt: boolean to enable on flash bbt option if not present false

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Stefan Roese <sr@denx.de>
12 years agoof: introduce helper to manage boolean
Jean-Christophe PLAGNIOL-VILLARD [Tue, 7 Feb 2012 04:12:51 +0000 (12:12 +0800)]
of: introduce helper to manage boolean

of_property_read_bool

Search for a property in a device node.
Returns true if the property exist false otherwise.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
12 years agoARM: at91: enable on flash bbt for Atmel Reference and DT boards
Jean-Christophe PLAGNIOL-VILLARD [Thu, 29 Dec 2011 07:05:50 +0000 (15:05 +0800)]
ARM: at91: enable on flash bbt for Atmel Reference and DT boards

Enable it on Calao board too as they are in DT too.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
12 years agomtd/atmel_nand: add on_flash_bbt to enable the use of On Flash BBT
Jean-Christophe PLAGNIOL-VILLARD [Thu, 29 Dec 2011 06:59:54 +0000 (14:59 +0800)]
mtd/atmel_nand: add on_flash_bbt to enable the use of On Flash BBT

This will allow to enable it from the board.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: David Woodhouse <dwmw2@infradead.org>
12 years agoATMEL: fix nand ecc support
Jean-Christophe PLAGNIOL-VILLARD [Thu, 29 Dec 2011 06:43:24 +0000 (14:43 +0800)]
ATMEL: fix nand ecc support

So we can now choose for the board the ecc mode (ecc soft, soft bch, no ecc
and hardware).

Set ecc mode in the boards to soft as currently in the driver.

Move platform data to a common header
include/linux/platform_data/atmel_nand.h

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Acked-by: David Woodhouse <dwmw2@infradead.org>
12 years agoARM: at91: at91sam9x5cm/dt: add leds support
Jean-Christophe PLAGNIOL-VILLARD [Thu, 23 Feb 2012 15:09:41 +0000 (23:09 +0800)]
ARM: at91: at91sam9x5cm/dt: add leds support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91: usb_a9g20/dt: add gpio-keys support
Jean-Christophe PLAGNIOL-VILLARD [Sat, 4 Feb 2012 04:43:10 +0000 (12:43 +0800)]
ARM: at91: usb_a9g20/dt: add gpio-keys support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91: at91sam9m10g45ek/dt: add gpio-keys support
Jean-Christophe PLAGNIOL-VILLARD [Sat, 4 Feb 2012 04:42:35 +0000 (12:42 +0800)]
ARM: at91: at91sam9m10g45ek/dt: add gpio-keys support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91: at91sam9m10g45ek/dt: add leds support
Jean-Christophe PLAGNIOL-VILLARD [Sat, 4 Feb 2012 04:26:01 +0000 (12:26 +0800)]
ARM: at91: at91sam9m10g45ek/dt: add leds support

Use the gpio for d7 as we do not support yet the pwm led via dt.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91: usb_a9g20/dt: add leds support
Jean-Christophe PLAGNIOL-VILLARD [Fri, 3 Feb 2012 17:24:22 +0000 (01:24 +0800)]
ARM: at91: usb_a9g20/dt: add leds support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91/pio: add new PIO3 features
Nicolas Ferre [Tue, 20 Jul 2010 17:18:51 +0000 (19:18 +0200)]
ARM: at91/pio: add new PIO3 features

This patch adds the support for new PIO controller found on some
at91sam SOCs.
- more peripheral multiplexing
- more features to configure on a PIO (pull-down, Schmitt trigger, debouncer)
- support for several IRQ triggering features (type and polarity)

Support for those new features are retrieved from the device tree
compatibility string.

Debugfs at91_gpio file is updated to monitor configuration.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91: add sam9_smc.o to at91sam9x5 build
Nicolas Ferre [Tue, 21 Feb 2012 08:54:00 +0000 (09:54 +0100)]
ARM: at91: add sam9_smc.o to at91sam9x5 build

Add these SMC accessors to the at91sam9x5 as we will need them for
NAND flash (for instance).

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91/tc/clocksource: Add 32 bit variant to Timer Counter
Nicolas Ferre [Thu, 19 Jan 2012 17:44:49 +0000 (18:44 +0100)]
ARM: at91/tc/clocksource: Add 32 bit variant to Timer Counter

Some SoC have a 32 bit variant of Timer Counter Blocks. We do not
need the chaining of two 16 bit counters anymore for them.

The SoC nature is deduced from the device tree "compatible" string.
For non-device-tree configurations, backward compatibility is maintained
by using the default 16 bit counter configuration.

This patch addresses both the atmel_tclib and its user: tcb_clksrc
clocksource.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
12 years agoARM: at91/tc: add device tree support to atmel_tclib
Nicolas Ferre [Thu, 19 Jan 2012 09:13:40 +0000 (10:13 +0100)]
ARM: at91/tc: add device tree support to atmel_tclib

Device tree support added to atmel_tclib: the generic Timer Counter
library. This is used by the clocksource/clockevent driver tcb_clksrc.

The current DT enabled platforms are also modified to use it:
- .dtsi files are modified to add Timer Counter Block entries
- alias are created to allow identification of each block
- clkdev lookup tables are added for clocks identification.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
12 years agoARM: at91/tclib: take iomem size from resource
Nicolas Ferre [Wed, 18 Jan 2012 15:56:36 +0000 (16:56 +0100)]
ARM: at91/tclib: take iomem size from resource

Requesting iomem region and ioremaping is now done using
the resource size specified instead of a constant value.

Each <SoC>_device.c file is modified accordingly to reflect
actual user interface size.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
12 years agoARM: at91/pit: add traces in case of error
Nicolas Ferre [Fri, 17 Feb 2012 10:54:29 +0000 (11:54 +0100)]
ARM: at91/pit: add traces in case of error

Traces related to IRQ management are useful for timers in case of
non-working IRQ subsystem (switch to irq_domain for instance).

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91: pit add DT support
Jean-Christophe PLAGNIOL-VILLARD [Mon, 27 Feb 2012 10:19:34 +0000 (11:19 +0100)]
ARM: at91: pit add DT support

Retreive registers address and IRQ from device tree entry.
Called from at91_dt_init_irq() so that timers are up-n-running
when timers initialization will occur.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
[nicolas.ferre@atmel.com: change error path and interrupts property handling]
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91: AIC and GPIO IRQ device tree initialization
Nicolas Ferre [Tue, 14 Feb 2012 17:08:14 +0000 (18:08 +0100)]
ARM: at91: AIC and GPIO IRQ device tree initialization

Both AIC and GPIO controllers are now using the standard of_irq_init()
function to initialize IRQs in case of DT use.
The DT specific initialization functions are now separated from the
non-DT case and are now using "linear" irq domains.
The .map() irqdomain operation is responsible for positioning the IRQ
handlers. In AIC case, the Linux IRQ number is directly programmed in
the hardware to avoid an additional reverse mapping operation.
The AIC position its irq domain as the "default" irq domain.

For DT case, the priority is not yet filled in the SMR. It will be the
subject of another patch.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91/board-dt: remove AIC irq domain from board file
Nicolas Ferre [Thu, 2 Feb 2012 14:47:58 +0000 (15:47 +0100)]
ARM: at91/board-dt: remove AIC irq domain from board file

Adding of irqdomain in AIC code make the specification
of the irq domain in board file useless.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
12 years agoARM: at91/gpio: remove the static specification of gpio_chip.base
Nicolas Ferre [Thu, 8 Dec 2011 14:35:22 +0000 (15:35 +0100)]
ARM: at91/gpio: remove the static specification of gpio_chip.base

This value is determined at runtime using device tree or platform data
information.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
12 years agoARM: at91/gpio: add .to_irq gpio_chip handler
Nicolas Ferre [Sat, 11 Feb 2012 14:56:01 +0000 (15:56 +0100)]
ARM: at91/gpio: add .to_irq gpio_chip handler

Replace the gpio_to_irq() macro by a plain gpiolib .to_irq() handler.
This call is using the irqdomain to translate hardware to Linux
IRQ numbers.
The irq_to_gpio() macro is completely removed.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
12 years agoARM: at91/gpio: non-DT builds do not have gpio_chip.of_node field
Nicolas Ferre [Mon, 13 Feb 2012 10:26:25 +0000 (11:26 +0100)]
ARM: at91/gpio: non-DT builds do not have gpio_chip.of_node field

Protect build failure in case of non-DT configuration: the
gpio_chip structure does not have a of_node field in case of
!CONFIG_OF_GPIO.

Keep this in a separate patch as it can be reverted if the
field is added for both DT/non-DT cases.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
12 years agoARM: at91/gpio: add irqdomain and DT support
Nicolas Ferre [Sat, 11 Feb 2012 14:41:40 +0000 (15:41 +0100)]
ARM: at91/gpio: add irqdomain and DT support

Add "legacy" type of irqdomain to preserve old-style numbering
and allow smooth transition for both DT and non-DT cases.

Original idea and code by Jean-Christophe Plagniol-Villard.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
12 years agoARM: at91/gpio: change comments and one variable name
Nicolas Ferre [Sat, 11 Feb 2012 14:28:08 +0000 (15:28 +0100)]
ARM: at91/gpio: change comments and one variable name

What was true only on at91sam9263 about the sharing of a single AIC
IRQ line for several GPIO banks is now used by several Atmel SoCs.

Change a variable name to allow better understanding while
introducing IRQ domains in following patches.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
12 years agoARM/USB: at91/ohci-at91: remove the use of irq_to_gpio
Nicolas Ferre [Sat, 11 Feb 2012 13:23:06 +0000 (14:23 +0100)]
ARM/USB: at91/ohci-at91: remove the use of irq_to_gpio

irq_to_gpio() macro will be removed from AT91 GPIO interrupt
controller. So we replace it with the use of gpio_to_irq()
and a reworked test.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: linux-usb@vger.kernel.org
12 years agoARM: at91/snapper9260: move gpio_to_irq out of structure initialization
Nicolas Ferre [Sat, 11 Feb 2012 19:48:52 +0000 (20:48 +0100)]
ARM: at91/snapper9260: move gpio_to_irq out of structure initialization

gpio_to_irq() implementation will be moved from a macro to a
plain function: we cannot use it in a structure initialization
anymore.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Reviewed-by: Ryan Mallon <rmallon@gmail.com>
12 years agoARM: at91/aic: add irq domain and device tree support
Nicolas Ferre [Tue, 22 Nov 2011 21:26:09 +0000 (22:26 +0100)]
ARM: at91/aic: add irq domain and device tree support

Add an irqdomain for the AIC interrupt controller.
The device tree support is mapping the registers and
is using the irq_domain_add_legacy() to manage hwirq
translation.
The documentation is describing the meaning of the
two cells required for using this "interrupt-controller"
in a device tree node.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
12 years agoMerge branch 'irqdomain/next' of git://git.secretlab.ca/git/linux-2.6
Nicolas Ferre [Thu, 1 Mar 2012 12:24:22 +0000 (13:24 +0100)]
Merge branch 'irqdomain/next' of git://git.secretlab.ca/git/linux-2.6

12 years agoMerge branch 'at91-3.4-base2+cleanup' of git://github.com/at91linux/linux-at91 into...
Arnd Bergmann [Mon, 27 Feb 2012 17:22:36 +0000 (17:22 +0000)]
Merge branch 'at91-3.4-base2+cleanup' of git://github.com/at91linux/linux-at91 into at91/staging/base2+cleanup

* 'at91-3.4-base2+cleanup' of git://github.com/at91linux/linux-at91: (20 commits)
  ARM: at91: properly sort dtb files in Makefile.boot
  ARM: at91: add at91sam9g25ek.dts in Makefile.boot
  ARM: at91/board-dt: drop default console
  Atmel: move console default platform_device to serial driver
  ARM: at91: merge SRAM Memory banks thanks to mirroring
  ARM: at91: finally drop at91_sys_read/write
  ARM: at91/rtc-at91sam9: pass the GPBR to use via resources
  ARM: at91:rtc/rtc-at91sam9: ioremap register bank
  ARM: at91/rtc-at91sam9: each SoC can select the RTT device to use
  ARM: at91/PMC: make register base soc independent
  ARM: at91/PMC: move assignment out of printf
  ARM: at91/pm_slowclock: add runtime detection of memory contoller
  ARM: at91: make sdram/ddr register base soc independent
  ARM: at91: move at91rm9200 sdramc defines to at91rm9200_sdramc.h
  ARM: at91/pm_slowclock: function slow_clock() accepts parameters
  ARM: at91/pm_slowclock: rename register to named define
  ARM: at91/ST: remove not needed casts
  ARM: at91: make ST (System Timer) soc independent
  ARM: at91: make matrix register base soc independent
  ARM: at91/at91x40: remove use of at91_sys_read/write

Based on top of the at91/9x5, rmk/for-armsoc, at91/device-board,
at91/pm_cleanup and at91/base.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
12 years agomfd: twl-core: Add IRQ_DOMAIN dependency
Grant Likely [Fri, 24 Feb 2012 21:58:54 +0000 (14:58 -0700)]
mfd: twl-core: Add IRQ_DOMAIN dependency

TWL4030 depends on IRQ_DOMAIN support, so this patch selects it in Kconfig.
It used to be that CONFIG_IRQ_DOMAIN must only be selected by the architecture,
but recent cleanups have fixed it so that it is safe to select from anywhere.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
[grant.likely: Changed from a depends to a select]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Samuel Ortiz <sameo@linux.intel.com>
12 years agodevicetree: Add empty of_platform_populate() for !CONFIG_OF_ADDRESS (sparc)
Grant Likely [Fri, 24 Feb 2012 21:58:34 +0000 (14:58 -0700)]
devicetree: Add empty of_platform_populate() for !CONFIG_OF_ADDRESS (sparc)

Sparc has its own helpers for translating address ranges when the device
tree is parsed at boot time, and it isn't able to use of_platform_populate().
However, there are some device drivers that want to use that function on
other DT enabled platforms (ie. TWL4030).  This patch adds an empty
of_platform_populate() implementation that returns an error when
CONFIG_OF_ADDRESS is not selected.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Benoit Cousson <b-cousson@ti.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
12 years agoirq_domain: Centralize definition of irq_dispose_mapping()
Grant Likely [Fri, 24 Feb 2012 15:24:17 +0000 (08:24 -0700)]
irq_domain: Centralize definition of irq_dispose_mapping()

Several architectures define their own empty irq_dispose_mapping().  Since
the irq_domain code is centralized now, there is little need to do so.  This
patch removes them and creates a new empty copy when !CONFIG_IRQ_DOMAIN is
selected.

The patch also means that IRQ_DOMAIN becomes selectable on all architectures.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: sparclinux@vger.kernel.org
Cc: linux@lists.openrisc.net
12 years agoirq_domain/mips: Allow irq_domain on MIPS
Grant Likely [Fri, 24 Feb 2012 15:07:06 +0000 (08:07 -0700)]
irq_domain/mips: Allow irq_domain on MIPS

This patch makes IRQ_DOMAIN usable on MIPS.  It uses an ugly workaround
to preserve current behaviour so that MIPS has time to add irq_domain
registration to the irq controller drivers.  The workaround will be
removed in Linux v3.6

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mips@linux-mips.org
12 years agoirq_domain/x86: Convert x86 (embedded) to use common irq_domain
Grant Likely [Fri, 16 Dec 2011 22:50:17 +0000 (15:50 -0700)]
irq_domain/x86: Convert x86 (embedded) to use common irq_domain

This patch removes the x86-specific definition of irq_domain and replaces
it with the common implementation.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
12 years agoARM: at91: properly sort dtb files in Makefile.boot
Jean-Christophe PLAGNIOL-VILLARD [Wed, 22 Feb 2012 16:04:04 +0000 (17:04 +0100)]
ARM: at91: properly sort dtb files in Makefile.boot

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91: add at91sam9g25ek.dts in Makefile.boot
Nicolas Ferre [Wed, 22 Feb 2012 11:17:36 +0000 (12:17 +0100)]
ARM: at91: add at91sam9g25ek.dts in Makefile.boot

Reported-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91/board-dt: drop default console
Jean-Christophe PLAGNIOL-VILLARD [Sun, 5 Feb 2012 18:54:46 +0000 (02:54 +0800)]
ARM: at91/board-dt: drop default console

This default console mechanism is not used if the console is selected
by command line (console= parameter).
Dropping this will simplify the compilation of multiple SoC in the same
kernel image.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoAtmel: move console default platform_device to serial driver
Jean-Christophe PLAGNIOL-VILLARD [Wed, 15 Feb 2012 16:24:07 +0000 (00:24 +0800)]
Atmel: move console default platform_device to serial driver

This variable spread on every SoC that is using the atmel_serial.c
driver can be included directly into the latter.

This will allow to compile multiple soc in the same kernel.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Cc: kernel@avr32linux.org
12 years agoARM: at91: merge SRAM Memory banks thanks to mirroring
Jean-Christophe PLAGNIOL-VILLARD [Wed, 7 Dec 2011 10:34:47 +0000 (18:34 +0800)]
ARM: at91: merge SRAM Memory banks thanks to mirroring

On at91sam9260 and at91sam9g20 the SRAM banks are mirrored. We can
merge them together to be able to have bigger and continuous
internal RAM.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91: finally drop at91_sys_read/write
Jean-Christophe PLAGNIOL-VILLARD [Wed, 15 Feb 2012 13:27:34 +0000 (21:27 +0800)]
ARM: at91: finally drop at91_sys_read/write

Remove at91_sys_read/write() from io.h file. This function
is not used anymore and was a stopper on the way to single
zImage kernel for AT91.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91/rtc-at91sam9: pass the GPBR to use via resources
Jean-Christophe PLAGNIOL-VILLARD [Wed, 15 Feb 2012 13:24:46 +0000 (21:24 +0800)]
ARM: at91/rtc-at91sam9: pass the GPBR to use via resources

The GPBR registers are used for storing RTC values. The GPBR registers
to use are now provided using standard resource entry. The array is
filled in SoC specific code.
rtc-at91sam9 RTT as RTC driver is modified to retrieve this information.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
[nicolas.ferre@atmel.com: rework resources assignment]
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Reviewed-by: Ryan Mallon <rmallon@gmail.com>
12 years agoARM: at91:rtc/rtc-at91sam9: ioremap register bank
Jean-Christophe PLAGNIOL-VILLARD [Sun, 18 Sep 2011 02:17:54 +0000 (10:17 +0800)]
ARM: at91:rtc/rtc-at91sam9: ioremap register bank

Instead of computing virtual address with AT91_VA_BASE_SYS, use the
appropriate ioremap() call on the driver "memory" resource.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91/rtc-at91sam9: each SoC can select the RTT device to use
Jean-Christophe PLAGNIOL-VILLARD [Wed, 15 Feb 2012 12:51:37 +0000 (20:51 +0800)]
ARM: at91/rtc-at91sam9: each SoC can select the RTT device to use

For the RTT as RTC driver rtc-at91sam9, the platform_device structure
is filled during SoC initialization. This will allow to convert this
RTC driver as a standard platform driver.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91/PMC: make register base soc independent
Jean-Christophe PLAGNIOL-VILLARD [Fri, 25 Nov 2011 01:59:46 +0000 (09:59 +0800)]
ARM: at91/PMC: make register base soc independent

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Reviewed-by: Ryan Mallon <rmallon@gmail.com>
12 years agoARM: at91/PMC: move assignment out of printf
Nicolas Ferre [Thu, 23 Feb 2012 08:44:37 +0000 (09:44 +0100)]
ARM: at91/PMC: move assignment out of printf

We move the assignment of values of register out of the
seq_printf() calls: It is obviously more readable.

Reported-by: Ryan Mallon <rmallon@gmail.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91/pm_slowclock: add runtime detection of memory contoller
Jean-Christophe PLAGNIOL-VILLARD [Wed, 22 Feb 2012 16:50:55 +0000 (17:50 +0100)]
ARM: at91/pm_slowclock: add runtime detection of memory contoller

This will allow to have all SoC in one kernel image.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91: make sdram/ddr register base soc independent
Jean-Christophe PLAGNIOL-VILLARD [Mon, 13 Feb 2012 04:58:53 +0000 (12:58 +0800)]
ARM: at91: make sdram/ddr register base soc independent

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91: move at91rm9200 sdramc defines to at91rm9200_sdramc.h
Jean-Christophe PLAGNIOL-VILLARD [Tue, 15 Nov 2011 18:58:31 +0000 (02:58 +0800)]
ARM: at91: move at91rm9200 sdramc defines to at91rm9200_sdramc.h

This cleanup is done to allow to have multiple SoC in the same image.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91/pm_slowclock: function slow_clock() accepts parameters
Jean-Christophe PLAGNIOL-VILLARD [Wed, 22 Feb 2012 16:50:54 +0000 (17:50 +0100)]
ARM: at91/pm_slowclock: function slow_clock() accepts parameters

Change slow_clock()/at91_slow_clock() prototype to accept the PMC
base address and one or two RAM controller addresses by parameters.
The r0, r1 and r2 registers are used differently and preserved during
function call.
Those values are defined in pm.c and slow_clock() function is called
from there with its new parameters.

This will allow to have a soc independent pm_slowclock.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Ached-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91/pm_slowclock: rename register to named define
Jean-Christophe PLAGNIOL-VILLARD [Wed, 22 Feb 2012 16:50:53 +0000 (17:50 +0100)]
ARM: at91/pm_slowclock: rename register to named define

This patch will give a name to ARM registers in the assembly
source code. It is done to simplify the code reading and
the passing of parameters to functions.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91/ST: remove not needed casts
Nicolas Ferre [Mon, 20 Feb 2012 10:13:13 +0000 (11:13 +0100)]
ARM: at91/ST: remove not needed casts

Remove the unnecessary (void) cast on at91_st_read()
return value.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Ryan Mallon <rmallon@gmail.com>
12 years agoARM: at91: make ST (System Timer) soc independent
Jean-Christophe PLAGNIOL-VILLARD [Mon, 20 Feb 2012 10:07:39 +0000 (11:07 +0100)]
ARM: at91: make ST (System Timer) soc independent

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Reviewed-by: Ryan Mallon <rmallon@gmail.com>
12 years agoARM: at91: make matrix register base soc independent
Jean-Christophe PLAGNIOL-VILLARD [Sun, 27 Nov 2011 15:15:50 +0000 (23:15 +0800)]
ARM: at91: make matrix register base soc independent

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Reviewed-by: Ryan Mallon <rmallon@gmail.com>
Cc: linux-usb@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoppc-6xx: fix build failure in flipper-pic.c and hlwd-pic.c
Paul Gortmaker [Wed, 22 Feb 2012 23:35:03 +0000 (18:35 -0500)]
ppc-6xx: fix build failure in flipper-pic.c and hlwd-pic.c

The commit bae1d8f19983fbfa25559aa3cb6a81a84aa82a18 (linux-next)

  "irq_domain/powerpc: Use common irq_domain structure instead of irq_host"

made this change:

   -static struct irq_host *flipper_irq_host;
   +static struct irq_domain *flipper_irq_host;

and this change:

   -static struct irq_host *hlwd_irq_host;
   +static struct irq_domain *hlwd_irq_host;

The intent was to change the type, and not the name, but then in a
couple of instances, it looks like the sed to change the irq_domain_ops
name inadvertently also changed the irq_host name where it was not
supposed to, causing build failures.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
12 years agoARM: at91/at91x40: remove use of at91_sys_read/write
Jean-Christophe PLAGNIOL-VILLARD [Sun, 5 Feb 2012 12:35:39 +0000 (20:35 +0800)]
ARM: at91/at91x40: remove use of at91_sys_read/write

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoARM: at91: factorise duplicated at91sam9 idle
Jean-Christophe PLAGNIOL-VILLARD [Sun, 5 Feb 2012 12:25:32 +0000 (20:25 +0800)]
ARM: at91: factorise duplicated at91sam9 idle

Remove duplicated at91sam9xxxx_idle() functions introduced
by commit c9dfafb "ARM: mach-at91: move special idle code out of line".
Replace by a generic at91sam9_idle() function in setup.c common
location.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
12 years agoirq_domain/microblaze: Convert microblaze to use irq_domains
Grant Likely [Thu, 26 Jan 2012 21:10:13 +0000 (14:10 -0700)]
irq_domain/microblaze: Convert microblaze to use irq_domains

This patch converts Microblaze to use the irq_domain remapper and get
away from hard coding the offset between hwirq number and the linux irq
number space.  This also paves the way for multiple interrupt controllers.

v2: Don't enable SPARSE_IRQ and keep NR_IRQS set to 33

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Michal Simek <monstr@monstr.eu>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: John Williams <john.williams@petalogix.com>
Cc: John Linn <john.linn@xilinx.com>
12 years agoirq_domain/powerpc: Replace custom xlate functions with library functions
Grant Likely [Wed, 25 Jan 2012 00:09:13 +0000 (17:09 -0700)]
irq_domain/powerpc: Replace custom xlate functions with library functions

This patch converts a number of the powerpc drivers to use the common library
of irq_domain xlate functions, dropping a bunch of lines in the process.

v5: - Remove tsi108 changes from patch

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>
Tested-by: Olof Johansson <olof@lixom.net>
12 years agoirq_domain/powerpc: constify irq_domain_ops
Grant Likely [Thu, 26 Jan 2012 19:24:34 +0000 (12:24 -0700)]
irq_domain/powerpc: constify irq_domain_ops

Make all the irq_domain_ops structures in powerpc 'static const'

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>
Tested-by: Olof Johansson <olof@lixom.net>
12 years agoirq_domain/c6x: Use library of xlate functions
Grant Likely [Thu, 26 Jan 2012 15:40:09 +0000 (08:40 -0700)]
irq_domain/c6x: Use library of xlate functions

The c6x irq controllers don't need to define custom .xlate hooks

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Mark Salter <msalter@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
12 years agoirq_domain/c6x: constify irq_domain structures
Grant Likely [Thu, 26 Jan 2012 19:25:18 +0000 (12:25 -0700)]
irq_domain/c6x: constify irq_domain structures

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Mark Salter <msalter@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
12 years agoirq_domain/c6x: Convert c6x to use generic irq_domain support.
Mark Salter [Thu, 26 Jan 2012 14:26:21 +0000 (09:26 -0500)]
irq_domain/c6x: Convert c6x to use generic irq_domain support.

The C6X IRQ support was copied almost verbatim from the PowerPC virtual IRQ
code. The PowerPC code was used as the basis for generic irq_domain support,
so this patch mostly copies what what done to arch/powerpc by Grant Likely
in his irq_domain patch series.

Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Aurelien Jacquiot <a-jacquiot@ti.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
12 years agoirq_domain: constify irq_domain_ops
Grant Likely [Thu, 26 Jan 2012 19:12:14 +0000 (12:12 -0700)]
irq_domain: constify irq_domain_ops

Make irq_domain_ops pointer a constant to make it safer for multiple
instances to share the same ops pointer and change the irq_domain code
so that it does not modify the ops.

v4: Fix mismatched type reference in powerpc code

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Milton Miller <miltonm@bga.com>
Tested-by: Olof Johansson <olof@lixom.net>
12 years agoirq_domain: Create common xlate functions that device drivers can use
Grant Likely [Thu, 26 Jan 2012 18:26:52 +0000 (11:26 -0700)]
irq_domain: Create common xlate functions that device drivers can use

Rather than having each interrupt controller driver creating its own barely
unique .xlate function for irq_domain, create a library of translators which
any driver can use directly.

v5: - Remove irq_domain_xlate_pci().  It was incorrect.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Mark Salter <msalter@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>
Tested-by: Olof Johansson <olof@lixom.net>
12 years agoirq_domain: Remove irq_domain_add_simple()
Grant Likely [Wed, 11 Jan 2012 00:09:30 +0000 (17:09 -0700)]
irq_domain: Remove irq_domain_add_simple()

irq_domain_add_simple() was a stop-gap measure until complete irq_domain
support was complete.  This patch removes the irq_domain_add_simple()
interface.

This patch also drops the explicit irq_domain initialization performed
by the mach-versatile code because the versatile interrupt controller
already has irq_domain support built into it.  This was a bug that was
hanging around quietly for a while, but with the full irq_domain which
actually verifies that irq_domain ranges are available it would cause
the registration to fail and the system wouldn't boot.

v4: Fixed number of irqs in mx5 gpio code
v2: Updated to pass in host_data pointer on irq_domain allocation.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>
Cc: Russell King <linux@arm.linux.org.uk>
Tested-by: Olof Johansson <olof@lixom.net>
12 years agoirq_domain: Remove 'new' irq_domain in favour of the ppc one
Grant Likely [Tue, 14 Feb 2012 21:06:57 +0000 (14:06 -0700)]
irq_domain: Remove 'new' irq_domain in favour of the ppc one

This patch removes the simplistic implementation of irq_domains and enables
the powerpc infrastructure for all irq_domain users.  The powerpc
infrastructure includes support for complex mappings between Linux and
hardware irq numbers, and can manage allocation of irq_descs.

This patch also converts the few users of irq_domain_add()/irq_domain_del()
to call irq_domain_add_legacy() instead.

v3: Fix bug that set up too many irqs in translation range.
v2: Fix removal of irq_alloc_descs() call in gic driver

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>
Tested-by: Olof Johansson <olof@lixom.net>
12 years agomfd: twl-core.c: Fix the number of interrupts managed by twl4030
Benoit Cousson [Tue, 14 Feb 2012 21:06:56 +0000 (14:06 -0700)]
mfd: twl-core.c: Fix the number of interrupts managed by twl4030

TWL4030 does handle 3 different interrupts ranges: 8 for the core, 8 for
the power events and 18 for the GPIOs.

Change the total number of interrupts managed by TWL4030 from 8 to 34.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
12 years agoof/address: add empty static inlines for !CONFIG_OF
Grant Likely [Tue, 14 Feb 2012 21:06:55 +0000 (14:06 -0700)]
of/address: add empty static inlines for !CONFIG_OF

As the title says, this patch adds empty implementations for the address
translation functions so that they can be used when CONFIG_OF is disabled.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
12 years agoirq_domain: Add support for base irq and hwirq in legacy mappings
Grant Likely [Tue, 14 Feb 2012 21:06:55 +0000 (14:06 -0700)]
irq_domain: Add support for base irq and hwirq in legacy mappings

Add support for a legacy mapping where irq = (hwirq - first_hwirq + first_irq)
so that a controller driver can allocate a fixed range of irq_descs and use
a simple calculation to translate back and forth between linux and hw irq
numbers.  This is needed to use an irq_domain with many of the ARM interrupt
controller drivers that manage their own irq_desc allocations.  Ultimately
the goal is to migrate those drivers to use the linear revmap, but doing it
this way allows each driver to be converted separately which makes the
migration path easier.

This patch generalizes the IRQ_DOMAIN_MAP_LEGACY method to use
(first_irq-first_hwirq) as the offset between hwirq and linux irq number,
and adds checks to make sure that the hwirq number does not exceed range
assigned to the controller.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>
Tested-by: Olof Johansson <olof@lixom.net>
12 years agoirq_domain: Replace irq_alloc_host() with revmap-specific initializers
Grant Likely [Tue, 14 Feb 2012 21:06:54 +0000 (14:06 -0700)]
irq_domain: Replace irq_alloc_host() with revmap-specific initializers

Each revmap type has different arguments for setting up the revmap.
This patch splits up the generator functions so that each revmap type
can do its own setup and the user doesn't need to keep track of how
each revmap type handles the arguments.

This patch also adds a host_data argument to the generators.  There are
cases where the host_data pointer will be needed before the function returns.
ie. the legacy map calls the .map callback for each irq before returning.

v2: - Add void *host_data argument to irq_domain_add_*() functions
    - fixed failure to compile
    - Moved IRQ_DOMAIN_MAP_* defines into irqdomain.c

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>
Tested-by: Olof Johansson <olof@lixom.net>
12 years agoirq_domain: Remove references to old irq_host names
Grant Likely [Tue, 14 Feb 2012 21:06:53 +0000 (14:06 -0700)]
irq_domain: Remove references to old irq_host names

No functional changes.  Replaces non-exported references to 'host' with domain.
Does not change any symbol names referenced by other .c files.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>
Tested-by: Olof Johansson <olof@lixom.net>
12 years agoirq_domain: remove NO_IRQ from irq domain code
Grant Likely [Tue, 14 Feb 2012 21:06:52 +0000 (14:06 -0700)]
irq_domain: remove NO_IRQ from irq domain code

zero always means no irq when using irq domains.  Get rid of the NO_IRQ
references.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>
Tested-by: Olof Johansson <olof@lixom.net>
12 years agoirq_domain: Move irq_domain code from powerpc to kernel/irq
Grant Likely [Thu, 16 Feb 2012 08:37:49 +0000 (01:37 -0700)]
irq_domain: Move irq_domain code from powerpc to kernel/irq

This patch only moves the code.  It doesn't make any changes, and the
code is still only compiled for powerpc.  Follow-on patches will generalize
the code for other architectures.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>
Tested-by: Olof Johansson <olof@lixom.net>
12 years agoirq_domain/powerpc: Eliminate virq_is_host()
Grant Likely [Tue, 14 Feb 2012 21:06:51 +0000 (14:06 -0700)]
irq_domain/powerpc: Eliminate virq_is_host()

There is only one user, and it is trivial to open-code.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>
Tested-by: Olof Johansson <olof@lixom.net>
12 years agoirq_domain/powerpc: eliminate irq_map; use irq_alloc_desc() instead
Grant Likely [Tue, 14 Feb 2012 21:06:51 +0000 (14:06 -0700)]
irq_domain/powerpc: eliminate irq_map; use irq_alloc_desc() instead

This patch drops the powerpc-specific irq_map table and replaces it with
directly using the irq_alloc_desc()/irq_free_desc() interfaces for allocating
and freeing irq_desc structures.

This patch is a preparation step for generalizing the powerpc-specific virq
infrastructure to become irq_domains.

As part of this change, the irq_big_lock is changed to a mutex from a raw
spinlock.  There is no longer any need to use a spin lock since the irq_desc
allocation code is now responsible for the critical section of finding
an unused range of irq numbers.

The radix lookup table is also changed to store the irq_data pointer instead
of the irq_map entry since the irq_map is removed.  This should end up being
functionally equivalent since only allocated irq_descs are ever added to the
radix tree.

v5: - Really don't ever allocate virq 0.  The previous version could still
      do it if hint == 0
    - Respect irq_virq_count setting for NOMAP.  Some NOMAP domains cannot
      use virq values above irq_virq_count.
    - Use numa_node_id() when allocating irq_descs.  Ideally the API should
      obtain that value from the caller, but that touches a lot of call sites
      so will be deferred to a follow-on patch.
    - Fix irq_find_mapping() to include irq numbers lower than
      NUM_ISA_INTERRUPTS.  With the switch to irq_alloc_desc*(), the lowest
      possible allocated irq is now returned by arch_probe_nr_irqs().
v4: - Fix incorrect access to irq_data structure in debugfs code
    - Don't ever allocate virq 0

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>
Tested-by: Olof Johansson <olof@lixom.net>
12 years agoirq_domain/powerpc: Use common irq_domain structure instead of irq_host
Grant Likely [Tue, 14 Feb 2012 21:06:50 +0000 (14:06 -0700)]
irq_domain/powerpc: Use common irq_domain structure instead of irq_host

This patch drops the powerpc-specific irq_host structures and uses the common
irq_domain strucutres defined in linux/irqdomain.h.  It also fixes all
the users to use the new structure names.

Renaming irq_host to irq_domain has been discussed for a long time, and this
patch is a step in the process of generalizing the powerpc virq code to be
usable by all architecture.

An astute reader will notice that this patch actually removes the irq_host
structure instead of renaming it.  This is because the irq_domain structure
already exists in include/linux/irqdomain.h and has the needed data members.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>
Tested-by: Olof Johansson <olof@lixom.net>
12 years agoirq_domain: convert microblaze from irq_host to irq_domain
Grant Likely [Tue, 14 Feb 2012 21:06:49 +0000 (14:06 -0700)]
irq_domain: convert microblaze from irq_host to irq_domain

Trivial change, microblaze doesn't use irq remapping yet.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Thomas Gleixner <tglx@linutronix.de>
12 years agoirq_domain: Make irq_domain structure match powerpc's irq_host
Grant Likely [Tue, 14 Feb 2012 21:06:48 +0000 (14:06 -0700)]
irq_domain: Make irq_domain structure match powerpc's irq_host

Part of the series to unify the irq remapping mechanisms in the
kernel.  A follow up patch will copy the powerpc implementation into
kernel/irq/irqdomain.c, which will be a lot easier if the structures
are identical.

Where they differ, I've chose to use the powerpc names since there is
a lot more code using those names.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>
Tested-by: Olof Johansson <olof@lixom.net>
12 years agoirq_domain: Be less verbose
Grant Likely [Tue, 14 Feb 2012 21:06:48 +0000 (14:06 -0700)]
irq_domain: Be less verbose

irq_domain printk's too much.  Drop some output.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Olof Johansson <olof@lixom.net>
12 years agoirq_domain: add documentation and MAINTAINERS entry.
Grant Likely [Tue, 14 Feb 2012 21:06:47 +0000 (14:06 -0700)]
irq_domain: add documentation and MAINTAINERS entry.

Documentation for irq_domain library which will be created in subsequent
patches.

v4: editorial changes

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Reviewed-by: Randy Dunlap <rdunlap@xenotime.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Milton Miller <miltonm@bga.com>
Tested-by: Olof Johansson <olof@lixom.net>
12 years agoMerge tag 'sound-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Linus Torvalds [Tue, 14 Feb 2012 17:09:24 +0000 (09:09 -0800)]
Merge tag 'sound-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

sound fixes for 3.3-rc4

Basically all small fixes suited as rc4: a few HD-audio regression fixes,
a stable fix for an old Dell laptop with intel8x0, and a simple fix for
ASoC fsi.

* tag 'sound-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: intel8x0: Fix default inaudible sound on Gateway M520
  ALSA: hda - Fix silent speaker output on Acer Aspire 6935
  ALSA: hda - Fix initialization of secondary capture source on VT1705
  ASoC: fsi: fixup fsi_pointer() calculation method
  ALSA: hda - Fix mute-LED VREF value for new HP laptops

12 years agoALSA: intel8x0: Fix default inaudible sound on Gateway M520
Daniel T Chen [Tue, 14 Feb 2012 04:44:22 +0000 (23:44 -0500)]
ALSA: intel8x0: Fix default inaudible sound on Gateway M520

BugLink: https://bugs.launchpad.net/bugs/930842
The reporter states that audio is inaudible by default without muting
'External Amplifier'. Add a quirk to handle his SSID so that changing
the control is not necessary.

Reported-and-tested-by: Benjamin Carlson <elderbubba0810@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoMerge tag 'asoc-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound...
Takashi Iwai [Tue, 14 Feb 2012 08:24:58 +0000 (09:24 +0100)]
Merge tag 'asoc-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

A simple fix from Morimoto-san for the pointer() operation in the FSI
driver.

12 years agoMerge git://git.samba.org/sfrench/cifs-2.6
Linus Torvalds [Tue, 14 Feb 2012 04:34:44 +0000 (20:34 -0800)]
Merge git://git.samba.org/sfrench/cifs-2.6

* git://git.samba.org/sfrench/cifs-2.6:
  cifs: don't return error from standard_receive3 after marking response malformed
  cifs: request oplock when doing open on lookup
  cifs: fix error handling when cifscreds key payload is an error