[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131125212101.GR18046@saruman.home>
Date: Mon, 25 Nov 2013 15:21:01 -0600
From: Felipe Balbi <balbi@...com>
To: Kishon Vijay Abraham I <kishon@...com>
CC: <bcousson@...libre.com>, <balbi@...com>,
<devicetree@...r.kernel.org>, <linux-doc@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-omap@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-usb@...r.kernel.org>, <rob.herring@...xeda.com>,
<pawel.moll@....com>, <mark.rutland@....com>,
<swarren@...dotorg.org>, <ijc+devicetree@...lion.org.uk>,
<rob@...dley.net>, <tony@...mide.com>, <linux@....linux.org.uk>,
<gregkh@...uxfoundation.org>, <grant.likely@...aro.org>,
<s.nawrocki@...sung.com>, <galak@...eaurora.org>
Subject: Re: [PATCH v3 04/10] usb: dwc3: use quirks to know if a particualr
platform doesn't have PHY
On Mon, Nov 25, 2013 at 03:31:24PM +0530, Kishon Vijay Abraham I wrote:
> There can be systems which does not have an external phy, so get
> phy only if no quirks are added that indicates the PHY is not present.
> Introduced two quirk flags to indicate the *absence* of usb2 phy and
> usb3 phy. Also remove checking if return value is -ENXIO since it's now
> changed to always enable usb_phy layer.
>
> Signed-off-by: Kishon Vijay Abraham I <kishon@...com>
> ---
> drivers/usb/dwc3/Kconfig | 1 +
> drivers/usb/dwc3/core.c | 93 ++++++++++++++++++++------------------
> drivers/usb/dwc3/core.h | 15 ++++++
> drivers/usb/dwc3/platform_data.h | 5 ++
> 4 files changed, 69 insertions(+), 45 deletions(-)
>
> diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
> index 70fc430..8e385b4 100644
> --- a/drivers/usb/dwc3/Kconfig
> +++ b/drivers/usb/dwc3/Kconfig
> @@ -1,6 +1,7 @@
> config USB_DWC3
> tristate "DesignWare USB3 DRD Core Support"
> depends on (USB || USB_GADGET) && HAS_DMA
> + select USB_PHY
no more selects, we've already had too many problems caused by bogus
usage of select.
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 986674f..f20f4a1 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -32,6 +32,7 @@
> #include <linux/delay.h>
> #include <linux/dma-mapping.h>
> #include <linux/of.h>
> +#include <linux/of_device.h>
>
> #include <linux/usb/ch9.h>
> #include <linux/usb/gadget.h>
> @@ -351,13 +352,28 @@ static void dwc3_core_exit(struct dwc3 *dwc)
>
> #define DWC3_ALIGN_MASK (16 - 1)
>
> +#ifdef CONFIG_OF
> +static const struct of_device_id of_dwc3_match[] = {
> + {
> + .compatible = "snps,dwc3"
> + },
> + {
> + .compatible = "synopsys,dwc3"
> + },
> + { },
> +};
> +MODULE_DEVICE_TABLE(of, of_dwc3_match);
> +#endif
> +
you can split this patch a little bit just to make it easier to review
because there are a few changes which are really obvious:
a) move of_device_id higher in source code so you can use it from probe.
while at that, aso use of_match_device() and return early if it
doesn't match anything.
b) introduce struct dwc3_data.
c) initialize of_id->data field.
d) start using struct dwc3_data
this will make to put all obvious changes (a-c) in separate patches so
review can focus on (d).
--
balbi
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists