[U-Boot] [RFC 0/3] omap: gpio: User generic (instead of custom) API

Sanjeev Premi premi at ti.com
Tue Aug 30 21:52:31 CEST 2011


The OMAP boards use a custom api for GPIO operations. While
it works, it doesn't help when when we don't know existence
of the customization.

I earlier encountered the problem when looking for GPIO
related changes when submitting prev set of patches. Since
the search for gpio_request() in omap sources returned empty,
I had assumed that it isn't supported.

This patchset attempts to adapt the current implementation
to use generic API.

Since, the changes impact all OMAP boards, and I wouldn't be
able to test on all, I decided to submit changes as RFC.
Unless any major issue is found, I will be able to submit
as formal patch by end of this week.

Following bash script was used to replace all occurences of
the custom API with generic equivalent. After the changes, I
have compile tested the OMAP3EVM only. Will be able to test
changes only by FRI.

 #!/bin/bash

 list=search.lst

 [ -f ${list} ] && \rm -rf ${list}

 grep -l -R "omap_.*_gpio" . > ${list}

 sed -i '/\.sh$/d'    ${list}
 sed -i '/\.o$/d'     ${list}
 sed -i '/\.orig$/d'  ${list}
 sed -i '/\.rej$/d'   ${list}
 sed -i '/\.git/d'    ${list}
 sed -i '/patch/d'    ${list}
 sed -i '/diff/d'     ${list}
 sed -i '/save/d'     ${list}

 for f in `cat ${list}` ;
 do
        echo "Fixing $f..."

        sed -r -i 's/omap_request_gpio\s*\((\w+)\)/gpio_request(\1, "")/g' "$f"
        sed -r -i 's/omap_free_gpio/gpio_free/g' "$f"
        sed -r -i 's/omap_set_gpio_direction\s*\((\w+),\s*1\)/gpio_direction_input(\1)/g' "$f"
        sed -r -i 's/omap_set_gpio_direction\s*\((\w+),\s*0\)/gpio_direction_output(\1)/g' "$f"
        sed -r -i 's/omap_set_gpio_dataout/gpio_set_value/g' "$f"
        sed -r -i 's/omap_get_gpio_datain/gpio_get_value/g' "$f"
 done

Sanjeev Premi (3):
  omap: gpio: Use generic API
  omap: gpio: generic changes after changing API
  omap: gpio: Adapt board files to use generic API

 arch/arm/cpu/armv7/omap-common/gpio.c  |   74 +++++++++++++++++++++++---------
 arch/arm/cpu/armv7/omap4/clocks.c      |    4 +-
 arch/arm/include/asm/arch-omap3/gpio.h |   19 ++++++++
 arch/arm/include/asm/omap_gpio.h       |   13 ------
 board/cm_t35/leds.c                    |    4 +-
 board/comelit/dig297/dig297.c          |   10 ++--
 board/isee/igep0020/igep0020.c         |   10 ++--
 board/logicpd/zoom2/debug_board.c      |    8 ++--
 board/logicpd/zoom2/led.c              |   36 ++++++++--------
 board/logicpd/zoom2/zoom2.c            |    8 ++--
 board/overo/overo.c                    |   52 +++++++++++-----------
 board/ti/beagle/beagle.c               |   34 +++++++-------
 board/ti/beagle/led.c                  |   12 +++---
 board/ti/evm/evm.c                     |   12 +++---
 doc/README.omap3                       |   20 ++++----
 15 files changed, 177 insertions(+), 139 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-omap3/gpio.h

Cc: Sandeep Paulraj <s-paulraj at ti.com>
Cc: Igor Grinberg <grinberg at compulab.co.il>
Cc: Luca Ceresoli <luca.ceresoli at comelit.it>
Cc: Enric Balletbo i Serra <eballetbo at gmail.com>
Cc: Sunil Kumar <sunilsaini05 at gmail.com>
Cc: Shashi Ranjan <shashiranjanmca05 at gmail.com>
Cc: Nishanth Menon <nm at ti.com>
Cc: Steve Sakoman <steve at sakoman.com>



More information about the U-Boot mailing list