From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC
Date: Wed, 23 Jul 2014 16:50:16 +0100 [thread overview]
Message-ID: <20140723155016.GM23210@lee--X1> (raw)
In-Reply-To: <1406126915-30601-2-git-send-email-peter.griffin@linaro.org>
On Wed, 23 Jul 2014, Peter Griffin wrote:
> This patch adds the ST glue logic to manage the DWC3 HC
> on STiH407 SoC family. It manages the powerdown signal,
> and configures the internal glue logic and syscfg registers.
>
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
> ---
> drivers/usb/dwc3/Kconfig | 9 ++
> drivers/usb/dwc3/Makefile | 1 +
> drivers/usb/dwc3/dwc3-st.c | 338 +++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 348 insertions(+)
> create mode 100644 drivers/usb/dwc3/dwc3-st.c
[...]
> +/*
> + * For all fields in USB2_VBUS_MNGMNT_SEL1
> + * 2?b00 : Override value from Reg 0x30 is selected
> + * 2?b01 : utmiotg_<signal_name> from usb3_top is selected
> + * 2?b10 : pipew_<signal_name> from PIPEW instance is selected
> + * 2?b11 : value is 1'b0
> + */
> +#define REG30 0x0
> +#define UTMIOTG 0x1
> +#define PIPEW 0x2
> +#define ZERO 0x3
Possible register values are usually prefixed with something
descriptive which identifies them.
USB2_VBUS_ looks appropriate here.
[...]
> +/**
> + * struct st_dwc3 - st-dwc3 driver private structure
> + * @dwc3: platform device pointer
> + * @dev: device pointer
> + * @glue_base ioaddr for the glue registers
> + * @regmap regmap pointer for getting syscfg
> + * @syscfg_reg_off usb syscfg control offset
> + * @dr_mode drd static host/device config
> + * @rstc_pwrdn rest controller for powerdown signal
> + * @rstc_rst reset controller for softreset signal
Some of these have ':', some of them don't. I suggest you standardise
to 'all do'.
> + *
Superflous line in comment.
> + */
> +
Superflous '\n'.
Take a look how you did the function headers below.
[...]
> +static int st_dwc3_drd_init(struct st_dwc3 *dwc3_data)
> +{
> + u32 val;
> + int err;
> +
> + err = regmap_read(dwc3_data->regmap, dwc3_data->syscfg_reg_off, &val);
> + if (err)
> + return err;
> +
> + switch (dwc3_data->dr_mode) {
> + case USB_DR_MODE_PERIPHERAL:
> + val |= USB_SET_PORT_DEVICE;
> + dev_dbg(dwc3_data->dev, "Configuring as Device\n");
> + break;
> +
> + case USB_DR_MODE_HOST:
> + val &= USB_HOST_DEFAULT_MASK;
> + dev_dbg(dwc3_data->dev, "Configuring as Host\n");
> + break;
> +
> + default:
> + dev_err(dwc3_data->dev, "Unsupported mode of operation %d\n"
> + , dwc3_data->dr_mode);
',' should be on the line above.
> + return -EINVAL;
> + }
> +
> + return regmap_write(dwc3_data->regmap, dwc3_data->syscfg_reg_off, val);
> +}
All of this stuff is pretty minor.
Once fixed apply my Ack on the next revision:
Acked-by: Lee Jones <lee.jones@linaro.org>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2014-07-23 15:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-23 14:48 [PATCH v3 0/3] Add ST dwc3 glue layer driver Peter Griffin
2014-07-23 14:48 ` [PATCH v3 1/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC Peter Griffin
2014-07-23 15:50 ` Lee Jones [this message]
2014-07-23 14:48 ` [PATCH v3 2/3] usb: dwc3: dwc3-st: Add st-dwc3 devicetree bindings documentation Peter Griffin
2014-07-23 15:34 ` Lee Jones
2014-07-23 14:48 ` [PATCH v3 3/3] MAINTAINERS: Add dwc3-st.c file to ARCH/STI architecture Peter Griffin
2014-07-23 15:29 ` Lee Jones
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=20140723155016.GM23210@lee--X1 \
--to=lee.jones@linaro.org \
--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