LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "pHilipp Zabel" <philipp.zabel@gmail.com>
To: "Felipe Balbi" <me@felipebalbi.com>
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
david-b@pacbell.net, tony@atomide.com
Subject: Re: [PATCH 2/4] USB: OTG: Make otg_get_transceiver() and otg_set_transceiver() generic
Date: Mon, 25 Aug 2008 15:35:06 +0200 [thread overview]
Message-ID: <74d0deb30808250635p670d7fd8vdf75ea5111ad0077@mail.gmail.com> (raw)
In-Reply-To: <1200753446-9378-3-git-send-email-me@felipebalbi.com>
Hi,
On Sat, Jan 19, 2008 at 4:37 PM, Felipe Balbi <me@felipebalbi.com> wrote:
> From: Tony Lidgren <tony@atomide.com>
>
> Move otg_get_transceiver() and otg_set_transceiver() from omap specific code
> to common otg.c so other upcoming drivers can share them.
>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> Signed-off-by: Felipe Balbi <me@felipebalbi.com>
> ---
> arch/arm/plat-omap/usb.c | 32 --------------------------------
> drivers/usb/core/otg.c | 20 ++++++++++++++++++++
> 2 files changed, 20 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/usb/core/otg.c b/drivers/usb/core/otg.c
> index 11967c0..531afa6 100644
> --- a/drivers/usb/core/otg.c
> +++ b/drivers/usb/core/otg.c
> @@ -14,9 +14,29 @@
> #include <linux/byteorder/generic.h>
> #include <linux/gfp.h>
> #include <linux/usb.h>
> +#include <linux/usb/otg.h>
>
> #include "otg_whitelist.h"
>
> +static struct otg_transceiver *xceiv;
> +
> +int otg_set_transceiver(struct otg_transceiver *x)
> +{
> + if (xceiv && x)
> + return -EBUSY;
> + xceiv = x;
> + return 0;
> +}
> +EXPORT_SYMBOL(otg_set_transceiver);
> +
> +struct otg_transceiver *otg_get_transceiver(void)
> +{
> + if (xceiv)
> + get_device(xceiv->dev);
> + return xceiv;
> +}
> +EXPORT_SYMBOL(otg_get_transceiver);
> +
> #ifdef CONFIG_USB_OTG_WHITELIST
>
> /*
> diff --git a/arch/arm/plat-omap/usb.c b/arch/arm/plat-omap/usb.c
> index a5aedf9..5cd39fa 100644
> --- a/arch/arm/plat-omap/usb.c
> +++ b/arch/arm/plat-omap/usb.c
> @@ -76,38 +76,6 @@
>
> /*-------------------------------------------------------------------------*/
>
> -#ifdef CONFIG_ARCH_OMAP_OTG
> -
> -static struct otg_transceiver *xceiv;
> -
> -/**
> - * otg_get_transceiver - find the (single) OTG transceiver driver
> - *
> - * Returns the transceiver driver, after getting a refcount to it; or
> - * null if there is no such transceiver. The caller is responsible for
> - * releasing that count.
> - */
> -struct otg_transceiver *otg_get_transceiver(void)
> -{
> - if (xceiv)
> - get_device(xceiv->dev);
> - return xceiv;
> -}
> -EXPORT_SYMBOL(otg_get_transceiver);
> -
> -int otg_set_transceiver(struct otg_transceiver *x)
> -{
> - if (xceiv && x)
> - return -EBUSY;
> - xceiv = x;
> - return 0;
> -}
> -EXPORT_SYMBOL(otg_set_transceiver);
> -
> -#endif
> -
> -/*-------------------------------------------------------------------------*/
> -
> #if defined(CONFIG_ARCH_OMAP_OTG) || defined(CONFIG_ARCH_OMAP15XX)
>
> static u32 __init omap_usb0_init(unsigned nwires, unsigned is_device)
> --
> 1.5.4.rc3.24.gb53139
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
what is the status of this patch? I guess moving
otg_get/set_transceiver into usb core like this (and adding
otg_put_transceiver) is better than duplicating this code for PXA and
other architectures?
regards
Philipp
next prev parent reply other threads:[~2008-08-25 13:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-19 14:37 [PATCH 0/4] USB OTG Targeted Peripheral List changes Felipe Balbi
2008-01-19 14:37 ` [PATCH 1/4] USB: OTG: Introduce new otg.c code Felipe Balbi
2008-01-19 14:37 ` [PATCH 2/4] USB: OTG: Make otg_get_transceiver() and otg_set_transceiver() generic Felipe Balbi
2008-01-19 14:37 ` [PATCH 3/4] USB: OTG: Start using new otg tpl Felipe Balbi
2008-01-19 14:37 ` [PATCH 4/4] USB: OTG: Add check for roothub initialization Felipe Balbi
2008-01-19 14:37 ` [PATCH] USB: OTG: Make otg_tpl come from platform_data Felipe Balbi
2008-08-25 13:35 ` pHilipp Zabel [this message]
2008-08-25 13:39 ` [PATCH 2/4] USB: OTG: Make otg_get_transceiver() and otg_set_transceiver() generic Felipe Balbi
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=74d0deb30808250635p670d7fd8vdf75ea5111ad0077@mail.gmail.com \
--to=philipp.zabel@gmail.com \
--cc=david-b@pacbell.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=me@felipebalbi.com \
--cc=tony@atomide.com \
--subject='Re: [PATCH 2/4] USB: OTG: Make otg_get_transceiver() and otg_set_transceiver() generic' \
/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
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).