All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@ti.com>
To: Pawel Laszczak <pawell@cadence.com>, gregkh@linuxfoundation.org
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	adouglas@cadence.com, jbergsagel@ti.com, peter.chen@nxp.com,
	pjez@cadence.com, kurahul@cadence.com
Subject: [RFC,v1,03/14] usb:cdns3: Driver initialization code.
Date: Tue, 6 Nov 2018 16:44:51 +0200	[thread overview]
Message-ID: <5BE1A8E3.6000705@ti.com> (raw)

On 03/11/18 19:51, Pawel Laszczak wrote:
> Patch adds core.c and core.h file that implements initialization
> of platform driver and adds function responsible for selecting,
> switching and running appropriate Device/Host mode.
> 
> Patch also adds gadget.c, host.c, gadget-export.h, host-export.h.
> These files contains templates functions used during initialization.
> The implementation will be added in next patches.
> 
> Signed-off-by: Pawel Laszczak <pawell@cadence.com>
> ---
>  drivers/usb/cdns3/Kconfig         |  20 ++
>  drivers/usb/cdns3/Makefile        |   4 +
>  drivers/usb/cdns3/core.c          | 373 ++++++++++++++++++++++++++++++
>  drivers/usb/cdns3/core.h          |  88 +++++++
>  drivers/usb/cdns3/gadget-export.h |  27 +++
>  drivers/usb/cdns3/gadget.c        |  36 +++
>  drivers/usb/cdns3/host-export.h   |  30 +++
>  drivers/usb/cdns3/host.c          |  28 +++
>  8 files changed, 606 insertions(+)
>  create mode 100644 drivers/usb/cdns3/core.c
>  create mode 100644 drivers/usb/cdns3/core.h
>  create mode 100644 drivers/usb/cdns3/gadget-export.h
>  create mode 100644 drivers/usb/cdns3/gadget.c
>  create mode 100644 drivers/usb/cdns3/host-export.h
>  create mode 100644 drivers/usb/cdns3/host.c
> 


<snip>

> diff --git a/drivers/usb/cdns3/core.h b/drivers/usb/cdns3/core.h
> new file mode 100644
> index 000000000000..e7159c474308
> --- /dev/null
> +++ b/drivers/usb/cdns3/core.h
> @@ -0,0 +1,88 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * Cadence USBSS DRD Driver.
> + *
> + * Copyright (C) 2017 NXP
> + * Copyright (C) 2018 Cadence.
> + *
> + * Authors: Peter Chen <peter.chen@nxp.com>
> + *          Pawel Laszczak <pawell@cadence.com>
> + */
> +#include <linux/usb/otg.h>
> +
> +#ifndef __LINUX_CDNS3_CORE_H
> +#define __LINUX_CDNS3_CORE_H
> +
> +struct cdns3;
> +enum cdns3_roles {
> +	CDNS3_ROLE_HOST = 0,
> +	CDNS3_ROLE_GADGET,
> +	CDNS3_ROLE_END,
> +	CDNS3_ROLE_OTG,
> +};
> +
> +/**
> + * struct cdns3_role_driver - host/gadget role driver
> + * @start: start this role
> + * @stop: stop this role
> + * @suspend: suspend callback for this role
> + * @resume: resume callback for this role
> + * @irq: irq handler for this role
> + * @name: role name string (host/gadget)
> + */
> +struct cdns3_role_driver {
> +	int (*start)(struct cdns3 *cdns);
> +	void (*stop)(struct cdns3 *cdns);
> +	int (*suspend)(struct cdns3 *cdns, bool do_wakeup);
> +	int (*resume)(struct cdns3 *cdns, bool hibernated);
> +	irqreturn_t (*irq)(struct cdns3 *cdns);

Why does role driver need hook to irq handler?

Can't each driver host or gadget handle it's respective irq
on its own? If the same IRQ line is used it could be requested
as a shared IRQ.

> +	const char *name;
> +};
> +

cheers,
-roger

WARNING: multiple messages have this Message-ID (diff)
From: Roger Quadros <rogerq@ti.com>
To: Pawel Laszczak <pawell@cadence.com>, <gregkh@linuxfoundation.org>
Cc: <linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<adouglas@cadence.com>, <jbergsagel@ti.com>, <peter.chen@nxp.com>,
	<pjez@cadence.com>, <kurahul@cadence.com>
Subject: Re: [RFC PATCH v1 03/14] usb:cdns3: Driver initialization code.
Date: Tue, 6 Nov 2018 16:44:51 +0200	[thread overview]
Message-ID: <5BE1A8E3.6000705@ti.com> (raw)
In-Reply-To: <1541267487-3664-4-git-send-email-pawell@cadence.com>



On 03/11/18 19:51, Pawel Laszczak wrote:
> Patch adds core.c and core.h file that implements initialization
> of platform driver and adds function responsible for selecting,
> switching and running appropriate Device/Host mode.
> 
> Patch also adds gadget.c, host.c, gadget-export.h, host-export.h.
> These files contains templates functions used during initialization.
> The implementation will be added in next patches.
> 
> Signed-off-by: Pawel Laszczak <pawell@cadence.com>
> ---
>  drivers/usb/cdns3/Kconfig         |  20 ++
>  drivers/usb/cdns3/Makefile        |   4 +
>  drivers/usb/cdns3/core.c          | 373 ++++++++++++++++++++++++++++++
>  drivers/usb/cdns3/core.h          |  88 +++++++
>  drivers/usb/cdns3/gadget-export.h |  27 +++
>  drivers/usb/cdns3/gadget.c        |  36 +++
>  drivers/usb/cdns3/host-export.h   |  30 +++
>  drivers/usb/cdns3/host.c          |  28 +++
>  8 files changed, 606 insertions(+)
>  create mode 100644 drivers/usb/cdns3/core.c
>  create mode 100644 drivers/usb/cdns3/core.h
>  create mode 100644 drivers/usb/cdns3/gadget-export.h
>  create mode 100644 drivers/usb/cdns3/gadget.c
>  create mode 100644 drivers/usb/cdns3/host-export.h
>  create mode 100644 drivers/usb/cdns3/host.c
> 


<snip>

> diff --git a/drivers/usb/cdns3/core.h b/drivers/usb/cdns3/core.h
> new file mode 100644
> index 000000000000..e7159c474308
> --- /dev/null
> +++ b/drivers/usb/cdns3/core.h
> @@ -0,0 +1,88 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * Cadence USBSS DRD Driver.
> + *
> + * Copyright (C) 2017 NXP
> + * Copyright (C) 2018 Cadence.
> + *
> + * Authors: Peter Chen <peter.chen@nxp.com>
> + *          Pawel Laszczak <pawell@cadence.com>
> + */
> +#include <linux/usb/otg.h>
> +
> +#ifndef __LINUX_CDNS3_CORE_H
> +#define __LINUX_CDNS3_CORE_H
> +
> +struct cdns3;
> +enum cdns3_roles {
> +	CDNS3_ROLE_HOST = 0,
> +	CDNS3_ROLE_GADGET,
> +	CDNS3_ROLE_END,
> +	CDNS3_ROLE_OTG,
> +};
> +
> +/**
> + * struct cdns3_role_driver - host/gadget role driver
> + * @start: start this role
> + * @stop: stop this role
> + * @suspend: suspend callback for this role
> + * @resume: resume callback for this role
> + * @irq: irq handler for this role
> + * @name: role name string (host/gadget)
> + */
> +struct cdns3_role_driver {
> +	int (*start)(struct cdns3 *cdns);
> +	void (*stop)(struct cdns3 *cdns);
> +	int (*suspend)(struct cdns3 *cdns, bool do_wakeup);
> +	int (*resume)(struct cdns3 *cdns, bool hibernated);
> +	irqreturn_t (*irq)(struct cdns3 *cdns);

Why does role driver need hook to irq handler?

Can't each driver host or gadget handle it's respective irq
on its own? If the same IRQ line is used it could be requested
as a shared IRQ.

> +	const char *name;
> +};
> +

cheers,
-roger

-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

             reply	other threads:[~2018-11-06 14:44 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06 14:44 Roger Quadros [this message]
2018-11-06 14:44 ` [RFC PATCH v1 03/14] usb:cdns3: Driver initialization code Roger Quadros
  -- strict thread matches above, loose matches on Subject: below --
2018-11-08 14:22 [RFC,v1,14/14] usb:cdns3: Feature for changing role Roger Quadros
2018-11-08 14:22 ` [RFC PATCH v1 14/14] " Roger Quadros
2018-11-08 12:03 [RFC,v1,13/14] usb:cdns3: Adds debugging function Pawel Laszczak
2018-11-08 12:03 ` [RFC PATCH v1 13/14] " Pawel Laszczak
2018-11-08 11:51 [RFC,v1,14/14] usb:cdns3: Feature for changing role Pawel Laszczak
2018-11-08 11:51 ` [RFC PATCH v1 14/14] " Pawel Laszczak
2018-11-08 11:38 [RFC,v1,03/14] usb:cdns3: Driver initialization code Pawel Laszczak
2018-11-08 11:38 ` [RFC PATCH v1 03/14] " Pawel Laszczak
2018-11-08 11:33 [RFC,v1,04/14] usb:cdns3: Added DRD support Pawel Laszczak
2018-11-08 11:33 ` [RFC PATCH v1 04/14] " Pawel Laszczak
2018-11-08  9:34 [RFC,v1,13/14] usb:cdns3: Adds debugging function Roger Quadros
2018-11-08  9:34 ` [RFC PATCH v1 13/14] " Roger Quadros
2018-11-07 13:14 [RFC,v1,03/14] usb:cdns3: Driver initialization code Pawel Laszczak
2018-11-07 13:14 ` [RFC PATCH v1 03/14] " Pawel Laszczak
2018-11-07  8:42 [RFC,v1,01/14] usb:cdns3: add pci to platform driver wrapper Pawel Laszczak
2018-11-07  8:42 ` [RFC PATCH v1 01/14] " Pawel Laszczak
2018-11-06 14:51 [RFC,v1,14/14] usb:cdns3: Feature for changing role Roger Quadros
2018-11-06 14:51 ` [RFC PATCH v1 14/14] " Roger Quadros
2018-11-06 14:32 [RFC,v1,04/14] usb:cdns3: Added DRD support Roger Quadros
2018-11-06 14:32 ` [RFC PATCH v1 04/14] " Roger Quadros
2018-11-06 14:18 [RFC,v1,03/14] usb:cdns3: Driver initialization code Roger Quadros
2018-11-06 14:18 ` [RFC PATCH v1 03/14] " Roger Quadros
2018-11-06 13:48 [RFC,v1,01/14] usb:cdns3: add pci to platform driver wrapper Roger Quadros
2018-11-06 13:48 ` [RFC PATCH v1 01/14] " Roger Quadros
2018-11-05  6:17 [RFC,v1,13/14] usb:cdns3: Adds debugging function Pawel Laszczak
2018-11-05  6:17 ` [RFC PATCH v1 13/14] " Pawel Laszczak
2018-11-03 19:14 [RFC,v1,13/14] " Joe Perches
2018-11-03 19:14 ` [RFC PATCH v1 13/14] " Joe Perches
2018-11-03 17:51 [RFC,v1,14/14] usb:cdns3: Feature for changing role Pawel Laszczak
2018-11-03 17:51 ` [RFC PATCH v1 14/14] " Pawel Laszczak
2018-11-03 17:51 [RFC,v1,13/14] usb:cdns3: Adds debugging function Pawel Laszczak
2018-11-03 17:51 ` [RFC PATCH v1 13/14] " Pawel Laszczak
2018-11-03 17:51 [RFC,v1,12/14] usb:cdns3: Adds transfer related function Pawel Laszczak
2018-11-03 17:51 ` [RFC PATCH v1 12/14] " Pawel Laszczak
2018-11-03 17:51 [RFC,v1,11/14] usb:cdns3: Adds enumeration " Pawel Laszczak
2018-11-03 17:51 ` [RFC PATCH v1 11/14] " Pawel Laszczak
2018-11-03 17:51 [RFC,v1,10/14] usb:cdns3: Implements ISR functionality Pawel Laszczak
2018-11-03 17:51 ` [RFC PATCH v1 10/14] " Pawel Laszczak
2018-11-03 17:51 [RFC,v1,09/14] usb:cdns3: Ep0 operations part of the API Pawel Laszczak
2018-11-03 17:51 ` [RFC PATCH v1 09/14] " Pawel Laszczak
2018-11-03 17:51 [RFC,v1,08/14] usb:cdns3: EpX " Pawel Laszczak
2018-11-03 17:51 ` [RFC PATCH v1 08/14] " Pawel Laszczak
2018-11-03 17:51 [RFC,v1,07/14] usb:cdns3: Implements device " Pawel Laszczak
2018-11-03 17:51 ` [RFC PATCH v1 07/14] " Pawel Laszczak
2018-11-03 17:51 [RFC,v1,06/14] usb:cdns3: Initialization code for Device side Pawel Laszczak
2018-11-03 17:51 ` [RFC PATCH v1 06/14] " Pawel Laszczak
2018-11-03 17:51 [RFC,v1,05/14] usb:cdns3: Added Wrapper to XCHI driver Pawel Laszczak
2018-11-03 17:51 ` [RFC PATCH v1 05/14] " Pawel Laszczak
2018-11-03 17:51 [RFC,v1,04/14] usb:cdns3: Added DRD support Pawel Laszczak
2018-11-03 17:51 ` [RFC PATCH v1 04/14] " Pawel Laszczak
2018-11-03 17:51 [RFC,v1,03/14] usb:cdns3: Driver initialization code Pawel Laszczak
2018-11-03 17:51 ` [RFC PATCH v1 03/14] " Pawel Laszczak
2018-11-03 17:51 [RFC,v1,02/14] usb:cdns3: Device side header file Pawel Laszczak
2018-11-03 17:51 ` [RFC PATCH v1 02/14] " Pawel Laszczak
2018-11-03 17:51 [RFC,v1,01/14] usb:cdns3: add pci to platform driver wrapper Pawel Laszczak
2018-11-03 17:51 ` [RFC PATCH v1 01/14] " Pawel Laszczak
2018-11-03 17:51 [RFC PATCH v1 00/14] Introduced new Cadence USBSS DRD Driver Pawel Laszczak

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=5BE1A8E3.6000705@ti.com \
    --to=rogerq@ti.com \
    --cc=adouglas@cadence.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jbergsagel@ti.com \
    --cc=kurahul@cadence.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=pawell@cadence.com \
    --cc=peter.chen@nxp.com \
    --cc=pjez@cadence.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.