All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Felipe Balbi <balbi@ti.com>
Cc: Peter Griffin <peter.griffin@linaro.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, maxime.coquelin@st.com,
	patrice.chotard@st.com, srinivas.kandagatla@gmail.com,
	devicetree@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-omap@vger.kernel.org, peppe.cavallaro@st.com
Subject: Re: [PATCH v2 1/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC
Date: Tue, 22 Jul 2014 16:45:03 +0100	[thread overview]
Message-ID: <20140722154503.GC23210@lee--X1> (raw)
In-Reply-To: <20140722145711.GC20588@saruman.home>

> > > > +static void st_dwc3_init(struct st_dwc3 *dwc3_data)
> > > > +{
> > > > +	u32 reg = st_dwc3_readl(dwc3_data->glue_base, USB2_CLKRST_CTRL);
> > > > +
> > > > +	reg |= aux_clk_en(1) | ext_cfg_reset_n(1) | xhci_revision(1);
> > > > +	reg &= ~sw_pipew_reset_n(1);
> > > 
> > > 1?  Better to add defines for these magic numbers.  What is 1 anyway?
> > 
> > They are just bit setting macros, I've converted them over to use BIT macro now,
> > so it no longer takes a parameter.
> 
> the macros are better, but make them upper case as everybody else.

When you say that the macros are better, what do you mean?

Defines do the job in a manner which is a great deal cleaner:

#define AUX_CLK_EN        BIT(0)
#define SW_PIPEW_RESET_N  BIT(4)
#define EXT_CFG_RESET_N   BIT(8)
#define XHCI_REVISION     BIT(12)

reg = AUX_CLK_EN | SW_PIPEW_RESET_N | XHCI_REVISION;
reg &= ~SW_PIPEW_RESET_N

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

WARNING: multiple messages have this Message-ID (diff)
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC
Date: Tue, 22 Jul 2014 16:45:03 +0100	[thread overview]
Message-ID: <20140722154503.GC23210@lee--X1> (raw)
In-Reply-To: <20140722145711.GC20588@saruman.home>

> > > > +static void st_dwc3_init(struct st_dwc3 *dwc3_data)
> > > > +{
> > > > +	u32 reg = st_dwc3_readl(dwc3_data->glue_base, USB2_CLKRST_CTRL);
> > > > +
> > > > +	reg |= aux_clk_en(1) | ext_cfg_reset_n(1) | xhci_revision(1);
> > > > +	reg &= ~sw_pipew_reset_n(1);
> > > 
> > > 1?  Better to add defines for these magic numbers.  What is 1 anyway?
> > 
> > They are just bit setting macros, I've converted them over to use BIT macro now,
> > so it no longer takes a parameter.
> 
> the macros are better, but make them upper case as everybody else.

When you say that the macros are better, what do you mean?

Defines do the job in a manner which is a great deal cleaner:

#define AUX_CLK_EN        BIT(0)
#define SW_PIPEW_RESET_N  BIT(4)
#define EXT_CFG_RESET_N   BIT(8)
#define XHCI_REVISION     BIT(12)

reg = AUX_CLK_EN | SW_PIPEW_RESET_N | XHCI_REVISION;
reg &= ~SW_PIPEW_RESET_N

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2014-07-22 15:45 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-05  6:25 [PATCH v2 0/3] Add ST dwc3 glue layer driver Peter Griffin
2014-07-05  6:25 ` Peter Griffin
2014-07-05  6:25 ` [PATCH v2 1/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC Peter Griffin
2014-07-05  6:25   ` Peter Griffin
2014-07-07 12:46   ` Lee Jones
2014-07-07 12:46     ` Lee Jones
2014-07-07 12:46     ` Lee Jones
2014-07-22  9:18     ` Peter Griffin
2014-07-22  9:18       ` Peter Griffin
2014-07-22  9:18       ` Peter Griffin
2014-07-22 10:15       ` Lee Jones
2014-07-22 10:15         ` Lee Jones
2014-07-22 10:15         ` Lee Jones
2014-07-22 14:57       ` Felipe Balbi
2014-07-22 14:57         ` Felipe Balbi
2014-07-22 14:57         ` Felipe Balbi
2014-07-22 15:45         ` Lee Jones [this message]
2014-07-22 15:45           ` Lee Jones
2014-07-22 15:51           ` Felipe Balbi
2014-07-22 15:51             ` Felipe Balbi
2014-07-22 15:51             ` Felipe Balbi
2014-07-22 15:56             ` Lee Jones
2014-07-22 15:56               ` Lee Jones
2014-07-22 15:56               ` Lee Jones
2014-07-23 14:33         ` Peter Griffin
2014-07-23 14:33           ` Peter Griffin
2014-08-20 18:24           ` Felipe Balbi
2014-08-20 18:24             ` Felipe Balbi
2014-08-20 18:24             ` Felipe Balbi
2014-07-07 13:21   ` Jingoo Han
2014-07-07 13:21     ` Jingoo Han
2014-07-22  9:38     ` Peter Griffin
2014-07-22  9:38       ` Peter Griffin
2014-07-05  6:25 ` [PATCH v2 2/3] ARM: dts: sti: Add st-dwc3 devicetree bindings documentation Peter Griffin
2014-07-05  6:25   ` Peter Griffin
2014-07-07 11:00   ` Lee Jones
2014-07-07 11:00     ` Lee Jones
2014-07-05  6:25 ` [PATCH v2 3/3] MAINTAINERS: Add dwc3-st.c file to ARCH/STI architecture Peter Griffin
2014-07-05  6:25   ` Peter Griffin
2014-07-07 10:51   ` Lee Jones
2014-07-07 10:51     ` Lee Jones
2014-07-07 10:51     ` Lee Jones
2014-07-08  7:40   ` Maxime Coquelin
2014-07-08  7:40     ` Maxime Coquelin
2014-07-08  7:40     ` Maxime Coquelin
2014-07-08  7:53     ` Lee Jones
2014-07-08  7:53       ` Lee Jones
2014-07-08  7:53       ` Lee Jones
2014-07-08  9:01       ` Maxime Coquelin
2014-07-08  9:01         ` Maxime Coquelin
2014-07-08  9:01         ` Maxime Coquelin
2014-07-10 13:27       ` Felipe Balbi
2014-07-10 13:27         ` Felipe Balbi
2014-07-10 13:27         ` Felipe Balbi
2014-07-10 13:39         ` Lee Jones
2014-07-10 13:39           ` Lee Jones
2014-07-10 15:24         ` Peter Griffin
2014-07-10 15:24           ` Peter Griffin

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=20140722154503.GC23210@lee--X1 \
    --to=lee.jones@linaro.org \
    --cc=balbi@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=maxime.coquelin@st.com \
    --cc=patrice.chotard@st.com \
    --cc=peppe.cavallaro@st.com \
    --cc=peter.griffin@linaro.org \
    --cc=srinivas.kandagatla@gmail.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.