From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 09/14] mfd: omap-usb-host: Add device tree support and binding information
Date: Mon, 11 Feb 2013 12:00:26 +0000 [thread overview]
Message-ID: <20130211120026.GD2726@e106331-lin.cambridge.arm.com> (raw)
In-Reply-To: <1360252974-7912-10-git-send-email-rogerq@ti.com>
On Thu, Feb 07, 2013 at 04:02:49PM +0000, Roger Quadros wrote:
> Allows the OMAP HS USB host controller to be specified
> via device tree.
>
> CC: Samuel Ortiz <sameo@linux.intel.com>
> Signed-off-by: Roger Quadros <rogerq@ti.com>
> ---
> .../devicetree/bindings/mfd/omap-usb-host.txt | 80 ++++++++++
> drivers/mfd/omap-usb-host.c | 160 +++++++++++++++++++-
> 2 files changed, 234 insertions(+), 6 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/mfd/omap-usb-host.txt
>
> diff --git a/Documentation/devicetree/bindings/mfd/omap-usb-host.txt b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt
> new file mode 100644
> index 0000000..b381fa6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt
> @@ -0,0 +1,80 @@
> +OMAP HS USB Host
> +
> +Required properties:
> +
> +- compatible: should be "ti,usbhs-host"
> +- reg: should contain one register range i.e. start and length
> +- ti,hwmods: must contain "usb_host_hs"
> +
> +Optional properties:
> +
> +- num-ports: number of USB ports. Usually this is automatically detected
> + from the IP's revision register but can be overridden by specifying
> + this property. A maximum of 3 ports are supported at the moment.
> +
> +- portN-mode: String specifying the port mode for port N, where N can be
> + from 1 to 3. If the port mode is not specified, that port is treated
> + as unused. When specified, it must be one of the following.
> + "ehci-phy",
> + "ehci-tll",
> + "ehci-hsic",
> + "ohci-phy-6pin-datse0",
> + "ohci-phy-6pin-dpdm",
> + "ohci-phy-3pin-datse0",
> + "ohci-phy-4pin-dpdm",
> + "ohci-tll-6pin-datse0",
> + "ohci-tll-6pin-dpdm",
> + "ohci-tll-3pin-datse0",
> + "ohci-tll-4pin-dpdm",
> + "ohci-tll-2pin-datse0",
> + "ohci-tll-2pin-dpdm",
> +
[...]
> +/**
> + * Map 'enum usbhs_omap_port_mode' found in <linux/platform_data/usb-omap.h>
> + * to the device tree binding portN-mode found in
> + * 'Documentation/devicetree/bindings/mfd/omap-usb-host.txt'
> + */
> +static const char *port_modes[] = {
> + [OMAP_USBHS_PORT_MODE_UNUSED] = "",
> + [OMAP_EHCI_PORT_MODE_PHY] = "ehci-phy",
> + [OMAP_EHCI_PORT_MODE_TLL] = "ehci-tll",
> + [OMAP_EHCI_PORT_MODE_HSIC] = "ehci-hsic",
> + [OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0] = "ohci-phy-6pin-datse0",
> + [OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM] = "ohci-phy-6pin-dpdm",
> + [OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0] = "ohci-phy-3pin-datse0",
> + [OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM] = "ohci-phy-4pin-dpdm",
> + [OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0] = "ohci-tll-6pin-datse0",
> + [OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM] = "ohci-tll-6pin-dpdm",
> + [OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0] = "ohci-tll-3pin-datse0",
> + [OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM] = "ohci-tll-4pin-dpdm",
> + [OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0] = "ohci-tll-2pin-datse0",
> + [OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM] = "ohci-tll-2pin-dpdm",
> +};
> +
> +/**
> + * omap_usbhs_get_dt_port_mode - Get the 'enum usbhs_omap_port_mode'
> + * from the port mode string.
> + * @mode: The port mode string, usually obtained from device tree.
> + *
> + * The function returns the 'enum usbhs_omap_port_mode' that matches the
> + * provided port mode string as per the port_modes table.
> + * If no match is found it returns -ENODEV
> + */
> +static const int omap_usbhs_get_dt_port_mode(const char *mode)
> +{
> + int i;
> +
> + for (i = 0; i < ARRAY_SIZE(port_modes); i++) {
> + if (!strcasecmp(mode, port_modes[i]))
> + return i;
> + }
Any reason for using strcasecmp rather than strcmp? The binding only specified
lower case versions, and this allows people to write "oHcI-PhY-6PiN-DaTsE0"
with impunity.
Otherwise, this looks fine to me.
Thanks,
Mark.
next prev parent reply other threads:[~2013-02-11 12:00 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-07 16:02 [PATCH v2 00/14] Device tree support for OMAP HS USB Host Roger Quadros
2013-02-07 16:02 ` [PATCH v2 01/14] usb: phy: nop: Add device tree support and binding information Roger Quadros
2013-02-11 11:40 ` Mark Rutland
2013-02-11 15:14 ` Roger Quadros
2013-02-11 15:31 ` Mark Rutland
2013-02-07 16:02 ` [PATCH v2 02/14] USB: phy: nop: Defer probe if device needs VCC/RESET Roger Quadros
2013-02-07 16:02 ` [PATCH v2 03/14] mfd: omap-usb-tll: move configuration code to omap_tll_init() Roger Quadros
2013-02-07 16:02 ` [PATCH v2 04/14] mfd: omap-usb-tll: Add device tree support Roger Quadros
2013-02-07 16:02 ` [PATCH v2 05/14] USB: ehci-omap: Get platform resources by index rather than by name Roger Quadros
2013-02-07 16:02 ` [PATCH v2 06/14] USB: ohci-omap3: " Roger Quadros
2013-02-07 16:02 ` [PATCH v2 07/14] USB: ohci-omap3: Add device tree support and binding information Roger Quadros
2013-02-11 11:46 ` Mark Rutland
2013-02-11 15:22 ` Roger Quadros
2013-02-11 15:32 ` Mark Rutland
2013-02-07 16:02 ` [PATCH v2 08/14] USB: ehci-omap: " Roger Quadros
2013-02-11 11:52 ` Mark Rutland
2013-02-07 16:02 ` [PATCH v2 09/14] mfd: omap-usb-host: " Roger Quadros
2013-02-11 12:00 ` Mark Rutland [this message]
2013-02-11 15:24 ` Roger Quadros
2013-02-07 16:02 ` [PATCH v2 10/14] ARM: dts: OMAP4: Add HS USB Host IP nodes Roger Quadros
2013-02-07 16:02 ` [PATCH v2 11/14] ARM: dts: omap4-panda: Add USB Host support Roger Quadros
2013-02-07 16:02 ` [PATCH v2 12/14] ARM: dts: OMAP3: Add HS USB Host IP nodes Roger Quadros
2013-02-07 16:02 ` [PATCH v2 13/14] ARM: dts: omap3-beagle: Add USB Host support Roger Quadros
2013-02-07 16:02 ` [PATCH v2 14/14] USB: ehci-omap: Fix autoloading of module Roger Quadros
2013-02-07 16:11 ` Alan Stern
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=20130211120026.GD2726@e106331-lin.cambridge.arm.com \
--to=mark.rutland@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).