From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alessandro Rubini Date: Mon, 20 Jul 2009 10:09:55 +0200 Subject: [U-Boot] [PATCH 0/2] arm nomadik: gpio and i2c In-Reply-To: <4A6422FC.6030508@invitel.hu> References: <4A6422FC.6030508@invitel.hu> <20090719171353.5A910832E416@gemini.denx.de> Message-ID: <20090720080955.GA2640@mail.gnudd.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > Agreed. So we need an gpio_core.c / .h which defines the following > functions (just a proposal): Yes. > typedef struct gpio_adapter { > int (*init_pin)(int pin); > int (*set)(int pin, value); > int (*get)(int pin); > int (*dir)(int pin, int direction); > int (*level)(int pin, int level); > } I don't understand the init_pin function, nor what "level" is. Actually, even "dir" can be dropped: a get configures as input, a set configures as output, the extra instruction is very little overhead. But an alternate function configuration is definitely needed: everybody has alternate functions associated to the pins. Just say "0" is gpio and 1...n is SoC-specific. So, are you going to write it? Or should someone else do that? thanks /alessandro