Add the .reset method to the HCD, and update the .start method
accordingly for this change.
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Add OHCI shutdown methods to cleanly shutdown the OHCI controller on
system shutdowns and reboots. This avoids the controller continuing
to run should be soft-reboot the platform, potentially scribbling
over system memory.
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Combine usb_hcd_sa1111_probe() and ohci_hcd_sa1111_drv_probe(), doing
the same for the remove methods.
Move sa1111_start_hc and sa1111_stop_hc to be located next to these
the probe/release functions, as they're only called from them.
Get rid of the /*----*/ breaker lines.
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Use dev_dbg() instead, it's more friendly.
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Clean up the ohci-sa1111 driver formatting to be more compliant with
current standards, and add 'static' to various function definitions
to avoid sparse complaints about undeclared functions. Remove the
unnecessary local declaration of 'usb_disabled', which can be found
instead in linux/usb.h.
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
The sa1111 support will ioremap() the device; there is no need for
platforms to setup a static mapping for this. Remove the static
mapping for this device from badge4, jornada720 and neponset.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Use dev_err() to report device specific errors rather than printk().
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Move the releasing of resources out of the release function - this
allows a cleaner and more conventional arrangement of the registration
failure paths and a saner unregistration process for these devices.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
It's pointless registering the PS/2 interfaces with the dmabounce code
when there's no DMA support for these in hardware, so only setup the
DMA masks for two subdevices which support DMA - the OHCI and SAC.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Use the bus notifier to register sa1111 devices with dmabounce, rather
than after the device has been registered, potentially racing with
driver binding.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Move the USB interface register definitions into the driver, rather
than keeping them in a common place.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Move the PCMCIA interface register definitions into the driver, rather
than keeping them in a common place.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Move the PS/2 interface register definitions into the driver, rather
than keeping them in a common location.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Get rid of the unused GPIO register definitions - we access GPIO
registers through the base + offset method, and having the phys
address definitions is unnecessary duplication.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Some platforms don't want certain devices to be registered, because,
eg, the interface is not wired. Provide a way for platforms to
prevent various devices from being registered via a devid bitmask in
the platform data.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
As the DMA engine API allows DMA channels to be reconfigured on the
fly, we can now support switching the DMA channel configuration to
support SIR transmit DMA without needing to claim an additional
physical DMA channel - thereby using up half the DMA channels just
for one driver.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Convert the sa11x0 IrDA driver to use the sa11x0 DMA engine driver
rather than our own platform specific DMA API.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Add sa11x0 DMA platform device and resources to the list of
generic platform devices for SA11x0 machines.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Add support for the SA-11x0 DMA driver, which replaces the private
API version in arch/arm/mach-sa1100/dma.c.
We model this as a set of virtual DMA channels, one for each request
signal, and assign the virtual DMA channel to a physical DMA channel
when there is work to be done. This allows DMA users to claim their
channels, and hold them while not in use, without affecting the
availability of the physical channels.
Another advantage over this approach, compared to the private version,
is that a channel can be reconfigured on the fly without having to
release and re-request it - which for the IrDA driver, allows us to
use DMA for SIR mode transmit without eating up three physical
channels. As IrDA is half-duplex, we actually only need one physical
channel, and this architecture allows us to achieve that.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
The sa11x0-ir device is not the device which is doing the DMA, the
DMA is being performed by a separate DMA engine. Split the struct
device associated with each DMA channel from the main struct device,
but for the time being initialize it from the main struct device.
This is another preparatory step to converting this driver to use the
DMA engine API.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
The SIR transmit buffer was being allocated as 4000 bytes. IrDA now
has constants for the buffer sizes, and defines the maximum wrapped
SIR packet to be 4269 bytes as indicated by IRDA_SIR_MAX_FRAME. Use
this definition to allocate the transmit buffer instead.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Convert the sa11x0 IrDA driver to use the scatterlist DMA API. This
is a preparatory patch for converting the driver to use the DMA engine
API, which requires a struct scatterlist for every transfer.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Move the interrupt handlers to the SIR and FIR sections of the file.
This improves the localization of the protocol handlers.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Whenever we complete a transmit, we always check for a speed change.
This check was open coded in several places. Provide a helper
function to do this instead.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Places these functions in better locations in the file, near where
they are used. This saves some tiresome paging up/down.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Ensure that we unmap and free a pending transmit skb when the interface
is stopped. We rearrange the code a little bit to give all places a
similar layout when freeing the skb in both the completion and interface
stop paths - this gives some consistency to the code.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Both the transmit and receive DMA store identical data: the skb, dma
address, and the dma registers. Move this data into its own data
structure. The following replacements were used:
rxskb -> dma_rx.skb
rxbuf_dma -> dma_rx.dma
rxdma -> dma_rx.regs
txskb -> dma_tx.skb
txbuf_dma -> dma_tx.dma
txdma -> dma_tx.regs
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Convert the sa11x0-ir driver to obtain its interrupt number from the
platform device resources, rather than via the asm/irq.h include.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Add the missing SET_NETDEV_DEV() call to set the parent device
correctly for this network interface.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Change the sa1111 device id to be a bitmask. This allows us to
specify the actual device, while allowing a single driver to bind
to both PS2 devices.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Move the handling of the 5v supply into badge4.c, removing this board
specific detail from the sa1111 ohci driver.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Add platform hooks to be called when individual sa1111 devices are
enabled and disabled. This will allow us to move some platform
specifics out of the individual drivers.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Add a shutdown hook to the sa1111_driver structure to allow drivers
to be notified of system reboots and shutdowns.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Implement the necessary allocation/freeing functionality to support
sparse IRQs with the SA-1111 device. On non-sparse IRQ platforms,
this allows us to dynamically allocate from within the available IRQ
number space.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Commit 19851c58e6 (sa1111: allow cascaded IRQs to be used by platforms)
moved the IRQ definitions to the .c file, and added an irq_base member
to the private data structure.
The inerrupt demultiplexer uses irq_base, but the interrupt setup code
does not. Also, although the commit adds a private data structure to
pass this data, it isn't even referenced, resulting in irq_base being
zero.
We also copied the IRQ numbers from the device info array into the actual
devices, resulting in wrong interrupt numbers passed to the sub-devices.
The net effect of this is that we always overwrite IRQs 0-54, even if
they are allocated elsewhere in the system.
Add the code necessary to setup the private irq_base, and use it in the
IRQ setup code. Make the SA-1111 probe fail with -EINVAL if there is no
platform data provided.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Add a .owner initializer to the sa1111 driver structures to allow
allow the modules to be associated with their driver structures.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Add an initializer for the struct device_driver .owner member.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
We should not write to the SA1111 registers after setting the SLEEP
bit. Moreover, the manual says that the PWM registers should be
disabled before we enter sleep. So, move the clearing of these
registers earlier in the suspend sequence.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
We weren't re-enabling the memory request/grant signals on resume,
causing DMA devices on the sa1111 to fail.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Now that we ioremap() the neponset register space, there's no need
to static map the neponset registers. Get rid of this static mapping.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Move the board specific neponset register definitions to the board
file, rather than mach/neponset.h. However, as the NCR_0 register
definitions are used by some drivers, leave these behind.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>