]> git.karo-electronics.de Git - karo-tx-uboot.git/commit
mxs_gpio: correctly use the GPIO API
authorLothar Waßmann <LW@KARO-electronics.de>
Thu, 30 Jun 2016 13:40:18 +0000 (15:40 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 30 Jun 2016 13:40:18 +0000 (15:40 +0200)
commit24ec4dbd5a59630f8d0ede2aad560d1336e31fdd
tree93c10436c27a196597e9ba6efb15d324bef55306
parent1371dc3452847204d725ed713ca478b6b4c02d77
mxs_gpio: correctly use the GPIO API

The GPIO API expects a linear GPIO number as parameter to the gpio_*()
functions. The current implementation of the mxs_gpio driver operates on
iomux_cfg_t cookies instead. Therefore the 'gpio' command cannot be
used with this driver.
Change the driver to implement the correct API and introduce some
checks to catch users that still use the old semantics.
1. assert the most sigificant bit in the iomux_cfg_t pad definitions,
   so that using such a cookie in place of a GPIO number will
   decisively generate an invalid GPIO number and flag an error at runtime.
2. introduce a compile switch CONFIG_MXS_IOMUX_COMPILE_CHECK to make
   the iomux_cfg_t cookie a 64 bit variable, so that passing an
   iomux_cfg_t value to a gpio_*() function will generate a compile
   time error.
arch/arm/include/asm/arch-mxs/gpio.h
arch/arm/include/asm/arch-mxs/iomux.h
board/denx/m28evk/m28evk.c
board/freescale/mx23evk/mx23evk.c
board/freescale/mx28evk/mx28evk.c
board/karo/tx28/tx28.c
board/olimex/mx23_olinuxino/mx23_olinuxino.c
drivers/gpio/mxs_gpio.c
include/configs/mx23_olinuxino.h