From: andrew@lunn.ch (Andrew Lunn)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 01/12] reset: add the Berlin reset controller driver
Date: Wed, 16 Jul 2014 18:39:53 +0200 [thread overview]
Message-ID: <20140716163953.GJ9858@lunn.ch> (raw)
In-Reply-To: <1405499166-6726-2-git-send-email-antoine.tenart@free-electrons.com>
On Wed, Jul 16, 2014 at 10:25:55AM +0200, Antoine T?nart wrote:
> Add a reset controller for Marvell Berlin SoCs which is used by the
> USB PHYs drivers (for now).
>
> Signed-off-by: Antoine T?nart <antoine.tenart@free-electrons.com>
> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
> drivers/reset/Makefile | 1 +
> drivers/reset/reset-berlin.c | 131 +++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 132 insertions(+)
> create mode 100644 drivers/reset/reset-berlin.c
>
> diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile
> index 60fed3d7820b..157d421f755b 100644
> --- a/drivers/reset/Makefile
> +++ b/drivers/reset/Makefile
> @@ -1,4 +1,5 @@
> obj-$(CONFIG_RESET_CONTROLLER) += core.o
> obj-$(CONFIG_ARCH_SOCFPGA) += reset-socfpga.o
> +obj-$(CONFIG_ARCH_BERLIN) += reset-berlin.o
> obj-$(CONFIG_ARCH_SUNXI) += reset-sunxi.o
> obj-$(CONFIG_ARCH_STI) += sti/
> diff --git a/drivers/reset/reset-berlin.c b/drivers/reset/reset-berlin.c
> new file mode 100644
> index 000000000000..7b894047a81d
> --- /dev/null
> +++ b/drivers/reset/reset-berlin.c
> @@ -0,0 +1,131 @@
> +/*
> + * Copyright (C) 2014 Marvell Technology Group Ltd.
> + *
> + * Antoine T?nart <antoine.tenart@free-electrons.com>
> + * Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> + *
> + * This file is licensed under the terms of the GNU General Public
> + * License version 2. This program is licensed "as is" without any
> + * warranty of any kind, whether express or implied.
> + */
> +
> +#include <linux/delay.h>
> +#include <linux/io.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/of_address.h>
> +#include <linux/platform_device.h>
> +#include <linux/reset-controller.h>
> +#include <linux/slab.h>
> +#include <linux/types.h>
> +
> +#define BERLIN_MAX_RESETS 32
> +
> +#define to_berlin_reset_priv(p) \
> + container_of((p), struct berlin_reset_priv, rcdev)
> +
> +struct berlin_reset_priv {
> + void __iomem *base;
> + unsigned int size;
> + struct reset_controller_dev rcdev;
> +};
> +
> +static int berlin_reset_reset(struct reset_controller_dev *rcdev,
> + unsigned long id)
> +{
> + struct berlin_reset_priv *priv = to_berlin_reset_priv(rcdev);
> + int offset = id >> 8;
> + int mask = BIT(id & 0xff);
nit:
The parameter to BIT() should be 0-31. So you want to & with 5. Given
your xlate function, it should never happen that it is greater than
31. Hence it is only a nit. If you need to respin, you can change
this, but don't bother to respin just because of this.
Andrew
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
To: "Antoine Ténart"
<antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Cc: sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
Peter.Chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org,
balbi-l0cyMroinI0@public.gmane.org,
p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
zmxu-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
jszhang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH v3 01/12] reset: add the Berlin reset controller driver
Date: Wed, 16 Jul 2014 18:39:53 +0200 [thread overview]
Message-ID: <20140716163953.GJ9858@lunn.ch> (raw)
In-Reply-To: <1405499166-6726-2-git-send-email-antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
On Wed, Jul 16, 2014 at 10:25:55AM +0200, Antoine Ténart wrote:
> Add a reset controller for Marvell Berlin SoCs which is used by the
> USB PHYs drivers (for now).
>
> Signed-off-by: Antoine Ténart <antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Acked-by: Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> ---
> drivers/reset/Makefile | 1 +
> drivers/reset/reset-berlin.c | 131 +++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 132 insertions(+)
> create mode 100644 drivers/reset/reset-berlin.c
>
> diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile
> index 60fed3d7820b..157d421f755b 100644
> --- a/drivers/reset/Makefile
> +++ b/drivers/reset/Makefile
> @@ -1,4 +1,5 @@
> obj-$(CONFIG_RESET_CONTROLLER) += core.o
> obj-$(CONFIG_ARCH_SOCFPGA) += reset-socfpga.o
> +obj-$(CONFIG_ARCH_BERLIN) += reset-berlin.o
> obj-$(CONFIG_ARCH_SUNXI) += reset-sunxi.o
> obj-$(CONFIG_ARCH_STI) += sti/
> diff --git a/drivers/reset/reset-berlin.c b/drivers/reset/reset-berlin.c
> new file mode 100644
> index 000000000000..7b894047a81d
> --- /dev/null
> +++ b/drivers/reset/reset-berlin.c
> @@ -0,0 +1,131 @@
> +/*
> + * Copyright (C) 2014 Marvell Technology Group Ltd.
> + *
> + * Antoine Ténart <antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> + * Sebastian Hesselbarth <sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> + *
> + * This file is licensed under the terms of the GNU General Public
> + * License version 2. This program is licensed "as is" without any
> + * warranty of any kind, whether express or implied.
> + */
> +
> +#include <linux/delay.h>
> +#include <linux/io.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/of_address.h>
> +#include <linux/platform_device.h>
> +#include <linux/reset-controller.h>
> +#include <linux/slab.h>
> +#include <linux/types.h>
> +
> +#define BERLIN_MAX_RESETS 32
> +
> +#define to_berlin_reset_priv(p) \
> + container_of((p), struct berlin_reset_priv, rcdev)
> +
> +struct berlin_reset_priv {
> + void __iomem *base;
> + unsigned int size;
> + struct reset_controller_dev rcdev;
> +};
> +
> +static int berlin_reset_reset(struct reset_controller_dev *rcdev,
> + unsigned long id)
> +{
> + struct berlin_reset_priv *priv = to_berlin_reset_priv(rcdev);
> + int offset = id >> 8;
> + int mask = BIT(id & 0xff);
nit:
The parameter to BIT() should be 0-31. So you want to & with 5. Given
your xlate function, it should never happen that it is greater than
31. Hence it is only a nit. If you need to respin, you can change
this, but don't bother to respin just because of this.
Andrew
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Lunn <andrew@lunn.ch>
To: "Antoine Ténart" <antoine.tenart@free-electrons.com>
Cc: sebastian.hesselbarth@gmail.com, Peter.Chen@freescale.com,
balbi@ti.com, p.zabel@pengutronix.de,
thomas.petazzoni@free-electrons.com, zmxu@marvell.com,
devicetree@vger.kernel.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org,
alexandre.belloni@free-electrons.com, jszhang@marvell.com,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 01/12] reset: add the Berlin reset controller driver
Date: Wed, 16 Jul 2014 18:39:53 +0200 [thread overview]
Message-ID: <20140716163953.GJ9858@lunn.ch> (raw)
In-Reply-To: <1405499166-6726-2-git-send-email-antoine.tenart@free-electrons.com>
On Wed, Jul 16, 2014 at 10:25:55AM +0200, Antoine Ténart wrote:
> Add a reset controller for Marvell Berlin SoCs which is used by the
> USB PHYs drivers (for now).
>
> Signed-off-by: Antoine Ténart <antoine.tenart@free-electrons.com>
> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
> drivers/reset/Makefile | 1 +
> drivers/reset/reset-berlin.c | 131 +++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 132 insertions(+)
> create mode 100644 drivers/reset/reset-berlin.c
>
> diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile
> index 60fed3d7820b..157d421f755b 100644
> --- a/drivers/reset/Makefile
> +++ b/drivers/reset/Makefile
> @@ -1,4 +1,5 @@
> obj-$(CONFIG_RESET_CONTROLLER) += core.o
> obj-$(CONFIG_ARCH_SOCFPGA) += reset-socfpga.o
> +obj-$(CONFIG_ARCH_BERLIN) += reset-berlin.o
> obj-$(CONFIG_ARCH_SUNXI) += reset-sunxi.o
> obj-$(CONFIG_ARCH_STI) += sti/
> diff --git a/drivers/reset/reset-berlin.c b/drivers/reset/reset-berlin.c
> new file mode 100644
> index 000000000000..7b894047a81d
> --- /dev/null
> +++ b/drivers/reset/reset-berlin.c
> @@ -0,0 +1,131 @@
> +/*
> + * Copyright (C) 2014 Marvell Technology Group Ltd.
> + *
> + * Antoine Ténart <antoine.tenart@free-electrons.com>
> + * Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> + *
> + * This file is licensed under the terms of the GNU General Public
> + * License version 2. This program is licensed "as is" without any
> + * warranty of any kind, whether express or implied.
> + */
> +
> +#include <linux/delay.h>
> +#include <linux/io.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/of_address.h>
> +#include <linux/platform_device.h>
> +#include <linux/reset-controller.h>
> +#include <linux/slab.h>
> +#include <linux/types.h>
> +
> +#define BERLIN_MAX_RESETS 32
> +
> +#define to_berlin_reset_priv(p) \
> + container_of((p), struct berlin_reset_priv, rcdev)
> +
> +struct berlin_reset_priv {
> + void __iomem *base;
> + unsigned int size;
> + struct reset_controller_dev rcdev;
> +};
> +
> +static int berlin_reset_reset(struct reset_controller_dev *rcdev,
> + unsigned long id)
> +{
> + struct berlin_reset_priv *priv = to_berlin_reset_priv(rcdev);
> + int offset = id >> 8;
> + int mask = BIT(id & 0xff);
nit:
The parameter to BIT() should be 0-31. So you want to & with 5. Given
your xlate function, it should never happen that it is greater than
31. Hence it is only a nit. If you need to respin, you can change
this, but don't bother to respin just because of this.
Andrew
next prev parent reply other threads:[~2014-07-16 16:39 UTC|newest]
Thread overview: 93+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-16 8:25 [PATCH v3 00/12] ARM: berlin: USB support Antoine Ténart
2014-07-16 8:25 ` Antoine Ténart
2014-07-16 8:25 ` Antoine Ténart
2014-07-16 8:25 ` [PATCH v3 01/12] reset: add the Berlin reset controller driver Antoine Ténart
2014-07-16 8:25 ` Antoine Ténart
2014-07-16 16:39 ` Andrew Lunn [this message]
2014-07-16 16:39 ` Andrew Lunn
2014-07-16 16:39 ` Andrew Lunn
2014-07-16 8:25 ` [PATCH v3 02/12] Documentation: bindings: add reset bindings docs for Marvell Berlin SoCs Antoine Ténart
2014-07-16 8:25 ` Antoine Ténart
2014-07-16 8:25 ` Antoine Ténart
2014-07-16 8:25 ` [PATCH v3 03/12] ARM: Berlin: select the reset controller Antoine Ténart
2014-07-16 8:25 ` Antoine Ténart
2014-07-16 8:25 ` Antoine Ténart
2014-07-16 8:25 ` [PATCH v3 04/12] ARM: dts: berlin: add a required reset property in the chip controller node Antoine Ténart
2014-07-16 8:25 ` Antoine Ténart
2014-07-16 8:25 ` Antoine Ténart
2014-07-16 8:25 ` [PATCH v3 05/12] phy: add the Berlin USB PHY driver Antoine Ténart
2014-07-16 8:25 ` Antoine Ténart
2014-07-16 8:25 ` Antoine Ténart
2014-07-16 9:19 ` Varka Bhadram
2014-07-16 9:19 ` Varka Bhadram
2014-07-16 9:19 ` Varka Bhadram
2014-07-16 9:25 ` Antoine Ténart
2014-07-16 9:25 ` Antoine Ténart
2014-07-16 9:25 ` Antoine Ténart
2014-07-16 9:33 ` Varka Bhadram
2014-07-16 9:33 ` Varka Bhadram
2014-07-16 9:33 ` Varka Bhadram
2014-07-16 9:47 ` Antoine Ténart
2014-07-16 9:47 ` Antoine Ténart
2014-07-16 9:50 ` Varka Bhadram
2014-07-16 9:50 ` Varka Bhadram
2014-07-16 8:26 ` [PATCH v3 06/12] Documentation: bindings: add doc for the Berlin USB PHY Antoine Ténart
2014-07-16 8:26 ` Antoine Ténart
2014-07-16 8:26 ` Antoine Ténart
2014-07-16 8:26 ` [PATCH v3 07/12] usb: chipidea: add a usb2 driver for ci13xxx Antoine Ténart
2014-07-16 8:26 ` Antoine Ténart
2014-07-16 8:26 ` Antoine Ténart
2014-07-16 8:41 ` Arnd Bergmann
2014-07-16 8:41 ` Arnd Bergmann
2014-07-16 8:41 ` Arnd Bergmann
2014-07-16 9:15 ` Antoine Ténart
2014-07-16 9:15 ` Antoine Ténart
2014-07-16 9:15 ` Antoine Ténart
2014-07-16 10:14 ` Arnd Bergmann
2014-07-16 10:14 ` Arnd Bergmann
2014-07-16 10:14 ` Arnd Bergmann
2014-07-16 11:58 ` Peter Chen
2014-07-16 11:58 ` Peter Chen
2014-07-16 12:12 ` Arnd Bergmann
2014-07-16 12:12 ` Arnd Bergmann
2014-07-16 12:12 ` Arnd Bergmann
2014-07-17 1:20 ` Peter Chen
2014-07-17 1:20 ` Peter Chen
2014-07-17 1:20 ` Peter Chen
2014-07-17 10:21 ` Arnd Bergmann
2014-07-17 10:21 ` Arnd Bergmann
2014-07-17 10:21 ` Arnd Bergmann
2014-07-17 11:19 ` Peter Chen
2014-07-17 11:19 ` Peter Chen
2014-07-17 11:19 ` Peter Chen
2014-07-17 11:34 ` Arnd Bergmann
2014-07-17 11:34 ` Arnd Bergmann
2014-07-17 12:20 ` Russell King - ARM Linux
2014-07-17 12:20 ` Russell King - ARM Linux
2014-07-25 2:18 ` Peter Chen
2014-07-25 2:18 ` Peter Chen
2014-07-25 2:18 ` Peter Chen
2014-07-25 8:07 ` Antoine Ténart
2014-07-25 8:07 ` Antoine Ténart
2014-07-25 8:07 ` Antoine Ténart
2014-07-25 8:22 ` Peter Chen
2014-07-25 8:22 ` Peter Chen
2014-07-16 8:26 ` [PATCH v3 08/12] Documentation: bindings: add doc for the USB2 ChipIdea USB driver Antoine Ténart
2014-07-16 8:26 ` Antoine Ténart
2014-07-16 8:26 ` Antoine Ténart
2014-07-16 8:39 ` Arnd Bergmann
2014-07-16 8:39 ` Arnd Bergmann
2014-07-16 8:39 ` Arnd Bergmann
2014-07-16 8:59 ` Antoine Ténart
2014-07-16 8:59 ` Antoine Ténart
2014-07-16 8:26 ` [PATCH v3 09/12] ARM: dts: berlin: add BG2Q nodes for USB support Antoine Ténart
2014-07-16 8:26 ` Antoine Ténart
2014-07-16 8:26 ` Antoine Ténart
2014-07-16 8:26 ` [PATCH v3 10/12] ARM: dts: Berlin: enable USB on the BG2Q DMP Antoine Ténart
2014-07-16 8:26 ` Antoine Ténart
2014-07-16 8:26 ` Antoine Ténart
2014-07-16 8:26 ` [PATCH v3 11/12] ARM: dts: berlin: add BG2CD nodes for USB support Antoine Ténart
2014-07-16 8:26 ` Antoine Ténart
2014-07-16 8:26 ` Antoine Ténart
2014-07-16 8:26 ` [PATCH v3 12/12] ARM: dts: berlin: enable USB on the Google Chromecast Antoine Ténart
2014-07-16 8:26 ` Antoine Ténart
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=20140716163953.GJ9858@lunn.ch \
--to=andrew@lunn.ch \
--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 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.