
On Thu, Jun 2, 2011 at 2:34 PM, Wolfgang Denk wd@denx.de wrote:
Dear Tom Warren,
In message BANLkTi=w1u7q+W-VKRYCq-wB50e7edFAdA@mail.gmail.com you wrote:
Let me double-check. IIRC, one (cmd_gpio) didn't apply since it was from another SoC and didn't have the commands we use on Tegra, and the other (where the driver should go) ended with Mike saying "i'm not sure sweating the location of the driver is important", so I've left it with the other GPIO drivers.
What I'm referring to is the "lots of duplicated code" part.
Actually, if you do a kompare between cmd_gpio.c and tegra2_gpio.c, there's virtually no 'duplicated' code, just 2 different implementations of do_gpio, with different args and parsing of params, etc. I use info, port, input and output, and cmd_gpio uses input, set, clear and toggle. Since cmd_gpio.c isn't built, it's not duplicating any code in the U-Boot binary, space-wise. So there's no advantage to using it instead of my own driver's cmd parser.
Note that the PCA953x GPIO driver also does it's own cmd parsing in do_pca953x().
Tom
Best regards,
Wolfgang Denk
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de Computers are not intelligent. They only think they are.