1
0
Fork 0
Commit Graph

18 Commits (d63870db3c41086d7f13ec8b41def4331db32327)

Author SHA1 Message Date
Hartley Sweeten ef12379f20 ARM: 5628/1: ep93xx: Introduce Pulse Width Modulator (PWM) driver
The EP93xx features two PWMs (one on the EP9307) with the following
features:

  * Configurable dual output
  * Separate input clocks for each PWM output
  * 16-bit resolution
  * Programmable pulse width (duty cycle), interval (frequency), and
    polarity

This adds the necessary core support as well as the driver.  A sysfs
interface is provided to control the PWM outputs.

Signed-off-by: Matthieu Crapet <mcrapet@gmail.com>
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Ryan Mallon <ryan@bluewatersys.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-07-30 17:45:43 +01:00
Hartley Sweeten c3e3baddbc [ARM] 5593/1: ep93xx: clock.c __iomem pointer
To ensure typesafe io, the enable_reg variable should be a
void __iomem pointer not u32.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-07-09 16:13:45 +01:00
Hartley Sweeten 701fac823e [ARM] 5578/1: ep93xx: add ep93xx-keypad clock
Add clkdev support for the ep93xx_keypad driver.

A matrix keypad driver for the ep93xx just got merged via the
input subsystem group.  For this driver to work the keypad clock
needs to be added to the ep93xx clkdev support.  In order to
accomplish this the following changes are implemented:

  1) Move the EP93XX_EXT_*_RATE defines to mach/include/hardware.h.
  2) Add EP93XX_KEYTCHCLK_DIV{4/16} for the keypad driver.
  3) Add support for programmable clocks (set_rate() callback).
  4) Add clk_keypad for the keypad driver.
  5) tab indent the clk_lookup table for easier reading.
  6) Add the set_rate() callback to program the keypad clock.
     This callback is generalized since the ADC clock (touchscreen)
     can use the same callback.
  7) Use the ep93xx_syscon_swlocked_write() core function for updating
     the software locked register.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Ryan Mallon <ryan@bluewatersys.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-07-09 16:10:51 +01:00
Hartley Sweeten 02239f0a42 [ARM] 5577/2: ep93xx: syscon locked register functions
Add core functions to handle writes to the ep93xx software locked
registers.

There are a number of registers in the EP93xx System Controller
that require a write to the software lock register before they
can be updated. This patch adds a number of exported functions
to the ep93xx core that handle this access.

The software locked clock divider registers, VidClkDiv, MIRClkDiv,
I2SClkDiv and KeyTchClkDiv would typically involve writing a
specific value to the register. To support this the
ep93xx_syscon_swlocked_write() function is provided.

For the DeviceCfg register it's more typical to only need to
set or clear a single bit. A generic ep93xx_devcfg_set_clear()
function is provided to handle both operations. Two inline
functions, ep93xx_devcfg_set_bits() and ep93xx_devcfg_clear_bits()
are also provided to improve code readability.

In addition, the remaining bits in the System Controller Device
Config Register have been documented and the previously defined
names shortened.

All code paths that use this functionality have been updated
except for arch/arm/kernel/crunch.c. That code is in a context
switch path, which is not reentrant, so it is safe against itself.

Cc: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: Matthias Kaehlcke <matthias@kaehlcke.net>
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Ryan Mallon <ryan@bluewatersys.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-07-09 16:10:51 +01:00
Matthias Kaehlcke ca8cbc8391 [ARM] 5552/1: ep93xx get_uart_rate(): use EP93XX_SYSCON_PWRCNT and EP93XX_SYSCON_PWRCN
ep93xx: get_uart_rate() uses the constants EP93XX_SYSCON_CLOCK_CONTROL
and EP93XX_SYSCON_CLOCK_UARTBAUD, which no longer exist. Use
EP93XX_SYSCON_PWRCNT and EP93XX_SYSCON_PWRCNT_UARTBAUD instead

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-06-11 22:18:58 +01:00
Russell King b0efb42478 Merge branch 'ep93xx' into devel 2009-06-10 22:40:04 +01:00
Hartley Sweeten 4070243250 [ARM] 5528/1: ep93xx: add defines for dma clock magic numbers
Update the dma clocks so that the magic numbers are named.

All the dma clocks have an enable bit to turn them on/off as
needed.  Currently these bits are in the code as "magic"
numbers.  This changes all of them to named defines to
improve code readability.

Also, the EP93XX_SYSCON_CLOCK_CONTROL register is improperly
named.  In the EP93xx User's Guide this register is called
PwrCnt (Power Control).  All of the uses of this register
are associated with the clock support so this patch also
modifies the names to match the User's Guide.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-05-29 20:16:31 +01:00
Hartley Sweeten e3a6d01932 [ARM] 5526/1: ep93xx: usb driver cleanup
Cleanup the ohci-ep93xx driver.

1) Use the usb.h dbg() macro instead of pr_debug() so that
   the source filename is prefixed to the message and it is
   terminated with a linefeed.

2) Add error handling for the clk_get() call.

3) Update clkdev support so that the usb clock is matched by
   the dev_id instead of the con_id.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-05-29 20:16:29 +01:00
Hartley Sweeten ff05c0330b [ARM] 5509/1: ep93xx: clkdev enable UARTS
Fix the clkdev API support for the ep93xx uart clocks.

The uarts available in the ep93xx have individual clock controls.
The current implementation assumes that the bootloader has enabled
the clocks before the kernel has booted. It also assumes that the
bootloader has set the UARTBAUD bit indicating that the uarts are
running off the 14.7456MHz external crystal.

This fixes both issues. It also allows the uart clocks to be stopped
when there are no users.

Tested-by: Matthias Kaehlcke <matthias@kaehlcke.net>

Cc: Ryan Mallon <ryan@bluewatersys.com>
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-05-16 19:55:56 +01:00
Ryan Mallon 1c8daabe1d [ARM] 5413/1: Add ep93xx dma m2p clocks
Add the clocks for ep93xx m2p dma engine.

Signed-off-by: Ryan Mallon <ryan@bluewatersys.com>
Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-27 20:57:48 +00:00
Russell King ae696fd532 [ARM] ep93xx: convert to clkdev and match clocks by struct device where possible
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-11-30 17:11:49 +00:00
Russell King fced80c735 [ARM] Convert asm/io.h to linux/io.h
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-09-06 12:10:45 +01:00
Russell King a09e64fbc0 [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>
2008-08-07 09:55:48 +01:00
Russell King be50972935 [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>
2008-08-07 09:40:08 +01:00
Dmitry Baryshkov 0c5d5b7044 [ARM] 5171/1: ep93xx: fix compilation of modules using clocks
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-07-10 14:50:21 +01:00
Russell King ed519dede3 [ARM] Convert AMBA PL010 driver to use the clk infrastructure
Convert the AMBA PL010 serial driver to use the clock infrastructure
to allow EP93xx platforms to properly gate the clock to the UARTs.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-04-22 12:30:41 +01:00
Lennert Buytenhek 51dd249eff [ARM] 4120/1: ep93xx: make clock init an arch_initcall()
Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-02-08 14:48:11 +00:00
Lennert Buytenhek 1d81eedb8f [ARM] 3634/1: ep93xx: initial implementation of the clk_* API
Patch from Lennert Buytenhek

Add an initial implementation of the clk_* API for the cirrus ep93xx
to the tree.  The initial implementation is somewhat minimal, with the
intention of extending it as we go along.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-06-24 10:33:02 +01:00