summaryrefslogtreecommitdiff
path: root/drivers/staging/ipack
AgeCommit message (Collapse)Author
2012-10-24staging: ipack: add missing include (implicit declaration of function 'kfree')Sergei Trofimovich
On ARCH=alpha make allmodconfig: linux-2.6/drivers/staging/ipack/bridges/tpci200.c: In function 'tpci200_free_irq': linux-2.6/drivers/staging/ipack/bridges/tpci200.c:188:2: error: implicit declaration of function 'kfree' [-Werror=implicit-function-declaration] linux-2.6/drivers/staging/ipack/bridges/tpci200.c: In function 'tpci200_request_irq': linux-2.6/drivers/staging/ipack/bridges/tpci200.c:215:2: error: implicit declaration of function 'kzalloc' [-Werror=implicit-function-declaration] Fixed by adding <linux/slab.h> header CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org> CC: Samuel Iglesias Gonsalvez <siglesias@igalia.com> CC: Jens Taprogge <jens.taprogge@taprogge.org> CC: "Miguel Gómez" <magomez@igalia.com> CC: devel@driverdev.osuosl.org Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-01Merge tag 'tty-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/ttyLinus Torvalds
Pull TTY changes from Greg Kroah-Hartman: "As we skipped the merge window for 3.6-rc1 for the tty tree, everything is now settled down and working properly, so we are ready for 3.7-rc1. Here's the patchset, it's big, but the large changes are removing a firmware file and adding a staging tty driver (it depended on the tty core changes, so it's going through this tree instead of the staging tree.) All of these patches have been in the linux-next tree for a while. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" Fix up more-or-less trivial conflicts in - drivers/char/pcmcia/synclink_cs.c: tty NULL dereference fix vs tty_port_cts_enabled() helper function - drivers/staging/{Kconfig,Makefile}: add-add conflict (dgrp driver added close to other staging drivers) - drivers/staging/ipack/devices/ipoctal.c: "split ipoctal_channel from iopctal" vs "TTY: use tty_port_register_device" * tag 'tty-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (235 commits) tty/serial: Add kgdb_nmi driver tty/serial/amba-pl011: Quiesce interrupts in poll_get_char tty/serial/amba-pl011: Implement poll_init callback tty/serial/core: Introduce poll_init callback kdb: Turn KGDB_KDB=n stubs into static inlines kdb: Implement disable_nmi command kernel/debug: Mask KGDB NMI upon entry serial: pl011: handle corruption at high clock speeds serial: sccnxp: Make 'default' choice in switch last serial: sccnxp: Remove mask termios caps for SW flow control serial: sccnxp: Report actual baudrate back to core serial: samsung: Add poll_get_char & poll_put_char Powerpc 8xx CPM_UART setting MAXIDL register proportionaly to baud rate Powerpc 8xx CPM_UART maxidl should not depend on fifo size Powerpc 8xx CPM_UART too many interrupts Powerpc 8xx CPM_UART desynchronisation serial: set correct baud_base for EXSYS EX-41092 Dual 16950 serial: omap: fix the reciever line error case 8250: blacklist Winbond CIR port 8250_pnp: do pnp probe before legacy probe ...
2012-09-14Staging: ipack/devices/ipoctal: simplify ipoctal_write_tty()Samuel Iglesias Gonsalvez
Remove count_wr and the assigment of nb_bytes = 0 in that function as is useless. Now it returns the count of the characters actually sent. There is other nb_bytes = 0 deleted that has a duplicate a few lines before. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-14Staging: ipack/devices/ipoctal: acknowledge BREAK condition.Samuel Iglesias Gonsalvez
Clear the BREAK flag from the ISR register. Doing that, we avoid to read the same condition for the next character received. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-14staging: ipack: remove irq field in struct ipack_device.Jens Taprogge
The field irq currently is identical to the slot number. It does not seem to have any real use. The number is written to hardware in ipoctal but it seems the value that is written does not matter. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-14Staging: ipack: move the responsibility to clear interrupts to the IPack ↵Jens Taprogge
devices. Now the IPack device acknowledges its own IRQ. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-14Staging: ipack: Add IPACK_INT_SPACE memory space.Jens Taprogge
This will allow us to correctly access the IPack INT space. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12staging: ipack/bridges/tpci200: Use endianess-aware types where applicable.Jens Taprogge
Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack/devices/ipoctal: Unmap memory on device removal.Jens Taprogge
Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack: update TODO fileSamuel Iglesias Gonsalvez
With the latest patches, the TODO file was outdated. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack/devices/ipoctal: read more than one character from RX FIFO.Samuel Iglesias Gonsalvez
The RX FIFO has a size of 3 characters. Check if when we are picking the oldest one, we have more to read. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack/devices/ipoctal: Get rid of ipoctal_list.Jens Taprogge
Use tty_dev->dev's drdata to associate struct ipocal_channel to the respective tty_struct. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack/devices/ipoctal: Use KBUILD_MODNAME instead of hardcoded string.Jens Taprogge
Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack/devices/ipoctal: Check tty_register_device return value.Jens Taprogge
Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack/devices/ipoctal: Clean up device removal.Jens Taprogge
Make use of dev_set_drvdata() and dev_get_drvdata() to store and obtain a pointer to the ipoctal struct corresponding to a struct dev. Previously we relied on a private list of devices. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack: Let interrupts return irqreturn_t.Jens Taprogge
Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack/bridges/tpci200: move tpci200_free_irq() and ↵Jens Taprogge
tpci200_request_irq() Now, all the interrupt related functions are next to each other. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack/bridges/tpci200: More cleanups.Jens Taprogge
Rename __tpci_request_irq() to tpci_enable_irq() and __tpci_free_irq() to tpci_disable_irq(). Change their second argument, move them above tpci200_interrupt(), and use tpci_disable_irq() in the latter Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack/bridges/tpci200: Cleanup in tpci200_slot_irq() and ↵Jens Taprogge
tpci200_interrupt() Minor cleanup. No functional changes. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack/bridges/tpci200: Clean up interrupt handling.Jens Taprogge
Previously the return value from tpci200_interrupt was not quite correct if a slot had caused an interrupt but no handler was instellalled: IRQ_NONE was returned. However in this case we react to the interrupt by disabling the IPack device interrupt. Basically there are two cases the code now distinguishes: - The tpci200 has raised an interrupt. We handle it and return IRQ_HANDLED. - Our device did not raise an interrupt. We return IRQ_NONE. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack/bridges/tpci200: Protect device registers with spinlock.Jens Taprogge
Some of the device registers are accessed from both interrupt and non-interrupt context. To ensure proper read-modify-write modification of these registers we can not use the "global" tpci200 mutex. Instead a spin-lock is used. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack/bridges/tpci200: RCU protect slot_irq pointers.Jens Taprogge
In tpci200_request_irq as well as tpci200_free_irq we set and unset the pointer to struct slot_irq. This pointer is accessed in tpci200_interrupt. To ensure that the pointer is not freed after it has been fetched in tpci200_interrupt() it is now protected through RCU. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack/devices/ipoctal: remove superfluous function.Jens Taprogge
ipoctal_write_tty and ipoctal_write are merged. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack/devices/ipoctal: Split interrupt service routine.Jens Taprogge
Split the IRQ service routing in TX part and RX part. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack/devices/ipoctal: Store isr masks in ipoctal_channelJens Taprogge
This way interrupt handling becomes independent of the channel number. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack/devices/ipoctal: put ipoctal_channel into tty->driver_data.Jens Taprogge
Each tty's driver_data is now pointing to the channel it is talking to. struct ipoctal_channel contains all the information the callbacks require to do their work. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack/devices/ipoctal: Directly use ioread/iowrite function.Jens Taprogge
Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack/devices/ipoctal: split ipoctal_channel from ipoctal.Jens Taprogge
By moving everything channel related into a separate struct we will be able to clean up a lot of code. In the end tty->driver_data will no longer need to point to ipoctal but instead can point to the respective channel. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack/bridges/tpci200: Clean up interrupt handler.Jens Taprogge
This also removes a possible bug in the unhandles_ints part when slots[i] is not set. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack/bridges/tpci200: Remove side effects of ↵Jens Taprogge
tpci200_{request,free}_irq. Use the __tpci200_{set,clear}_mask routines to access control register. Do not overwrite flags unrelated to interrupt handling. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12Staging: ipack/bridges/tpci200: add helpers for writing control regs.Jens Taprogge
Convert tpci200_set_clockrate and tpci200_interrupt. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Staging: ipack/bridges/tpci200: Store the irq holder in slot_irq.Jens Taprogge
This way we do no longer need to keep a dangling pointer to struct ipack_device in tpci200_slot after the device has been removed. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Staging: ipack: delete .remove_device() callbackSamuel Iglesias Gonsálvez
As the IP module driver takes care of freeing its resources. Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Staging: ipack/bridges/tpci200: remove tpci200_slot_unregisterSamuel Iglesias Gonsálvez
It is not needed as the IP module should free its IRQ using tpci200_free_irq callback. Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Staging: ipack/bridges/tpci200: delete ipack_device_unregister calls when ↵Samuel Iglesias Gonsálvez
exiting As the ipack_bus_unregister() takes care of unregistering the devices plugged in the carrier, it is not needed to do it in the carrier driver. Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Staging: ipack: unregister devices when uninstall the carrier device.Samuel Iglesias Gonsálvez
Find the IP modules that are plugged to the carrier and unregister them. Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Staging: ipack/devices/ipoctal: free the IRQ.Samuel Iglesias Gonsálvez
As the IRQ was requested by the driver, it should free it also. Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Staging: ipack/devices/ipoctal: change exiting procedureSamuel Iglesias Gonsálvez
The ipoctal devices can be uninstalled from the ipack_driver_unregister() call as the device model calles the bus's .remove() function for each device registered by the driver and it will execute the .remove() function of the ipoctal driver. Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Staging: ipack/bridges/tpci200: fix the uninstall the ipack deviceSamuel Iglesias Gonsálvez
Using the call to the ipack_device_unregister() function to avoid the strange way it was doing, as the device model will take care of calling the bus's .remove function when a device is being unregistered. Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Staging: ipack/bridges/tpci200: increment the reference counter of the pci_devSamuel Iglesias Gonsálvez
As indicated in the documentation of pci_dev_get. Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Staging: ipack/bridges/tpci200: reorder the iounmap and pci_release_regionSamuel Iglesias Gonsálvez
Move iounmap and pci_release_region to tpci200_unregister(), as it is the place where the clean-up of the device is done. Also, renamed iounmap() to pci_iounmap() as the mapped region was requested from PCI bus. Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Staging: ipack: check the device ID space CRC.Jens Taprogge
We check the CRC and store the result of the check in struct ipac_device. A warning is emitted if the check fails. However we leave it to the IPack module device to refuse to initialize due to a bad CRC. I have seen otherwise good modules with bad CRCs. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Staging: ipack: reset previous timeouts during device registration.Jens Taprogge
Resetting the previous timeout we avoid to read the timeout status register and see timeout errors that don't correspond to the present state of the device. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Staging: ipack: Switch to 8MHz operation before reading ID.Jens Taprogge
Reading the ID space at 8 MHz is always supported. Most carriers will boot up in 8MHz mode. Still, play it safe and ensure we are operating at 8Mhz. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Staging: ipack/bridges/tpci200: remove struct list_headSamuel Iglesias Gonsálvez
As the linked list was removed before, delete the useless struct list_head Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Staging: ipack: remove field driver from struct ipack_device.Jens Taprogge
After a successful match is found the driver field in struct device is set by the core device code. We can use this field. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Staging: ipack: Choose the optimum bus speed by default.Jens Taprogge
Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Staging: ipack: Obtain supported speeds from ID ROM.Jens Taprogge
Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Staging: ipack/bridges/tpci200: provide new callbacks to tpci200Jens Taprogge
Provide get_clockrate, set_clockrate, get_error, get_timeout and reset_timeout callbacks. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Staging: ipack: Provide several carrier callbacks.Jens Taprogge
We provide callbacks to: - set/get the clockrate a module is accessed at, - get the error state of a slot, - get/reset the timeout state of a slot. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>