Skip to contentSkip to conversation

powerpc/5200: Rework GPT driver to also be an IRQ controller

PATCH Superseded Grant Likely 1 participant 1 message Feb 2, 2009

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/5200: Rework GPT driver to also be an IRQ controller

From: Grant Likely <[email protected]>

This patch adds IRQ controller support to the MPC5200 General Purpose Timer (GPT) device driver. With this patch the mpc5200-gpt driver supports both GPIO and IRQ functions.

The GPT driver was contained within the mpc52xx_gpio.c file, but this patch moves it out into a new file (mpc52xx_gpt.c) since it has more than just GPIO functionality now and it was only grouped with the mpc52xx-gpio drivers as a matter of convenience before. Also, this driver will most likely get extended again to also provide support for the timer function.

Implementation note: Alternately, I could have tried to implement the IRQ support as a separate driver and left the GPIO portion alone. However, multiple functions of this device (ie. GPIO input+interrupt controller, or timer+GPIO) can be active at the same time and the registers are shared so it is safer to contain all functionality within a single driver.

Changes since v1:
- Removed magic numbers
- Only set to GPIO mode if it has the gpio-controller property. Otherwise leave the configuration alone. Firmware may have already configured it.

---

 arch/powerpc/platforms/52xx/Makefile       |    2 
 arch/powerpc/platforms/52xx/mpc52xx_gpio.c |   85 ------
 arch/powerpc/platforms/52xx/mpc52xx_gpt.c  |  432 ++++++++++++++++++++++++++++
 3 files changed, 433 insertions(+), 86 deletions(-)
 create mode 100644 arch/powerpc/platforms/52xx/mpc52xx_gpt.c
arch/powerpc/platforms/52xx/Makefile +1 -1
index 9dfbde2..bfd4f52 100644
@@ -1,7 +1,7 @@
 #
 # Makefile for 52xx based boards
 #
-obj-y				+= mpc52xx_pic.o mpc52xx_common.o
+obj-y				+= mpc52xx_pic.o mpc52xx_common.o mpc52xx_gpt.o
 obj-$(CONFIG_PCI)		+= mpc52xx_pci.o
 
 obj-$(CONFIG_PPC_MPC5200_SIMPLE) += mpc5200_simple.o
arch/powerpc/platforms/52xx/mpc52xx_gpio.c +0 -85

97 lines not on this page · raw message

arch/powerpc/platforms/52xx/mpc52xx_gpt.c new file +432 -0

432 lines not on this page · raw message