public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/3] omap: gpio: Use generic API (instead of custom)
@ 2011-09-05 20:28 Sanjeev Premi
  2011-09-05 20:28 ` [U-Boot] [PATCH 1/3] omap: gpio: Use generic API Sanjeev Premi
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Sanjeev Premi @ 2011-09-05 20:28 UTC (permalink / raw)
  To: u-boot

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 aims to use generic API instead of custom one.
After making the API level changes, most of the board specific
files were updated via this bash script (to minimize errors).

  [script]
  list=search.lst

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

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

  sed -i '/\.sh$/d'    ${list}	# Protect this script

  sed -i '/\.o$/d'     ${list}	# Object files
  sed -i '/\.orig$/d'  ${list}	# ongoing merge
  sed -i '/\.rej$/d'   ${list}	# ongoing merge

  sed -i '/\.git/d'    ${list}	# git packs
  sed -i '/patch/d'    ${list}	# patches
  sed -i '/diff/d'     ${list}	# saved diffs
  sed -i '/save/d'     ${list}	# any specifically saved content

  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*,\s*1\)/gpio_direction_input(\1)/g' "$f"
    sed -r -i 's/omap_set_gpio_direction\s*\((\w+)\s*,\s*(\w+)\)/gpio_direction_output(\1, \2)/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"
    sed -r -i 's/omap_get_gpio_dataout/gpio_get_value/g' "$f"
    sed -r -i 's/asm\/arch\/gpio.h/asm\/gpio.h/g' "$f"
  done
  [/script]

Few manual changes were still required to ensure that sources
compile without errors for all these configurations:
 - omap3_evm_config
 - am3517_evm_config
 - am3517_crane_config
 - omap4_panda_config
 - omap3_zoom1_config
 - omap4_sdp4430_config
 - igep0020_config
 - cm_t35_config
 - devkit8000_config
 - igep0030_config
 - dig297_config
 - omap3_beagle_config
 - omap3_pandora_config
 - omap3_sdp3430_config
 - omap3_zoom2_config
 - omap3_overo_config

 All these boards define "CONFIG_OMAP34XX" - therefore likely
 to be impacted with this change. The list was created using:
 grep -l -R "OMAP34XX" include/configs | cut -d "/" -f 3 | sed 's/\.h/_config/g'

 Some additional patches would be required for successful
 build. Some of them are under discussion, but they status
 shouldn't impact the contents of this patch set:
 1) http://marc.info/?l=u-boot&m=131515805732292&w=2
 2) http://marc.info/?l=u-boot&m=131521839308281&w=2

Changes since RFC[1]:
 1) While the original RFC was based against the master of
    u-boot.git. This series is based against master of
    u-boot-arm.git

 2) Used better logic to search and fix 'possibly' impacted
    files i.e. the script embedded above.

 3) In order to avoid rejection of patch series due to long
    recipent list, board maintainers will be sent separate
    (off-the-list) notification.

 [1] http://marc.info/?l=u-boot&m=131473403131657&w=2


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 |  113 ++++++++++++++++++++++++---------
 arch/arm/cpu/armv7/omap4/clocks.c     |    5 +-
 arch/arm/include/asm/omap_gpio.h      |   15 -----
 board/cm_t35/leds.c                   |    6 +-
 board/comelit/dig297/dig297.c         |   12 ++--
 board/isee/igep0020/igep0020.c        |   12 ++--
 board/logicpd/zoom2/debug_board.c     |   10 ++--
 board/logicpd/zoom2/led.c             |   38 ++++++------
 board/logicpd/zoom2/zoom2.c           |   10 ++--
 board/overo/overo.c                   |   54 ++++++++--------
 board/ti/beagle/beagle.c              |   44 +++++++-------
 board/ti/beagle/led.c                 |   22 +++---
 board/ti/evm/evm.c                    |   12 ++--
 doc/README.omap3                      |   20 +++---
 14 files changed, 205 insertions(+), 168 deletions(-)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-09-08 12:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-05 20:28 [U-Boot] [PATCH 0/3] omap: gpio: Use generic API (instead of custom) Sanjeev Premi
2011-09-05 20:28 ` [U-Boot] [PATCH 1/3] omap: gpio: Use generic API Sanjeev Premi
2011-09-05 20:28 ` [U-Boot] [PATCH 2/3] omap: gpio: generic changes after changing API Sanjeev Premi
2011-09-05 20:28 ` [U-Boot] [PATCH 3/3] omap: gpio: Adapt board files to use generic API Sanjeev Premi
2011-09-05 20:46 ` [U-Boot] [PATCH 0/3] omap: gpio: Use generic API (instead of custom) Paulraj, Sandeep
2011-09-07  9:24 ` Luca Ceresoli
2011-09-07  9:39   ` Premi, Sanjeev
2011-09-07  9:48     ` Premi, Sanjeev
2011-09-08 12:51       ` Luca Ceresoli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox