public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 12/16] dm: Add GPIO support and tests
Date: Fri, 28 Jun 2013 23:51:13 +0200	[thread overview]
Message-ID: <201306282351.13410.marex@denx.de> (raw)
In-Reply-To: <1371613960-28678-13-git-send-email-sjg@chromium.org>

Dear Simon Glass,

> Add driver model support for GPIOs. Since existing GPIO drivers do not use
> driver model, this feature must be enabled by CONFIG_DM_GPIO. After all
> GPO drivers are converted over we can perhaps remove this config.
> 
> Tests are provided for the sandbox implementation, and are a sufficient
> sanity check for basic operation.
> 
> The GPIO uclass understands the concept of named banks of GPIOs, with each
> GPIO device providing a single bank. Within each bank the GPIOs are
> numbered using an offset from 0 to n-1. For example a bank named 'b' with
> 20 offsets will provide GPIOs named b0 to b19.
> 
> Anonymous GPIO banks are also supported, and are just numbered without any
> prefix.
> 
> Each time a GPIO driver is added to the uclass, the GPIOs are renumbered
> accordinging, so there is always a global GPIO numbering order.

[...]

> +struct dm_gpio_ops {
> +	int (*request)(struct device *dev, unsigned offset, const char *label);
> +	int (*free)(struct device *dev, unsigned offset);
> +	int (*direction_input)(struct device *dev, unsigned offset);
> +	int (*direction_output)(struct device *dev, unsigned offset,
> +				int value);
> +	int (*get_value)(struct device *dev, unsigned offset);
> +	int (*set_value)(struct device *dev, unsigned offset, int value);
> +	int (*get_function)(struct device *dev, unsigned offset);

What's this "get_function()" call about? Is this to set GPIO AF ? If so, it's 
mixing pinmux and GPIO into one, that shouldn't happen.

> +	int (*get_state)(struct device *dev, unsigned offset, char *state,
> +			 int maxlen);
> +};

[...]

Best regards,
Marek Vasut

  reply	other threads:[~2013-06-28 21:51 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-19  3:52 [U-Boot] [PATCH v3 0/16] Driver model implementation, tests, demo and GPIO Simon Glass
2013-06-19  3:52 ` [U-Boot] [PATCH v3 01/16] sandbox: Make map_to_sysmem() use a constant pointer Simon Glass
2013-06-19  3:52 ` [U-Boot] [PATCH v3 02/16] sandbox: Correct data sizes and printf() strings in fdtdec.c Simon Glass
2013-06-19  3:52 ` [U-Boot] [PATCH v3 03/16] sandbox: config: Don't use 64-bit physical memory Simon Glass
2013-06-19  3:52 ` [U-Boot] [PATCH v3 04/16] sandbox: Build a device tree file for sandbox Simon Glass
2013-06-19  3:52 ` [U-Boot] [PATCH v3 05/16] Add cmd_process_error() to report and process errors Simon Glass
2013-06-19  3:52 ` [U-Boot] [PATCH v3 06/16] sandbox: config: Enable driver model Simon Glass
2013-06-19  3:52 ` [U-Boot] [PATCH v3 07/16] dm: Add base driver model support Simon Glass
2013-06-28 20:53   ` Marek Vasut
2013-10-18 16:44     ` Simon Glass
2013-06-19  3:52 ` [U-Boot] [PATCH v3 08/16] dm: Set up driver model after relocation Simon Glass
2013-06-28 20:53   ` Marek Vasut
2013-10-18 16:45     ` Simon Glass
2013-10-19  0:45       ` Marek Vasut
2013-06-19  3:52 ` [U-Boot] [PATCH v3 09/16] dm: Add basic tests Simon Glass
2013-06-19  3:52 ` [U-Boot] [PATCH v3 10/16] dm: Add a 'dm' command for testing Simon Glass
2013-06-28 20:57   ` Marek Vasut
2013-10-18 17:00     ` Simon Glass
2013-06-19  3:52 ` [U-Boot] [PATCH v3 11/16] dm: Add a demonstration/example driver Simon Glass
2013-06-28 21:46   ` Marek Vasut
2013-10-18 19:44     ` Simon Glass
2013-06-19  3:52 ` [U-Boot] [PATCH v3 12/16] dm: Add GPIO support and tests Simon Glass
2013-06-28 21:51   ` Marek Vasut [this message]
2013-10-18 19:46     ` Simon Glass
2013-06-19  3:52 ` [U-Boot] [PATCH v3 13/16] sandbox: Convert GPIOs to use driver model Simon Glass
2013-06-19  3:52 ` [U-Boot] [PATCH v3 14/16] dm: Enable gpio command to support " Simon Glass
2013-06-19  3:52 ` [U-Boot] [PATCH v3 15/16] dm: Add README for " Simon Glass
2013-06-28 21:26   ` Marek Vasut
2013-10-18 17:05     ` Simon Glass
2013-06-19  3:52 ` [U-Boot] [PATCH v3 16/16] dm: Move old driver model documentation into an 'old-docs' directory Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201306282351.13410.marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox